Views
No views yet
>>id<< (id = valid target language ID), e.g. >>deu<<1from transformers import MarianMTModel, MarianTokenizer
2
3src_text = [
4 ">>deu<< Replace this with text in an accepted source language.",
5 ">>spa<< This is the second sentence."
6]
7
8model_name = "pytorch-models/opus-mt-tc-bible-big-bat-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) )1from transformers import pipeline
2pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-bible-big-bat-deu_eng_fra_por_spa")
3print(pipe(">>deu<< Replace this with text in an accepted source language."))| langpair | testset | chr-F | BLEU | #sent | #words |
|---|---|---|---|---|---|
| lav-eng | tatoeba-test-v2021-08-07 | 0.63015 | 21.5 | 1631 | 11213 |
| lit-deu | tatoeba-test-v2021-08-07 | 0.66527 | 47.5 | 1115 | 8531 |
| lit-eng | tatoeba-test-v2021-08-07 | 0.72975 | 58.9 | 2528 | 17855 |
| lit-spa | tatoeba-test-v2021-08-07 | 0.67956 | 49.9 | 454 | 2751 |
| lav-deu | flores101-devtest | 0.54001 | 23.8 | 1012 | 25094 |
| lav-fra | flores101-devtest | 0.57002 | 29.4 | 1012 | 28343 |
| lav-por | flores101-devtest | 0.55155 | 26.7 | 1012 | 26519 |
| lav-spa | flores101-devtest | 0.49259 | 20.8 | 1012 | 29199 |
| lit-eng | flores101-devtest | 0.59073 | 32.1 | 1012 | 24721 |
| lit-por | flores101-devtest | 0.55106 | 27.8 | 1012 | 26519 |
| lit-deu | flores200-devtest | 0.53223 | 23.7 | 1012 | 25094 |
| lit-eng | flores200-devtest | 0.59361 | 32.6 | 1012 | 24721 |
| lit-fra | flores200-devtest | 0.56786 | 30.0 | 1012 | 28343 |
| lit-por | flores200-devtest | 0.55393 | 28.2 | 1012 | 26519 |
| lit-spa | flores200-devtest | 0.49041 | 20.9 | 1012 | 29199 |
| lav-eng | newstest2017 | 0.49729 | 22.0 | 2001 | 47511 |
| lit-eng | newstest2019 | 0.59971 | 31.2 | 1000 | 25878 |
| lav-deu | ntrex128 | 0.47317 | 18.5 | 1997 | 48761 |
| lav-eng | ntrex128 | 0.53734 | 19.7 | 1997 | 47673 |
| lav-fra | ntrex128 | 0.47843 | 19.6 | 1997 | 53481 |
| lav-por | ntrex128 | 0.47027 | 19.3 | 1997 | 51631 |
| lav-spa | ntrex128 | 0.49428 | 22.7 | 1997 | 54107 |
| lit-deu | ntrex128 | 0.50279 | 19.4 | 1997 | 48761 |
| lit-eng | ntrex128 | 0.56642 | 28.1 | 1997 | 47673 |
| lit-fra | ntrex128 | 0.51276 | 22.6 | 1997 | 53481 |
| lit-por | ntrex128 | 0.50864 | 22.6 | 1997 | 51631 |
| lit-spa | ntrex128 | 0.53105 | 25.9 | 1997 | 54107 |
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}