🚀 opus-mt-tc-big-zle-de
这是一个用于将东斯拉夫语(zle)翻译成德语(de)的神经机器翻译模型。本模型是 [OPUS - MT 项目](https://github.com/Helsinki - NLP/Opus - MT) 的一部分,该项目致力于让神经机器翻译模型广泛可用,覆盖世界上众多语言。所有模型最初都使用 [Marian NMT](https://marian - nmt.github.io/) 这一出色的框架进行训练,它是一个用纯 C++ 编写的高效神经机器翻译实现。这些模型通过 huggingface 的 transformers 库转换为 PyTorch 格式。训练数据来自 OPUS,训练流程遵循 [OPUS - MT - train](https://github.com/Helsinki - NLP/Opus - MT - train) 的程序。
- 相关出版物:[OPUS - MT – Building open translation services for the World](https://aclanthology.org/2020.eamt - 1.61/) 和 [The Tatoeba Translation Challenge – Realistic Data Sets for Low Resource and Multilingual MT](https://aclanthology.org/2020.wmt - 1.139/)(如果使用此模型,请引用这些文献)
@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",
}
📚 详细文档
模型信息
属性 |
详情 |
发布时间 |
2022 - 03 - 19 |
源语言 |
白俄罗斯语(bel)、俄语(rus)、乌克兰语(ukr) |
目标语言 |
德语(deu) |
模型类型 |
transformer - big |
训练数据 |
opusTCv20210807 ([来源](https://github.com/Helsinki - NLP/Tatoeba - Challenge)) |
分词方式 |
SentencePiece (spm32k,spm32k) |
原始模型 |
[opusTCv20210807_transformer - big_2022 - 03 - 19.zip](https://object.pouta.csc.fi/Tatoeba - MT - models/zle - deu/opusTCv20210807_transformer - big_2022 - 03 - 19.zip) |
更多模型信息 |
[OPUS - MT zle - deu README](https://github.com/Helsinki - NLP/Tatoeba - Challenge/tree/master/models/zle - deu/README.md) |
支持语言
- 白俄罗斯语(be)
- 德语(de)
- 俄语(ru)
- 乌克兰语(uk)
- 东斯拉夫语(zle)
标签
许可证
本模型使用 CC - BY - 4.0 许可证。
模型索引
本模型在不同数据集上的翻译任务表现如下:
任务名称 |
数据集 |
BLEU值 |
俄语到德语翻译(Translation rus - deu) |
flores101 - devtest |
26.1 |
乌克兰语到德语翻译(Translation ukr - deu) |
flores101 - devtest |
28.1 |
白俄罗斯语到德语翻译(Translation bel - deu) |
tatoeba - test - v2021 - 08 - 07 |
44.8 |
俄语到德语翻译(Translation rus - deu) |
tatoeba - test - v2021 - 08 - 07 |
51.8 |
乌克兰语到德语翻译(Translation ukr - deu) |
tatoeba - test - v2021 - 08 - 07 |
54.7 |
俄语到德语翻译(Translation rus - deu) |
newstest2013 |
25.2 |
💻 使用示例
基础用法
from transformers import MarianMTModel, MarianTokenizer
src_text = [
"Это был по-настоящему прекрасный день.",
"Дождь кончился?"
]
model_name = "pytorch-models/opus-mt-tc-big-zle-de"
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) )
高级用法
你也可以使用 transformers 的管道来使用 OPUS - MT 模型,示例如下:
from transformers import pipeline
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-zle-de")
print(pipe("Это был по-настоящему прекрасный день."))
🔍 基准测试
- 测试集翻译结果:[opusTCv20210807_transformer - big_2022 - 03 - 19.test.txt](https://object.pouta.csc.fi/Tatoeba - MT - models/zle - deu/opusTCv20210807_transformer - big_2022 - 03 - 19.test.txt)
- 测试集得分:[opusTCv20210807_transformer - big_2022 - 03 - 19.eval.txt](https://object.pouta.csc.fi/Tatoeba - MT - models/zle - deu/opusTCv20210807_transformer - big_2022 - 03 - 19.eval.txt)
- 基准测试结果:benchmark_results.txt
- 基准测试输出:benchmark_translations.zip
语言对 |
测试集 |
chr - F |
BLEU |
句子数量 |
单词数量 |
bel - deu |
tatoeba - test - v2021 - 08 - 07 |
0.63720 |
44.8 |
551 |
4182 |
rus - deu |
tatoeba - test - v2021 - 08 - 07 |
0.69768 |
51.8 |
12800 |
98842 |
ukr - deu |
tatoeba - test - v2021 - 08 - 07 |
0.70860 |
54.7 |
10319 |
64646 |
bel - deu |
flores101 - devtest |
0.47052 |
12.9 |
1012 |
25094 |
rus - deu |
flores101 - devtest |
0.56159 |
26.1 |
1012 |
25094 |
ukr - deu |
flores101 - devtest |
0.57251 |
28.1 |
1012 |
25094 |
rus - deu |
newstest2012 |
0.49257 |
19.8 |
3003 |
72886 |
rus - deu |
newstest2013 |
0.54015 |
25.2 |
3000 |
63737 |
🙏 致谢
本工作得到了以下项目和机构的支持:
- [欧洲语言网格](https://www.european - language - grid.eu/) 的 [试点项目 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),由欧盟的“地平线 2020”研究和创新计划(资助协议编号 771113)下的欧洲研究理事会(ERC)资助。
- MeMAD 项目,由欧盟的“地平线 2020”研究和创新计划(资助协议编号 780069)资助。
我们也感谢 CSC -- 芬兰科学信息技术中心 提供的慷慨计算资源和 IT 基础设施。
🛠️ 模型转换信息
- transformers 版本:4.16.2
- OPUS - MT git 哈希值:1bdabf7
- 转换时间:2022 年 3 月 23 日星期三 22:16:45 EET
- 转换机器:LM0 - 400 - 22516.local