用于将巴斯克语(eu)翻译为意大利语族语言(itc)的神经机器翻译模型。
该模型是 OPUS-MT project 的一部分,旨在为世界上的多种语言提供广泛可用和可访问的神经机器翻译模型。所有模型最初都是使用 Marian NMT 的框架进行训练的,该框架是一个用纯C++编写的高效NMT实现。使用 transformers 库将模型转换为 pyTorch。训练数据来自于 OPUS ,训练流程使用了 OPUS-MT-train 的流程。模型描述:
这是一个具有多个目标语言的多语言翻译模型。需要以 >>id<< (id = 有效的目标语言ID) 的形式提供一个句子初始语言标记,例如 >>fra<<
该模型可用于翻译和文本生成。
内容警告:读者应注意,该模型是基于可能包含令人不安、冒犯和可能传播历史和现实刻板印象的各种公共数据集进行训练的。
大量研究探讨了语言模型的偏见和公平性问题(参见,例如, Sheng et al. (2021) 和 Bender et al. (2021) )。
一个简短的示例代码:
from transformers import MarianMTModel, MarianTokenizer
src_text = [
">>fra<< Aberatsa da.",
">>spa<< Zuzena?"
]
model_name = "pytorch-models/opus-mt-tc-big-eu-itc"
tokenizer = MarianTokenizer.from_pretrained(model_name)
model = MarianMTModel.from_pretrained(model_name)
translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
for t in translated:
print( tokenizer.decode(t, skip_special_tokens=True) )
# expected output:
# Il est riche.
# ¿Directo?
您也可以使用 transformers pipeline 使用 OPUS-MT 模型,例如:
from transformers import pipeline
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-eu-itc")
print(pipe(">>fra<< Aberatsa da."))
# expected output: Il est riche.
| langpair | testset | chr-F | BLEU | #sent | #words |
|---|---|---|---|---|---|
| eus-spa | tatoeba-test-v2021-08-07 | 0.68019 | 50.3 | 1850 | 12469 |
@inproceedings{tiedemann-thottingal-2020-opus,
title = "{OPUS}-{MT} {--} Building open translation services for the World",
author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
month = nov,
year = "2020",
address = "Lisboa, Portugal",
publisher = "European Association for Machine Translation",
url = "https://aclanthology.org/2020.eamt-1.61",
pages = "479--480",
}
@inproceedings{tiedemann-2020-tatoeba,
title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
author = {Tiedemann, J{\"o}rg},
booktitle = "Proceedings of the Fifth Conference on Machine Translation",
month = nov,
year = "2020",
address = "Online",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2020.wmt-1.139",
pages = "1174--1182",
}
该工作得到 European Language Grid 的支持,如 pilot project 2866 所述,获得了 FoTran project 的资助,该项目由欧洲研究理事会(ERC)在欧洲联盟的Horizon 2020研究和创新计划(授予协议号771113)下资助,并且由 MeMAD project 在欧洲联盟的Horizon 2020研究和创新计划(授予协议号780069)下资助。我们还感谢 CSC -- IT Center for Science 费尔干得的慷慨计算资源和IT基础设施。