Translation
Transformers
PyTorch
TensorFlow
JAX
Rust
Safetensors
t5
text2text-generation
summarization
text-generation-inference
Run this model with HF Jobs
Run google-t5/t5-base on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/google-t5/t5-base. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/google-t5/t5-base on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use google-t5/t5-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use google-t5/t5-base with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("translation", model="google-t5/t5-base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("google-t5/t5-base") model = AutoModelForSeq2SeqLM.from_pretrained("google-t5/t5-base", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
Update model card (#3)
Browse files- Update model card (39bc9d8eb7fe9b7ca947fbfcf5667c7bf0897fac)
Co-authored-by: Marissa Gerchick <Marissa@users.noreply.huggingface.co>
12 unmodified lines13141516171819202128 unmodified lines5051525354555657585960616263646566676869707112 unmodified lineslicense: apache-2.0---[Google's T5](https://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html)## PreTrainingThe model was pre-trained on a on a **multi-task mixture of unsupervised (1.) and supervised tasks (2.)**.Thereby, the following datasets were being used for (1.) and (2.):28 unmodified lines- ReCoRD [Zhang et al., 2018](https://arxiv.org/abs/1810.12885)- BoolQ [Clark et al., 2019](https://arxiv.org/abs/1905.10044)## All T5 checkpointsOther Community Checkpoints: [here](https://huggingface.co/models?search=t5)## PaperFor more information, please take a look at the original paper.Paper: [Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer](https://arxiv.org/pdf/1910.10683.pdf)Authors: *Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu***Abstract**Transfer learning, where a model is first pre-trained on a data-rich task before being fine-tuned on a downstream task, has emerged as a powerful technique in natural language processing (NLP). The effectiveness of transfer learning has given rise to a diversity of approaches, methodology, and practice. 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. By combining the insights from our exploration with scale and our new “Colossal Clean Crawled Corpus”, we achieve state-of-the-art results on many benchmarks covering summarization, question answering, text classification, and more. To facilitate future work on transfer learning for NLP, we release our dataset, pre-trained models, and code.12 unmodified lines1314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818228 unmodified lines11111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919012 unmodified lineslicense: apache-2.0---# Model Card for T5 Base# Table of Contents1. [Model Details](#model-details)2. [Uses](#uses)3. [Bias, Risks, and Limitations](#bias-risks-and-limitations)4. [Training Details](#training-details)5. [Evaluation](#evaluation)6. [Environmental Impact](#environmental-impact)7. [Citation](#citation)8. [Model Card Authors](#model-card-authors)9. [How To Get Started With the Model](#how-to-get-started-with-the-model)# Model Details## Model DescriptionThe developers of the Text-To-Text Transfer Transformer (T5) [write](https://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html):> 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.T5-Base is the checkpoint with 220 million parameters.- **Developed by:** Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu. See [associated paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf) and [GitHub repo](https://github.com/google-research/text-to-text-transfer-transformer#released-model-checkpoints)- **Model type:** Language model- **Language(s) (NLP):** English, French, Romanian, German- **License:** Apache 2.0- **Related Models:** [All T5 Checkpoints](https://huggingface.co/models?search=t5)- **Resources for more information:**- [Research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf)- [Google's T5 Blog Post](https://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html)- [GitHub Repo](https://github.com/google-research/text-to-text-transfer-transformer)- [Hugging Face T5 Docs](https://huggingface.co/docs/transformers/model_doc/t5)# Uses## Direct Use and Downstream UseThe developers write in a [blog post](https://ai.googleblog.com/2020/02/exploring-transfer-learning-with-t5.html) that the model:> 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.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.## Out-of-Scope UseMore information needed.# Bias, Risks, and LimitationsMore information needed.## RecommendationsMore information needed.# Training Details## Training DataThe 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.The model was pre-trained on a on a **multi-task mixture of unsupervised (1.) and supervised tasks (2.)**.Thereby, the following datasets were being used for (1.) and (2.):28 unmodified lines- ReCoRD [Zhang et al., 2018](https://arxiv.org/abs/1810.12885)- BoolQ [Clark et al., 2019](https://arxiv.org/abs/1905.10044)## Training ProcedureIn their [abstract](https://jmlr.org/papers/volume21/20-074/20-074.pdf), the model developers write:> 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.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.# Evaluation## Testing Data, Factors & MetricsThe developers evaluated the model on 24 tasks, see the [research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf) for full details.## ResultsFor full results for T5-Base, see the [research paper](https://jmlr.org/papers/volume21/20-074/20-074.pdf), Table 14.# Environmental ImpactCarbon 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).- **Hardware Type:** Google Cloud TPU Pods- **Hours used:** More information needed- **Cloud Provider:** GCP- **Compute Region:** More information needed- **Carbon Emitted:** More information needed# Citation**BibTeX:**```bibtex@article{2020t5,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},title = {Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer},journal = {Journal of Machine Learning Research},year = {2020},volume = {21},number = {140},pages = {1-67},url = {http://jmlr.org/papers/v21/20-074.html}}```**APA:**- 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.# Model Card AuthorsThis model card was written by the team at Hugging Face.# How to Get Started with the ModelUse the code below to get started with the model.<details><summary> Click to expand </summary>```pythonfrom transformers import T5Tokenizer, T5Modeltokenizer = T5Tokenizer.from_pretrained("t5-base")model = T5Model.from_pretrained("t5-base")input_ids = tokenizer("Studies have been shown that owning a dog is good for you", return_tensors="pt").input_ids # Batch size 1decoder_input_ids = tokenizer("Studies show that", return_tensors="pt").input_ids # Batch size 1# forward passoutputs = model(input_ids=input_ids, decoder_input_ids=decoder_input_ids)last_hidden_states = outputs.last_hidden_state```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.</details>
README.md+130-11