Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,140 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- es
|
5 |
+
- eu
|
6 |
+
metrics:
|
7 |
+
- BLEU
|
8 |
+
- TER
|
9 |
+
---
|
10 |
+
## Hitz Center’s Spanish-Basque machine translation model
|
11 |
+
|
12 |
+
## Model description
|
13 |
+
|
14 |
+
This model was trained from scratch using [Marian NMT](https://marian-nmt.github.io/) on a combination of Spanish-Basque datasets totalling 35,619,691 sentence pairs. 12,091,549 sentence pairs were parallel data collected from the web while the remaining 23,528,142 sentence pairs were parallel synthetic data created backtranslating [EusCrawl](https://www.ixa.eus/euscrawl/) Basque monolingual dataset. The model was evaluated on the Flores, TaCon and NTREX evaluation datasets.
|
15 |
+
|
16 |
+
- **Developed by:** HiTZ Research Center & IXA Research group (University of the Basque Country UPV/EHU)
|
17 |
+
- **Model type:** traslation
|
18 |
+
- **Source Language:** Spanish
|
19 |
+
- **Target Language:** Basque
|
20 |
+
- **License:** apache-2.0
|
21 |
+
|
22 |
+
## Intended uses and limitations
|
23 |
+
|
24 |
+
You can use this model for machine translation from Spanish to Basque.
|
25 |
+
|
26 |
+
At the time of submission, no measures have been taken to estimate the bias and toxicity embedded in the model. However, we are aware that our models may be biased since the corpora have been collected using crawling techniques on multiple web sources.
|
27 |
+
|
28 |
+
## How to Get Started with the Model
|
29 |
+
|
30 |
+
Use the code below to get started with the model.
|
31 |
+
|
32 |
+
```
|
33 |
+
from transformers import MarianMTModel, MarianTokenizer
|
34 |
+
from transformers import AutoTokenizer
|
35 |
+
from transformers import AutoModelForSeq2SeqLM
|
36 |
+
|
37 |
+
src_text = ["Esto es una prueba."]
|
38 |
+
|
39 |
+
model_name = "HiTZ/mt-hitz-es-eu"
|
40 |
+
tokenizer = MarianTokenizer.from_pretrained(model_name)
|
41 |
+
|
42 |
+
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
43 |
+
translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=T
|
44 |
+
rue))
|
45 |
+
print([tokenizer.decode(t, skip_special_tokens=True) for t in translated])`
|
46 |
+
```
|
47 |
+
The recommended environments include the following transfomer versions: 4.12.3 , 4.15.0 , 4.26.1
|
48 |
+
|
49 |
+
## Training Details
|
50 |
+
|
51 |
+
### Training Data
|
52 |
+
|
53 |
+
The Spanish-Basque data collected from the web was a combination of the following datasets:
|
54 |
+
|
55 |
+
| Dataset | Sentences before cleaning |
|
56 |
+
|------------------------|--------------------------:|
|
57 |
+
| CCMatrix | 6,564,108 |
|
58 |
+
| MultiParaCrawl | 3,344,373 |
|
59 |
+
| Paracrawl | 2,410,895 |
|
60 |
+
| TranslationMemories_EJ | 1,127,141 |
|
61 |
+
| OpenData2017 (IWSLT18) | 926,941 |
|
62 |
+
| OpenSubtitles | 793,593 |
|
63 |
+
| TranslationMemories_GD | 788,776 |
|
64 |
+
| EhuHac | 609,912 |
|
65 |
+
| OPUS-Elhuyar | 642,347 |
|
66 |
+
| EiTB-ParCC | 637,182 |
|
67 |
+
| WikiMatrix | 154,281 |
|
68 |
+
| **Total** | ** 12,091,549 ** |
|
69 |
+
|
70 |
+
The 23,528,142 sentence pairs of synthetic parallel data were created by backtranslating the EusCrawl Basque monolingual dataset using a previous version (without synthetic parallel data) of the [EU-ES translator from the HiTZ center](https://huggingface.co/HiTZ/mt-hitz-eu-es).
|
71 |
+
|
72 |
+
|
73 |
+
### Training Procedure
|
74 |
+
|
75 |
+
#### Preprocessing
|
76 |
+
|
77 |
+
After concatenation, all datasets are cleaned and deduplicated using [bifixer](https://github.com/bitextor/bifixer) and [biclener](https://github.com/bitextor/bicleaner) tools [(Ramírez-Sánchez et al., 2020)](https://aclanthology.org/2020.eamt-1.31/). Any sentence pairs with a classification score of less than 0.5 is removed. The filtered corpus is composed of 30,776,776 parallel sentences.
|
78 |
+
|
79 |
+
#### Tokenization
|
80 |
+
All data is tokenized using sentencepiece, with a 32,000 token sentencepiece model learned from the combination of all filtered training data. This model is included.
|
81 |
+
|
82 |
+
## Evaluation
|
83 |
+
### Variable and metrics
|
84 |
+
We use the BLEU and TER scores for evaluation on test sets: [Flores-200](https://github.com/facebookresearch/flores/tree/main/flores200), [TaCon](https://elrc-share.eu/repository/browse/tacon-spanish-constitution-mt-test-set/84a96138b98611ec9c1a00155d02670628f3e6857b0f422abd82abc3795ec8c2/) and [NTREX](https://github.com/MicrosoftTranslator/NTREX)
|
85 |
+
|
86 |
+
### Evaluation results
|
87 |
+
Below are the evaluation results on the machine translation from Spanish to Basque compared to [Google Translate](https://translate.google.com/) and [NLLB 200 3.3B](https://huggingface.co/facebook/nllb-200-3.3B):
|
88 |
+
|
89 |
+
####BLEU scores
|
90 |
+
|
91 |
+
|
92 |
+
| Test set |Google Translate | NLLB 3.3 |mt-hitz-es-eu|
|
93 |
+
|----------------------|-----------------|-----------|-------------|
|
94 |
+
| Flores 200 devtest | 13.7 | 11.7 | **13.8** |
|
95 |
+
| TaCON | **14.2** | 11.3 | 13.7 |
|
96 |
+
| NTREX | 13.9 | 11.3 | **14.3** |
|
97 |
+
| Average | 13.9 | 11.4 | **14.1** |
|
98 |
+
|
99 |
+
####TER scores
|
100 |
+
|
101 |
+
| Test set |Google Translate | NLLB 3.3 |mt-hitz-es-eu|
|
102 |
+
|----------------------|-----------------|----------|-------------|
|
103 |
+
| Flores 200 devtest |**70.4** | 74.2 | 71.1 |
|
104 |
+
| TaCON |**63.3** | 72.0 | 66.7 |
|
105 |
+
| NTREX |**69.5** | 74.3 | 69.7 |
|
106 |
+
| Average |**67.7** | 73.5 | 69.2 |
|
107 |
+
|
108 |
+
|
109 |
+
<!-- Momentuz ez dugu artikulurik. ILENIAn zerbait egiten bada eguneratu beharko da -->
|
110 |
+
|
111 |
+
<!--
|
112 |
+
## Citation [optional]
|
113 |
+
|
114 |
+
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. - ->
|
115 |
+
|
116 |
+
**BibTeX:**
|
117 |
+
|
118 |
+
[More Information Needed]
|
119 |
+
|
120 |
+
**APA:**
|
121 |
+
|
122 |
+
[More Information Needed]
|
123 |
+
-->
|
124 |
+
|
125 |
+
## Additional information
|
126 |
+
### Author
|
127 |
+
HiTZ Research Center & IXA Research group (University of the Basque Country UPV/EHU)
|
128 |
+
### Contact information
|
129 |
+
For further information, send an email to <hitz@ehu.eus>
|
130 |
+
### Licensing information
|
131 |
+
This work is licensed under a [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
132 |
+
### Funding
|
133 |
+
This work is funded by the Ministerio para la Transformación Digital y de la Función Pública - Funded by EU – NextGenerationEU within the framework of the [project ILENIA](https://proyectoilenia.es/) with reference 2022/TL22/00215337, 2022/TL22/00215336, 2022/TL22/00215335 y 2022/TL22/00215334
|
134 |
+
### Disclaimer
|
135 |
+
<details>
|
136 |
+
<summary>Click to expand</summary>
|
137 |
+
The models published in this repository are intended for a generalist purpose and are available to third parties. These models may have bias and/or any other undesirable distortions.
|
138 |
+
When third parties, deploy or provide systems and/or services to other parties using any of these models (or using systems based on these models) or become users of the models, they should note that it is their responsibility to mitigate the risks arising from their use and, in any event, to comply with applicable regulations, including regulations regarding the use of Artificial Intelligence.
|
139 |
+
In no event shall the owner and creator of the models (HiTZ Research Center) be liable for any results arising from the use made by third parties of these models.
|
140 |
+
</details>
|