File size: 2,062 Bytes
cc20d6a
 
31daa56
 
 
cc20d6a
31daa56
 
 
ef5c442
72c9d8f
235bc01
 
72c9d8f
 
 
 
 
 
068670d
 
72c9d8f
 
 
 
 
 
 
 
31daa56
 
 
72c9d8f
31daa56
72c9d8f
 
a711312
72c9d8f
 
 
 
 
 
ba4f742
72c9d8f
31daa56
0e6ce71
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---

license: apache-2.0
language: Spanish Nahuatl 
tags:
- translation Spanish Nahuatl 
---


# t5-small-spanish-nahuatl
## Model description
This model is a T5 Transformer ([t5-small](https://huggingface.co/t5-small)) fine-tuned on 29,007 spanish and nahuatl sentences using 12,890 samples collected from the web and 16,117 samples from the Axolotl dataset.

The dataset is normalized using 'sep' normalization from [py-elotl](https://github.com/ElotlMX/py-elotl).


## Usage
```python

from transformers import AutoModelForSeq2SeqLM

from transformers import AutoTokenizer



model = AutoModelForSeq2SeqLM.from_pretrained('hackathon-pln-es/t5-small-spanish-nahuatl')

tokenizer = AutoTokenizer.from_pretrained('hackathon-pln-es/t5-small-spanish-nahuatl')



model.eval()

sentence = 'muchas flores son blancas'

input_ids = tokenizer('translate Spanish to Nahuatl: ' + sentence, return_tensors='pt').input_ids

outputs = model.generate(input_ids)

# outputs = miak xochitl istak

outputs = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0]

```


## Evaluation results
The model is evaluated on 400 validation sentences. 
- Validation loss: 1.56 
- BLEU: 0.13

_Note: Since the Axolotl corpus contains multiple misalignments, the real BLEU and Validation loss are slightly better. These misalignments also introduce noise into the training._


## References
- Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2019. Exploring the limits
of transfer learning with a unified Text-to-Text transformer.

- 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).


## Team members
- Emilio Morales [(milmor)](https://huggingface.co/milmor)
- Rodrigo Martínez Arzate 
- Luis Armando Mercado [(luisarmando)](https://huggingface.co/luisar)
- Jacobo del Valle [(jjdv)](https://huggingface.co/jjdv)