Commit
·
87f46db
1
Parent(s):
91962dc
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
tags:
|
5 |
+
- simcls
|
6 |
+
datasets:
|
7 |
+
- cnn_dailymail
|
8 |
+
---
|
9 |
+
|
10 |
+
# SimCLS
|
11 |
+
|
12 |
+
SimCLS is a framework for abstractive summarization presented in [SimCLS: A Simple Framework for Contrastive Learning of Abstractive Summarization](https://arxiv.org/abs/2106.01890).
|
13 |
+
It is a two-stage approach consisting of a *generator* and a *scorer*. In the first stage, a large pre-trained model for abstractive summarization (the *generator*) is used to generate candidate summaries, whereas, in the second stage, the *scorer* assigns a score to each candidate given the source document. The final summary is the highest-scoring candidate.
|
14 |
+
|
15 |
+
This model is the *scorer* trained for summarization of CNN/DailyMail ([paper](https://arxiv.org/abs/1602.06023), [datasets](https://huggingface.co/datasets/cnn_dailymail)). It should be used in conjunction with [facebook/bart-large-cnn](https://huggingface.co/facebook/bart-large-cnn). See [our Github repository](https://github.com/andrejmiscic/simcls-pytorch) for details on training, evaluation, and usage.
|
16 |
+
|
17 |
+
## Usage
|
18 |
+
|
19 |
+
```bash
|
20 |
+
git clone https://github.com/andrejmiscic/simcls-pytorch.git
|
21 |
+
cd simcls-pytorch
|
22 |
+
pip3 install torch torchvision torchaudio transformers sentencepiece
|
23 |
+
```
|
24 |
+
|
25 |
+
```python
|
26 |
+
from src.model import SimCLS, GeneratorType
|
27 |
+
|
28 |
+
summarizer = SimCLS(generator_type=GeneratorType.Bart,
|
29 |
+
generator_path="facebook/bart-large-cnn",
|
30 |
+
scorer_path="andrejmiscic/simcls-scorer-cnndm")
|
31 |
+
|
32 |
+
article = "This is a news article."
|
33 |
+
summary = summarizer(article)
|
34 |
+
print(summary)
|
35 |
+
```
|
36 |
+
|
37 |
+
### Results
|
38 |
+
|
39 |
+
All of our results are reported together with 95% confidence intervals computed using 10000 iterations of bootstrap. See [SimCLS paper](https://arxiv.org/abs/2106.01890) for a description of baselines.
|
40 |
+
|
41 |
+
| System | Rouge-1 | Rouge-2 | Rouge-L |
|
42 |
+
|------------------|----------------------:|----------------------:|----------------------:|
|
43 |
+
| BART | 44.16 | 21.28 | 40.90 |
|
44 |
+
| **SimCLS paper** | --- | --- | --- |
|
45 |
+
| Origin | 44.39 | 21.21 | 41.28 |
|
46 |
+
| Min | 33.17 | 11.67 | 30.77 |
|
47 |
+
| Max | 54.36 | 28.73 | 50.77 |
|
48 |
+
| Random | 43.98 | 20.06 | 40.94 |
|
49 |
+
| **SimCLS** | 46.67 | 22.15 | 43.54 |
|
50 |
+
| **Our results** | --- | --- | --- |
|
51 |
+
| Origin | 44.41, [44.18, 44.63] | 21.05, [20.80, 21.29] | 41.53, [41.30, 41.75] |
|
52 |
+
| Min | 33.43, [33.25, 33.62] | 10.97, [10.82, 11.12] | 30.57, [30.40, 30.74] |
|
53 |
+
| Max | 53.87, [53.67, 54.08] | 29.72, [29.47, 29.98] | 51.13, [50.92, 51.34] |
|
54 |
+
| Random | 43.94, [43.73, 44.16] | 20.09, [19.86, 20.31] | 41.06, [40.85, 41.27] |
|
55 |
+
| **SimCLS** | 46.53, [46.32, 46.75] | 22.14, [21.91, 22.37] | 43.56, [43.34, 43.78] |
|
56 |
+
|
57 |
+
### Citation of the original work
|
58 |
+
|
59 |
+
```bibtex
|
60 |
+
@inproceedings{liu-liu-2021-simcls,
|
61 |
+
title = "{S}im{CLS}: A Simple Framework for Contrastive Learning of Abstractive Summarization",
|
62 |
+
author = "Liu, Yixin and
|
63 |
+
Liu, Pengfei",
|
64 |
+
booktitle = "Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 2: Short Papers)",
|
65 |
+
month = aug,
|
66 |
+
year = "2021",
|
67 |
+
address = "Online",
|
68 |
+
publisher = "Association for Computational Linguistics",
|
69 |
+
url = "https://aclanthology.org/2021.acl-short.135",
|
70 |
+
doi = "10.18653/v1/2021.acl-short.135",
|
71 |
+
pages = "1065--1072",
|
72 |
+
}
|
73 |
+
```
|