ybelkada commited on
Commit
647e079
1 Parent(s): 309c953

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +187 -0
README.md ADDED
@@ -0,0 +1,187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ tags:
5
+ - summarization
6
+ - translation
7
+
8
+ license: apache-2.0
9
+ ---
10
+
11
+ # Model Card for FLAN-T5 large
12
+
13
+ ![model image](https://s3.amazonaws.com/moonup/production/uploads/1666360754614-62441d1d9fdefb55a0b7d12c.png)
14
+
15
+ # Table of Contents
16
+
17
+ 1. [Model Details](#model-details)
18
+ 2. [Uses](#uses)
19
+ 3. [Bias, Risks, and Limitations](#bias-risks-and-limitations)
20
+ 4. [Training Details](#training-details)
21
+ 5. [Evaluation](#evaluation)
22
+ 6. [Environmental Impact](#environmental-impact)
23
+ 7. [Citation](#citation)
24
+ 8. [Model Card Authors](#model-card-authors)
25
+ 9. [How To Get Started With the Model](#how-to-get-started-with-the-model)
26
+
27
+ # Model Details
28
+
29
+ ## Model Description
30
+
31
+ The developers of the Text-To-Text Transfer Transformer (T5) [write](https://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html):
32
+
33
+ > With T5, we propose reframing all NLP tasks into a unified text-to-text-format where the input and output are always text strings, in contrast to BERT-style models that can only output either a class label or a span of the input. Our text-to-text framework allows us to use the same model, loss function, and hyperparameters on any NLP task.
34
+
35
+ T5-Base is the checkpoint with 220 million parameters.
36
+
37
+ - **Developed by:** Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Eric Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, Albert Webson, Shixiang Shane, Gu Zhuyun, Dai Mirac, Suzgun Xinyun, Chen Aakanksha, Chowdhery Sharan, Narang Gaurav, Mishra Adams, Yu Vincent, Zhao Yanping, Huang Andrew, Dai Hongkun, Yu Slav Petrov, Ed H. Chi, Jeff Dean, Jacob Devlin, Adam Roberts; Denny Zhou, Quoc V. Le, Jason Wei∗ See [associated paper](https://arxiv.org/pdf/2210.11416.pdf) and [GitHub repo](https://github.com/google-research/t5x/blob/main/docs/models.md#flan-t5-checkpoints)
38
+ - **Model type:** Language model
39
+ - **Language(s) (NLP):** English, French, Romanian, German
40
+ - **License:** Apache 2.0
41
+ - **Related Models:** [All T5 Checkpoints](https://huggingface.co/models?search=t5)
42
+ - **Resources for more information:**
43
+ - [Research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf)
44
+ - [Google's T5 Blog Post](https://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html)
45
+ - [GitHub Repo](https://github.com/google-research/text-to-text-transfer-transformer)
46
+ - [Hugging Face T5 Docs](https://huggingface.co/docs/transformers/model_doc/t5)
47
+
48
+ # Uses
49
+
50
+ ## Direct Use and Downstream Use
51
+
52
+ The developers write in a [blog post](https://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html) that the model:
53
+
54
+ > Our text-to-text framework allows us to use the same model, loss function, and hyperparameters on any NLP task, including machine translation, document summarization, question answering, and classification tasks (e.g., sentiment analysis). We can even apply T5 to regression tasks by training it to predict the string representation of a number instead of the number itself.
55
+
56
+ See the [blog post](https://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html) and [research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf) for further details.
57
+
58
+ ## Out-of-Scope Use
59
+
60
+ More information needed.
61
+
62
+ # Bias, Risks, and Limitations
63
+
64
+ More information needed.
65
+
66
+ ## Recommendations
67
+
68
+ More information needed.
69
+
70
+ # Training Details
71
+
72
+ ## Training Data
73
+
74
+ The model is pre-trained on the [Colossal Clean Crawled Corpus (C4)](https://www.tensorflow.org/datasets/catalog/c4), which was developed and released in the context of the same [research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf) as T5.
75
+
76
+ The model was pre-trained on a on a **multi-task mixture of unsupervised (1.) and supervised tasks (2.)**.
77
+ Thereby, the following datasets were being used for (1.) and (2.):
78
+
79
+ 1. **Datasets used for Unsupervised denoising objective**:
80
+
81
+ - [C4](https://huggingface.co/datasets/c4)
82
+ - [Wiki-DPR](https://huggingface.co/datasets/wiki_dpr)
83
+
84
+
85
+ 2. **Datasets used for Supervised text-to-text language modeling objective**
86
+
87
+ - Sentence acceptability judgment
88
+ - CoLA [Warstadt et al., 2018](https://arxiv.org/abs/1805.12471)
89
+ - Sentiment analysis
90
+ - SST-2 [Socher et al., 2013](https://nlp.stanford.edu/~socherr/EMNLP2013_RNTN.pdf)
91
+ - Paraphrasing/sentence similarity
92
+ - MRPC [Dolan and Brockett, 2005](https://aclanthology.org/I05-5002)
93
+ - STS-B [Ceret al., 2017](https://arxiv.org/abs/1708.00055)
94
+ - QQP [Iyer et al., 2017](https://quoradata.quora.com/First-Quora-Dataset-Release-Question-Pairs)
95
+ - Natural language inference
96
+ - MNLI [Williams et al., 2017](https://arxiv.org/abs/1704.05426)
97
+ - QNLI [Rajpurkar et al.,2016](https://arxiv.org/abs/1606.05250)
98
+ - RTE [Dagan et al., 2005](https://link.springer.com/chapter/10.1007/11736790_9)
99
+ - CB [De Marneff et al., 2019](https://semanticsarchive.net/Archive/Tg3ZGI2M/Marneffe.pdf)
100
+ - Sentence completion
101
+ - COPA [Roemmele et al., 2011](https://www.researchgate.net/publication/221251392_Choice_of_Plausible_Alternatives_An_Evaluation_of_Commonsense_Causal_Reasoning)
102
+ - Word sense disambiguation
103
+ - WIC [Pilehvar and Camacho-Collados, 2018](https://arxiv.org/abs/1808.09121)
104
+ - Question answering
105
+ - MultiRC [Khashabi et al., 2018](https://aclanthology.org/N18-1023)
106
+ - ReCoRD [Zhang et al., 2018](https://arxiv.org/abs/1810.12885)
107
+ - BoolQ [Clark et al., 2019](https://arxiv.org/abs/1905.10044)
108
+
109
+ ## Training Procedure
110
+
111
+ In their [abstract](https://jmlr.org/papers/volume21/20-074/20-074.pdf), the model developers write:
112
+
113
+ > In this paper, we explore the landscape of transfer learning techniques for NLP by introducing a unified framework that converts every language problem into a text-to-text format. Our systematic study compares pre-training objectives, architectures, unlabeled datasets, transfer approaches, and other factors on dozens of language understanding tasks.
114
+
115
+ The framework introduced, the T5 framework, involves a training procedure that brings together the approaches studied in the paper. See the [research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf) for further details.
116
+
117
+ # Evaluation
118
+
119
+ ## Testing Data, Factors & Metrics
120
+
121
+ The developers evaluated the model on 88 tasks and 10 languages. See the table below for quantitative evaluation:
122
+ ![image.png](https://s3.amazonaws.com/moonup/production/uploads/1666361983550-62441d1d9fdefb55a0b7d12c.png)
123
+ For full details, please check the [research paper](https://arxiv.org/pdf/2210.11416.pdf).
124
+
125
+ ## Results
126
+
127
+ For full results for FLAN-T5-Large, see the [research paper](https://arxiv.org/pdf/2210.11416.pdf), Table 3.
128
+
129
+ # Environmental Impact
130
+
131
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
132
+
133
+ - **Hardware Type:** Google Cloud TPU Pods
134
+ - **Hours used:** More information needed
135
+ - **Cloud Provider:** GCP
136
+ - **Compute Region:** More information needed
137
+ - **Carbon Emitted:** More information needed
138
+
139
+ # Citation
140
+
141
+ **BibTeX:**
142
+
143
+ ```bibtex
144
+ @article{2020t5,
145
+ author = {Colin Raffel and Noam Shazeer and Adam Roberts and Katherine Lee and Sharan Narang and Michael Matena and Yanqi Zhou and Wei Li and Peter J. Liu},
146
+ title = {Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer},
147
+ journal = {Journal of Machine Learning Research},
148
+ year = {2020},
149
+ volume = {21},
150
+ number = {140},
151
+ pages = {1-67},
152
+ url = {http://jmlr.org/papers/v21/20-074.html}
153
+ }
154
+ ```
155
+
156
+ **APA:**
157
+ - Raffel, C., Shazeer, N., Roberts, A., Lee, K., Narang, S., Matena, M., ... & Liu, P. J. (2020). Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140), 1-67.
158
+
159
+ # Model Card Authors
160
+
161
+ This model card was written by the team at Hugging Face.
162
+
163
+ # How to Get Started with the Model
164
+
165
+ Use the code below to get started with the model.
166
+
167
+ <details>
168
+ <summary> Click to expand </summary>
169
+
170
+ ```python
171
+ from transformers import T5Tokenizer, T5Model
172
+
173
+ tokenizer = T5Tokenizer.from_pretrained("t5-base")
174
+ model = T5Model.from_pretrained("t5-base")
175
+
176
+ input_ids = tokenizer(
177
+ "Studies have been shown that owning a dog is good for you", return_tensors="pt"
178
+ ).input_ids # Batch size 1
179
+ decoder_input_ids = tokenizer("Studies show that", return_tensors="pt").input_ids # Batch size 1
180
+
181
+ # forward pass
182
+ outputs = model(input_ids=input_ids, decoder_input_ids=decoder_input_ids)
183
+ last_hidden_states = outputs.last_hidden_state
184
+ ```
185
+
186
+ See the [Hugging Face T5](https://huggingface.co/docs/transformers/model_doc/t5#transformers.T5Model) docs and a [Colab Notebook](https://colab.research.google.com/github/google-research/text-to-text-transfer-transformer/blob/main/notebooks/t5-trivia.ipynb) created by the model developers for more examples.
187
+ </details>