🚀 opus-mt-tc-big-en-gmq
opus-mt-tc-big-en-gmq是一款用于将英语(en)翻译成北日耳曼语系(gmq)的神经机器翻译模型,为多语言翻译提供便利。
🚀 快速开始
本模型是 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",
}
✨ 主要特性
- 支持多种北日耳曼语系语言的翻译,包括丹麦语、法罗语、冰岛语等。
- 作为多语言翻译模型,使用句子初始语言标记
>>id<<
(id为有效目标语言ID)来指定目标语言。
📦 安装指南
文档未提及安装步骤,可参考OPUS - MT项目相关说明进行安装。
💻 使用示例
基础用法
from transformers import MarianMTModel, MarianTokenizer
src_text = [
">>nno<< The United States borders Canada.",
">>nob<< This is the biggest hotel in this city."
]
model_name = "pytorch-models/opus-mt-tc-big-en-gmq"
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-gmq")
print(pipe(">>nno<< The United States borders Canada."))
📚 详细文档
模型信息
基准测试
语言对 |
测试集 |
chr - F |
BLEU |
句子数量 |
单词数量 |
eng - dan |
tatoeba - test - v2021 - 08 - 07 |
0.75165 |
61.6 |
10795 |
79385 |
eng - fao |
tatoeba - test - v2021 - 08 - 07 |
0.40395 |
18.3 |
294 |
1933 |
eng - isl |
tatoeba - test - v2021 - 08 - 07 |
0.59731 |
39.9 |
2503 |
19023 |
eng - nno |
tatoeba - test - v2021 - 08 - 07 |
0.61271 |
40.1 |
460 |
3428 |
eng - nob |
tatoeba - test - v2021 - 08 - 07 |
0.72380 |
57.3 |
4539 |
36119 |
eng - swe |
tatoeba - test - v2021 - 08 - 07 |
0.74197 |
60.9 |
10362 |
68067 |
eng - dan |
flores101 - devtest |
0.70810 |
47.7 |
1012 |
24638 |
eng - isl |
flores101 - devtest |
0.52076 |
24.1 |
1012 |
22834 |
eng - nob |
flores101 - devtest |
0.62760 |
34.5 |
1012 |
23873 |
eng - swe |
flores101 - devtest |
0.70129 |
46.9 |
1012 |
23121 |
eng - isl |
newsdev2021.en - is |
0.50376 |
22.6 |
2004 |
43721 |
eng - isl |
newstest2021.en - is |
0.50516 |
21.5 |
1000 |
25233 |
致谢
这项工作得到了以下项目的支持:
我们也感谢 CSC -- 芬兰科学信息技术中心 提供的慷慨计算资源和IT基础设施。
模型转换信息
属性 |
详情 |
transformers版本 |
4.16.2 |
OPUS - MT git哈希值 |
3405783 |
转换时间 |
Wed Apr 13 17:14:46 EEST 2022 |
转换机器 |
LM0 - 400 - 22516.local |
📄 许可证
本模型使用CC - BY - 4.0许可证。