🚀 大型英語到拉脫維亞語翻譯模型(opus-mt-tc-big-en-lv)
這是一個用於將英語(en)翻譯成拉脫維亞語(lv)的神經機器翻譯模型。該模型屬於 [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 – 為世界構建開放翻譯服務](https://aclanthology.org/2020.eamt - 1.61/) 和 [塔託埃巴翻譯挑戰 – 低資源和多語言機器翻譯的現實數據集](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",
}
🚀 快速開始
本模型可用於將英語翻譯成拉脫維亞語,以下是使用示例。
✨ 主要特性
- 屬於 OPUS - MT 項目,致力於多語言翻譯。
- 基於 Marian NMT 框架訓練,後轉換為 PyTorch 格式。
- 訓練數據來自 OPUS,採用 OPUS - MT - train 的訓練流程。
📦 安裝指南
文檔未提及安裝步驟,暫不提供。
💻 使用示例
基礎用法
from transformers import MarianMTModel, MarianTokenizer
src_text = [
">>lav<< A day has twenty - four hours.",
">>ltg<< He's a good lawyer."
]
model_name = "pytorch - models/opus - mt - tc - big - en - lv"
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 - lv")
print(pipe(">>lav<< A day has twenty - four hours."))
📚 詳細文檔
模型信息
屬性 |
詳情 |
發佈時間 |
2022 - 03 - 13 |
源語言 |
英語(eng) |
目標語言 |
拉脫維亞語(lav) |
模型類型 |
大型變壓器模型(transformer - big) |
訓練數據 |
opusTCv20210807 + bt ([來源](https://github.com/Helsinki - NLP/Tatoeba - Challenge)) |
分詞方式 |
SentencePiece(spm32k, spm32k) |
原始模型 |
[opusTCv20210807 + bt_transformer - big_2022 - 03 - 13.zip](https://object.pouta.csc.fi/Tatoeba - MT - models/eng - lav/opusTCv20210807 + bt_transformer - big_2022 - 03 - 13.zip) |
更多信息 |
[OPUS - MT 英語到拉脫維亞語 README](https://github.com/Helsinki - NLP/Tatoeba - Challenge/tree/master/models/eng - lav/README.md) |
基準測試
- 測試集翻譯:[opusTCv20210807 + bt_transformer - big_2022 - 03 - 13.test.txt](https://object.pouta.csc.fi/Tatoeba - MT - models/eng - lav/opusTCv20210807 + bt_transformer - big_2022 - 03 - 13.test.txt)
- 測試集得分:[opusTCv20210807 + bt_transformer - big_2022 - 03 - 13.eval.txt](https://object.pouta.csc.fi/Tatoeba - MT - models/eng - lav/opusTCv20210807 + bt_transformer - big_2022 - 03 - 13.eval.txt)
- 基準測試結果:benchmark_results.txt
- 基準測試輸出:benchmark_translations.zip
語言對 |
測試集 |
字符 F 值 |
BLEU 得分 |
句子數量 |
單詞數量 |
英語 - 拉脫維亞語 |
tatoeba - test - v2021 - 08 - 07 |
0.66411 |
44.0 |
1631 |
9932 |
英語 - 拉脫維亞語 |
flores101 - devtest |
0.59397 |
30.1 |
1012 |
22092 |
英語 - 拉脫維亞語 |
newsdev2017 |
0.58082 |
28.9 |
2003 |
41503 |
英語 - 拉脫維亞語 |
newstest2017 |
0.53202 |
22.1 |
2001 |
39392 |
致謝
這項工作得到了以下項目和機構的支持:
- [歐洲語言網格](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),由歐洲研究理事會(ERC)在歐盟的“地平線 2020”研究與創新計劃(資助協議編號 771113)下資助。
- MeMAD 項目,由歐盟的“地平線 2020”研究與創新計劃資助(資助協議編號 780069)。
- 感謝 芬蘭科學信息技術中心(CSC) 提供的大量計算資源和 IT 基礎設施。
模型轉換信息
- transformers 版本:4.16.2
- OPUS - MT git 哈希值:3405783
- 轉換時間:2022 年 4 月 13 日星期三 17:36:04 EEST
- 轉換機器:LM0 - 400 - 22516.local
📄 許可證
本模型使用的許可證為 CC - BY - 4.0。