🚀 opus-mt-tc-big-sh-en
这是一个用于从塞尔维亚-克罗地亚语(sh)翻译到英语(en)的神经机器翻译模型。该模型是 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 = [
"Ispostavilo se da je istina.",
"Ovaj vikend imamo besplatne pozive."
]
model_name = "pytorch-models/opus-mt-tc-big-sh-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) )
高级用法
from transformers import pipeline
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-sh-en")
print(pipe("Ispostavilo se da je istina."))
📚 详细文档
模型信息
基准测试
语言对 |
测试集 |
字符 F 值 |
BLEU 值 |
句子数量 |
单词数量 |
bos_Latn - eng |
tatoeba - test - v2021 - 08 - 07 |
0.80010 |
66.5 |
301 |
1826 |
hbs - eng |
tatoeba - test - v2021 - 08 - 07 |
0.71744 |
56.4 |
10017 |
68934 |
hrv - eng |
tatoeba - test - v2021 - 08 - 07 |
0.73563 |
58.8 |
1480 |
10620 |
srp_Cyrl - eng |
tatoeba - test - v2021 - 08 - 07 |
0.68248 |
44.7 |
1580 |
10181 |
srp_Latn - eng |
tatoeba - test - v2021 - 08 - 07 |
0.71781 |
58.4 |
6656 |
46307 |
hrv - eng |
flores101 - devtest |
0.63948 |
37.1 |
1012 |
24721 |
致谢
这项工作得到了以下项目的支持:
- [欧洲语言网格](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),由欧洲研究理事会(ERC)在欧盟的“地平线 2020”研究和创新计划(资助协议编号 771113)下资助。
- MeMAD 项目,由欧盟的“地平线 2020”研究和创新计划资助,资助协议编号 780069。
我们也感谢 芬兰科学信息技术中心(CSC) 提供的慷慨计算资源和 IT 基础设施。
模型转换信息
- transformers 版本:4.16.2
- OPUS - MT git 哈希值:3405783
- 转换时间:2022 年 4 月 13 日星期三 19:21:10 EEST
- 转换机器:LM0 - 400 - 22516.local
📄 许可证
本模型采用 CC - BY - 4.0 许可证。