🚀 opus-mt-tc-big-zls-en
這是一個用於將南斯拉夫語系(zls)翻譯成英語(en)的神經機器翻譯模型。它是OPUS - MT項目的一部分,該項目致力於讓神經機器翻譯模型在全球多種語言中廣泛可用。
🚀 快速開始
此模型可用於將南斯拉夫語系的文本翻譯成英語。它基於OPUS - MT項目開發,利用Marian NMT框架進行訓練,並通過huggingface的transformers庫轉換為pyTorch模型。
✨ 主要特性
- 多語言支持:支持保加利亞語(bg)、波斯尼亞語(bs)、克羅地亞語(hr)、馬其頓語(mk)、塞爾維亞 - 克羅地亞語(sh)、斯洛文尼亞語(sl)、塞爾維亞語(sr)等南斯拉夫語系語言到英語的翻譯。
- 開源項目:作為OPUS - MT項目的一部分,遵循開放原則,便於研究和使用。
- 高效訓練:使用Marian NMT框架進行訓練,該框架用純C++編寫,訓練效率高。
📦 安裝指南
文檔未提及具體安裝步驟,暫不提供。
💻 使用示例
基礎用法
from transformers import MarianMTModel, MarianTokenizer
src_text = [
"Да не би случайно Том да остави Мери да кара колата?",
"Какво е времето днес?"
]
model_name = "pytorch-models/opus-mt-tc-big-zls-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) )
高級用法
from transformers import pipeline
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-zls-en")
print(pipe("Да не би случайно Том да остави Мери да кара колата?"))
📚 詳細文檔
模型信息
基準測試
語言對 |
測試集 |
chr - F |
BLEU |
句子數量 |
單詞數量 |
bos_Latn - eng |
tatoeba - test - v2021 - 08 - 07 |
0.79339 |
66.5 |
301 |
1826 |
bul - eng |
tatoeba - test - v2021 - 08 - 07 |
0.72656 |
59.3 |
10000 |
71872 |
hbs - eng |
tatoeba - test - v2021 - 08 - 07 |
0.71783 |
57.3 |
10017 |
68934 |
hrv - eng |
tatoeba - test - v2021 - 08 - 07 |
0.74066 |
59.2 |
1480 |
10620 |
mkd - eng |
tatoeba - test - v2021 - 08 - 07 |
0.70043 |
57.4 |
10010 |
65667 |
slv - eng |
tatoeba - test - v2021 - 08 - 07 |
0.39534 |
23.5 |
2495 |
16940 |
srp_Cyrl - eng |
tatoeba - test - v2021 - 08 - 07 |
0.67628 |
47.0 |
1580 |
10181 |
srp_Latn - eng |
tatoeba - test - v2021 - 08 - 07 |
0.71878 |
58.5 |
6656 |
46307 |
bul - eng |
flores101 - devtest |
0.67375 |
42.0 |
1012 |
24721 |
hrv - eng |
flores101 - devtest |
0.63914 |
37.1 |
1012 |
24721 |
mkd - eng |
flores101 - devtest |
0.67444 |
43.2 |
1012 |
24721 |
slv - eng |
flores101 - devtest |
0.62087 |
35.2 |
1012 |
24721 |
srp_Cyrl - eng |
flores101 - devtest |
0.67810 |
36.8 |
1012 |
24721 |
測試集翻譯:opusTCv20210807+bt_transformer-big_2022-03-17.test.txt
測試集得分:opusTCv20210807+bt_transformer-big_2022-03-17.eval.txt
基準測試結果:benchmark_results.txt
基準測試輸出:benchmark_translations.zip
🔧 技術細節
此模型最初使用Marian NMT框架進行訓練,該框架是一個用純C++編寫的高效NMT實現。之後,使用huggingface的transformers庫將模型轉換為pyTorch模型。訓練數據來自OPUS,訓練流程遵循OPUS - MT - train的程序。
📄 許可證
該模型遵循CC - BY - 4.0許可證。
引用說明
如果使用此模型,請引用以下出版物:
@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",
}
致謝
本工作得到了以下項目的支持:
同時,感謝CSC -- IT Center for Science(芬蘭)提供的計算資源和IT基礎設施。
模型轉換信息
- transformers版本:4.16.2
- OPUS - MT git哈希值:3405783
- 轉換時間:Wed Apr 13 20:12:26 EEST 2022
- 轉換機器:LM0 - 400 - 22516.local