Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,90 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- pt
|
| 5 |
+
- gl
|
| 6 |
+
metrics:
|
| 7 |
+
- bleu (floresdev): 25.6
|
| 8 |
+
- bleu (floredevtest): 25.4
|
| 9 |
+
- bleu (ntrex): 25.1
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
**Descrición do Modelo**
|
| 13 |
+
|
| 14 |
+
Modelo feito con OpenNMT-py 3.2 para o par português-galego utilizando unha arquitectura transformer. O modelo foi transformado para o formato da ctranslate2.
|
| 15 |
+
|
| 16 |
+
**Como traducir con este Modelo**
|
| 17 |
+
|
| 18 |
+
+ Instalar o [Python 3.9](https://www.python.org/downloads/release/python-390/)
|
| 19 |
+
+ Traducir un input_text utilizando o modelo nos-coda_iacobus-pt-gl cos seguintes comandos:
|
| 20 |
+
```bash
|
| 21 |
+
perl tokenizer.perl < input.txt > input.tok
|
| 22 |
+
```
|
| 23 |
+
```bash
|
| 24 |
+
subword_nmt.apply_bpe -c ./bpe/es.bpe < input.tok > input.bpe
|
| 25 |
+
```
|
| 26 |
+
```bash
|
| 27 |
+
python3 translate.py ./ct2-es-gl_12L input.bpe > output.txt
|
| 28 |
+
```
|
| 29 |
+
```bash
|
| 30 |
+
sed -i 's/@@ //g' output.txt
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
**Adestramento**
|
| 34 |
+
|
| 35 |
+
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.
|
| 36 |
+
|
| 37 |
+
**Procedemento de adestramento**
|
| 38 |
+
|
| 39 |
+
+ 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.
|
| 40 |
+
|
| 41 |
+
+ 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
|
| 42 |
+
|
| 43 |
+
+ Utilizando o .yaml deste repositorio pode replicar o proceso de adestramento. É preciso modificar os paths do ficheiro .yaml para a Open NMT saber onde ir buscar os textos. Após facer isto, pode do seguinte xeito comezar o proceso:
|
| 44 |
+
|
| 45 |
+
```bash
|
| 46 |
+
onmt_build_vocab -config pt-gl.yaml -n_sample 35000
|
| 47 |
+
onmt_train -config pt-gl.yaml
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
**Hiperparámetros**
|
| 51 |
+
|
| 52 |
+
Os parámetros usados para o desenvolvemento do modelo poden ser consultados directamente no mesmo ficheiro .yaml pt-gl.yaml
|
| 53 |
+
|
| 54 |
+
**Avaliación**
|
| 55 |
+
|
| 56 |
+
A avaliación BLEU dos modelos é feita sobre os testes máis utilizados (Flores_dev, Flores_devtest, Ntrex).
|
| 57 |
+
|
| 58 |
+
| FLORES_DEV| FLORES_DEVTEST | NTREX |
|
| 59 |
+
| --------- |:---------- :| -------:|
|
| 60 |
+
| 25.6 | 25.4 | 25.1 |
|
| 61 |
+
|
| 62 |
+
**Licenzas do Modelo**
|
| 63 |
+
|
| 64 |
+
MIT License
|
| 65 |
+
|
| 66 |
+
Copyright (c) 2023 Proxecto Nós
|
| 67 |
+
|
| 68 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 69 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 70 |
+
in the Software without restriction, including without limitation the rights
|
| 71 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 72 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 73 |
+
furnished to do so, subject to the following conditions:
|
| 74 |
+
|
| 75 |
+
The above copyright notice and this permission notice shall be included in all
|
| 76 |
+
copies or substantial portions of the Software.
|
| 77 |
+
|
| 78 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 79 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 80 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 81 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 82 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 83 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 84 |
+
SOFTWARE.
|
| 85 |
+
|
| 86 |
+
**Financiamento**
|
| 87 |
+
|
| 88 |
+
This model was developed within the Nós Project, 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/00215336.
|
| 89 |
+
|
| 90 |
+
|