Views
No views yet
>>id<< (id = valid target language ID), e.g. >>aar<<1from transformers import MarianMTModel, MarianTokenizer
2
3src_text = [
4 ">>kab<< Tu seras parmi nous demain.",
5 ">>heb<< Let's get out of here while we can."
6]
7
8model_name = "pytorch-models/opus-mt-tc-bible-big-deu_eng_fra_por_spa-afa"
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# Azekka ad tiliḍ yid-i
18# בוא נצא מכאן כל עוד אנחנו יכולים.1from transformers import pipeline
2pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-bible-big-deu_eng_fra_por_spa-afa")
3print(pipe(">>kab<< Tu seras parmi nous demain."))
4
5# expected output: Azekka ad tiliḍ yid-i| langpair | testset | chr-F | BLEU | #sent | #words |
|---|---|---|---|---|---|
| deu-ara | tatoeba-test-v2021-08-07 | 0.49517 | 20.2 | 1209 | 6324 |
| deu-heb | tatoeba-test-v2021-08-07 | 0.56943 | 35.8 | 3090 | 20341 |
| eng-ara | tatoeba-test-v2021-08-07 | 0.46273 | 17.3 | 10305 | 61356 |
| eng-heb | tatoeba-test-v2021-08-07 | 0.57708 | 34.9 | 10519 | 63628 |
| eng-mlt | tatoeba-test-v2021-08-07 | 0.61044 | 29.5 | 203 | 899 |
| fra-ara | tatoeba-test-v2021-08-07 | 0.42223 | 10.4 | 1569 | 7956 |
| fra-heb | tatoeba-test-v2021-08-07 | 0.58681 | 37.5 | 3281 | 20655 |
| por-heb | tatoeba-test-v2021-08-07 | 0.61593 | 41.0 | 719 | 4423 |
| spa-ara | tatoeba-test-v2021-08-07 | 0.53669 | 23.9 | 1511 | 7547 |
| spa-heb | tatoeba-test-v2021-08-07 | 0.61966 | 41.2 | 1849 | 12112 |
| deu-ara | flores101-devtest | 0.47927 | 15.7 | 1012 | 21357 |
| eng-hau | flores101-devtest | 0.47807 | 19.0 | 1012 | 27730 |
| eng-mlt | flores101-devtest | 0.67196 | 32.9 | 1012 | 22169 |
| fra-mlt | flores101-devtest | 0.56271 | 19.9 | 1012 | 22169 |
| por-heb | flores101-devtest | 0.49378 | 19.6 | 1012 | 20749 |
| spa-ara | flores101-devtest | 0.44988 | 11.7 | 1012 | 21357 |
| deu-ara | flores200-devtest | 0.661 | 0.0 | 1012 | 5 |
| deu-hau | flores200-devtest | 0.40471 | 11.4 | 1012 | 27730 |
| deu-heb | flores200-devtest | 0.48645 | 18.1 | 1012 | 20238 |
| deu-mlt | flores200-devtest | 0.54079 | 17.5 | 1012 | 22169 |
| eng-ara | flores200-devtest | 0.627 | 0.0 | 1012 | 5 |
| eng-arz | flores200-devtest | 0.42804 | 11.1 | 1012 | 21034 |
| eng-hau | flores200-devtest | 0.49023 | 20.4 | 1012 | 27730 |
| eng-heb | flores200-devtest | 0.56635 | 27.1 | 1012 | 20238 |
| eng-mlt | flores200-devtest | 0.68334 | 34.9 | 1012 | 22169 |
| eng-som | flores200-devtest | 0.42814 | 9.9 | 1012 | 25991 |
| fra-ara | flores200-devtest | 0.631 | 0.0 | 1012 | 5 |
| fra-hau | flores200-devtest | 0.42731 | 13.2 | 1012 | 27730 |
| fra-heb | flores200-devtest | 0.49683 | 19.1 | 1012 | 20238 |
| fra-mlt | flores200-devtest | 0.56844 | 20.4 | 1012 | 22169 |
| por-ara | flores200-devtest | 0.622 | 0.0 | 1012 | 5 |
| por-hau | flores200-devtest | 0.42593 | 13.6 | 1012 | 27730 |
| por-heb | flores200-devtest | 0.50345 | 19.7 | 1012 | 20238 |
| por-mlt | flores200-devtest | 0.58913 | 21.5 | 1012 | 22169 |
| spa-ara | flores200-devtest | 0.587 | 0.0 | 1012 | 5 |
| spa-hau | flores200-devtest | 0.40309 | 9.4 | 1012 | 27730 |
| spa-heb | flores200-devtest | 0.45249 | 13.5 | 1012 | 20238 |
| spa-mlt | flores200-devtest | 0.51077 | 12.7 | 1012 | 22169 |
| eng-hau | newstest2021 | 0.43617 | 13.1 | 1000 | 32966 |
| deu-hau | ntrex128 | 0.41931 | 12.5 | 1997 | 54982 |
| deu-heb | ntrex128 | 0.43961 | 13.3 | 1997 | 39624 |
| deu-mlt | ntrex128 | 0.49871 | 15.1 | 1997 | 43308 |
| eng-hau | ntrex128 | 0.51601 | 23.2 | 1997 | 54982 |
| eng-heb | ntrex128 | 0.50625 | 20.3 | 1997 | 39624 |
| eng-mlt | ntrex128 | 0.62552 | 29.0 | 1997 | 43308 |
| eng-som | ntrex128 | 0.46845 | 13.5 | 1997 | 49351 |
| fra-hau | ntrex128 | 0.43729 | 14.5 | 1997 | 54982 |
| fra-heb | ntrex128 | 0.43855 | 13.9 | 1997 | 39624 |
| fra-mlt | ntrex128 | 0.51640 | 17.3 | 1997 | 43308 |
| fra-som | ntrex128 | 0.41813 | 9.6 | 1997 | 49351 |
| por-hau | ntrex128 | 0.44408 | 15.1 | 1997 | 54982 |
| por-heb | ntrex128 | 0.45739 | 15.0 | 1997 | 39624 |
| por-mlt | ntrex128 | 0.53719 | 18.2 | 1997 | 43308 |
| por-som | ntrex128 | 0.41367 | 9.3 | 1997 | 49351 |
| spa-hau | ntrex128 | 0.44695 | 14.8 | 1997 | 54982 |
| spa-heb | ntrex128 | 0.45509 | 14.5 | 1997 | 39624 |
| spa-mlt | ntrex128 | 0.53631 | 17.7 | 1997 | 43308 |
| spa-som | ntrex128 | 0.41755 | 9.1 | 1997 | 49351 |
| eng-ara | tico19-test | 0.56288 | 25.4 | 2100 | 51339 |
| eng-hau | tico19-test | 0.50060 | 22.2 | 2100 | 64509 |
| fra-amh | tico19-test | 3.575 | 1.3 | 2100 | 44782 |
| fra-hau | tico19-test | 5.071 | 1.8 | 2100 | 64509 |
| fra-orm | tico19-test | 4.044 | 1.8 | 2100 | 50032 |
| fra-som | tico19-test | 2.698 | 0.9 | 2100 | 63654 |
| fra-tir | tico19-test | 4.151 | 1.4 | 2100 | 46685 |
| por-amh | tico19-test | 3.799 | 1.4 | 2100 | 44782 |
| por-ara | tico19-test | 0.44442 | 16.0 | 2100 | 51339 |
| por-hau | tico19-test | 5.786 | 2.0 | 2100 | 64509 |
| por-orm | tico19-test | 4.613 | 2.0 | 2100 | 50032 |
| por-som | tico19-test | 3.413 | 1.2 | 2100 | 63654 |
| por-tir | tico19-test | 5.092 | 1.6 | 2100 | 46685 |
| spa-amh | tico19-test | 3.831 | 1.4 | 2100 | 44782 |
| spa-ara | tico19-test | 0.45429 | 16.5 | 2100 | 51339 |
| spa-hau | tico19-test | 5.790 | 1.9 | 2100 | 64509 |
| spa-orm | tico19-test | 4.617 | 1.9 | 2100 | 50032 |
| spa-som | tico19-test | 3.402 | 1.2 | 2100 | 63654 |
| spa-tir | tico19-test | 5.033 | 1.6 | 2100 | 46685 |
1@article{tiedemann2023democratizing,
2 title={Democratizing neural machine translation with {OPUS-MT}},
3 author={Tiedemann, J{\"o}rg and Aulamo, Mikko and Bakshandaeva, Daria and Boggia, Michele and Gr{\"o}nroos, Stig-Arne and Nieminen, Tommi and Raganato, Alessandro and Scherrer, Yves and Vazquez, Raul and Virpioja, Sami},
4 journal={Language Resources and Evaluation},
5 number={58},
6 pages={713--755},
7 year={2023},
8 publisher={Springer Nature},
9 issn={1574-0218},
10 doi={10.1007/s10579-023-09704-w}
11}
12
13@inproceedings{tiedemann-thottingal-2020-opus,
14 title = "{OPUS}-{MT} {--} Building open translation services for the World",
15 author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
16 booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
17 month = nov,
18 year = "2020",
19 address = "Lisboa, Portugal",
20 publisher = "European Association for Machine Translation",
21 url = "https://aclanthology.org/2020.eamt-1.61",
22 pages = "479--480",
23}
24
25@inproceedings{tiedemann-2020-tatoeba,
26 title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
27 author = {Tiedemann, J{\"o}rg},
28 booktitle = "Proceedings of the Fifth Conference on Machine Translation",
29 month = nov,
30 year = "2020",
31 address = "Online",
32 publisher = "Association for Computational Linguistics",
33 url = "https://aclanthology.org/2020.wmt-1.139",
34 pages = "1174--1182",
35}