NimaBoscarino commited on
Commit
fe4418c
1 Parent(s): 7c50704

Clarification for YAML frontmatter material

Browse files
app.py CHANGED
@@ -124,6 +124,7 @@ code {
124
  This tool should be treated as a Proof Of Concept, and is not designed for production-level use.
125
  - This is currently designed to only work on **English** model cards.
126
  - This tool relies on a very strict model card schema, which may be different from your model card.
 
127
  - If your model card contains any HTML fragments, this tool might not be able to read your model card.
128
  """)
129
 
 
124
  This tool should be treated as a Proof Of Concept, and is not designed for production-level use.
125
  - This is currently designed to only work on **English** model cards.
126
  - This tool relies on a very strict model card schema, which may be different from your model card.
127
+ - Only material in the main card body is considered – any data in the YAML frontmatter is disregarded.
128
  - If your model card contains any HTML fragments, this tool might not be able to read your model card.
129
  """)
130
 
tests/cards/facebook___bart-large-cnn.md ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ tags:
5
+ - summarization
6
+ license: mit
7
+ thumbnail: https://huggingface.co/front/thumbnails/facebook.png
8
+ datasets:
9
+ - cnn_dailymail
10
+ model-index:
11
+ - name: facebook/bart-large-cnn
12
+ results:
13
+ - task:
14
+ type: summarization
15
+ name: Summarization
16
+ dataset:
17
+ name: cnn_dailymail
18
+ type: cnn_dailymail
19
+ config: 3.0.0
20
+ split: train
21
+ metrics:
22
+ - name: ROUGE-1
23
+ type: rouge
24
+ value: 42.9486
25
+ verified: true
26
+ - name: ROUGE-2
27
+ type: rouge
28
+ value: 20.8149
29
+ verified: true
30
+ - name: ROUGE-L
31
+ type: rouge
32
+ value: 30.6186
33
+ verified: true
34
+ - name: ROUGE-LSUM
35
+ type: rouge
36
+ value: 40.0376
37
+ verified: true
38
+ - name: loss
39
+ type: loss
40
+ value: 2.529000997543335
41
+ verified: true
42
+ - name: gen_len
43
+ type: gen_len
44
+ value: 78.5866
45
+ verified: true
46
+ ---
47
+ # BART (large-sized model), fine-tuned on CNN Daily Mail
48
+
49
+ 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).
50
+
51
+ 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.
52
+
53
+ ## Model description
54
+
55
+ 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.
56
+
57
+ 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.
58
+
59
+ ## Intended uses & limitations
60
+
61
+ You can use this model for text summarization.
62
+
63
+ ### How to use
64
+
65
+ Here is how to use this model with the [pipeline API](https://huggingface.co/transformers/main_classes/pipelines.html):
66
+
67
+ ```python
68
+ from transformers import pipeline
69
+
70
+ summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
71
+
72
+ ARTICLE = """ New York (CNN)When Liana Barrientos was 23 years old, she got married in Westchester County, New York.
73
+ A year later, she got married again in Westchester County, but to a different man and without divorcing her first husband.
74
+ 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.
75
+ 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.
76
+ 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
77
+ 2010 marriage license application, according to court documents.
78
+ Prosecutors said the marriages were part of an immigration scam.
79
+ On Friday, she pleaded not guilty at State Supreme Court in the Bronx, according to her attorney, Christopher Wright, who declined to comment further.
80
+ 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
81
+ Annette Markowski, a police spokeswoman. In total, Barrientos has been married 10 times, with nine of her marriages occurring between 1999 and 2002.
82
+ 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.
83
+ Prosecutors said the immigration scam involved some of her husbands, who filed for permanent residence status shortly after the marriages.
84
+ Any divorces happened only after such filings were approved. It was unclear whether any of the men will be prosecuted.
85
+ The case was referred to the Bronx District Attorney\'s Office by Immigration and Customs Enforcement and the Department of Homeland Security\'s
86
+ Investigation Division. Seven of the men are from so-called "red-flagged" countries, including Egypt, Turkey, Georgia, Pakistan and Mali.
87
+ Her eighth husband, Rashid Rajput, was deported in 2006 to his native Pakistan after an investigation by the Joint Terrorism Task Force.
88
+ If convicted, Barrientos faces up to four years in prison. Her next court appearance is scheduled for May 18.
89
+ """
90
+ print(summarizer(ARTICLE, max_length=130, min_length=30, do_sample=False))
91
+ >>> [{'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.'}]
92
+ ```
93
+
94
+ ### BibTeX entry and citation info
95
+
96
+ ```bibtex
97
+ @article{DBLP:journals/corr/abs-1910-13461,
98
+ author = {Mike Lewis and
99
+ Yinhan Liu and
100
+ Naman Goyal and
101
+ Marjan Ghazvininejad and
102
+ Abdelrahman Mohamed and
103
+ Omer Levy and
104
+ Veselin Stoyanov and
105
+ Luke Zettlemoyer},
106
+ title = {{BART:} Denoising Sequence-to-Sequence Pre-training for Natural Language
107
+ Generation, Translation, and Comprehension},
108
+ journal = {CoRR},
109
+ volume = {abs/1910.13461},
110
+ year = {2019},
111
+ url = {http://arxiv.org/abs/1910.13461},
112
+ eprinttype = {arXiv},
113
+ eprint = {1910.13461},
114
+ timestamp = {Thu, 31 Oct 2019 14:02:26 +0100},
115
+ biburl = {https://dblp.org/rec/journals/corr/abs-1910-13461.bib},
116
+ bibsource = {dblp computer science bibliography, https://dblp.org}
117
+ }
tests/conftest.py CHANGED
@@ -19,6 +19,7 @@ expected_check_results = {
19
  "distilbert-base-uncased-finetuned-sst-2-english": [True, True, False, False],
20
  "distilroberta-base": [True, True, False, True],
21
  "emilyalsentzer___Bio_ClinicalBERT": [False, False, False, False],
 
22
  "facebook___bart-large-mnli": [False, False, False, False],
23
  "google___electra-base-discriminator": [False, False, False, False],
24
  "gpt2": [True, True, False, True],
 
19
  "distilbert-base-uncased-finetuned-sst-2-english": [True, True, False, False],
20
  "distilroberta-base": [True, True, False, True],
21
  "emilyalsentzer___Bio_ClinicalBERT": [False, False, False, False],
22
+ "facebook___bart-large-cnn": [True, True, False, False], # Evaluation scores are in the metadata, not card body.
23
  "facebook___bart-large-mnli": [False, False, False, False],
24
  "google___electra-base-discriminator": [False, False, False, False],
25
  "gpt2": [True, True, False, True],