imdbo commited on
Commit
96dcb13
·
1 Parent(s): dffbf15

upload ct2 model

Browse files
README.md CHANGED
@@ -1,3 +1,95 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - gl
5
+ - es
6
+ - en
7
+ - eu
8
+ - ca
9
+ metrics:
10
+ - bleu average (Flores): 25.1
11
+ ---
12
+
13
+ **English text [here](https://huggingface.co/proxectonos/NOS-MT-OpenNMT-gl-es/blob/main/README_English.md)**
14
+
15
+ **Descrición do Modelo**
16
+
17
+ Modelo feito con OpenNMT-py 3.2 para as línguas do Reino de España e inglés utilizando unha arquitectura transformer. O modelo foi transformado para o formato da ctranslate2.
18
+
19
+ **Como usar este Modelo**
20
+
21
+ + Instalar o [Python 3.9](https://www.python.org/downloads/release/python-390/)
22
+ + Instalar o [ctranslate 3.2](https://github.com/OpenNMT/CTranslate2)
23
+ + Instalar o subword_nmt:
24
+ ```bash
25
+ pip install subword-nmt
26
+ ```
27
+ + Traducir un input.txt utilizando o modelo cos seguintes comandos:
28
+ ```bash
29
+ perl tokenizer.perl < input.txt > input.tok
30
+ ```
31
+ ```bash
32
+ subword_nmt.apply_bpe -c ./bpe/es.bpe < input.tok > input.bpe
33
+ ```
34
+ ```bash
35
+ python3 translate.py ./ct2-multi input.bpe > output.txt
36
+ ```
37
+ ```bash
38
+ ': sed -i 's/@@ //g' output.txt
39
+ ```
40
+
41
+ **Adestramento**
42
+
43
+ No adestramento, utilizamos córpora auténticos e sintéticos do [ProxectoNós](https://github.com/proxectonos/corpora). Os primeiros son córpora de traducións feitas directamente por tradutores humanos. É importante salientar que a pesar destes textos seren feitos por humanos, non están libres de erros lingüísticos. Os segundos son córpora de traducións español-portugués, que convertemos en español-galego a través da tradución automática portugués-galego con Opentrad/Apertium e transliteración para palabras fóra de vocabulario.
44
+
45
+ **Procedemento de adestramento**
46
+
47
+ + Tokenización dos datasets feita co tokenizador (tokenizer.pl) de [linguakit](https://github.com/citiususc/Linguakit) que foi modificado para evitar o salto de liña por token do ficheiro orixinal.
48
+
49
+ + O vocabulario BPE para os modelos foi xerado a través do script [learn_bpe.py](https://github.com/OpenNMT/OpenNMT-py/blob/master/tools/learn_bpe.py) da OpenNMT
50
+
51
+
52
+ **Avaliación**
53
+
54
+ A avaliación BLEU dos modelos é feita cunha mistura de tests desenvolvidos internamente (gold1, gold2, test-suite) con outros datasets disponíbeis en galego (Flores).
55
+
56
+ | ca-en | ca-es | ca-eu | ca-gl | en-ca | en-es | en-eu | en-gl | es-ca | es-en | es-eu | eu-es | es-gl | eu-ca | eu-en | eu-gl | gl-ca | gl-en | gl-es | gl-eu | AVERAGE |
57
+ |----------|----------|----------|----------|----------|----------|----------|----------|----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
58
+ | 39.6 | 23.6 | 16.3 | 30.9 | 39.8 | 24.5 | 18.6 | 31.9 | 22.9 | 24.6 | 13.0 | 17.8 | 22.0 | 23.0 | 26.1 | 21.5 | 30.9 | 34.9 | 23.7 | 16.4 | 25.1 |
59
+ **Licenzas do Modelo**
60
+
61
+ MIT License
62
+
63
+ Copyright (c) 2023 Proxecto Nós
64
+
65
+ Permission is hereby granted, free of charge, to any person obtaining a copy
66
+ of this software and associated documentation files (the "Software"), to deal
67
+ in the Software without restriction, including without limitation the rights
68
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
69
+ copies of the Software, and to permit persons to whom the Software is
70
+ furnished to do so, subject to the following conditions:
71
+
72
+ The above copyright notice and this permission notice shall be included in all
73
+ copies or substantial portions of the Software.
74
+
75
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
76
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
77
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
78
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
79
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
80
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
81
+ SOFTWARE.
82
+
83
+ **Financiamento**
84
+
85
+ Esta investigación foi financiada polo proxecto "Nós: o galego na sociedade e economía da intelixencia artificial", resultado dun acordo entre a Xunta de Galicia e a Universidade de Santiago de Compostela, o que resultou no subsidio ED431G2019/04 da Consellaría de Educación, Universidade e Formación Profesional da Galiza, e polo Fondo Europeo de Desenvolvemento Rexional (programa ERDF/FEDER), e Grupos de Referencia: ED431C 2020/21.
86
+
87
+ **Citar este traballo**
88
+
89
+ Se utilizar este modelo no seu traballo, cite por favor así:
90
+
91
+ Daniel Bardanca Outeirinho, Pablo Gamallo Otero, Iria de-Dios-Flores, and José Ramom Pichel Campos. 2024.
92
+ Exploring the effects of vocabulary size in neural machine translation: Galician as a target language.
93
+ In Proceedings of the 16th International Conference on Computational Processing of Portuguese, pages 600–604,
94
+ Santiago de Compostela, Galiza. Association for Computational Lingustics.
95
+
README_English.md ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ language:
4
+ - gl
5
+ - es
6
+ - en
7
+ - eu
8
+ - ca
9
+ metrics:
10
+ - bleu average (Flores): 25.1
11
+ ---
12
+
13
+ **English text [here](https://huggingface.co/proxectonos/NOS-MT-OpenNMT-gl-es/blob/main/README_English.md)**
14
+
15
+ **Model Description**
16
+
17
+ Model created with OpenNMT-py 3.2 for the languages of the Kingdom of Spain and English using a transformer architecture. The model was converted to the ctranslate2 format.
18
+
19
+ **How to Use This Model**
20
+
21
+ + Install [Python 3.9](https://www.python.org/downloads/release/python-390/)
22
+ + Install [ctranslate 3.2](https://github.com/OpenNMT/CTranslate2)
23
+ + Install subword_nmt:
24
+ ```bash
25
+ pip install subword-nmt
26
+ ```
27
+ + Translate an input.txt using the model with the following commands:
28
+ ```bash
29
+ perl tokenizer.perl < input.txt > input.tok
30
+ ```
31
+ ```bash
32
+ subword_nmt.apply_bpe -c ./bpe/es.bpe < input.tok > input.bpe
33
+ ```
34
+ ```bash
35
+ python3 translate.py ./ct2-multi input.bpe > output.txt
36
+ ```
37
+ ```bash
38
+ ': sed -i 's/@@ //g' output.txt
39
+ ```
40
+
41
+ **Training**
42
+
43
+ In the training, we used authentic and synthetic corpora from the [ProxectoNós](https://github.com/proxectonos/corpora). The former are corpora of translations made directly by human translators. It is important to note that despite these texts being made by humans, they are not free from linguistic errors. The latter are corpora of Spanish-Portuguese translations, which we converted into Spanish-Galician through Portuguese-Galician automatic translation with Opentrad/Apertium and transliteration for out-of-vocabulary words.
44
+
45
+ **Training Procedure**
46
+
47
+ + Tokenization of the datasets was done with the tokenizer (tokenizer.pl) from [linguakit](https://github.com/citiususc/Linguakit) which was modified to avoid line breaks per token from the original file.
48
+
49
+ + The BPE vocabulary for the models was generated through the [learn_bpe.py](https://github.com/OpenNMT/OpenNMT-py/blob/master/tools/learn_bpe.py) script from OpenNMT.
50
+
51
+
52
+ **Evaluation**
53
+
54
+ The BLEU evaluation of the models is done with a mix of internally developed tests (gold1, gold2, test-suite) and other available datasets in Galician (Flores).
55
+
56
+ | ca-en | ca-es | ca-eu | ca-gl | en-ca | en-es | en-eu | en-gl | es-ca | es-en | es-eu | eu-es | es-gl | eu-ca | eu-en | eu-gl | gl-ca | gl-en | gl-es | gl-eu | AVERAGE |
57
+ |----------|----------|----------|----------|----------|----------|----------|----------|----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|-----------|
58
+ | 39.6 | 23.6 | 16.3 | 30.9 | 39.8 | 24.5 | 18.6 | 31.9 | 22.9 | 24.6 | 13.0 | 17.8 | 22.0 | 23.0 | 26.1 | 21.5 | 30.9 | 34.9 | 23.7 | 16.4 | 25.1 |
59
+ **Model Licenses**
60
+
61
+ MIT License
62
+
63
+ Copyright (c) 2023 Proxecto Nós
64
+
65
+ Permission is hereby granted, free of charge, to any person obtaining a copy
66
+ of this software and associated documentation files (the "Software"), to deal
67
+ in the Software without restriction, including without limitation the rights
68
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
69
+ copies of the Software, and to permit persons to whom the Software is
70
+ furnished to do so, subject to the following conditions:
71
+
72
+ The above copyright notice and this permission notice shall be included in all
73
+ copies or substantial portions of the Software.
74
+
75
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
76
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
77
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
78
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
79
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
80
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
81
+ SOFTWARE.
82
+
83
+ **Funding**
84
+
85
+ This research was funded by the project "Nós: Galician in the society and economy of artificial intelligence", resulting from an agreement between the Xunta de Galicia and the University of Santiago de Compostela, which resulted in the ED431G2019/04 grant from the Consellería de Educación, Universidade e Formación Profesional da Galiza, and by the European Regional Development Fund (ERDF/FEDER program), and Reference Groups: ED431C 2020/21.
86
+
87
+ **Cite This Work**
88
+
89
+ If you use this model in your work, please cite it as follows:
90
+
91
+ Daniel Bardanca Outeirinho, Pablo Gamallo Otero, Iria de-Dios-Flores, and José Ramom Pichel Campos. 2024.
92
+ Exploring the effects of vocabulary size in neural machine translation: Galician as a target language.
93
+ In Proceedings of the 16th International Conference on Computational Processing of Portuguese, pages 600–604,
94
+ Santiago de Compostela, Galiza. Association for Computational Linguistics.
bpe/mnmt_25.bpe ADDED
The diff for this file is too large to render. See raw diff
 
ct2-multi/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_source_bos": false,
3
+ "add_source_eos": false,
4
+ "bos_token": "<s>",
5
+ "decoder_start_token": "<s>",
6
+ "eos_token": "</s>",
7
+ "layer_norm_epsilon": null,
8
+ "multi_query_attention": false,
9
+ "unk_token": "<unk>"
10
+ }
ct2-multi/model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5637a1be4a22a0ef6934336d893ab7e9432e0fb2263f4b1f98de8f0164efa312
3
+ size 471529833
ct2-multi/source_vocabulary.json ADDED
The diff for this file is too large to render. See raw diff
 
ct2-multi/target_vocabulary.json ADDED
The diff for this file is too large to render. See raw diff