英文

opus-mt-tc-big-ar-itc

目录

  • 模型详情
  • 用途
  • 风险、限制和偏见
  • 如何开始使用该模型
  • 训练
  • 评估
  • 引用信息
  • 致谢

模型详情

用于从阿拉伯语(ara)翻译成意大利语类(itc)的神经机器翻译模型。

这个模型是 OPUS-MT project 的一部分,它致力于使神经机器翻译模型在世界上的许多语言中得到广泛的应用和使用。所有模型最初都是使用令人惊叹的框架 Marian NMT 进行训练的,这是一个用纯C++编写的高效的NMT实现。这些模型已经使用huggingface的transformers库将其转换为pyTorch。训练数据来自 OPUS ,并且训练流程使用了 OPUS-MT-train 的过程。模型描述:

  • 开发者:芬兰赫尔辛基大学语言技术研究小组
  • 模型类型:翻译(transformer-big)
  • 发布日期:2022-07-28
  • 许可证:CC-BY-4.0
  • 语言:
    • 源语言:ara
    • 目标语言:cat fra glg ita por ron spa
    • 语言对:ara-cat ara-fra ara-glg ara-ita ara-por ara-ron ara-spa
    • 有效的目标语言标签:>>acf<< >>aoa<< >>arg<< >>ast<< >>cat<< >>cbk<< >>ccd<< >>cks<< >>cos<< >>cri<< >>crs<< >>dlm<< >>drc<< >>egl<< >>ext<< >>fab<< >>fax<< >>fra<< >>frc<< >>frm<< >>fro<< >>frp<< >>fur<< >>gcf<< >>gcr<< >>glg<< >>hat<< >>idb<< >>ist<< >>ita<< >>itk<< >>kea<< >>kmv<< >>lad<< >>lad_Latn<< >>lat<< >>lat_Latn<< >>lij<< >>lld<< >>lmo<< >>lou<< >>mcm<< >>mfe<< >>mol<< >>mwl<< >>mxi<< >>mzs<< >>nap<< >>nrf<< >>oci<< >>osc<< >>osp<< >>osp_Latn<< >>pap<< >>pcd<< >>pln<< >>pms<< >>pob<< >>por<< >>pov<< >>pre<< >>pro<< >>qbb<< >>qhr<< >>rcf<< >>rgn<< >>roh<< >>ron<< >>ruo<< >>rup<< >>ruq<< >>scf<< >>scn<< >>sdc<< >>sdn<< >>spa<< >>spq<< >>spx<< >>src<< >>srd<< >>sro<< >>tmg<< >>tvy<< >>vec<< >>vkp<< >>wln<< >>xfa<< >>xum<<
  • 原始模型: opusTCv20210807_transformer-big_2022-07-28.zip
  • 更多信息资源:

这是一个多语言翻译模型,具有多个目标语言。需要以表格形式提供句子的初始语言令牌,例如 >>id<< (id = 有效的目标语言ID),例如 >>fra<<

用途

此模型可用于翻译和文本生成。

风险、限制和偏见

内容警告:读者应注意,该模型是基于可能包含令人不安、冒犯并传递历史和当前刻板印象的各种公共数据集进行训练的。

大量研究已经探讨了语言模型的偏见和公正性问题(例如,参见 Sheng et al. (2021) Bender et al. (2021) )。

如何开始使用该模型

示例代码:

from transformers import MarianMTModel, MarianTokenizer

src_text = [
    ">>lat_Latn<< إيش إسمك؟",
    ">>por<< اليونان جميلة."
]

model_name = "pytorch-models/opus-mt-tc-big-ar-itc"
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:
#     Iulia: Tu nombre es?
#     A Grécia é linda.

您还可以使用transformers pipelines来使用OPUS-MT模型,例如:

from transformers import pipeline
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-ar-itc")
print(pipe(">>lat_Latn<< إيش إسمك؟"))

# expected output: Iulia: Tu nombre es?

训练

评估

langpair testset chr-F BLEU #sent #words
ara-fra tatoeba-test-v2021-08-07 0.57876 41.5 1569 11066
ara-ita tatoeba-test-v2021-08-07 0.66888 46.5 235 1495
ara-spa tatoeba-test-v2021-08-07 0.64686 47.2 1511 9708
ara-cat flores101-devtest 0.55670 28.7 1012 27304
ara-fra flores101-devtest 0.59715 33.4 1012 28343
ara-glg flores101-devtest 0.51898 23.5 1012 26582
ara-ita flores101-devtest 0.52523 22.3 1012 27306
ara-por flores101-devtest 0.58260 31.6 1012 26519
ara-ron flores101-devtest 0.51425 22.4 1012 26799
ara-spa flores101-devtest 0.50203 21.8 1012 29199

引用信息

@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",
}

致谢

这项工作得到 European Language Grid 的支持,由 pilot project 2866 提供,通过欧洲研究委员会(ERC)在欧洲联盟的“2020年地平线2020研究和创新计划”(授予协议编号771113)和 MeMAD project 提供,通过欧洲联盟的“2020年地平线2020研究和创新计划”(授予协议编号780069)提供。我们还对芬兰 CSC -- IT Center for Science 的慷慨提供的计算资源和IT基础设施表示感谢。

模型转换信息

  • transformers版本:4.16.2
  • OPUS-MT git哈希值:8b9f0b0
  • 转换时间:2022年8月13日,东欧夏令时间00:04:20
  • 转换机器:LM0-400-22516.local