🚀 opus-mt-tc-big-en-pt
这是一个用于将英语(en)翻译成葡萄牙语(pt)的神经机器翻译模型。该模型能够为用户提供高效、准确的英葡翻译服务,在相关领域具有重要的应用价值。
🚀 快速开始
本模型是 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",
}
✨ 主要特性
- 这是一个具有多种目标语言的多语言翻译模型。
- 翻译效果良好,在不同测试集上有一定的 BLEU 得分。
📦 安装指南
文档未提及具体安装步骤,故跳过此章节。
💻 使用示例
基础用法
from transformers import MarianMTModel, MarianTokenizer
src_text = [
">>por<< Tom tried to stab me.",
">>por<< He has been to Hawaii several times."
]
model_name = "pytorch-models/opus-mt-tc-big-en-pt"
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-pt")
print(pipe(">>por<< Tom tried to stab me."))
📚 详细文档
模型信息
这是一个具有多种目标语言的多语言翻译模型,需要以 >>id<<
(id = 有效目标语言 ID)的形式使用句子初始语言标记,例如 >>pob<<
。
基准测试
语言对 |
测试集 |
chr - F |
BLEU |
句子数量 |
单词数量 |
eng - por |
tatoeba - test - v2021 - 08 - 07 |
0.69320 |
49.6 |
13222 |
105265 |
eng - por |
flores101 - devtest |
0.71673 |
50.4 |
1012 |
26519 |
致谢
这项工作得到了以下项目的支持:
- [欧洲语言网格](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
- 转换时间:Wed Apr 13 17:48:54 EEST 2022
- 转换机器:LM0 - 400 - 22516.local
📄 许可证
本模型使用的许可证为 cc - by - 4.0。