Update README.md
Browse files
README.md
CHANGED
@@ -11,11 +11,11 @@ widget:
|
|
11 |
---
|
12 |
|
13 |
# t5-small-spanish-nahuatl
|
14 |
-
Nahuatl is the most widely spoken indigenous language in Mexico. However, training a neural network for the neural machine translation task is challenging due to the lack of structured data. The most popular datasets, such as the Axolot and bible-corpus, only consist of ~16,000 and ~7,000 samples, respectively. Moreover, there are multiple variants of Nahuatl, which makes this task even more difficult. For example, it is possible to find a single word from the Axolot dataset written in more than three different ways. Therefore, we leverage the T5 text-to-text prefix training strategy in this work to compensate for the lack of data. We first
|
15 |
|
16 |
|
17 |
## Model description
|
18 |
-
This model is a T5 Transformer ([t5-small](https://huggingface.co/t5-small)) fine-tuned on
|
19 |
|
20 |
|
21 |
## Usage
|
@@ -36,7 +36,7 @@ outputs = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]
|
|
36 |
|
37 |
## Approach
|
38 |
### Dataset
|
39 |
-
Since the Axolotl corpus contains
|
40 |
|
41 |
| Axolotl best aligned books |
|
42 |
|:-----------------------------------------------------:|
|
@@ -55,30 +55,31 @@ Since the Axolotl corpus contains misaligments, we just select the best samples
|
|
55 |
| Una tortillita nom谩s - Se taxkaltsin saj |
|
56 |
| Vida econ贸mica de Tenochtitlan |
|
57 |
|
58 |
-
Also,
|
59 |
|
60 |
### Model and training
|
61 |
-
We employ two training stages using a multilingual T5-small.
|
62 |
|
63 |
### Training-stage 1 (learning Spanish)
|
64 |
-
In training stage 1 we first introduce Spanish to the model. The goal is to learn a new language rich in data (Spanish) and not lose the previous knowledge
|
65 |
|
66 |
### Training-stage 2 (learning Nahuatl)
|
67 |
-
We use the pre-trained Spanish-English model to learn Spanish-Nahuatl. Since the amount of Nahuatl pairs is limited, we also add
|
68 |
|
69 |
### Training setup
|
70 |
We train the models on the same datasets for 660k steps using batch size = 16 and a learning rate of 2e-5.
|
71 |
|
72 |
|
73 |
## Evaluation results
|
74 |
-
|
75 |
|
76 |
| English-Spanish pretraining | Validation loss | BLEU | Chrf |
|
77 |
|:----------------------------:|:---------------:|:-----|-------:|
|
78 |
| False | 1.34 | 6.17 | 26.96 |
|
79 |
| True | 1.31 | 6.18 | 28.21 |
|
80 |
|
81 |
-
|
|
|
82 |
|
83 |
## References
|
84 |
- Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2019. Exploring the limits
|
@@ -86,6 +87,10 @@ of transfer learning with a unified Text-to-Text transformer.
|
|
86 |
|
87 |
- Ximena Gutierrez-Vasques, Gerardo Sierra, and Hernandez Isaac. 2016. Axolotl: a web accessible parallel corpus for Spanish-Nahuatl. In International Conference on Language Resources and Evaluation (LREC).
|
88 |
|
|
|
|
|
|
|
|
|
89 |
|
90 |
## Team members
|
91 |
- Emilio Alejandro Morales [(milmor)](https://huggingface.co/milmor)
|
|
|
11 |
---
|
12 |
|
13 |
# t5-small-spanish-nahuatl
|
14 |
+
Nahuatl is the most widely spoken indigenous language in Mexico. However, training a neural network for the neural machine translation task is challenging due to the lack of structured data. The most popular datasets, such as the Axolot and bible-corpus, only consist of ~16,000 and ~7,000 samples, respectively. Moreover, there are multiple variants of Nahuatl, which makes this task even more difficult. For example, it is possible to find a single word from the Axolot dataset written in more than three different ways. Therefore, we leverage the T5 text-to-text prefix training strategy in this work to compensate for the lack of data. We first train the multilingual model to learn Spanish and then adapt the model to Nahuatl. The resulting model successfully translates short sentences from Spanish to Nahuatl. Finally, we report Chrf and BLEU results.
|
15 |
|
16 |
|
17 |
## Model description
|
18 |
+
This model is a T5 Transformer ([t5-small](https://huggingface.co/t5-small)) fine-tuned on Spanish and Nahuatl sentences collected from the web. The dataset is normalized using 'sep' normalization from [py-elotl](https://github.com/ElotlMX/py-elotl).
|
19 |
|
20 |
|
21 |
## Usage
|
|
|
36 |
|
37 |
## Approach
|
38 |
### Dataset
|
39 |
+
Since the Axolotl corpus contains misalignments, we select the best samples (12,207). We also use the [bible-corpus](https://github.com/christos-c/bible-corpus) (7,821).
|
40 |
|
41 |
| Axolotl best aligned books |
|
42 |
|:-----------------------------------------------------:|
|
|
|
55 |
| Una tortillita nom谩s - Se taxkaltsin saj |
|
56 |
| Vida econ贸mica de Tenochtitlan |
|
57 |
|
58 |
+
Also, we collected 3,000 extra samples from the web to increase the data.
|
59 |
|
60 |
### Model and training
|
61 |
+
We employ two training stages using a multilingual T5-small. The advantage of this model is that it can handle different vocabularies and prefixes. T5-small is pre-trained on different tasks and languages (French, Romanian, English, German).
|
62 |
|
63 |
### Training-stage 1 (learning Spanish)
|
64 |
+
In training stage 1, we first introduce Spanish to the model. The goal is to learn a new language rich in data (Spanish) and not lose the previous knowledge. We use the English-Spanish [Anki](https://www.manythings.org/anki/) dataset, which consists of 118.964 text pairs. Next, we train the model till convergence, adding the prefix "Translate Spanish to English: "
|
65 |
|
66 |
### Training-stage 2 (learning Nahuatl)
|
67 |
+
We use the pre-trained Spanish-English model to learn Spanish-Nahuatl. Since the amount of Nahuatl pairs is limited, we also add 20,000 samples from the English-Spanish Anki dataset to our dataset. This two-task training avoids overfitting and makes the model more robust.
|
68 |
|
69 |
### Training setup
|
70 |
We train the models on the same datasets for 660k steps using batch size = 16 and a learning rate of 2e-5.
|
71 |
|
72 |
|
73 |
## Evaluation results
|
74 |
+
We evaluate the model on the same 505 validation Nahuatl sentences for a fair comparison. Finally, we report the results using chrf and sacrebleu hugging face metrics:
|
75 |
|
76 |
| English-Spanish pretraining | Validation loss | BLEU | Chrf |
|
77 |
|:----------------------------:|:---------------:|:-----|-------:|
|
78 |
| False | 1.34 | 6.17 | 26.96 |
|
79 |
| True | 1.31 | 6.18 | 28.21 |
|
80 |
|
81 |
+
|
82 |
+
The English-Spanish pretraining improves BLEU and Chrf and leads to faster convergence. Is it possible to reproduce the evaluation on the [eval.ipynb](https://github.com/milmor/spanish-nahuatl-translation/blob/main/eval.ipynb) notebook.
|
83 |
|
84 |
## References
|
85 |
- Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2019. Exploring the limits
|
|
|
87 |
|
88 |
- Ximena Gutierrez-Vasques, Gerardo Sierra, and Hernandez Isaac. 2016. Axolotl: a web accessible parallel corpus for Spanish-Nahuatl. In International Conference on Language Resources and Evaluation (LREC).
|
89 |
|
90 |
+
- https://github.com/christos-c/bible-corpus
|
91 |
+
|
92 |
+
- https://github.com/ElotlMX/py-elotl
|
93 |
+
|
94 |
|
95 |
## Team members
|
96 |
- Emilio Alejandro Morales [(milmor)](https://huggingface.co/milmor)
|