🚀 大模型英文到阿拉伯文翻译模型(opus-mt-tc-big-en-ar)
这是一个用于将英文(en)翻译成阿拉伯文(ar)的神经机器翻译模型。它属于 [OPUS - MT 项目](https://github.com/Helsinki - NLP/Opus - MT) 的一部分,该项目致力于让神经机器翻译模型广泛可用,覆盖世界上多种语言。所有模型最初都使用 [Marian NMT](https://marian - nmt.github.io/) 这一出色的框架进行训练,这是一个用纯 C++ 编写的高效神经机器翻译实现。这些模型通过 huggingface 的 transformers 库转换为 pyTorch 格式。训练数据来自 OPUS,训练流程采用 [OPUS - MT - train](https://github.com/Helsinki - NLP/Opus - MT - train) 的方法。
- 相关出版物:[OPUS - MT – Building open translation services for the World](https://aclanthology.org/2020.eamt - 1.61/) 和 [The Tatoeba Translation Challenge – Realistic Data Sets for Low Resource and Multilingual MT](https://aclanthology.org/2020.wmt - 1.139/)(如果使用此模型,请引用)
@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",
}
🚀 快速开始
模型信息
属性 |
详情 |
模型类型 |
大模型英文到阿拉伯文翻译模型(transformer - big) |
训练数据 |
opusTCv20210807 + bt([来源](https://github.com/Helsinki - NLP/Tatoeba - Challenge)) |
发布日期 |
2022 - 02 - 25 |
源语言 |
英文(eng) |
目标语言 |
阿拉伯文(afb、ara) |
有效目标语言标签 |
>>afb<< >>ara<< |
分词方式 |
SentencePiece(spm32k,spm32k) |
原始模型 |
[opusTCv20210807 + bt_transformer - big_2022 - 02 - 25.zip](https://object.pouta.csc.fi/Tatoeba - MT - models/eng - ara/opusTCv20210807 + bt_transformer - big_2022 - 02 - 25.zip) |
更多已发布模型信息 |
[OPUS - MT eng - ara README](https://github.com/Helsinki - NLP/Tatoeba - Challenge/tree/master/models/eng - ara/README.md) |
更多模型相关信息 |
MarianMT |
这是一个支持多种目标语言的多语言翻译模型。需要在句子开头使用 >>id<<
形式的语言标记(id 为有效的目标语言 ID),例如 >>afb<<
。
模型转换信息
- transformers 版本:4.16.2
- OPUS - MT git 哈希值:3405783
- 转换时间:2022 年 4 月 13 日星期三 16:37:31 EEST
- 转换机器:LM0 - 400 - 22516.local
✨ 主要特性
- 基于先进的神经机器翻译技术,能够实现英文到阿拉伯文的高质量翻译。
- 属于 OPUS - MT 项目,借助该项目的资源和方法进行训练和优化。
- 支持多目标语言,通过特定的语言标记可以指定不同的目标语言。
📦 安装指南
文档未提及安装步骤,暂不提供相关内容。
💻 使用示例
基础用法
from transformers import MarianMTModel, MarianTokenizer
src_text = [
">>ara<< I can't help you because I'm busy.",
">>ara<< I have to write a letter. Do you have some paper?"
]
model_name = "pytorch - models/opus - mt - tc - big - en - ar"
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 - ar")
print(pipe(">>ara<< I can't help you because I'm busy."))
📚 详细文档
基准测试
- 测试集翻译结果:[opusTCv20210807 + bt_transformer - big_2022 - 02 - 25.test.txt](https://object.pouta.csc.fi/Tatoeba - MT - models/eng - ara/opusTCv20210807 + bt_transformer - big_2022 - 02 - 25.test.txt)
- 测试集得分:[opusTCv20210807 + bt_transformer - big_2022 - 02 - 25.eval.txt](https://object.pouta.csc.fi/Tatoeba - MT - models/eng - ara/opusTCv20210807 + bt_transformer - big_2022 - 02 - 25.eval.txt)
- 基准测试结果:benchmark_results.txt
- 基准测试输出:benchmark_translations.zip
语言对 |
测试集 |
chr - F |
BLEU |
句子数量 |
单词数量 |
eng - ara |
tatoeba - test - v2021 - 08 - 07 |
0.48813 |
19.8 |
10305 |
61356 |
eng - ara |
flores101 - devtest |
0.61154 |
29.4 |
1012 |
21357 |
eng - ara |
tico19 - test |
0.60075 |
30.0 |
2100 |
51339 |
致谢
这项工作得到了以下机构和项目的支持:
- [欧洲语言网格](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),由欧盟的“地平线 2020”研究与创新计划(资助协议编号 771113)下的欧洲研究理事会(ERC)资助。
- MeMAD 项目,由欧盟的“地平线 2020”研究与创新计划资助(资助协议编号 780069)。
同时,我们也感谢 芬兰科学信息技术中心(CSC) 提供的慷慨计算资源和 IT 基础设施。
📄 许可证
本模型使用的许可证为 CC - BY - 4.0。