HuggingFace镜像/opus-mt-tc-big-ar-en
模型介绍文件和版本分析
下载使用量0

opus-mt-tc-big-ar-en

用于从阿拉伯语(ar)翻译到英语(en)的神经机器翻译模型。

该模型是OPUS-MT 项目的一部分,该项目旨在为世界上多种语言提供广泛可用且易于获取的神经机器翻译模型。所有模型最初均使用出色的 Marian NMT 框架进行训练,这是一个用纯 C++ 编写的高效 NMT 实现。这些模型已通过 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",
}

模型信息

  • 发布时间:2022-03-09
  • 源语言:afb ara arz
  • 目标语言:eng
  • 模型:transformer-big
  • 数据:opusTCv20210807+bt(来源)
  • 分词:SentencePiece(spm32k,spm32k)
  • 原始模型:opusTCv20210807+bt_transformer-big_2022-03-09.zip
  • 更多已发布模型信息:OPUS-MT ara-eng README

使用方法

一段简短的示例代码:

from transformers import MarianMTModel, MarianTokenizer

src_text = [
    "اتبع قلبك فحسب.",
    "وين راهي دّوش؟"
]

model_name = "pytorch-models/opus-mt-tc-big-ar-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) )

# expected output:
#     Just follow your heart.
#     Wayne Rahi Dosh?

您也可以通过 transformers 流水线使用 OPUS-MT 模型,例如:

from transformers import pipeline
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-ar-en")
print(pipe("اتبع قلبك فحسب."))

# expected output: Just follow your heart.

基准测试

  • 测试集翻译:opusTCv20210807+bt_transformer-big_2022-03-09.test.txt
  • 测试集分数:opusTCv20210807+bt_transformer-big_2022-03-09.eval.txt
  • 基准测试结果:benchmark_results.txt
  • 基准测试输出:benchmark_translations.zip
语言对测试集字符F值BLEU值句子数单词数
ara-engtatoeba-test-v2021-08-070.6347747.31030576975
ara-engflores101-devtest0.6698742.6101224721
ara-engtico19-test0.6852144.4210056323

致谢

本研究得到了欧洲语言网格(试点项目 2866,参见https://live.european-language-grid.eu/catalogue/#/resource/projects/2866)、FoTran 项目(由欧洲研究理事会(ERC)在欧盟“地平线 2020”研究与创新计划资助,资助协议编号 771113)以及MeMAD 项目(由欧盟“地平线 2020”研究与创新计划资助,资助协议编号 780069)的支持。我们同样感谢芬兰CSC——科学 IT 中心提供的慷慨计算资源和 IT 基础设施。

模型转换信息

  • transformers 版本:4.16.2
  • OPUS-MT git 哈希值:3405783
  • 转换时间:2022 年 4 月 13 日星期三 18:17:57 东欧夏令时间
  • 转换机器:LM0-400-22516.local