Views
No views yet
>>id<< (id = valid target language ID), e.g. >>deu<<1from transformers import MarianMTModel, MarianTokenizer
2
3src_text = [
4 ">>eng<< Anta i ak-d-yennan ur yerbiḥ ara Tom?",
5 ">>fra<< Iselman d aɣbalu axatar i wučči n yemdanen."
6]
7
8model_name = "pytorch-models/opus-mt-tc-bible-big-afa-deu_eng_fra_por_spa"
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# Who told you that he didn't?
18# L'eau est une source importante de nourriture pour les gens.1from transformers import pipeline
2pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-bible-big-afa-deu_eng_fra_por_spa")
3print(pipe(">>eng<< Anta i ak-d-yennan ur yerbiḥ ara Tom?"))
4
5# expected output: Who told you that he didn't?| langpair | testset | chr-F | BLEU | #sent | #words |
|---|---|---|---|---|---|
| ara-deu | tatoeba-test-v2021-08-07 | 0.61039 | 41.7 | 1209 | 8371 |
| ara-eng | tatoeba-test-v2021-08-07 | 5.430 | 0.0 | 10305 | 76975 |
| ara-fra | tatoeba-test-v2021-08-07 | 0.56120 | 38.8 | 1569 | 11066 |
| ara-spa | tatoeba-test-v2021-08-07 | 0.62567 | 43.7 | 1511 | 9708 |
| heb-deu | tatoeba-test-v2021-08-07 | 0.63131 | 42.4 | 3090 | 25101 |
| heb-eng | tatoeba-test-v2021-08-07 | 0.64960 | 49.2 | 10519 | 77427 |
| heb-fra | tatoeba-test-v2021-08-07 | 0.64348 | 46.3 | 3281 | 26123 |
| heb-por | tatoeba-test-v2021-08-07 | 0.63350 | 43.2 | 719 | 5335 |
| mlt-eng | tatoeba-test-v2021-08-07 | 0.66653 | 51.0 | 203 | 1165 |
| amh-eng | flores101-devtest | 0.47357 | 21.0 | 1012 | 24721 |
| amh-fra | flores101-devtest | 0.43155 | 16.2 | 1012 | 28343 |
| amh-por | flores101-devtest | 0.42109 | 15.1 | 1012 | 26519 |
| ara-deu | flores101-devtest | 0.51110 | 20.4 | 1012 | 25094 |
| ara-fra | flores101-devtest | 0.56934 | 29.7 | 1012 | 28343 |
| ara-por | flores101-devtest | 0.55727 | 28.2 | 1012 | 26519 |
| ara-spa | flores101-devtest | 0.48350 | 19.5 | 1012 | 29199 |
| hau-eng | flores101-devtest | 0.46804 | 21.6 | 1012 | 24721 |
| hau-fra | flores101-devtest | 0.41827 | 15.9 | 1012 | 28343 |
| heb-eng | flores101-devtest | 0.62422 | 36.6 | 1012 | 24721 |
| mlt-eng | flores101-devtest | 0.72390 | 49.1 | 1012 | 24721 |
| mlt-fra | flores101-devtest | 0.60840 | 34.7 | 1012 | 28343 |
| mlt-por | flores101-devtest | 0.59863 | 31.8 | 1012 | 26519 |
| acm-deu | flores200-devtest | 0.48947 | 17.6 | 1012 | 25094 |
| acm-eng | flores200-devtest | 0.56799 | 28.5 | 1012 | 24721 |
| acm-fra | flores200-devtest | 0.53577 | 26.1 | 1012 | 28343 |
| acm-por | flores200-devtest | 0.52441 | 23.9 | 1012 | 26519 |
| acm-spa | flores200-devtest | 0.46985 | 18.2 | 1012 | 29199 |
| amh-deu | flores200-devtest | 0.41553 | 12.6 | 1012 | 25094 |
| amh-eng | flores200-devtest | 0.49333 | 22.5 | 1012 | 24721 |
| amh-fra | flores200-devtest | 0.44890 | 17.8 | 1012 | 28343 |
| amh-por | flores200-devtest | 0.43771 | 16.5 | 1012 | 26519 |
| apc-deu | flores200-devtest | 0.47480 | 16.0 | 1012 | 25094 |
| apc-eng | flores200-devtest | 0.56075 | 28.1 | 1012 | 24721 |
| apc-fra | flores200-devtest | 0.52325 | 24.6 | 1012 | 28343 |
| apc-por | flores200-devtest | 0.51055 | 22.9 | 1012 | 26519 |
| apc-spa | flores200-devtest | 0.45634 | 17.2 | 1012 | 29199 |
| arz-deu | flores200-devtest | 0.45844 | 14.1 | 1012 | 25094 |
| arz-eng | flores200-devtest | 0.52534 | 22.7 | 1012 | 24721 |
| arz-fra | flores200-devtest | 0.50336 | 21.8 | 1012 | 28343 |
| arz-por | flores200-devtest | 0.48741 | 20.0 | 1012 | 26519 |
| arz-spa | flores200-devtest | 0.44516 | 15.8 | 1012 | 29199 |
| hau-eng | flores200-devtest | 0.48137 | 23.4 | 1012 | 24721 |
| hau-fra | flores200-devtest | 0.42981 | 17.2 | 1012 | 28343 |
| hau-por | flores200-devtest | 0.41385 | 15.7 | 1012 | 26519 |
| heb-deu | flores200-devtest | 0.53482 | 22.8 | 1012 | 25094 |
| heb-eng | flores200-devtest | 0.63368 | 38.0 | 1012 | 24721 |
| heb-fra | flores200-devtest | 0.58417 | 32.6 | 1012 | 28343 |
| heb-por | flores200-devtest | 0.57140 | 30.7 | 1012 | 26519 |
| mlt-eng | flores200-devtest | 0.73415 | 51.1 | 1012 | 24721 |
| mlt-fra | flores200-devtest | 0.61626 | 35.8 | 1012 | 28343 |
| mlt-spa | flores200-devtest | 0.50534 | 21.8 | 1012 | 29199 |
| som-eng | flores200-devtest | 0.42764 | 17.7 | 1012 | 24721 |
| tir-por | flores200-devtest | 2.931 | 0.0 | 1012 | 26519 |
| hau-eng | newstest2021 | 0.43744 | 15.5 | 997 | 27372 |
| amh-eng | ntrex128 | 0.42042 | 15.0 | 1997 | 47673 |
| hau-eng | ntrex128 | 0.50349 | 26.1 | 1997 | 47673 |
| hau-fra | ntrex128 | 0.41837 | 15.8 | 1997 | 53481 |
| hau-por | ntrex128 | 0.40851 | 15.3 | 1997 | 51631 |
| hau-spa | ntrex128 | 0.43376 | 18.5 | 1997 | 54107 |
| heb-deu | ntrex128 | 0.49482 | 17.7 | 1997 | 48761 |
| heb-eng | ntrex128 | 0.59241 | 31.3 | 1997 | 47673 |
| heb-fra | ntrex128 | 0.52180 | 24.0 | 1997 | 53481 |
| heb-por | ntrex128 | 0.51248 | 23.2 | 1997 | 51631 |
| mlt-spa | ntrex128 | 0.57078 | 30.9 | 1997 | 54107 |
| som-eng | ntrex128 | 0.49187 | 24.3 | 1997 | 47673 |
| som-fra | ntrex128 | 0.41236 | 15.1 | 1997 | 53481 |
| som-por | ntrex128 | 0.41550 | 15.2 | 1997 | 51631 |
| som-spa | ntrex128 | 0.43278 | 17.6 | 1997 | 54107 |
| tir-eng | tico19-test | 2.655 | 0.0 | 2100 | 56824 |
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}