Update README.md
Browse files
README.md
CHANGED
@@ -1 +1,55 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language: en
|
4 |
+
---
|
5 |
+
|
6 |
+
# LongT5 (transient-global attention, large-sized model)
|
7 |
+
|
8 |
+
LongT5 model pre-trained on English language. The model was introduced in the paper [LongT5: Efficient Text-To-Text Transformer for Long Sequences](https://arxiv.org/pdf/2112.07916.pdf) by Guo et al. and first released in [the LongT5 repository](https://github.com/google-research/longt5). All the model architecture and configuration can be found in [Flaxformer repository](https://github.com/google/flaxformer) which uses another Google research project repository [T5x](https://github.com/google-research/t5x).
|
9 |
+
|
10 |
+
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.
|
11 |
+
|
12 |
+
## Model description
|
13 |
+
LongT5 model is an encoder-decoder transformer pre-trained in a text-to-text denoising generative setting ([Pegasus-like generation pre-training](https://arxiv.org/pdf/1912.08777.pdf)). LongT5 model is an extension of [T5 model](https://arxiv.org/pdf/1910.10683.pdf), and it enables using one of the two different efficient attention mechanisms - (1) Local attention, or (2) Transient-Global attention. The usage of attention sparsity patterns allows the model to efficiently handle input sequence.
|
14 |
+
|
15 |
+
LongT5 is particularly effective when fine-tuned for text generation (summarization, question answering) which requires handling long input sequences (up to 16,384 tokens).
|
16 |
+
|
17 |
+
Results of LongT5 (transient-global attention, large-sized model) fine-tuned on multiple (summarization, QA) tasks.
|
18 |
+
|
19 |
+
| Dataset | Rouge-1 | Rouge-2 | Rouge-Lsum |
|
20 |
+
| --- | --- | --- | --- |
|
21 |
+
| arXiv (16k input) | 48.28 | 21.63 | 44.11 |
|
22 |
+
| PubMed (16k input) | 49.98 | 24.69 | 46.46 |
|
23 |
+
| BigPatent (16k input) | 70.38 | 56.81 | 62.73 |
|
24 |
+
| MultiNews (8k input) | 47.18 | 18.44 | 24.18 |
|
25 |
+
| MediaSum (4k input) | 35.54 | 19.04 | 32.20 |
|
26 |
+
| CNN / DailyMail (4k input) | 42.49 | 20.51 | 40.18 |
|
27 |
+
|
28 |
+
## Intended uses & limitations
|
29 |
+
|
30 |
+
The model is mostly meant to be fine-tuned on a supervised dataset. See the [model hub](https://huggingface.co/models?search=longt5) to look for fine-tuned versions on a task that interests you.
|
31 |
+
|
32 |
+
### How to use
|
33 |
+
|
34 |
+
```python
|
35 |
+
from transformers import AutoTokenizer, BartModel
|
36 |
+
|
37 |
+
tokenizer = AutoTokenizer.from_pretrained("google/longt5-tglobal-large")
|
38 |
+
model = BartModel.from_pretrained("google/longt5-tglobal-large")
|
39 |
+
|
40 |
+
inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
|
41 |
+
outputs = model(**inputs)
|
42 |
+
|
43 |
+
last_hidden_states = outputs.last_hidden_state
|
44 |
+
```
|
45 |
+
|
46 |
+
### BibTeX entry and citation info
|
47 |
+
|
48 |
+
```bibtex
|
49 |
+
@article{guo2021longt5,
|
50 |
+
title={LongT5: Efficient Text-To-Text Transformer for Long Sequences},
|
51 |
+
author={Guo, Mandy and Ainslie, Joshua and Uthus, David and Ontanon, Santiago and Ni, Jianmo and Sung, Yun-Hsuan and Yang, Yinfei},
|
52 |
+
journal={arXiv preprint arXiv:2112.07916},
|
53 |
+
year={2021}
|
54 |
+
}
|
55 |
+
```
|