英文

opus-mt-tc-big-it-en

神经机器翻译模型,用于从意大利语(it)翻译到英语(en)。

该模型是 OPUS-MT project 的一部分,旨在为世界上许多语言提供广泛可用且易于访问的神经机器翻译模型。所有模型都是使用 Marian NMT 的出色框架训练的,该框架是用纯C++编写的高效NMT实现。通过huggingface的transformers库将模型转换为pyTorch。训练数据来自 OPUS ,并且训练流程使用了 OPUS-MT-train 的方法

@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",
}

模型信息

用法

简短的示例代码:

from transformers import MarianMTModel, MarianTokenizer

src_text = [
    "So chi è il mio nemico.",
    "Tom è illetterato; non capisce assolutamente nulla."
]

model_name = "pytorch-models/opus-mt-tc-big-it-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:
#     I know who my enemy is.
#     Tom is illiterate; he understands absolutely nothing.

您还可以使用transformers的pipelines来使用OPUS-MT模型,例如:

from transformers import pipeline
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-it-en")
print(pipe("So chi è il mio nemico."))

# expected output: I know who my enemy is.

基准测试

langpair testset chr-F BLEU #sent #words
ita-eng tatoeba-test-v2021-08-07 0.82288 72.1 17320 119214
ita-eng flores101-devtest 0.62115 32.8 1012 24721
ita-eng newssyscomb2009 0.59822 34.4 502 11818
ita-eng newstest2009 0.59646 34.3 2525 65399

鸣谢

该工作得到 European Language Grid 的支持,由 pilot project 2866 FoTran project 资助,该计划是欧洲研究理事会(ERC)在欧洲联盟的Horizon 2020研究和创新计划(授权协议号771113)下资助的,以及由欧洲联盟的Horizon 2020研究和创新计划(授权协议号780069)和 MeMAD project 资助的。我们还感谢 CSC -- IT Center for Science 芬兰提供的慷慨计算资源和IT基础设施。

模型转换信息

  • transformers版本:4.16.2
  • OPUS-MT git hash:3405783
  • 转换时间:Wed Apr 13 19:40:08 EEST 2022
  • 转换机器:LM0-400-22516.local