韩语(ko)到英语(en)的神经机器翻译模型。
该模型是 OPUS-MT project 的一部分,旨在使神经机器翻译模型广泛可用和易于访问,服务于世界上的许多语言。所有模型最初都是使用令人惊叹的 Marian NMT 框架训练的,该框架是用纯 C++ 编写的高效 NMT 实现。这些模型已经使用 huggingface 的 transformers 库转换为 pyTorch。训练数据来自 OPUS ,训练流程使用 OPUS-MT-train 的程序。 模型描述:
该模型可用于翻译和文本生成。
内容警告:读者应注意,该模型是使用可能包含令人不安、冒犯的内容的各种公共数据集进行训练的,并且可能传播历史和现实中的刻板印象。
已经有大量研究探讨了语言模型的偏见和公平性问题(参见,例如, Sheng et al. (2021) 和 Bender et al. (2021) )。
简短的示例代码:
from transformers import MarianMTModel, MarianTokenizer
src_text = [
"2, 4, 6 등은 짝수이다.",
"네."
]
model_name = "pytorch-models/opus-mt-tc-big-ko-en"
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:
# 2, 4, and 6 are even.
# Yeah.
您也可以使用 transformers 框架进行 OPUS-MT 模型的操作,例如:
from transformers import pipeline
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-ko-en")
print(pipe("2, 4, 6 등은 짝수이다."))
# expected output: 2, 4, and 6 are even.
| langpair | testset | chr-F | BLEU | #sent | #words |
|---|---|---|---|---|---|
| kor-eng | tatoeba-test-v2021-08-07 | 0.58829 | 41.3 | 2400 | 17619 |
| kor-eng | flores101-devtest | 0.56615 | 27.7 | 1012 | 24721 |
@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 的一部分,由欧洲研究委员会(ERC)在欧洲联盟的Horizon 2020研究和创新计划下(资助协议号771113)以及欧洲联盟的Horizon 2020研究和创新计划下的资助,协议号780069的 MeMAD project 支持。我们还感谢芬兰的 CSC -- IT Center for Science 提供的慷慨计算资源和 IT 基础设施。