File size: 4,101 Bytes
3978465
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aaf356b
3978465
aaf356b
3978465
 
 
 
aaf356b
3978465
 
 
 
fa41308
3978465
aaf356b
3978465
 
 
aaf356b
 
 
 
3978465
 
 
aaf356b
 
fa41308
3978465
 
 
 
 
 
aaf356b
3978465
aaf356b
3978465
 
 
fa41308
3978465
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
license: mit
language:
- gl
metrics:
- bleu (Gold1): 82.6
- bleu (Gold2): 49.9
- bleu (Flores): 23.8 
- bleu (Test-suite): 77.2 
---

---
License: MIT
---

**Model description** 

Model developed with OpenNMT for the Galician-Spanish pair using the transformer architecture.

**How to translate**

+ Open bash terminal
+ Install [Python 3.9](https://www.python.org/downloads/release/python-390/) 
+ Install [Open NMT toolkit v.2.2](https://github.com/OpenNMT/OpenNMT-py)
+ Translate an input_text using the NOS-MT-gl-es model with the following command:

```bash 
onmt_translate -src input_text聽-model NOS-MT-gl-es -output ./output_file.txt -replace_unk -phrase_table phrase_table-gl-es.txt -gpu 0
```
+ The resulting translation will be in the PATH indicated by the -output flag.

**Training**

To train this model, we have used authentic and synthetic corpora from [ProxectoN贸s](https://github.com/proxectonos/corpora).

Authentic corpora are corpora produced by human translators. Synthetic corpora are Spanish-Portuguese translations, which have been converted to Spanish-Galician by means of Portuguese-Galician translation with Opentrad/Apertium and transliteration for out-of-vocabulary words. 


**Training process**

+ Tokenisation was performed with a modified version of the [linguakit](https://github.com/citiususc/Linguakit) tokeniser (tokenizer.pl) that does not append a new line after each token.
+ All BPE models were generated with the script [learn_bpe.py](https://github.com/OpenNMT/OpenNMT-py/blob/master/tools/learn_bpe.py)
+ Using the .yaml in this repository, it is possible to replicate the original training process. Before training the model, please verify that the path to each target (tgt) and (src) file is correct. Once this is done, proceed as follows:

```bash 
onmt_build_vocab -config  bpe-gl-es_emb.yaml -n_sample 100000
onmt_train -config bpe-gl-es_emb.yaml
```

**Hyperparameters** 

You may find the parameters used for this model inside the file  bpe-gl-es_emb.yaml 

**Evaluation** 

The BLEU evaluation of the models is a mixture of internally developed tests (gold1, gold2, test-suite) and other datasets available in Galician (Flores).

| GOLD 1        | GOLD 2        | FLORES  | TEST-SUITE|
| ------------- |:-------------:| -------:|----------:| 
| 82.6          | 49.9          | 23.8    | 77.2      |


**Licensing information** 

MIT License

Copyright (c) 2023 Proxecto N贸s

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

**Funding** 

This research was funded by the project "N贸s: Galician in the society and economy of artificial intelligence", agreement between Xunta de Galicia and University of Santiago de Compostela, and grant ED431G2019/04 by the Galician Ministry of Education, University and Professional Training, and the European Regional Development Fund (ERDF/FEDER program), and Groups of Reference: ED431C 2020/21.
 
**Citation Information**

Gamallo, Pablo; Bardanca, Daniel; Pichel, Jos茅 Ramom; Garc铆a, Marcos; Rodr铆guez-Rey, Sandra; de-Dios-Flores, Iria. 2023. NOS-MT-OpenNMT-gl-es. Url: https://huggingface.co/proxectonos/NOS-MT-OpenNMT-gl-es