Introduction
English - Hungarian translation model that was trained on the Hunglish2 dataset using OpenNMT.
Usage
Install the necessary dependencies:
pip3 install ctranslate2 pyonmttok
Simple tokenization & translation using Python:
import ctranslate2
import pyonmttok
from huggingface_hub import snapshot_download
model_dir = snapshot_download(repo_id="SZTAKI-HLT/opennmt-en-hu", revision="main")
tokenizer=pyonmttok.Tokenizer(mode="none", sp_model_path = model_dir + "/sp_m.model")
tokenized=tokenizer.tokenize("Hello világ")
translator = ctranslate2.Translator(model_dir)
translated = translator.translate_batch([tokenized[0]])
print(tokenizer.detokenize(translated[0].hypotheses[0]))
Citation
If you use our model, please cite the following paper:
@inproceedings{nagy2022syntax,
title={Syntax-based data augmentation for Hungarian-English machine translation},
author={Nagy, Attila and Nanys, Patrick and Konr{\'a}d, Bal{\'a}zs Frey and Bial, Bence and {\'A}cs, Judit},
booktitle = {XVIII. Magyar Számítógépes Nyelvészeti Konferencia (MSZNY 2022)},
year={2022},
publisher = {Szegedi Tudományegyetem, Informatikai Intézet},
}
- Downloads last month
- 5