🚀 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 |