This repository contains the scripts to train neuronal translation models for OpenNMT and also the Softcatalà published models.
For more information about training see the TRAINING document.
The corpus used to train these models are available here: https://github.com/Softcatala/parallel-catalan-corpus/
And here the tools that at Softcatalà to serve these models in production: https://github.com/Softcatala/nmt-softcatala
| Language pair | SC model BLEU | SC Flores200 BLEU | Google BLEU | Meta NLLB200 BLEU | Opus-MT BLEU | Sentences | Download model |
|---|---|---|---|---|---|---|---|
| German-Catalan | 35.3 | 29.2 | 35.5 | 30.7 | 18.5 | 3137426 | deu-cat-2024-10-02.zip |
| Catalan-German | 29.0 | 25.4 | 32.9 | 29.1 | 15.8 | 3137426 | cat-deu-2024-10-06.zip |
| English-Catalan | 47.9 | 43.9 | 46.0 | 41.7 | 29.8 | 9617177 | eng-cat-2024-09-24.zip |
| Catalan-English | 49.8 | 43.8 | 47.0 | 48.0 | 29.6 | 9617177 | cat-eng-2024-09-29.zip |
| Basque-Catalan | 38.8 | 24.9 | 29.6 | 25.7 | N/A | 9546180 | eus-cat-2024-08-09.zip |
| Catalan-Basque | 27.3 | 17.1 | 18.0 | 10.5 | N/A | 9546180 | cat-eus-2024-08-12.zip |
| French-Catalan | 43.0 | 33.8 | 37.3 | 33.3 | 27.2 | 6392858 | fra-cat-2024-08-29.zip |
| Catalan-French | 43.1 | 37.0 | 41.7 | 39.6 | 27.9 | 6392858 | cat-fra-2024-08-30.zip |
| Galician-Catalan | 66.4 | 32.5 | 36.5 | 33.2 | N/A | 5644577 | glg-cat-2024-09-03.zip |
| Catalan-Galician | 69.4 | 32.2 | 33.1 | 31.7 | N/A | 5644577 | cat-glg-2024-09-04.zip |
| Italian-Catalan | 41.0 | 27.0 | 30.6 | 27.8 | 22.0 | 4146825 | ita-cat-2024-08-29.zip |
| Catalan-Italian | 38.3 | 25.1 | 27.5 | 26.0 | 19.2 | 4146825 | cat-ita-2024-08-30.zip |
| Japanese-Catalan | 25.5 | 17.5 | 23.4 | N/A | N/A | 1996286 | jpn-cat-2024-10-04.zip |
| Catalan-Japanese | 21.8 | 20.6 | 32.5 | N/A | N/A | 3992572 | cat-jpn-2024-10-08.zip |
| Dutch-Catalan | 30.4 | 20.3 | 27.1 | 24.8 | 15.8 | 2208538 | nld-cat-2022-11-19.zip |
| Catalan-Dutch | 27.6 | 18.2 | 23.4 | 21.8 | 13.4 | 2208538 | cat-nld-2022-11-19.zip |
| Occitan-Catalan | 74.9 | 32.5 | N/A | 36.2 | N/A | 2711350 | oci-cat-2022-11-17.zip |
| Catalan-Occitan | 78.8 | 28.9 | N/A | 27.8 | N/A | 2711350 | cat-oci-2022-11-21.zip |
| Portuguese-Catalan | 41.6 | 33.9 | 38.7 | 34.5 | 28.1 | 2043019 | por-cat-2022-11-16.zip |
| Catalan-Portuguese | 39.0 | 32.3 | 40.0 | 36.5 | 27.5 | 2043019 | cat-por-2022-11-18.zip |
| Spanish-Catalan | 88.8 | 22.6 | 23.6 | 25.8 | 22.5 | 7596985 | spa-cat-2022-11-16.zip |
| Catalan-Spanish | 87.5 | 24.2 | 24.2 | 25.5 | 23.2 | 7596985 | cat-spa-2022-11-17.zip |
Legend:
Notes:
Description of the directories on the contained in the models zip file:
You can use the models with https://github.com/OpenNMT/CTranslate2 which offers fast inference.
At Softcatalà we built also command line tools to translate TXT and PO files. See: https://github.com/Softcatala/nmt-softcatala/tree/master/use-models-tools
Download the model and unpack it:
wget https://www.softcatala.org/pub/softcatala/opennmt/models/2022-11-22/eng-cat-2024-09-24.zip
unzip eng-cat-2024-09-24.zip
Install dependencies:
pip3 install ctranslate2 pyonmttok
Simple translation using Python:
import ctranslate2
translator = ctranslate2.Translator("eng-cat/ctranslate2/")
translator.translate_batch([["▁Hello", "▁world", "!"]])
[[{'tokens': ['▁Hola', '▁món', '!']}]]
Simple tokenization & translation using Python:
import pyonmttok
tokenizer=pyonmttok.Tokenizer(mode="none", sp_model_path = "eng-cat/tokenizer/sp_m.model")
tokenized=tokenizer.tokenize("Hello world!")
import ctranslate2
translator = ctranslate2.Translator("eng-cat/ctranslate2/")
translated = translator.translate_batch([tokenized[0]])
print(tokenizer.detokenize(translated[0][0]['tokens']))
Hola món!
In order to train models you should have a GPU.
First you need to install the necessary packages:
make install
After this, you download be all the corpuses:
make get-corpus
To train the English - Catalan model type:
make train-eng-cat
We recommend using Kaggle which provides Jupyter notebooks with GPU access.
We have a Jupyter notebook which allows to trains simple models to learn how to use this toolset.
129 followers · starred Nov 2022
This repository contains the scripts to train neuronal translation models for OpenNMT and also the Softcatalà published models.
For more information about training see the TRAINING document.
The corpus used to train these models are available here: https://github.com/Softcatala/parallel-catalan-corpus/
And here the tools that at Softcatalà to serve these models in production: https://github.com/Softcatala/nmt-softcatala
| Language pair | SC model BLEU | SC Flores200 BLEU | Google BLEU | Meta NLLB200 BLEU | Opus-MT BLEU | Sentences | Download model |
|---|---|---|---|---|---|---|---|
| German-Catalan | 35.3 | 29.2 | 35.5 | 30.7 | 18.5 | 3137426 | deu-cat-2024-10-02.zip |
| Catalan-German | 29.0 | 25.4 | 32.9 | 29.1 | 15.8 | 3137426 | cat-deu-2024-10-06.zip |
| English-Catalan | 47.9 | 43.9 | 46.0 | 41.7 | 29.8 | 9617177 | eng-cat-2024-09-24.zip |
| Catalan-English | 49.8 | 43.8 | 47.0 | 48.0 | 29.6 | 9617177 | cat-eng-2024-09-29.zip |
| Basque-Catalan | 38.8 | 24.9 | 29.6 | 25.7 | N/A | 9546180 | eus-cat-2024-08-09.zip |
| Catalan-Basque | 27.3 | 17.1 | 18.0 | 10.5 | N/A | 9546180 | cat-eus-2024-08-12.zip |
| French-Catalan | 43.0 | 33.8 | 37.3 | 33.3 | 27.2 | 6392858 | fra-cat-2024-08-29.zip |
| Catalan-French | 43.1 | 37.0 | 41.7 | 39.6 | 27.9 | 6392858 | cat-fra-2024-08-30.zip |
| Galician-Catalan | 66.4 | 32.5 | 36.5 | 33.2 | N/A | 5644577 | glg-cat-2024-09-03.zip |
| Catalan-Galician | 69.4 | 32.2 | 33.1 | 31.7 | N/A | 5644577 | cat-glg-2024-09-04.zip |
| Italian-Catalan | 41.0 | 27.0 | 30.6 | 27.8 | 22.0 | 4146825 | ita-cat-2024-08-29.zip |
| Catalan-Italian | 38.3 | 25.1 | 27.5 | 26.0 | 19.2 | 4146825 | cat-ita-2024-08-30.zip |
| Japanese-Catalan | 25.5 | 17.5 | 23.4 | N/A | N/A | 1996286 | jpn-cat-2024-10-04.zip |
| Catalan-Japanese | 21.8 | 20.6 | 32.5 | N/A | N/A | 3992572 | cat-jpn-2024-10-08.zip |
| Dutch-Catalan | 30.4 | 20.3 | 27.1 | 24.8 | 15.8 | 2208538 | nld-cat-2022-11-19.zip |
| Catalan-Dutch | 27.6 | 18.2 | 23.4 | 21.8 | 13.4 | 2208538 | cat-nld-2022-11-19.zip |
| Occitan-Catalan | 74.9 | 32.5 | N/A | 36.2 | N/A | 2711350 | oci-cat-2022-11-17.zip |
| Catalan-Occitan | 78.8 | 28.9 | N/A | 27.8 | N/A | 2711350 | cat-oci-2022-11-21.zip |
| Portuguese-Catalan | 41.6 | 33.9 | 38.7 | 34.5 | 28.1 | 2043019 | por-cat-2022-11-16.zip |
| Catalan-Portuguese | 39.0 | 32.3 | 40.0 | 36.5 | 27.5 | 2043019 | cat-por-2022-11-18.zip |
| Spanish-Catalan | 88.8 | 22.6 | 23.6 | 25.8 | 22.5 | 7596985 | spa-cat-2022-11-16.zip |
| Catalan-Spanish | 87.5 | 24.2 | 24.2 | 25.5 | 23.2 | 7596985 | cat-spa-2022-11-17.zip |
Legend:
Notes:
Description of the directories on the contained in the models zip file:
You can use the models with https://github.com/OpenNMT/CTranslate2 which offers fast inference.
At Softcatalà we built also command line tools to translate TXT and PO files. See: https://github.com/Softcatala/nmt-softcatala/tree/master/use-models-tools
Download the model and unpack it:
wget https://www.softcatala.org/pub/softcatala/opennmt/models/2022-11-22/eng-cat-2024-09-24.zip
unzip eng-cat-2024-09-24.zip
Install dependencies:
pip3 install ctranslate2 pyonmttok
Simple translation using Python:
import ctranslate2
translator = ctranslate2.Translator("eng-cat/ctranslate2/")
translator.translate_batch([["▁Hello", "▁world", "!"]])
[[{'tokens': ['▁Hola', '▁món', '!']}]]
Simple tokenization & translation using Python:
import pyonmttok
tokenizer=pyonmttok.Tokenizer(mode="none", sp_model_path = "eng-cat/tokenizer/sp_m.model")
tokenized=tokenizer.tokenize("Hello world!")
import ctranslate2
translator = ctranslate2.Translator("eng-cat/ctranslate2/")
translated = translator.translate_batch([tokenized[0]])
print(tokenizer.detokenize(translated[0][0]['tokens']))
Hola món!
In order to train models you should have a GPU.
First you need to install the necessary packages:
make install
After this, you download be all the corpuses:
make get-corpus
To train the English - Catalan model type:
make train-eng-cat
We recommend using Kaggle which provides Jupyter notebooks with GPU access.
We have a Jupyter notebook which allows to trains simple models to learn how to use this toolset.
129 followers · starred Nov 2022