pytorch tf t5 text2text-generation en arxiv:1910.10683 transformers autotrain_compatible
---
language: en
inference: false
---

## T5-inshorts: T5 model trained on inshorts data

### Details of T5

The **T5** model was presented in [Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer](https://arxiv.org/abs/1910.10683) by *Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J. Liu* and here is the 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 all text-based language problems into a text-to-text format. Our systematic study compares pre-training objectives, architectures, unlabeled data sets, 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 data set, pre-trained models, and code.

### Details of the downstream task (Summarization) - Dataset 📚

- The summarization data has been taken from [Inshorts News Data](https://www.kaggle.com/shashichander009/inshorts-news-data) from kaggle. Inshorts is a news service that provides short summaries of news from around the web. This dataset contains headlines and summary of news items along with its source.


### Model training

The training script is present [here](https://github.com/lordtt13/transformers-experiments/blob/master/Custom%20Tasks/fine-tune-t5-for-summarization.ipynb).

### Pipelining the Model

```python
import transformers

model = transformers.T5ForConditionalGeneration.from_pretrained('lordtt13/t5-inshorts')

tokenizer = transformers.T5Tokenizer.from_pretrained("lordtt13/t5-inshorts")

nlp_fill = transformers.pipeline('summarization', model = model, tokenizer = tokenizer)
nlp_fill('The CBI on Saturday booked four former officials of Syndicate Bank and six others for cheating, forgery, criminal conspiracy and causing ₹209 crore loss to the state-run bank. The accused had availed home loans and credit from Syndicate Bank on the basis of forged and fabricated documents. These funds were fraudulently transferred to the companies owned by the accused persons.', min_length=5, max_length=40)

# Output:
# [{'summary_text': ': CBI books 4 ex-bank officials for cheating, forgery'}]
```

> Created by [Tanmay Thakur](https://github.com/lordtt13) | [LinkedIn](https://www.linkedin.com/in/tanmay-thakur-6bb5a9154/)

> PS: Still looking for more resources to expand my expansion!