erathi commited on
Commit
7abc12e
1 Parent(s): d712b0b

initial commit

Browse files
README.md ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ pipeline_tag: summarization
5
+ license: mit
6
+ thumbnail: https://huggingface.co/front/thumbnails/facebook.png
7
+ datasets:
8
+ - cnn_dailymail
9
+ model-index:
10
+ - name: facebook/bart-large-cnn
11
+ results:
12
+ - task:
13
+ type: summarization
14
+ name: Summarization
15
+ dataset:
16
+ name: cnn_dailymail
17
+ type: cnn_dailymail
18
+ config: 3.0.0
19
+ split: train
20
+ metrics:
21
+ - name: ROUGE-1
22
+ type: rouge
23
+ value: 42.9486
24
+ verified: true
25
+ - name: ROUGE-2
26
+ type: rouge
27
+ value: 20.8149
28
+ verified: true
29
+ - name: ROUGE-L
30
+ type: rouge
31
+ value: 30.6186
32
+ verified: true
33
+ - name: ROUGE-LSUM
34
+ type: rouge
35
+ value: 40.0376
36
+ verified: true
37
+ - name: loss
38
+ type: loss
39
+ value: 2.529000997543335
40
+ verified: true
41
+ - name: gen_len
42
+ type: gen_len
43
+ value: 78.5866
44
+ verified: true
45
+ ---
46
+ # BART (large-sized model), fine-tuned on CNN Daily Mail
47
+
48
+ 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).
49
+
50
+ 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.
51
+
52
+ ## Model description
53
+
54
+ 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.
55
+
56
+ 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.
57
+
58
+ ## Intended uses & limitations
59
+
60
+ You can use this model for text summarization.
61
+
62
+ ### How to use
63
+
64
+ Here is how to use this model with the [pipeline API](https://huggingface.co/transformers/main_classes/pipelines.html):
65
+
66
+ ```python
67
+ from transformers import pipeline
68
+
69
+ summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
70
+
71
+ ARTICLE = """ New York (CNN)When Liana Barrientos was 23 years old, she got married in Westchester County, New York.
72
+ A year later, she got married again in Westchester County, but to a different man and without divorcing her first husband.
73
+ 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.
74
+ 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.
75
+ 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
76
+ 2010 marriage license application, according to court documents.
77
+ Prosecutors said the marriages were part of an immigration scam.
78
+ On Friday, she pleaded not guilty at State Supreme Court in the Bronx, according to her attorney, Christopher Wright, who declined to comment further.
79
+ 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
80
+ Annette Markowski, a police spokeswoman. In total, Barrientos has been married 10 times, with nine of her marriages occurring between 1999 and 2002.
81
+ 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.
82
+ Prosecutors said the immigration scam involved some of her husbands, who filed for permanent residence status shortly after the marriages.
83
+ Any divorces happened only after such filings were approved. It was unclear whether any of the men will be prosecuted.
84
+ The case was referred to the Bronx District Attorney\'s Office by Immigration and Customs Enforcement and the Department of Homeland Security\'s
85
+ Investigation Division. Seven of the men are from so-called "red-flagged" countries, including Egypt, Turkey, Georgia, Pakistan and Mali.
86
+ Her eighth husband, Rashid Rajput, was deported in 2006 to his native Pakistan after an investigation by the Joint Terrorism Task Force.
87
+ If convicted, Barrientos faces up to four years in prison. Her next court appearance is scheduled for May 18.
88
+ """
89
+ print(summarizer(ARTICLE, max_length=130, min_length=30, do_sample=False))
90
+ >>> [{'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.'}]
91
+ ```
92
+
93
+ ### BibTeX entry and citation info
94
+
95
+ ```bibtex
96
+ @article{DBLP:journals/corr/abs-1910-13461,
97
+ author = {Mike Lewis and
98
+ Yinhan Liu and
99
+ Naman Goyal and
100
+ Marjan Ghazvininejad and
101
+ Abdelrahman Mohamed and
102
+ Omer Levy and
103
+ Veselin Stoyanov and
104
+ Luke Zettlemoyer},
105
+ title = {{BART:} Denoising Sequence-to-Sequence Pre-training for Natural Language
106
+ Generation, Translation, and Comprehension},
107
+ journal = {CoRR},
108
+ volume = {abs/1910.13461},
109
+ year = {2019},
110
+ url = {http://arxiv.org/abs/1910.13461},
111
+ eprinttype = {arXiv},
112
+ eprint = {1910.13461},
113
+ timestamp = {Thu, 31 Oct 2019 14:02:26 +0100},
114
+ biburl = {https://dblp.org/rec/journals/corr/abs-1910-13461.bib},
115
+ bibsource = {dblp computer science bibliography, https://dblp.org}
116
+ }
117
+ ```
config.json ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_num_labels": 3,
3
+ "activation_dropout": 0.0,
4
+ "activation_function": "gelu",
5
+ "add_final_layer_norm": false,
6
+ "architectures": [
7
+ "BartForConditionalGeneration"
8
+ ],
9
+ "attention_dropout": 0.0,
10
+ "bos_token_id": 0,
11
+ "classif_dropout": 0.0,
12
+ "classifier_dropout": 0.0,
13
+ "d_model": 1024,
14
+ "decoder_attention_heads": 16,
15
+ "decoder_ffn_dim": 4096,
16
+ "decoder_layerdrop": 0.0,
17
+ "decoder_layers": 12,
18
+ "decoder_start_token_id": 2,
19
+ "dropout": 0.1,
20
+ "early_stopping": true,
21
+ "encoder_attention_heads": 16,
22
+ "encoder_ffn_dim": 4096,
23
+ "encoder_layerdrop": 0.0,
24
+ "encoder_layers": 12,
25
+ "eos_token_id": 2,
26
+ "force_bos_token_to_be_generated": true,
27
+ "forced_bos_token_id": 0,
28
+ "forced_eos_token_id": 2,
29
+ "gradient_checkpointing": false,
30
+ "id2label": {
31
+ "0": "LABEL_0",
32
+ "1": "LABEL_1",
33
+ "2": "LABEL_2"
34
+ },
35
+ "init_std": 0.02,
36
+ "is_encoder_decoder": true,
37
+ "label2id": {
38
+ "LABEL_0": 0,
39
+ "LABEL_1": 1,
40
+ "LABEL_2": 2
41
+ },
42
+ "length_penalty": 2.0,
43
+ "max_length": 142,
44
+ "max_position_embeddings": 1024,
45
+ "min_length": 56,
46
+ "model_type": "bart",
47
+ "no_repeat_ngram_size": 3,
48
+ "normalize_before": false,
49
+ "num_beams": 4,
50
+ "num_hidden_layers": 12,
51
+ "output_past": true,
52
+ "pad_token_id": 1,
53
+ "prefix": " ",
54
+ "scale_embedding": false,
55
+ "task_specific_params": {
56
+ "summarization": {
57
+ "early_stopping": true,
58
+ "length_penalty": 2.0,
59
+ "max_length": 142,
60
+ "min_length": 56,
61
+ "no_repeat_ngram_size": 3,
62
+ "num_beams": 4
63
+ }
64
+ },
65
+ "transformers_version": "4.7.0.dev0",
66
+ "use_cache": true,
67
+ "vocab_size": 50264
68
+ }
flax_model.msgpack ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f615a75675b1367dcfaaf8854cae74d3053a7b5c2ed1403992c0348eff5c2e74
3
+ size 135
generation_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "decoder_start_token_id": 2,
5
+ "early_stopping": true,
6
+ "eos_token_id": 2,
7
+ "forced_bos_token_id": 0,
8
+ "forced_eos_token_id": 2,
9
+ "length_penalty": 2.0,
10
+ "max_length": 142,
11
+ "min_length": 56,
12
+ "no_repeat_ngram_size": 3,
13
+ "num_beams": 4,
14
+ "pad_token_id": 1,
15
+ "transformers_version": "4.27.0.dev0"
16
+ }
generation_config_for_summarization.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "decoder_start_token_id": 2,
5
+ "early_stopping": true,
6
+ "eos_token_id": 2,
7
+ "forced_bos_token_id": 0,
8
+ "forced_eos_token_id": 2,
9
+ "length_penalty": 2.0,
10
+ "max_length": 142,
11
+ "min_length": 56,
12
+ "no_repeat_ngram_size": 3,
13
+ "num_beams": 4,
14
+ "pad_token_id": 1,
15
+ "transformers_version": "4.27.0.dev0"
16
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b47a529a848e57feaee0c161104bfcbe7963cf82dbd98a796c0451dd9847d14a
3
+ size 135
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:01ede0cc31b5d1e32f4279df457db93415b3368fd7a57d0fb829d1271710fd30
3
+ size 135
rust_model.ot ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33bae8b845678132267019667306bfe2ee8ca730ced34cc5ddf750ea47b6b1b3
3
+ size 135
tf_model.h5 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3448eb338bbb00129ecabd096e4b816deb7f455086f3cc85981249899b488cd
3
+ size 135
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
vocab.json ADDED
The diff for this file is too large to render. See raw diff