Update README
Browse files
README.md
CHANGED
@@ -1,3 +1,62 @@
|
|
1 |
---
|
2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- large_spanish_corpus
|
5 |
+
- oscar-corpus/OSCAR-2109
|
6 |
+
- bertin-project/mc4-es-sampled
|
7 |
+
language:
|
8 |
+
- es
|
9 |
+
tags:
|
10 |
+
- text-generation-inference
|
11 |
---
|
12 |
+
|
13 |
+
# T5S (base-sized model)
|
14 |
+
|
15 |
+
T5S model pre-trained on Spanish language. It was introduced in the paper [Sequence-to-Sequence Spanish Pre-trained Language Models](https://arxiv.org/abs/2309.11259).
|
16 |
+
|
17 |
+
## Model description
|
18 |
+
|
19 |
+
T5S is a T5 Version 1.1 model (transformer encoder-decoder) with a bidirectional (BERT-like) encoder and an autoregressive (GPT-like) decoder, which includes the following improvements compared to the original T5 model:
|
20 |
+
|
21 |
+
- GEGLU activation in feed-forward hidden layer, rather than ReLU.
|
22 |
+
|
23 |
+
- Dropout was turned off in pre-training (quality win). Dropout should be re-enabled during fine-tuning.
|
24 |
+
|
25 |
+
- Pre-trained only on unlabeled corpus without mixing in the downstream tasks.
|
26 |
+
|
27 |
+
- no parameter sharing between embedding and classifier layer
|
28 |
+
|
29 |
+
T5S is particularly effective when fine-tuned for text generation (e.g. summarization, translation) or comprehension tasks (e.g. text classification, question answering) using text-to-text format.
|
30 |
+
|
31 |
+
### How to use
|
32 |
+
|
33 |
+
Here is how to use this model in PyTorch:
|
34 |
+
|
35 |
+
```python
|
36 |
+
from transformers import T5Tokenizer, T5Model
|
37 |
+
|
38 |
+
tokenizer = T5Tokenizer.from_pretrained("vgaraujov/t5-base-spanish")
|
39 |
+
model = T5Model.from_pretrained("vgaraujov/t5-base-spanish")
|
40 |
+
|
41 |
+
input_ids = tokenizer(
|
42 |
+
"Estudios han demostrado que tener un perro es bueno para la salud", return_tensors="pt"
|
43 |
+
).input_ids # Batch size 1
|
44 |
+
decoder_input_ids = tokenizer("Estudios demuestran que", return_tensors="pt").input_ids # Batch size 1
|
45 |
+
|
46 |
+
# forward pass
|
47 |
+
outputs = model(input_ids=input_ids, decoder_input_ids=decoder_input_ids)
|
48 |
+
last_hidden_states = outputs.last_hidden_state
|
49 |
+
```
|
50 |
+
|
51 |
+
### Citation (BibTeX)
|
52 |
+
|
53 |
+
```bibtex
|
54 |
+
@misc{araujo2023sequencetosequence,
|
55 |
+
title={Sequence-to-Sequence Spanish Pre-trained Language Models},
|
56 |
+
author={Vladimir Araujo and Maria Mihaela Trusca and Rodrigo Tufiño and Marie-Francine Moens},
|
57 |
+
year={2023},
|
58 |
+
eprint={2309.11259},
|
59 |
+
archivePrefix={arXiv},
|
60 |
+
primaryClass={cs.CL}
|
61 |
+
}
|
62 |
+
```
|