CoolFace
Modelpublic

Helsinki-NLP/opus-mt-tc-big-en-zle

sourceHugging Facecc-by-4.0updated 3y agoView on Hugging Face
0likes1.3kdownloads
Model Card

opus-mt-tc-big-en-zle

Neural machine translation model for translating from English (en) to East Slavic languages (zle).

This model is part of the OPUS-MT project, an effort to make neural machine translation models widely available and accessible for many languages in the world. All models are originally trained using the amazing framework of Marian NMT, an efficient NMT implementation written in pure C++. The models have been converted to pyTorch using the transformers library by huggingface. Training data is taken from OPUS and training pipelines use the procedures of OPUS-MT-train.

@inproceedings{tiedemann-thottingal-2020-opus,
    title = "{OPUS}-{MT} {--} Building open translation services for the World",
    author = {Tiedemann, J{\"o}rg  and Thottingal, Santhosh},
    booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
    month = nov,
    year = "2020",
    address = "Lisboa, Portugal",
    publisher = "European Association for Machine Translation",
    url = "https://aclanthology.org/2020.eamt-1.61",
    pages = "479--480",
}

@inproceedings{tiedemann-2020-tatoeba,
    title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
    author = {Tiedemann, J{\"o}rg},
    booktitle = "Proceedings of the Fifth Conference on Machine Translation",
    month = nov,
    year = "2020",
    address = "Online",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2020.wmt-1.139",
    pages = "1174--1182",
}

Model info

This is a multilingual translation model with multiple target languages. A sentence initial language token is required in the form of >>id<< (id = valid target language ID), e.g. >>bel<<

Usage

A short example code:

python
from transformers import MarianMTModel, MarianTokenizer

src_text = [
    ">>rus<< Are they coming as well?",
    ">>rus<< I didn't let Tom do what he wanted to do."
]

model_name = "pytorch-models/opus-mt-tc-big-en-zle"
tokenizer = MarianTokenizer.from_pretrained(model_name)
model = MarianMTModel.from_pretrained(model_name)
translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))

for t in translated:
    print( tokenizer.decode(t, skip_special_tokens=True) )

# expected output:
#     Они тоже приедут?
#     Я не позволил Тому сделать то, что он хотел.

You can also use OPUS-MT models with the transformers pipelines, for example:

python
from transformers import pipeline
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-en-zle")
print(pipe(">>rus<< Are they coming as well?"))

# expected output: Они тоже приедут?

Benchmarks

langpairtestsetchr-FBLEU#sent#words
eng-beltatoeba-test-v2021-08-070.5034524.9250016237
eng-rustatoeba-test-v2021-08-070.6618245.519425134296
eng-ukrtatoeba-test-v2021-08-070.6017537.71312780998
eng-belflores101-devtest0.4207811.2101224829
eng-rusflores101-devtest0.5965432.7101223295
eng-ukrflores101-devtest0.6013132.1101222810
eng-rusnewstest20120.6284236.8300364790
eng-rusnewstest20130.5462726.9300058560
eng-rusnewstest20140.6834843.5300361603
eng-rusnewstest20150.6262134.9281855915
eng-rusnewstest20160.6059533.1299862014
eng-rusnewstest20170.6424937.3300160253
eng-rusnewstest20180.6121932.9300061907
eng-rusnewstest20190.5790231.8199748147
eng-rusnewstest20200.5293925.5200247083
eng-rustico19-test0.5931433.7210055843

Acknowledgements

The work is supported by the European Language Grid as pilot project 2866, by the FoTran project, funded by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 771113), and the MeMAD project, funded by the European Union’s Horizon 2020 Research and Innovation Programme under grant agreement No 780069. We are also grateful for the generous computational resources and IT infrastructure provided by CSC -- IT Center for Science, Finland.

Model conversion info

  • —transformers version: 4.16.2
  • —OPUS-MT git hash: 1bdabf7
  • —port time: Thu Mar 24 01:58:40 EET 2022
  • —port machine: LM0-400-22516.local