🚀 opus-mt-tc-big-en-hu
opus-mt-tc-big-en-hu 是一个用于将英语(en)翻译成匈牙利语(hu)的神经机器翻译模型。它属于 OPUS-MT 项目 的一部分,该项目致力于让神经机器翻译模型在全球多种语言中广泛可用且易于获取。所有模型最初都使用 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",
}
✨ 主要特性
- 支持英语到匈牙利语的神经机器翻译。
- 属于 OPUS-MT 项目,依托强大的开源社区和资源。
- 使用 Marian NMT 框架训练,转换为 pyTorch 格式方便使用。
📦 安装指南
文档未提供安装步骤,跳过该章节。
💻 使用示例
基础用法
from transformers import MarianMTModel, MarianTokenizer
src_text = [
"I wish I hadn't seen such a horrible film.",
"She's at school."
]
model_name = "pytorch-models/opus-mt-tc-big-en-hu"
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) )
高级用法
from transformers import pipeline
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-en-hu")
print(pipe("I wish I hadn't seen such a horrible film."))
📚 详细文档
模型信息
基准测试
语言对 |
测试集 |
chr-F |
BLEU |
句子数量 |
单词数量 |
eng-hun |
tatoeba-test-v2021-08-07 |
0.62096 |
38.7 |
13037 |
79562 |
eng-hun |
flores101-devtest |
0.60159 |
29.6 |
1012 |
22183 |
eng-hun |
newssyscomb2009 |
0.51918 |
20.6 |
502 |
9733 |
eng-hun |
newstest2009 |
0.50973 |
20.3 |
2525 |
54965 |
致谢
这项工作得到了以下项目和机构的支持:
我们也感谢 CSC -- 芬兰科学信息技术中心 提供的慷慨计算资源和 IT 基础设施。
模型转换信息
- transformers 版本:4.16.2
- OPUS-MT git 哈希值:3405783
- 转换时间:2022 年 4 月 13 日星期三 17:21:20 EEST
- 转换机器:LM0-400-22516.local
📄 许可证
本模型使用的许可证为 cc-by-4.0。