File size: 8,226 Bytes
4f75298
c5121e4
 
75fe23c
4f75298
 
45b6053
 
75fe23c
9137060
 
 
 
 
 
 
 
 
 
 
 
75fe23c
9137060
75fe23c
9137060
75fe23c
9137060
75fe23c
9137060
75fe23c
9137060
75fe23c
9137060
75fe23c
9137060
75fe23c
9137060
75fe23c
9137060
75fe23c
9137060
75fe23c
9137060
75fe23c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9137060
75fe23c
4f75298
5481f4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6d60e92
5481f4b
6d60e92
5481f4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
deb0f97
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
---
language:
- en
license: mit
tags:
- summarization
datasets:
- cnn_dailymail
thumbnail: https://huggingface.co/front/thumbnails/facebook.png
model-index:
- name: facebook/bart-large-cnn
  results:
  - task:
      type: summarization
      name: Summarization
    dataset:
      name: cnn_dailymail
      type: cnn_dailymail
      config: 3.0.0
      split: train
    metrics:
    - type: rouge
      value: 42.9486
      name: ROUGE-1
      verified: true
    - type: rouge
      value: 20.8149
      name: ROUGE-2
      verified: true
    - type: rouge
      value: 30.6186
      name: ROUGE-L
      verified: true
    - type: rouge
      value: 40.0376
      name: ROUGE-LSUM
      verified: true
    - type: loss
      value: 2.529000997543335
      name: loss
      verified: true
    - type: gen_len
      value: 78.5866
      name: gen_len
      verified: true
  - task:
      type: summarization
      name: Summarization
    dataset:
      name: multi_news
      type: multi_news
      config: default
      split: test
    metrics:
    - type: rouge
      value: 27.4304
      name: ROUGE-1
      verified: true
      verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiOTlmN2RmZWZjYmZmYjY5Mzk4Y2ZjMDRkNGUwZWQ4MTQ3ZTQzMTA2ODRhMmFjNjRmMDkxNTBkMTQ0MzRhYjA4MCIsInZlcnNpb24iOjF9.Uw_-unhd7rxXemBwV_sr0ajFqEfjIS3W9tkn7pl4MWt2czx17k8vNQiJjC9JhqwHArzQXFMtcC3_MMxUYzluBA
    - type: rouge
      value: 8.9225
      name: ROUGE-2
      verified: true
      verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiODI2YTE0NDkyNTg1NjcwYmU5NjYzNmNmM2MxN2E2MjEwMTkyZDZiNWQ1ZTZhNDFmY2QzOGQ0ZTc4YjQwMmJkMiIsInZlcnNpb24iOjF9.-FTnj_dJZQGaav6Jr6M6RBM2POaEYOBuiZUQsh_zFlGT2p5xRE0S0Xx3k0Od4Lku6RTsx8PY3R8yP5UJ2m2KBQ
    - type: rouge
      value: 16.2037
      name: ROUGE-L
      verified: true
      verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZGJkMTdjODkyZjU1NWViYzQyNWY3MjQwMzJjODkwNDFkYzhiMmM5YTE5ZmQ5YTk3NDIzNjVjYTlkYTIwYjAyMSIsInZlcnNpb24iOjF9.DO0iQsWnb5yBZyFtBtzgxXjebQMTovZaSpLL9Wnbg3QD9pwQL6zVnSu5m1YHSTtZAsRgckHVW7K86sv1ITZcBg
    - type: rouge
      value: 24.752
      name: ROUGE-LSUM
      verified: true
      verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZjU3YWM3ZjVmMWZlOTg1ODE0ZmYxZmI4ODI5MGI5YTkwNTk3MGI1YjFhYjA4MDJkYWZjN2M1MTk4NmQ3MWE1NiIsInZlcnNpb24iOjF9.07SKt9OCN_KdAFB4j4A_u86C1SuWIfaYiCPiXyI8Jt2l0XVdzQx4nsH2rmPZEC_a96C_ri8oF9PstLI3-bzoAA
    - type: loss
      value: 2.721339225769043
      name: loss
      verified: true
      verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiNjAwZmQxZjQxZDgyMGFlYzNjZjY0YjZhZGU3OTI3MTQ3MzEwNzhkZDUyMThlZGIwMTlhYTQyZjBmZTBmMTgzOCIsInZlcnNpb24iOjF9.sfz9_ybz3BTaWCfzJrIQGtpxDDB1V86r4RNP9oYpoF-ry_m0DIiIkmPRqjvN3YL9ycpNT6etiB1R2uzG1tfQCw
    - type: gen_len
      value: 73.5605
      name: gen_len
      verified: true
      verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMTc5NTZkYzc5OGEwMzI5YWVlM2VlMWY5M2M0NGVjNDZjZGNkNzg4Y2IwOWZmMTc0M2JhYmM2NTg1NGE3ZWNlMSIsInZlcnNpb24iOjF9.pmX6YYXcgRUS1gVTMdeJI5kPS20G-Pc40U488N2pHoWpo2ISr4kOy_Ppzf5MQKoJiZoCMohvWvoLny3uMkHQDA
---
# BART (large-sized model), fine-tuned on CNN Daily Mail 

BART model pre-trained on English language, and fine-tuned on [CNN Daily Mail](https://huggingface.co/datasets/cnn_dailymail). It was introduced in the paper [BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension](https://arxiv.org/abs/1910.13461) by Lewis et al. and first released in [this repository (https://github.com/pytorch/fairseq/tree/master/examples/bart). 

Disclaimer: The team releasing BART did not write a model card for this model so this model card has been written by the Hugging Face team.

## Model description

BART is a transformer encoder-encoder (seq2seq) model with a bidirectional (BERT-like) encoder and an autoregressive (GPT-like) decoder. BART is pre-trained by (1) corrupting text with an arbitrary noising function, and (2) learning a model to reconstruct the original text.

BART is particularly effective when fine-tuned for text generation (e.g. summarization, translation) but also works well for comprehension tasks (e.g. text classification, question answering). This particular checkpoint has been fine-tuned on CNN Daily Mail, a large collection of text-summary pairs.

## Intended uses & limitations

You can use this model for text summarization. 

### How to use

Here is how to use this model with the [pipeline API](https://huggingface.co/transformers/main_classes/pipelines.html):

```python
from transformers import pipeline

summarizer = pipeline("summarization", model="facebook/bart-large-cnn")

ARTICLE = """ New York (CNN)When Liana Barrientos was 23 years old, she got married in Westchester County, New York.
A year later, she got married again in Westchester County, but to a different man and without divorcing her first husband.
Only 18 days after that marriage, she got hitched yet again. Then, Barrientos declared "I do" five more times, sometimes only within two weeks of each other.
In 2010, she married once more, this time in the Bronx. In an application for a marriage license, she stated it was her "first and only" marriage.
Barrientos, now 39, is facing two criminal counts of "offering a false instrument for filing in the first degree," referring to her false statements on the
2010 marriage license application, according to court documents.
Prosecutors said the marriages were part of an immigration scam.
On Friday, she pleaded not guilty at State Supreme Court in the Bronx, according to her attorney, Christopher Wright, who declined to comment further.
After leaving court, Barrientos was arrested and charged with theft of service and criminal trespass for allegedly sneaking into the New York subway through an emergency exit, said Detective
Annette Markowski, a police spokeswoman. In total, Barrientos has been married 10 times, with nine of her marriages occurring between 1999 and 2002.
All occurred either in Westchester County, Long Island, New Jersey or the Bronx. She is believed to still be married to four men, and at one time, she was married to eight men at once, prosecutors say.
Prosecutors said the immigration scam involved some of her husbands, who filed for permanent residence status shortly after the marriages.
Any divorces happened only after such filings were approved. It was unclear whether any of the men will be prosecuted.
The case was referred to the Bronx District Attorney\'s Office by Immigration and Customs Enforcement and the Department of Homeland Security\'s
Investigation Division. Seven of the men are from so-called "red-flagged" countries, including Egypt, Turkey, Georgia, Pakistan and Mali.
Her eighth husband, Rashid Rajput, was deported in 2006 to his native Pakistan after an investigation by the Joint Terrorism Task Force.
If convicted, Barrientos faces up to four years in prison.  Her next court appearance is scheduled for May 18.
"""
print(summarizer(ARTICLE, max_length=130, min_length=30, do_sample=False))
>>> [{'summary_text': 'Liana Barrientos, 39, is charged with two counts of "offering a false instrument for filing in the first degree" In total, she has been married 10 times, with nine of her marriages occurring between 1999 and 2002. She is believed to still be married to four men.'}]
```

### BibTeX entry and citation info

```bibtex
@article{DBLP:journals/corr/abs-1910-13461,
  author    = {Mike Lewis and
               Yinhan Liu and
               Naman Goyal and
               Marjan Ghazvininejad and
               Abdelrahman Mohamed and
               Omer Levy and
               Veselin Stoyanov and
               Luke Zettlemoyer},
  title     = {{BART:} Denoising Sequence-to-Sequence Pre-training for Natural Language
               Generation, Translation, and Comprehension},
  journal   = {CoRR},
  volume    = {abs/1910.13461},
  year      = {2019},
  url       = {http://arxiv.org/abs/1910.13461},
  eprinttype = {arXiv},
  eprint    = {1910.13461},
  timestamp = {Thu, 31 Oct 2019 14:02:26 +0100},
  biburl    = {https://dblp.org/rec/journals/corr/abs-1910-13461.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}
```