Helsinki-NLP/opus-100
Viewer • Updated • 55.1M • 20k • 243
This is a bidrection English ↔ French translation model that is built on top of the BERT Encoder-Decoder model architecture. It was trained on the en-fr subset of the OPUS-100 dataset where the translations were flipped during pre-processing to double as a French to English dataset.
The model makes use of special tokens to indicate the target language for translation:
<2fr>: Indicates that the input text should be translated to French.<2en>: Indicates that the input text should be translated to English.from transformers import AutoTokenizer, pipeline
model_path = "baguette-boy-en-fr"
tokenizer = AutoTokenizer.from_pretrained(model_path)
translator = pipeline("translation", model=model_path, tokenizer=tokenizer)
translation_output = translator("<2fr> Hello, how are you?")
print(translation_output[0]["translation_text"].replace(" ", "").replace("Ġ", " "))
translation_output = translator("<2en> Bonjour, comment ça va?")
print(translation_output[0]["translation_text"].replace(" ", "").replace("Ġ", " "))
en-fr subset<2fr> and <2en> to indicate target language<s> (BOS), </s> (EOS), [PAD], [UNK]en-fr subset because of the bidirectional flipping@inproceedings{zhang-etal-2020-improving,
title = "Improving Massively Multilingual Neural Machine Translation and Zero-Shot Translation",
author = "Zhang, Biao and
Williams, Philip and
Titov, Ivan and
Sennrich, Rico",
editor = "Jurafsky, Dan and
Chai, Joyce and
Schluter, Natalie and
Tetreault, Joel",
booktitle = "Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics",
month = jul,
year = "2020",
address = "Online",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2020.acl-main.148",
doi = "10.18653/v1/2020.acl-main.148",
pages = "1628--1639",
}
@inproceedings{tiedemann-2012-parallel,
title = "Parallel Data, Tools and Interfaces in {OPUS}",
author = {Tiedemann, J{\"o}rg},
editor = "Calzolari, Nicoletta and
Choukri, Khalid and
Declerck, Thierry and
Do{\u{g}}an, Mehmet U{\u{g}}ur and
Maegaard, Bente and
Mariani, Joseph and
Moreno, Asuncion and
Odijk, Jan and
Piperidis, Stelios",
booktitle = "Proceedings of the Eighth International Conference on Language Resources and Evaluation ({LREC}'12)",
month = may,
year = "2012",
address = "Istanbul, Turkey",
publisher = "European Language Resources Association (ELRA)",
url = "http://www.lrec-conf.org/proceedings/lrec2012/pdf/463_Paper.pdf",
pages = "2214--2218",
}