Nós MT — galego → inglés
Modelo de tradución Transformer convertido de OpenNMT-py a CTranslate2. Esta versión utiliza o checkpoint e os ficheiros CT2 indicados a continuación.
- Checkpoint:
gl-en20k_08_05_26_step_150000.pt - Format: CTranslate2 (float32)
- BPE:
gl20k.code→gl.code;en20k.code→en.code - SHA-256 (
model.bin):4d8f8a6535080a84abd33d6d90ca29c817c59458d672f3f27dd67a20958223c9
Resultados BLEU
BLEU medido con CT2, avaliado o 2026-09-14 con CTranslate2 4.8.0, CUDA float32 nunha NVIDIA A100. Os valores OpenNMT recalculáronse a partir das saídas gardadas do mesmo checkpoint. Inclúese só FLORES test, sen FLORES dev. A media dá o mesmo peso aos seis datasets. Úsase SacreBLEU con maiúsculas e minúsculas e tokenización 13a, tras eliminar BPE e destokenizar. As saídas e o BLEU de CT2 non son idénticos aos de OpenNMT.
| Dataset | CT2 BLEU | OpenNMT BLEU |
|---|---|---|
| gold-PT | 61.075 | 61.537 |
| gold-ES | 47.142 | 47.102 |
| test-suite | 46.870 | 47.814 |
| tatoeba | 74.387 | 75.058 |
| taCon | 41.008 | 41.180 |
| flores_test | 38.432 | 38.745 |
| Media | 51.486 | 51.906 |
Uso
Descarga o repositorio e executa estes comandos desde a súa raíz. input.txt debe conter unha oración por liña.
pip install ctranslate2==4.8.0 subword-nmt
perl tokenizer.perl < input.txt > input.tok
python -m subword_nmt.apply_bpe -c gl.code < input.tok > input.bpe
python translate.py > output.bpe
sed 's/@@ //g' output.bpe > output.tok
perl detokenizer.perl < output.tok > output.txt
translate.py:
import ctranslate2
translator = ctranslate2.Translator(".", device="cpu", compute_type="float32")
with open("input.bpe", encoding="utf-8") as source:
for line in source:
tokens = line.split()
if not tokens:
print()
continue
result = translator.translate_batch(
[tokens], beam_size=5, length_penalty=0,
disable_unk=True, replace_unknowns=True,
max_decoding_length=250,
)
print(" ".join(result[0].hypotheses[0]))
Usa device="cuda" cunha instalación CUDA compatible. Aplica BPE unha soa vez, co ficheiro da lingua de orixe incluído aquí.
Licenzas do Modelo
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.
Financiamento
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.
Citar este traballo
Se utilizar este modelo no seu traballo, cite por favor así:
Daniel Bardanca Outeirinho, Pablo Gamallo Otero, Iria de-Dios-Flores, and José Ramom Pichel Campos. 2024. Exploring the effects of vocabulary size in neural machine translation: Galician as a target language. In Proceedings of the 16th International Conference on Computational Processing of Portuguese, pages 600–604, Santiago de Compostela, Galiza. Association for Computational Lingustics.
- Downloads last month
- 40