用于从英语(en)翻译成韩语(ko)的神经机器翻译模型。
该模型是OPUS-MT 项目的一部分,该项目旨在为世界上多种语言提供广泛可用且易于获取的神经机器翻译模型。所有模型最初均使用Marian NMT这一出色的框架进行训练,Marian NMT 是一个用纯 C++编写的高效 NMT 实现。这些模型已通过 huggingface 的 transformers 库转换为 PyTorch 格式。训练数据取自OPUS,训练流程采用OPUS-MT-train的程序。 模型说明:
这是一个具有多种目标语言的多语言翻译模型。需要以 >>id<<(id = 有效的目标语言 ID)的形式在句首添加语言标记,例如 >><<
该模型可用于翻译和文本到文本生成任务。
内容警告:读者需注意,本模型基于多种公共数据集训练而成,这些数据可能包含令人不安、冒犯性的内容,并且可能传播历史及当前的刻板印象。
已有大量研究探讨了语言模型中的偏见和公平性问题(例如,参见 Sheng et al. (2021) 和 Bender et al. (2021))。
简短示例代码:
from transformers import MarianMTModel, MarianTokenizer
src_text = [
"2, 4, 6 etc. are even numbers.",
"Yes."
]
model_name = "pytorch-models/opus-mt-tc-big-en-ko"
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, 6 등은 짝수입니다.
# 그래您也可以通过 transformers 流水线使用 OPUS-MT 模型,例如:
from transformers import pipeline
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-en-ko")
print(pipe("2, 4, 6 etc. are even numbers."))
# expected output: 2, 4, 6 등은 짝수입니다.| 语言对 | 测试集 | 字符F值 | BLEU值 | 句子数 | 单词数 |
|---|
@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",
}本研究工作得到了欧洲语言网格(试点项目编号2866,详见https://live.european-language-grid.eu/catalogue/#/resource/projects/2866)、[FoTran项目](https://www.helsinki.fi/en/researchgroups/natural-language-understanding-with-cross-lingual-grounding)(由欧洲研究理事会(ERC)在欧盟“地平线2020”研究与创新计划资助,资助协议编号771113)以及[MeMAD项目](https://memad.eu/)(由欧盟“地平线2020”研究与创新计划资助,资助协议编号780069)的支持。我们同样感谢芬兰[CSC——科学IT中心](https://www.csc.fi/)提供的慷慨计算资源和IT基础设施。