Views
No views yet
>>id<< (id = valid target language ID), e.g. >>anp<<1from transformers import MarianMTModel, MarianTokenizer
2
3src_text = [
4 ">>anp<< Replace this with text in an accepted source language.",
5 ">>urd<< This is the second sentence."
6]
7
8model_name = "pytorch-models/opus-mt-tc-bible-big-deu_eng_fra_por_spa-inc"
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) )1from transformers import pipeline
2pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-bible-big-deu_eng_fra_por_spa-inc")
3print(pipe(">>anp<< Replace this with text in an accepted source language."))| langpair | testset | chr-F | BLEU | #sent | #words |
|---|---|---|---|---|---|
| eng-ben | tatoeba-test-v2021-08-07 | 0.48316 | 18.1 | 2500 | 11654 |
| eng-hin | tatoeba-test-v2021-08-07 | 0.52587 | 28.1 | 5000 | 32904 |
| eng-mar | tatoeba-test-v2021-08-07 | 0.52516 | 24.2 | 10396 | 61140 |
| eng-urd | tatoeba-test-v2021-08-07 | 0.46228 | 18.8 | 1663 | 12155 |
| deu-ben | flores101-devtest | 0.44269 | 10.8 | 1012 | 21155 |
| deu-hin | flores101-devtest | 0.48314 | 21.9 | 1012 | 27743 |
| eng-ben | flores101-devtest | 0.51768 | 17.4 | 1012 | 21155 |
| eng-guj | flores101-devtest | 0.54325 | 22.7 | 1012 | 23840 |
| eng-hin | flores101-devtest | 0.58472 | 34.1 | 1012 | 27743 |
| fra-ben | flores101-devtest | 0.44304 | 11.1 | 1012 | 21155 |
| fra-hin | flores101-devtest | 0.48245 | 22.5 | 1012 | 27743 |
| deu-ben | flores200-devtest | 0.44696 | 11.3 | 1012 | 21155 |
| deu-guj | flores200-devtest | 0.40939 | 12.0 | 1012 | 23840 |
| deu-hin | flores200-devtest | 0.48864 | 22.7 | 1012 | 27743 |
| deu-hne | flores200-devtest | 0.43166 | 14.2 | 1012 | 26582 |
| deu-mag | flores200-devtest | 0.43058 | 14.2 | 1012 | 26516 |
| deu-urd | flores200-devtest | 0.41167 | 14.3 | 1012 | 28098 |
| eng-ben | flores200-devtest | 0.52088 | 17.7 | 1012 | 21155 |
| eng-guj | flores200-devtest | 0.54758 | 23.2 | 1012 | 23840 |
| eng-hin | flores200-devtest | 0.58825 | 34.4 | 1012 | 27743 |
| eng-hne | flores200-devtest | 0.46144 | 19.1 | 1012 | 26582 |
| eng-mag | flores200-devtest | 0.50291 | 21.9 | 1012 | 26516 |
| eng-mar | flores200-devtest | 0.49344 | 15.6 | 1012 | 21810 |
| eng-pan | flores200-devtest | 0.45635 | 18.4 | 1012 | 27451 |
| eng-sin | flores200-devtest | 0.45683 | 11.8 | 1012 | 23278 |
| eng-urd | flores200-devtest | 0.48224 | 20.6 | 1012 | 28098 |
| fra-ben | flores200-devtest | 0.44486 | 11.1 | 1012 | 21155 |
| fra-guj | flores200-devtest | 0.41021 | 12.2 | 1012 | 23840 |
| fra-hin | flores200-devtest | 0.48632 | 22.7 | 1012 | 27743 |
| fra-hne | flores200-devtest | 0.42777 | 13.8 | 1012 | 26582 |
| fra-mag | flores200-devtest | 0.42725 | 14.3 | 1012 | 26516 |
| fra-urd | flores200-devtest | 0.40901 | 13.6 | 1012 | 28098 |
| por-ben | flores200-devtest | 0.43877 | 10.7 | 1012 | 21155 |
| por-hin | flores200-devtest | 0.50121 | 23.9 | 1012 | 27743 |
| por-hne | flores200-devtest | 0.42270 | 14.1 | 1012 | 26582 |
| por-mag | flores200-devtest | 0.42146 | 13.7 | 1012 | 26516 |
| por-san | flores200-devtest | 9.879 | 0.4 | 1012 | 18253 |
| por-urd | flores200-devtest | 0.41225 | 14.5 | 1012 | 28098 |
| spa-ben | flores200-devtest | 0.42040 | 8.8 | 1012 | 21155 |
| spa-hin | flores200-devtest | 0.43977 | 16.4 | 1012 | 27743 |
| eng-hin | newstest2014 | 0.51541 | 24.0 | 2507 | 60872 |
| eng-guj | newstest2019 | 0.57815 | 25.7 | 998 | 21924 |
| deu-ben | ntrex128 | 0.44384 | 9.9 | 1997 | 40095 |
| deu-hin | ntrex128 | 0.43252 | 17.0 | 1997 | 55219 |
| deu-urd | ntrex128 | 0.41844 | 14.8 | 1997 | 54259 |
| eng-ben | ntrex128 | 0.52381 | 17.3 | 1997 | 40095 |
| eng-guj | ntrex128 | 0.49386 | 17.2 | 1997 | 45335 |
| eng-hin | ntrex128 | 0.52696 | 27.4 | 1997 | 55219 |
| eng-mar | ntrex128 | 0.45244 | 10.8 | 1997 | 42375 |
| eng-nep | ntrex128 | 0.43339 | 8.8 | 1997 | 40570 |
| eng-pan | ntrex128 | 0.46534 | 19.5 | 1997 | 54355 |
| eng-sin | ntrex128 | 0.44124 | 10.5 | 1997 | 44429 |
| eng-urd | ntrex128 | 0.50060 | 22.4 | 1997 | 54259 |
| fra-ben | ntrex128 | 0.42857 | 9.4 | 1997 | 40095 |
| fra-hin | ntrex128 | 0.42777 | 17.4 | 1997 | 55219 |
| fra-urd | ntrex128 | 0.41229 | 14.3 | 1997 | 54259 |
| por-ben | ntrex128 | 0.44134 | 10.1 | 1997 | 40095 |
| por-hin | ntrex128 | 0.43461 | 17.7 | 1997 | 55219 |
| por-urd | ntrex128 | 0.41777 | 14.5 | 1997 | 54259 |
| spa-ben | ntrex128 | 0.45329 | 10.6 | 1997 | 40095 |
| spa-hin | ntrex128 | 0.43747 | 17.9 | 1997 | 55219 |
| spa-urd | ntrex128 | 0.41929 | 14.6 | 1997 | 54259 |
| eng-ben | tico19-test | 0.51850 | 18.6 | 2100 | 51695 |
| eng-hin | tico19-test | 0.62999 | 41.9 | 2100 | 62680 |
| eng-mar | tico19-test | 0.45968 | 13.0 | 2100 | 50872 |
| eng-nep | tico19-test | 0.54373 | 18.7 | 2100 | 48363 |
| eng-urd | tico19-test | 0.50920 | 21.7 | 2100 | 65312 |
| fra-hin | tico19-test | 0.48666 | 25.6 | 2100 | 62680 |
| fra-nep | tico19-test | 0.41414 | 10.0 | 2100 | 48363 |
| por-ben | tico19-test | 0.45609 | 12.7 | 2100 | 51695 |
| por-hin | tico19-test | 0.55530 | 31.2 | 2100 | 62680 |
| por-mar | tico19-test | 0.40344 | 9.7 | 2100 | 50872 |
| por-nep | tico19-test | 0.47698 | 12.4 | 2100 | 48363 |
| por-urd | tico19-test | 0.44747 | 15.6 | 2100 | 65312 |
| spa-ben | tico19-test | 0.46418 | 13.3 | 2100 | 51695 |
| spa-hin | tico19-test | 0.55526 | 31.0 | 2100 | 62680 |
| spa-mar | tico19-test | 0.41189 | 10.0 | 2100 | 50872 |
| spa-nep | tico19-test | 0.47414 | 12.1 | 2100 | 48363 |
| spa-urd | tico19-test | 0.44788 | 15.6 | 2100 | 65312 |
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}