Initial commit
Browse files- .gitattributes +1 -0
- README.md +198 -0
- benchmark_results.txt +14 -0
- benchmark_translations.zip +3 -0
- config.json +45 -0
- pytorch_model.bin +3 -0
- source.spm +3 -0
- special_tokens_map.json +1 -0
- target.spm +3 -0
- tokenizer_config.json +1 -0
- vocab.json +0 -0
.gitattributes
CHANGED
@@ -25,3 +25,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
25 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
25 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.spm filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- bat
|
4 |
+
- lt
|
5 |
+
- lv
|
6 |
+
- ru
|
7 |
+
- zle
|
8 |
+
|
9 |
+
tags:
|
10 |
+
- translation
|
11 |
+
|
12 |
+
license: cc-by-4.0
|
13 |
+
model-index:
|
14 |
+
- name: opus-mt-tc-base-zle-bat
|
15 |
+
results:
|
16 |
+
- task:
|
17 |
+
name: Translation rus-lav
|
18 |
+
type: translation
|
19 |
+
args: rus-lav
|
20 |
+
dataset:
|
21 |
+
name: flores101-devtest
|
22 |
+
type: flores_101
|
23 |
+
args: rus lav devtest
|
24 |
+
metrics:
|
25 |
+
- name: BLEU
|
26 |
+
type: bleu
|
27 |
+
value: 20.0
|
28 |
+
- task:
|
29 |
+
name: Translation rus-lit
|
30 |
+
type: translation
|
31 |
+
args: rus-lit
|
32 |
+
dataset:
|
33 |
+
name: flores101-devtest
|
34 |
+
type: flores_101
|
35 |
+
args: rus lit devtest
|
36 |
+
metrics:
|
37 |
+
- name: BLEU
|
38 |
+
type: bleu
|
39 |
+
value: 20.6
|
40 |
+
- task:
|
41 |
+
name: Translation ukr-lav
|
42 |
+
type: translation
|
43 |
+
args: ukr-lav
|
44 |
+
dataset:
|
45 |
+
name: flores101-devtest
|
46 |
+
type: flores_101
|
47 |
+
args: ukr lav devtest
|
48 |
+
metrics:
|
49 |
+
- name: BLEU
|
50 |
+
type: bleu
|
51 |
+
value: 21.4
|
52 |
+
- task:
|
53 |
+
name: Translation ukr-lit
|
54 |
+
type: translation
|
55 |
+
args: ukr-lit
|
56 |
+
dataset:
|
57 |
+
name: flores101-devtest
|
58 |
+
type: flores_101
|
59 |
+
args: ukr lit devtest
|
60 |
+
metrics:
|
61 |
+
- name: BLEU
|
62 |
+
type: bleu
|
63 |
+
value: 20.5
|
64 |
+
- task:
|
65 |
+
name: Translation rus-lav
|
66 |
+
type: translation
|
67 |
+
args: rus-lav
|
68 |
+
dataset:
|
69 |
+
name: tatoeba-test-v2021-08-07
|
70 |
+
type: tatoeba_mt
|
71 |
+
args: rus-lav
|
72 |
+
metrics:
|
73 |
+
- name: BLEU
|
74 |
+
type: bleu
|
75 |
+
value: 55.3
|
76 |
+
- task:
|
77 |
+
name: Translation rus-lit
|
78 |
+
type: translation
|
79 |
+
args: rus-lit
|
80 |
+
dataset:
|
81 |
+
name: tatoeba-test-v2021-08-07
|
82 |
+
type: tatoeba_mt
|
83 |
+
args: rus-lit
|
84 |
+
metrics:
|
85 |
+
- name: BLEU
|
86 |
+
type: bleu
|
87 |
+
value: 47.2
|
88 |
+
---
|
89 |
+
# opus-mt-tc-base-zle-bat
|
90 |
+
|
91 |
+
Neural machine translation model for translating from East Slavic languages (zle) to Baltic languages (bat).
|
92 |
+
|
93 |
+
This model is part of the [OPUS-MT project](https://github.com/Helsinki-NLP/Opus-MT), an effort to make neural machine translation models widely available and accessible for many languages in the world. All models are originally trained using the amazing framework of [Marian NMT](https://marian-nmt.github.io/), an efficient NMT implementation written in pure C++. The models have been converted to pyTorch using the transformers library by huggingface. Training data is taken from [OPUS](https://opus.nlpl.eu/) and training pipelines use the procedures of [OPUS-MT-train](https://github.com/Helsinki-NLP/Opus-MT-train).
|
94 |
+
|
95 |
+
* Publications: [OPUS-MT – Building open translation services for the World](https://aclanthology.org/2020.eamt-1.61/) and [The Tatoeba Translation Challenge – Realistic Data Sets for Low Resource and Multilingual MT](https://aclanthology.org/2020.wmt-1.139/) (Please, cite if you use this model.)
|
96 |
+
|
97 |
+
```
|
98 |
+
@inproceedings{tiedemann-thottingal-2020-opus,
|
99 |
+
title = "{OPUS}-{MT} {--} Building open translation services for the World",
|
100 |
+
author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
|
101 |
+
booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
|
102 |
+
month = nov,
|
103 |
+
year = "2020",
|
104 |
+
address = "Lisboa, Portugal",
|
105 |
+
publisher = "European Association for Machine Translation",
|
106 |
+
url = "https://aclanthology.org/2020.eamt-1.61",
|
107 |
+
pages = "479--480",
|
108 |
+
}
|
109 |
+
|
110 |
+
@inproceedings{tiedemann-2020-tatoeba,
|
111 |
+
title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
|
112 |
+
author = {Tiedemann, J{\"o}rg},
|
113 |
+
booktitle = "Proceedings of the Fifth Conference on Machine Translation",
|
114 |
+
month = nov,
|
115 |
+
year = "2020",
|
116 |
+
address = "Online",
|
117 |
+
publisher = "Association for Computational Linguistics",
|
118 |
+
url = "https://aclanthology.org/2020.wmt-1.139",
|
119 |
+
pages = "1174--1182",
|
120 |
+
}
|
121 |
+
```
|
122 |
+
|
123 |
+
## Model info
|
124 |
+
|
125 |
+
* Release: 2022-03-14
|
126 |
+
* source language(s): rus
|
127 |
+
* target language(s): lav lit
|
128 |
+
* valid target language labels: >>lav<< >>lit<<
|
129 |
+
* model: transformer-align
|
130 |
+
* data: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
|
131 |
+
* tokenization: SentencePiece (spm32k,spm32k)
|
132 |
+
* original model: [opusTCv20210807_transformer-align_2022-03-14.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-bat/opusTCv20210807_transformer-align_2022-03-14.zip)
|
133 |
+
* more information released models: [OPUS-MT zle-bat README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/zle-bat/README.md)
|
134 |
+
* more information about the model: [MarianMT](https://huggingface.co/docs/transformers/model_doc/marian)
|
135 |
+
|
136 |
+
This is a multilingual translation model with multiple target languages. A sentence initial language token is required in the form of `>>id<<` (id = valid target language ID), e.g. `>>lav<<`
|
137 |
+
|
138 |
+
## Usage
|
139 |
+
|
140 |
+
A short example code:
|
141 |
+
|
142 |
+
```python
|
143 |
+
from transformers import MarianMTModel, MarianTokenizer
|
144 |
+
|
145 |
+
src_text = [
|
146 |
+
">>lav<< Африка - колыбель человечества.",
|
147 |
+
">>lit<< Том — наш капітан."
|
148 |
+
]
|
149 |
+
|
150 |
+
model_name = "pytorch-models/opus-mt-tc-base-zle-bat"
|
151 |
+
tokenizer = MarianTokenizer.from_pretrained(model_name)
|
152 |
+
model = MarianMTModel.from_pretrained(model_name)
|
153 |
+
translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
|
154 |
+
|
155 |
+
for t in translated:
|
156 |
+
print( tokenizer.decode(t, skip_special_tokens=True) )
|
157 |
+
|
158 |
+
# expected output:
|
159 |
+
# Āfrika ir cilvēces šūpulis.
|
160 |
+
# Tomas yra mūsų kapitonas.
|
161 |
+
```
|
162 |
+
|
163 |
+
You can also use OPUS-MT models with the transformers pipelines, for example:
|
164 |
+
|
165 |
+
```python
|
166 |
+
from transformers import pipeline
|
167 |
+
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-base-zle-bat")
|
168 |
+
print(pipe(">>lav<< Африка - колыбель человечества."))
|
169 |
+
|
170 |
+
# expected output: Āfrika ir cilvēces šūpulis.
|
171 |
+
```
|
172 |
+
|
173 |
+
## Benchmarks
|
174 |
+
|
175 |
+
* test set translations: [opusTCv20210807_transformer-align_2022-03-14.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-bat/opusTCv20210807_transformer-align_2022-03-14.test.txt)
|
176 |
+
* test set scores: [opusTCv20210807_transformer-align_2022-03-14.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-bat/opusTCv20210807_transformer-align_2022-03-14.eval.txt)
|
177 |
+
* benchmark results: [benchmark_results.txt](benchmark_results.txt)
|
178 |
+
* benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
|
179 |
+
|
180 |
+
| langpair | testset | chr-F | BLEU | #sent | #words |
|
181 |
+
|----------|---------|-------|-------|-------|--------|
|
182 |
+
| rus-lav | tatoeba-test-v2021-08-07 | 0.74223 | 55.3 | 274 | 1518 |
|
183 |
+
| rus-lit | tatoeba-test-v2021-08-07 | 0.70795 | 47.2 | 3598 | 20662 |
|
184 |
+
| rus-lav | flores101-devtest | 0.50134 | 20.0 | 1012 | 22092 |
|
185 |
+
| rus-lit | flores101-devtest | 0.53732 | 20.6 | 1012 | 20695 |
|
186 |
+
| ukr-lav | flores101-devtest | 0.51379 | 21.4 | 1012 | 22092 |
|
187 |
+
| ukr-lit | flores101-devtest | 0.54085 | 20.5 | 1012 | 20695 |
|
188 |
+
|
189 |
+
## Acknowledgements
|
190 |
+
|
191 |
+
The work is supported by the [European Language Grid](https://www.european-language-grid.eu/) as [pilot project 2866](https://live.european-language-grid.eu/catalogue/#/resource/projects/2866), by the [FoTran project](https://www.helsinki.fi/en/researchgroups/natural-language-understanding-with-cross-lingual-grounding), funded by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 771113), and the [MeMAD project](https://memad.eu/), funded by the European Union’s Horizon 2020 Research and Innovation Programme under grant agreement No 780069. We are also grateful for the generous computational resources and IT infrastructure provided by [CSC -- IT Center for Science](https://www.csc.fi/), Finland.
|
192 |
+
|
193 |
+
## Model conversion info
|
194 |
+
|
195 |
+
* transformers version: 4.16.2
|
196 |
+
* OPUS-MT git hash: 1bdabf7
|
197 |
+
* port time: Wed Mar 23 22:11:57 EET 2022
|
198 |
+
* port machine: LM0-400-22516.local
|
benchmark_results.txt
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
rus-lav flores101-dev 0.49996 20.4 997 21381
|
2 |
+
rus-lit flores101-dev 0.53395 19.4 997 20018
|
3 |
+
rus-lav flores101-devtest 0.50134 20.0 1012 22092
|
4 |
+
rus-lit flores101-devtest 0.53732 20.6 1012 20695
|
5 |
+
ukr-lav flores101-devtest 0.51379 21.4 1012 22092
|
6 |
+
ukr-lit flores101-devtest 0.54085 20.5 1012 20695
|
7 |
+
ukr-lav flores101-dev 0.50854 22.0 997 21381
|
8 |
+
ukr-lit flores101-dev 0.53197 20.4 997 20018
|
9 |
+
rus-lav tatoeba-test-v2020-07-28 0.74223 55.3 274 1518
|
10 |
+
rus-lit tatoeba-test-v2020-07-28 0.73342 49.7 2500 14406
|
11 |
+
rus-lav tatoeba-test-v2021-03-30 0.73994 54.9 276 1531
|
12 |
+
rus-lit tatoeba-test-v2021-03-30 0.72190 48.8 5296 30476
|
13 |
+
rus-lav tatoeba-test-v2021-08-07 0.74223 55.3 274 1518
|
14 |
+
rus-lit tatoeba-test-v2021-08-07 0.70795 47.2 3598 20662
|
benchmark_translations.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:85a32651df1213207d2f3427026c481710e8c5e7d3beec928037274155391fa7
|
3 |
+
size 1968750
|
config.json
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"activation_dropout": 0.0,
|
3 |
+
"activation_function": "swish",
|
4 |
+
"architectures": [
|
5 |
+
"MarianMTModel"
|
6 |
+
],
|
7 |
+
"attention_dropout": 0.0,
|
8 |
+
"bad_words_ids": [
|
9 |
+
[
|
10 |
+
61955
|
11 |
+
]
|
12 |
+
],
|
13 |
+
"bos_token_id": 0,
|
14 |
+
"classifier_dropout": 0.0,
|
15 |
+
"d_model": 512,
|
16 |
+
"decoder_attention_heads": 8,
|
17 |
+
"decoder_ffn_dim": 2048,
|
18 |
+
"decoder_layerdrop": 0.0,
|
19 |
+
"decoder_layers": 6,
|
20 |
+
"decoder_start_token_id": 61955,
|
21 |
+
"decoder_vocab_size": 61956,
|
22 |
+
"dropout": 0.1,
|
23 |
+
"encoder_attention_heads": 8,
|
24 |
+
"encoder_ffn_dim": 2048,
|
25 |
+
"encoder_layerdrop": 0.0,
|
26 |
+
"encoder_layers": 6,
|
27 |
+
"eos_token_id": 24393,
|
28 |
+
"forced_eos_token_id": 24393,
|
29 |
+
"init_std": 0.02,
|
30 |
+
"is_encoder_decoder": true,
|
31 |
+
"max_length": 512,
|
32 |
+
"max_position_embeddings": 512,
|
33 |
+
"model_type": "marian",
|
34 |
+
"normalize_embedding": false,
|
35 |
+
"num_beams": 4,
|
36 |
+
"num_hidden_layers": 6,
|
37 |
+
"pad_token_id": 61955,
|
38 |
+
"scale_embedding": true,
|
39 |
+
"share_encoder_decoder_embeddings": true,
|
40 |
+
"static_position_embeddings": true,
|
41 |
+
"torch_dtype": "float16",
|
42 |
+
"transformers_version": "4.18.0.dev0",
|
43 |
+
"use_cache": true,
|
44 |
+
"vocab_size": 61956
|
45 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0f47c7a65452e0363678208928cf6f8d59f4754070aec656830813aa35fc35ff
|
3 |
+
size 215378499
|
source.spm
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4dea55300569b8892ec5874a69c0c09cc3455c523d7c465414b4ed83a5b6dcea
|
3 |
+
size 1019549
|
special_tokens_map.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"eos_token": "</s>", "unk_token": "<unk>", "pad_token": "<pad>"}
|
target.spm
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:107339f7b7525483951a3795ea4d12a2ac15a1337e5d4d04dddf95816ecd92ca
|
3 |
+
size 827768
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"source_lang": "zle", "target_lang": "bat", "unk_token": "<unk>", "eos_token": "</s>", "pad_token": "<pad>", "model_max_length": 512, "sp_model_kwargs": {}, "separate_vocabs": false, "special_tokens_map_file": null, "name_or_path": "marian-models/opusTCv20210807_transformer-align_2022-03-14/zle-bat", "tokenizer_class": "MarianTokenizer"}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|