Views
No views yet
@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",
}>>id<< (id = valid target language ID), e.g. >>bel<<1from transformers import MarianMTModel, MarianTokenizer
2
3src_text = [
4 ">>rus<< Su novela se vendió bien.",
5 ">>ukr<< Quiero ir a Corea del Norte."
6]
7
8model_name = "pytorch-models/opus-mt-tc-big-es-zle"
9tokenizer = MarianTokenizer.from_pretrained(model_name)
10model = MarianMTModel.from_pretrained(model_name)
11translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
12
13for t in translated:
14 print( tokenizer.decode(t, skip_special_tokens=True) )
15
16# expected output:
17# Его роман хорошо продавался.
18# Я хочу поїхати до Північної Кореї.1from transformers import pipeline
2pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-es-zle")
3print(pipe(">>rus<< Su novela se vendió bien."))
4
5# expected output: Его роман хорошо продавался.| langpair | testset | chr-F | BLEU | #sent | #words |
|---|---|---|---|---|---|
| spa-bel | tatoeba-test-v2021-08-07 | 0.54506 | 27.5 | 205 | 1259 |
| spa-rus | tatoeba-test-v2021-08-07 | 0.68523 | 49.0 | 10506 | 69242 |
| spa-ukr | tatoeba-test-v2021-08-07 | 0.63502 | 42.3 | 10115 | 54544 |
| spa-rus | flores101-devtest | 0.49913 | 20.2 | 1012 | 23295 |
| spa-ukr | flores101-devtest | 0.47772 | 17.4 | 1012 | 22810 |
| spa-rus | newstest2012 | 0.52436 | 24.6 | 3003 | 64790 |
| spa-rus | newstest2013 | 0.54249 | 26.9 | 3000 | 58560 |