🚀 opus-mt-tc-big-en-cat_oci_spa
这是一个用于将英语(en)翻译成加泰罗尼亚语、奥克语和西班牙语(cat+oci+spa)的神经机器翻译模型。该模型属于OPUS-MT项目的一部分,旨在让神经机器翻译模型广泛适用于世界上多种语言。
🚀 快速开始
本模型是 OPUS-MT项目 的一部分,该项目致力于让神经机器翻译模型在世界上多种语言中广泛可用。所有模型最初都使用 Marian NMT 这一出色的框架进行训练,它是一个用纯C++编写的高效神经机器翻译实现。这些模型通过huggingface的transformers库转换为pyTorch格式。训练数据来自 OPUS,训练流程采用 OPUS-MT-train 的方法。
相关出版物:OPUS-MT – Building open translation services for the World 和 The Tatoeba Translation Challenge – Realistic Data Sets for Low Resource and Multilingual MT (如果使用此模型,请引用)。
@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格式。
- 训练数据来自OPUS,采用OPUS-MT-train的训练流程。
📦 安装指南
文档中未提及具体安装步骤,暂不提供。
💻 使用示例
基础用法
from transformers import MarianMTModel, MarianTokenizer
src_text = [
">>spa<< Why do you want Tom to go there with me?",
">>spa<< She forced him to eat spinach."
]
model_name = "pytorch-models/opus-mt-tc-big-en-cat_oci_spa"
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-cat_oci_spa")
print(pipe(">>spa<< Why do you want Tom to go there with me?"))
📚 详细文档
模型信息
这是一个支持多种目标语言的多语言翻译模型。需要以 >>id<<
(id = 有效目标语言ID)的形式提供句子初始语言标记,例如 >>cat<<
。
基准测试
语言对 |
测试集 |
chr-F |
BLEU |
句子数量 |
单词数量 |
eng-cat |
tatoeba-test-v2021-08-07 |
0.66414 |
47.8 |
1631 |
12344 |
eng-spa |
tatoeba-test-v2021-08-07 |
0.73725 |
57.0 |
16583 |
134710 |
eng-cat |
flores101-devtest |
0.66071 |
41.5 |
1012 |
27304 |
eng-oci |
flores101-devtest |
0.56192 |
25.4 |
1012 |
27305 |
eng-spa |
flores101-devtest |
0.56288 |
28.1 |
1012 |
29199 |
eng-spa |
newssyscomb2009 |
0.58431 |
31.4 |
502 |
12503 |
eng-spa |
news-test2008 |
0.56622 |
30.0 |
2051 |
52586 |
eng-spa |
newstest2009 |
0.57988 |
30.5 |
2525 |
68111 |
eng-spa |
newstest2010 |
0.62343 |
37.4 |
2489 |
65480 |
eng-spa |
newstest2011 |
0.62424 |
39.1 |
3003 |
79476 |
eng-spa |
newstest2012 |
0.63006 |
39.6 |
3003 |
79006 |
eng-spa |
newstest2013 |
0.60291 |
35.8 |
3000 |
70528 |
eng-spa |
tico19-test |
0.73224 |
52.5 |
2100 |
66563 |
🔧 技术细节
文档中未提及具体技术细节,暂不提供。
📄 许可证
本模型使用的许可证为 cc-by-4.0。
致谢
这项工作得到了 欧洲语言网格 作为 试点项目2866 的支持,以及 FoTran项目 的资助,该项目由欧盟的“地平线2020”研究和创新计划(资助协议编号771113)下的欧洲研究理事会(ERC)资助,还有 MeMAD项目 的资助,该项目由欧盟的“地平线2020”研究和创新计划(资助协议编号780069)资助。我们也感谢 芬兰CSC -- 科学信息技术中心 提供的慷慨计算资源和IT基础设施。
模型转换信息
属性 |
详情 |
transformers版本 |
4.16.2 |
OPUS-MT git哈希值 |
3405783 |
转换时间 |
Wed Apr 13 16:40:45 EEST 2022 |
转换机器 |
LM0-400-22516.local |