sysresearch101 commited on
Commit
69237fd
·
verified ·
1 Parent(s): 57bdf7e

Update README.md

Browse files

updated model card with better information and links to references

Files changed (1) hide show
  1. README.md +102 -97
README.md CHANGED
@@ -9,45 +9,6 @@ tags:
9
  model-index:
10
  - name: sysresearch101/t5-large-finetuned-xsum
11
  results:
12
- # - task:
13
- # type: summarization
14
- # name: Summarization
15
- # dataset:
16
- # name: xsum
17
- # type: xsum
18
- # config: 3.0.0
19
- # split: train
20
- # metrics:
21
- # - type: rouge
22
- # value: <TODO>
23
- # name: ROUGE-1
24
- # verified: true
25
- # verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiNmE1YjI2OWVjMGRiZWU3MjJhOTViMWIzNWU3MDNlZmFkMmNhZTFiN2RhOTc0ZjkyNzc5ZDg1YWZiZWFhMTEyZiIsInZlcnNpb24iOjF9.ye9137aCRynwSZM0YD2k4_LIcrRU4EyCRjBB8YQ0kUCImJyHNVFPFbbzObfLSM3XQ_tauALczriBCMJ7IGxeDQ
26
- # - type: rouge
27
- # value: <TODO>
28
- # name: ROUGE-2
29
- # verified: true
30
- # verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiYWYzYzZlZTEwYThhYjJkYzE0MzA1ZjE2NDBiMDNjOTNlZWNjNmMxNDJiMDE4OTJhMjdhNGI3OWRiZjQ1M2RhOSIsInZlcnNpb24iOjF9.-6WOpeYKgyiQSvWIeCfJWWTzI8kt_Q5by31r-ceBF384NMf6APLA94jKpLdE2HDbDgUtuxF9LAHFz9jmhkqKCA
31
- # - type: rouge
32
- # value: <TODO>
33
- # name: ROUGE-L
34
- # verified: true
35
- # verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiNDAxODg3ZjRlMmUwZTdjYmRmYTZhMzEwYTg4MmU4NmY2MmJlZTE5N2MxYjY4YmE4NGM0NDJkNDRiYjc2OTQwMSIsInZlcnNpb24iOjF9.iWTpIMKC2HGkJMYOQviXBnc-lj4pHLWVyfMXSfbz26s1KUi5gOD97eEaHeBmUW5IMs64dosTVa6xo3T-5_FdDA
36
- # - type: rouge
37
- # value: <TODO>
38
- # name: ROUGE-LSUM
39
- # verified: true
40
- # verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMGU2YzFiMDRkOTc2OTFjMGI1MzA3MTgwMzczMjhkMTMxNzkyNDVlZGUzMGM3OTk4ODk0YjQ4MzRjYTVlNmZmNiIsInZlcnNpb24iOjF9.K1duMlA1zQpSiencBbbhpShckuvEb8zspnJG5jf1n65KmNY4Md3VA96ERKixUOIymnTo-gKyS9QEDKblPmR_Ag
41
- # - type: loss
42
- # value: <TODO>
43
- # name: loss
44
- # verified: true
45
- # verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZDQ4MDI4MzgyOWUwYzI0YTE3MTE2ODdhYjU3MGE1MTg1NTU4OTM4NzlmYjE1MDY5M2Q2OTVkZjY4MzRlZTYzOCIsInZlcnNpb24iOjF9.5BMk4fs-oVoDNJnPBpDlSkywd3Qogat4_N8_IdS26AObm2i1blwonx4sy8l8RK50pq16bJbplBEEG-3HuTz9DQ
46
- # - type: gen_len
47
- # value: <TODO>
48
- # name: gen_len
49
- # verified: true
50
- # verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiOTE4ZTAzNmYxMzE2NGYzYTM2MzMxNTNlN2M4YmJlOWI3ZWFkMGRlMTc5NGMzNjBlZjg1MjJhZDdlNDIwZTAwNyIsInZlcnNpb24iOjF9._JTVMjukkupE4_QWOQZZZVwmnXSh-ppo7jlGdk0CUxNIIVTStxQhex09O1H6-Ilk9dtYk1PVCNNg8alZAFHeDQ
51
  - task:
52
  type: summarization
53
  name: Summarization
@@ -61,104 +22,148 @@ model-index:
61
  value: 26.8921
62
  name: ROUGE-1
63
  verified: true
64
- verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZmFkMTFiNmM3YmRkZDk1Y2FhM2EwOTdiYmUwYjBhMGEzZmIyZmIwNWI5OTVmY2U0N2QzYzgxYzM0OTEzMjFjNSIsInZlcnNpb24iOjF9.fOq4zI_BWvTLFJFQOWNk3xEsDIu3aAeboGYPw5TiBqdJJjvdyKmLbfj2WVnNboWbrmp1PuL01iJjTi2Xj6PUAA
 
65
  - type: rouge
66
  value: 6.9411
67
  name: ROUGE-2
68
  verified: true
69
- verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMTBlZmI3NjQ3M2JiYzI4MTg3YmJkMjg0ZmE5MDUwNzljNTYyM2M0NzA3YTNiNTA2Nzk4MDhhYWZjZjgyMmE1MCIsInZlcnNpb24iOjF9.rH0DY2hMz2rXaK29vkt7xah-3G95rY4MOS2oVKjXmw4TijB-ZVytfLJAlBmyqA8HYAythRCywmLSjjCDWc66Cg
 
70
  - type: rouge
71
  value: 21.2832
72
  name: ROUGE-L
73
  verified: true
74
- verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiODAwZDYzNTc0NjZhNzNiMDE2ZDY2NjNjNmViNTc0NDVjNTZkYjljODhmYmNiMWFhY2NkZjU5MzQ0NmM0OTcyMSIsInZlcnNpb24iOjF9.5duHtdjZ8dwtbp1HKyMR4mVK9IIlEZvuWGjQMErpE7VNyKPhMOT6Avh_vXFQz6q_jBzqpZGGREho1mt50yBsDw
 
75
  - type: rouge
76
  value: 21.284
77
  name: ROUGE-LSUM
78
  verified: true
79
- verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMGQ2NmNhZTZmZDFkNTcyYjQ4MjhhYWJhODY1ZGRjODY2ZTE5MmRmZDRlYTk4NWE4YWM1OWY2M2NjOWQ3YzU0OCIsInZlcnNpb24iOjF9.SJ8xTcAVWrRDmJmQoxE1ADIcdGA4tr3V04Lv0ipMJiUksCdNC7FO8jYbjG9XmiqbDnnr5h4XoK4JB4-GsA-gDA
 
80
  - type: loss
81
  value: 2.5411810874938965
82
  name: loss
83
  verified: true
84
- verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZGViNTVlNGI0Njk4NmZmZjExNDBkNTQ4N2FhMzRkZjRjNDNlYzFhZDIyMjJhMmFiM2ZhMTQzYTM4YzNkNWVlNyIsInZlcnNpb24iOjF9.p9n2Kf48k9F9Bkk9j7UKRayvVmOr7_LV80T0ti4lUWFtTsZ91Re841xnEAcKSYgQ9-Bni56ldq9js3kunspJCw
 
85
  - type: gen_len
86
  value: 18.7755
87
  name: gen_len
88
  verified: true
89
- verifyToken: eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZmQ1ZWUxNmFjNmU0OGI4MDQyZDNjMWQwZGViNDhlMzE1OGE3YmYwYzZjYmM1NWEwMjk2MDFiMjQ4ZThhMjg5YyIsInZlcnNpb24iOjF9.aNp-NFzBSm84GnXuDtYuHaOsSk7zw8kjCphowYFciwt-aDnhwwurYIr59kMT8JNFMnRInsDi8tvYdapareV3DA
 
 
 
 
 
90
  ---
91
 
92
- # T5-large Summarization Model Trained on the XSUM Dataset
93
 
94
- Finetuned T5 Large summarization model.
 
 
95
 
96
- ## Finetuning Corpus
97
 
98
- `t5-large-finetuned-xsum` model is based on `t5-large model` by [huggingface](https://huggingface.co/t5-large), finetuned using [XSUM](https://huggingface.co/datasets/xsum) datasets.
99
 
100
- ## Load Finetuned Model
 
 
 
 
 
 
 
 
 
 
 
 
 
101
 
102
  ```python
103
- from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, DataCollatorForSeq2Seq, Seq2SeqTrainingArguments, Seq2SeqTrainer
 
 
 
 
 
 
 
 
 
 
 
 
104
 
105
  tokenizer = AutoTokenizer.from_pretrained("sysresearch101/t5-large-finetuned-xsum")
106
- model = model = AutoModelForSeq2SeqLM.from_pretrained("sysresearch101/t5-large-finetuned-xsum")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
 
108
- ARTICLE_TO_SUMMARIZE = "..."
109
 
110
- # generate summary
 
 
111
 
112
- input_ids = tokenizer.encode(ARTICLE_TO_SUMMARIZE, return_tensors='pt')
113
- summary_ids = model.generate(input_ids,
114
- min_length=20,
115
- max_length=80,
116
- num_beams=10,
117
- repetition_penalty=2.5,
118
- length_penalty=1.0,
119
- early_stopping=True,
120
- no_repeat_ngram_size=2,
121
- use_cache=True,
122
- do_sample = True,
123
- temperature = 0.8,
124
- top_k = 50,
125
- top_p = 0.95)
126
 
127
- summary_text = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
128
- print(summary_text)
129
 
130
- Output: <TODO>
131
 
 
 
 
 
 
 
 
 
132
  ```
133
 
134
- ### How to use via a pipeline
135
 
136
- Here is how to use this model with the [pipeline API](https://huggingface.co/transformers/main_classes/pipelines.html):
 
 
137
 
138
 
139
- ```python
140
- from transformers import pipeline
141
 
142
- summarizer = pipeline("summarization", model="sysresearch101/t5-large-finetuned-xsum")
 
143
 
144
- ARTICLE = """ New York (CNN)When Liana Barrientos was 23 years old, she got married in Westchester County, New York.
145
- A year later, she got married again in Westchester County, but to a different man and without divorcing her first husband.
146
- 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.
147
- 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.
148
- 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
149
- 2010 marriage license application, according to court documents.
150
- Prosecutors said the marriages were part of an immigration scam.
151
- On Friday, she pleaded not guilty at State Supreme Court in the Bronx, according to her attorney, Christopher Wright, who declined to comment further.
152
- 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
153
- Annette Markowski, a police spokeswoman. In total, Barrientos has been married 10 times, with nine of her marriages occurring between 1999 and 2002.
154
- 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.
155
- Prosecutors said the immigration scam involved some of her husbands, who filed for permanent residence status shortly after the marriages.
156
- Any divorces happened only after such filings were approved. It was unclear whether any of the men will be prosecuted.
157
- The case was referred to the Bronx District Attorney\'s Office by Immigration and Customs Enforcement and the Department of Homeland Security\'s
158
- Investigation Division. Seven of the men are from so-called "red-flagged" countries, including Egypt, Turkey, Georgia, Pakistan and Mali.
159
- Her eighth husband, Rashid Rajput, was deported in 2006 to his native Pakistan after an investigation by the Joint Terrorism Task Force.
160
- If convicted, Barrientos faces up to four years in prison. Her next court appearance is scheduled for May 18.
161
- """
162
- print(summarizer(ARTICLE, max_length=130, min_length=30, do_sample=False))
163
- >>> [{'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.'}]
164
- ```
 
9
  model-index:
10
  - name: sysresearch101/t5-large-finetuned-xsum
11
  results:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  - task:
13
  type: summarization
14
  name: Summarization
 
22
  value: 26.8921
23
  name: ROUGE-1
24
  verified: true
25
+ verifyToken: >-
26
+ eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZmFkMTFiNmM3YmRkZDk1Y2FhM2EwOTdiYmUwYjBhMGEzZmIyZmIwNWI5OTVmY2U0N2QzYzgxYzM0OTEzMjFjNSIsInZlcnNpb24iOjF9.fOq4zI_BWvTLFJFQOWNk3xEsDIu3aAeboGYPw5TiBqdJJjvdyKmLbfj2WVnNboWbrmp1PuL01iJjTi2Xj6PUAA
27
  - type: rouge
28
  value: 6.9411
29
  name: ROUGE-2
30
  verified: true
31
+ verifyToken: >-
32
+ eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMTBlZmI3NjQ3M2JiYzI4MTg3YmJkMjg0ZmE5MDUwNzljNTYyM2M0NzA3YTNiNTA2Nzk4MDhhYWZjZjgyMmE1MCIsInZlcnNpb24iOjF9.rH0DY2hMz2rXaK29vkt7xah-3G95rY4MOS2oVKjXmw4TijB-ZVytfLJAlBmyqA8HYAythRCywmLSjjCDWc66Cg
33
  - type: rouge
34
  value: 21.2832
35
  name: ROUGE-L
36
  verified: true
37
+ verifyToken: >-
38
+ eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiODAwZDYzNTc0NjZhNzNiMDE2ZDY2NjNjNmViNTc0NDVjNTZkYjljODhmYmNiMWFhY2NkZjU5MzQ0NmM0OTcyMSIsInZlcnNpb24iOjF9.5duHtdjZ8dwtbp1HKyMR4mVK9IIlEZvuWGjQMErpE7VNyKPhMOT6Avh_vXFQz6q_jBzqpZGGREho1mt50yBsDw
39
  - type: rouge
40
  value: 21.284
41
  name: ROUGE-LSUM
42
  verified: true
43
+ verifyToken: >-
44
+ eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiMGQ2NmNhZTZmZDFkNTcyYjQ4MjhhYWJhODY1ZGRjODY2ZTE5MmRmZDRlYTk4NWE4YWM1OWY2M2NjOWQ3YzU0OCIsInZlcnNpb24iOjF9.SJ8xTcAVWrRDmJmQoxE1ADIcdGA4tr3V04Lv0ipMJiUksCdNC7FO8jYbjG9XmiqbDnnr5h4XoK4JB4-GsA-gDA
45
  - type: loss
46
  value: 2.5411810874938965
47
  name: loss
48
  verified: true
49
+ verifyToken: >-
50
+ eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZGViNTVlNGI0Njk4NmZmZjExNDBkNTQ4N2FhMzRkZjRjNDNlYzFhZDIyMjJhMmFiM2ZhMTQzYTM4YzNkNWVlNyIsInZlcnNpb24iOjF9.p9n2Kf48k9F9Bkk9j7UKRayvVmOr7_LV80T0ti4lUWFtTsZ91Re841xnEAcKSYgQ9-Bni56ldq9js3kunspJCw
51
  - type: gen_len
52
  value: 18.7755
53
  name: gen_len
54
  verified: true
55
+ verifyToken: >-
56
+ eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJoYXNoIjoiZmQ1ZWUxNmFjNmU0OGI4MDQyZDNjMWQwZGViNDhlMzE1OGE3YmYwYzZjYmM1NWEwMjk2MDFiMjQ4ZThhMjg5YyIsInZlcnNpb24iOjF9.aNp-NFzBSm84GnXuDtYuHaOsSk7zw8kjCphowYFciwt-aDnhwwurYIr59kMT8JNFMnRInsDi8tvYdapareV3DA
57
+ datasets:
58
+ - EdinburghNLP/xsum
59
+ base_model:
60
+ - google-t5/t5-large
61
  ---
62
 
63
+ # T5-Large Fine-tuned on XSum
64
 
65
+ **Task:** Abstractive Summarization (English)
66
+ **Base Model:** google-t5/t5-large
67
+ **License:** MIT
68
 
69
+ ## Overview
70
 
71
+ This model is a T5-Large checkpoint fine-tuned exclusively on the [XSum](https://huggingface.co/datasets/EdinburghNLP/xsum) dataset. It specializes in generating concise, single-sentence summaries in the style of BBC article abstracts.
72
 
73
+ ## Performance ~ On XSum test set
74
+
75
+ | Metric | Score |
76
+ |--------|-------|
77
+ | ROUGE-1 | 26.89 |
78
+ | ROUGE-2 | 6.94 |
79
+ | ROUGE-L | 21.28 |
80
+ | Loss | 2.54 |
81
+ | Avg. Length | 18.77 tokens |
82
+
83
+
84
+ ## Usage
85
+
86
+ ### Quick Start
87
 
88
  ```python
89
+ from transformers import pipeline
90
+
91
+ summarizer = pipeline("summarization", model="sysresearch101/t5-large-finetuned-xsum")
92
+
93
+ article = "Your article text here..."
94
+ summary = summarizer(article, max_length=80, min_length=20, do_sample=False)
95
+ print(summary[0]['summary_text'])
96
+ ```
97
+
98
+ ### Advanced Usage
99
+
100
+ ```python
101
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
102
 
103
  tokenizer = AutoTokenizer.from_pretrained("sysresearch101/t5-large-finetuned-xsum")
104
+ model = AutoModelForSeq2SeqLM.from_pretrained("sysresearch101/t5-large-finetuned-xsum")
105
+
106
+ inputs = tokenizer("summarize: " + article, return_tensors="pt", max_length=512, truncation=True)
107
+ outputs = model.generate(
108
+ **inputs,
109
+ max_length=80,
110
+ min_length=20,
111
+ num_beams=4,
112
+ no_repeat_ngram_size=2,
113
+ length_penalty=1.0,
114
+ repetition_penalty=2.5,
115
+ use_cache=True,
116
+ early_stopping=True
117
+ do_sample = True,
118
+ temperature = 0.8,
119
+ top_k = 50,
120
+ top_p = 0.95
121
+ )
122
+
123
+ summary = tokenizer.decode(outputs[0], skip_special_tokens=True)
124
+ ```
125
+
126
+ ## Training Data
127
+
128
+ - [XSum](https://huggingface.co/datasets/EdinburghNLP/xsum): BBC articles paired with professionally written single-sentence summaries
129
+
130
 
131
+ ## Intended Use
132
 
133
+ - **Primary:** Summarization
134
+ - **Secondary:** Research on extreme summarization, single-sentence summary generation, Educational demonstrations, comparative studies with multi-sentence models
135
+ - **Not recommended:** Multi-sentence summarization tasks, production use without validation
136
 
137
+ ## Limitations
138
+ - Trained only on news domain; may not generalize to other text types
139
+ - Generates very short summaries (average ~19 tokens)
140
+ - May oversimplify complex topics due to single-sentence constraint
 
 
 
 
 
 
 
 
 
 
141
 
 
 
142
 
143
+ ## Citation
144
 
145
+ ```bibtex
146
+ @misc{stept2023_t5_large_xsum,
147
+ author = {Shlomo Stept (sysresearch101)},
148
+ title = {T5-Large Fine-tuned on XSum for Abstractive Summarization},
149
+ year = {2023},
150
+ publisher = {Hugging Face},
151
+ url = {https://huggingface.co/sysresearch101/t5-large-finetuned-xsum}
152
+ }
153
  ```
154
 
155
+ ## Papers Using This Model
156
 
157
+ * [Tam et al. (2023). *Evaluating the Factual Consistency of Large Language Models Through Summarization (FIB).* Findings of ACL 2023.](https://arxiv.org/pdf/2211.08412)
158
+ * [Liu et al. (2024). *LLMs as Narcissistic Evaluators: When Ego Inflates Evaluation Scores.* Findings of ACL 2024.](https://aclanthology.org/2024.findings-acl.753.pdf)
159
+ * [Zhu et al. (2024). *MTAS: A Reference-Free Approach for Evaluating Abstractive Summarization Systems.* Proceedings of the ACM on SE (FSE 2024).](https://doi.org/10.1145/3660820)
160
 
161
 
162
+ ## Contact
 
163
 
164
+ Created by [Shlomo Stept](https://shlomostept.com) ([ORCID: 0009-0009-3185-589X](https://orcid.org/0009-0009-3185-589X))
165
+ DARMIS AI
166
 
167
+
168
+ - Website: [shlomostept.com](https://shlomostept.com)
169
+ - LinkedIn: [linkedin.com/in/shlomo-stept](https://linkedin.com/in/shlomo-stept)