Initial commit
Browse files- .gitattributes +1 -0
- README.md +209 -0
- benchmark_results.txt +16 -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,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- be
|
4 |
+
- es
|
5 |
+
- ru
|
6 |
+
- rue
|
7 |
+
- uk
|
8 |
+
- zle
|
9 |
+
|
10 |
+
tags:
|
11 |
+
- translation
|
12 |
+
|
13 |
+
license: cc-by-4.0
|
14 |
+
model-index:
|
15 |
+
- name: opus-mt-tc-big-zle-es
|
16 |
+
results:
|
17 |
+
- task:
|
18 |
+
name: Translation rus-spa
|
19 |
+
type: translation
|
20 |
+
args: rus-spa
|
21 |
+
dataset:
|
22 |
+
name: flores101-devtest
|
23 |
+
type: flores_101
|
24 |
+
args: rus spa devtest
|
25 |
+
metrics:
|
26 |
+
- name: BLEU
|
27 |
+
type: bleu
|
28 |
+
value: 22.5
|
29 |
+
- task:
|
30 |
+
name: Translation ukr-spa
|
31 |
+
type: translation
|
32 |
+
args: ukr-spa
|
33 |
+
dataset:
|
34 |
+
name: flores101-devtest
|
35 |
+
type: flores_101
|
36 |
+
args: ukr spa devtest
|
37 |
+
metrics:
|
38 |
+
- name: BLEU
|
39 |
+
type: bleu
|
40 |
+
value: 22.7
|
41 |
+
- task:
|
42 |
+
name: Translation bel-spa
|
43 |
+
type: translation
|
44 |
+
args: bel-spa
|
45 |
+
dataset:
|
46 |
+
name: tatoeba-test-v2021-08-07
|
47 |
+
type: tatoeba_mt
|
48 |
+
args: bel-spa
|
49 |
+
metrics:
|
50 |
+
- name: BLEU
|
51 |
+
type: bleu
|
52 |
+
value: 46.3
|
53 |
+
- task:
|
54 |
+
name: Translation rus-spa
|
55 |
+
type: translation
|
56 |
+
args: rus-spa
|
57 |
+
dataset:
|
58 |
+
name: tatoeba-test-v2021-08-07
|
59 |
+
type: tatoeba_mt
|
60 |
+
args: rus-spa
|
61 |
+
metrics:
|
62 |
+
- name: BLEU
|
63 |
+
type: bleu
|
64 |
+
value: 52.3
|
65 |
+
- task:
|
66 |
+
name: Translation ukr-spa
|
67 |
+
type: translation
|
68 |
+
args: ukr-spa
|
69 |
+
dataset:
|
70 |
+
name: tatoeba-test-v2021-08-07
|
71 |
+
type: tatoeba_mt
|
72 |
+
args: ukr-spa
|
73 |
+
metrics:
|
74 |
+
- name: BLEU
|
75 |
+
type: bleu
|
76 |
+
value: 51.6
|
77 |
+
- task:
|
78 |
+
name: Translation rus-spa
|
79 |
+
type: translation
|
80 |
+
args: rus-spa
|
81 |
+
dataset:
|
82 |
+
name: newstest2012
|
83 |
+
type: wmt-2012-news
|
84 |
+
args: rus-spa
|
85 |
+
metrics:
|
86 |
+
- name: BLEU
|
87 |
+
type: bleu
|
88 |
+
value: 29.0
|
89 |
+
- task:
|
90 |
+
name: Translation rus-spa
|
91 |
+
type: translation
|
92 |
+
args: rus-spa
|
93 |
+
dataset:
|
94 |
+
name: newstest2013
|
95 |
+
type: wmt-2013-news
|
96 |
+
args: rus-spa
|
97 |
+
metrics:
|
98 |
+
- name: BLEU
|
99 |
+
type: bleu
|
100 |
+
value: 31.7
|
101 |
+
---
|
102 |
+
# opus-mt-tc-big-zle-es
|
103 |
+
|
104 |
+
Neural machine translation model for translating from East Slavic languages (zle) to Spanish (es).
|
105 |
+
|
106 |
+
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).
|
107 |
+
|
108 |
+
* 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.)
|
109 |
+
|
110 |
+
```
|
111 |
+
@inproceedings{tiedemann-thottingal-2020-opus,
|
112 |
+
title = "{OPUS}-{MT} {--} Building open translation services for the World",
|
113 |
+
author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
|
114 |
+
booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
|
115 |
+
month = nov,
|
116 |
+
year = "2020",
|
117 |
+
address = "Lisboa, Portugal",
|
118 |
+
publisher = "European Association for Machine Translation",
|
119 |
+
url = "https://aclanthology.org/2020.eamt-1.61",
|
120 |
+
pages = "479--480",
|
121 |
+
}
|
122 |
+
|
123 |
+
@inproceedings{tiedemann-2020-tatoeba,
|
124 |
+
title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
|
125 |
+
author = {Tiedemann, J{\"o}rg},
|
126 |
+
booktitle = "Proceedings of the Fifth Conference on Machine Translation",
|
127 |
+
month = nov,
|
128 |
+
year = "2020",
|
129 |
+
address = "Online",
|
130 |
+
publisher = "Association for Computational Linguistics",
|
131 |
+
url = "https://aclanthology.org/2020.wmt-1.139",
|
132 |
+
pages = "1174--1182",
|
133 |
+
}
|
134 |
+
```
|
135 |
+
|
136 |
+
## Model info
|
137 |
+
|
138 |
+
* Release: 2022-03-23
|
139 |
+
* source language(s): bel rue rus ukr
|
140 |
+
* target language(s): spa
|
141 |
+
* model: transformer-big
|
142 |
+
* data: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
|
143 |
+
* tokenization: SentencePiece (spm32k,spm32k)
|
144 |
+
* original model: [opusTCv20210807_transformer-big_2022-03-23.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-spa/opusTCv20210807_transformer-big_2022-03-23.zip)
|
145 |
+
* more information released models: [OPUS-MT zle-spa README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/zle-spa/README.md)
|
146 |
+
|
147 |
+
## Usage
|
148 |
+
|
149 |
+
A short example code:
|
150 |
+
|
151 |
+
```python
|
152 |
+
from transformers import MarianMTModel, MarianTokenizer
|
153 |
+
|
154 |
+
src_text = [
|
155 |
+
"Том був п'яничкою.",
|
156 |
+
"Он достаточно взрослый, чтобы путешествовать одному."
|
157 |
+
]
|
158 |
+
|
159 |
+
model_name = "pytorch-models/opus-mt-tc-big-zle-es"
|
160 |
+
tokenizer = MarianTokenizer.from_pretrained(model_name)
|
161 |
+
model = MarianMTModel.from_pretrained(model_name)
|
162 |
+
translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
|
163 |
+
|
164 |
+
for t in translated:
|
165 |
+
print( tokenizer.decode(t, skip_special_tokens=True) )
|
166 |
+
|
167 |
+
# expected output:
|
168 |
+
# Tom era un borracho.
|
169 |
+
# Es lo suficientemente mayor como para viajar solo.
|
170 |
+
```
|
171 |
+
|
172 |
+
You can also use OPUS-MT models with the transformers pipelines, for example:
|
173 |
+
|
174 |
+
```python
|
175 |
+
from transformers import pipeline
|
176 |
+
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-zle-es")
|
177 |
+
print(pipe("Том був п'яничкою."))
|
178 |
+
|
179 |
+
# expected output: Tom era un borracho.
|
180 |
+
```
|
181 |
+
|
182 |
+
## Benchmarks
|
183 |
+
|
184 |
+
* test set translations: [opusTCv20210807_transformer-big_2022-03-23.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-spa/opusTCv20210807_transformer-big_2022-03-23.test.txt)
|
185 |
+
* test set scores: [opusTCv20210807_transformer-big_2022-03-23.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-spa/opusTCv20210807_transformer-big_2022-03-23.eval.txt)
|
186 |
+
* benchmark results: [benchmark_results.txt](benchmark_results.txt)
|
187 |
+
* benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
|
188 |
+
|
189 |
+
| langpair | testset | chr-F | BLEU | #sent | #words |
|
190 |
+
|----------|---------|-------|-------|-------|--------|
|
191 |
+
| bel-spa | tatoeba-test-v2021-08-07 | 0.65523 | 46.3 | 205 | 1412 |
|
192 |
+
| rus-spa | tatoeba-test-v2021-08-07 | 0.69933 | 52.3 | 10506 | 75246 |
|
193 |
+
| ukr-spa | tatoeba-test-v2021-08-07 | 0.68862 | 51.6 | 10115 | 59284 |
|
194 |
+
| bel-spa | flores101-devtest | 0.44744 | 14.1 | 1012 | 29199 |
|
195 |
+
| rus-spa | flores101-devtest | 0.50880 | 22.5 | 1012 | 29199 |
|
196 |
+
| ukr-spa | flores101-devtest | 0.50943 | 22.7 | 1012 | 29199 |
|
197 |
+
| rus-spa | newstest2012 | 0.55185 | 29.0 | 3003 | 79006 |
|
198 |
+
| rus-spa | newstest2013 | 0.56826 | 31.7 | 3000 | 70528 |
|
199 |
+
|
200 |
+
## Acknowledgements
|
201 |
+
|
202 |
+
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.
|
203 |
+
|
204 |
+
## Model conversion info
|
205 |
+
|
206 |
+
* transformers version: 4.16.2
|
207 |
+
* OPUS-MT git hash: 1bdabf7
|
208 |
+
* port time: Thu Mar 24 00:12:49 EET 2022
|
209 |
+
* port machine: LM0-400-22516.local
|
benchmark_results.txt
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
bel-spa flores101-dev 0.44353 13.7 997 27793
|
2 |
+
rus-spa flores101-dev 0.50556 22.3 997 27793
|
3 |
+
bel-spa flores101-devtest 0.44744 14.1 1012 29199
|
4 |
+
rus-spa flores101-devtest 0.50880 22.5 1012 29199
|
5 |
+
ukr-spa flores101-devtest 0.50943 22.7 1012 29199
|
6 |
+
ukr-spa flores101-dev 0.50342 22.6 997 27793
|
7 |
+
rus-spa newstest2012 0.55185 29.0 3003 79006
|
8 |
+
rus-spa newstest2013 0.56826 31.7 3000 70528
|
9 |
+
rus-spa tatoeba-test-v2020-07-28 0.69982 52.4 10000 71496
|
10 |
+
ukr-spa tatoeba-test-v2020-07-28 0.68800 51.6 10000 58486
|
11 |
+
bel-spa tatoeba-test-v2021-03-30 0.65745 46.6 207 1432
|
12 |
+
rus-spa tatoeba-test-v2021-03-30 0.69886 52.3 10272 73506
|
13 |
+
ukr-spa tatoeba-test-v2021-03-30 0.68810 51.6 10027 58644
|
14 |
+
bel-spa tatoeba-test-v2021-08-07 0.65523 46.3 205 1412
|
15 |
+
rus-spa tatoeba-test-v2021-08-07 0.69933 52.3 10506 75246
|
16 |
+
ukr-spa tatoeba-test-v2021-08-07 0.68862 51.6 10115 59284
|
benchmark_translations.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fa9d2950928ab0da418f7f585214b7f4fe0370ac83f81f8ade08ff4f9c0529c7
|
3 |
+
size 4379707
|
config.json
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"activation_dropout": 0.0,
|
3 |
+
"activation_function": "relu",
|
4 |
+
"architectures": [
|
5 |
+
"MarianMTModel"
|
6 |
+
],
|
7 |
+
"attention_dropout": 0.0,
|
8 |
+
"bad_words_ids": [
|
9 |
+
[
|
10 |
+
61514
|
11 |
+
]
|
12 |
+
],
|
13 |
+
"bos_token_id": 0,
|
14 |
+
"classifier_dropout": 0.0,
|
15 |
+
"d_model": 1024,
|
16 |
+
"decoder_attention_heads": 16,
|
17 |
+
"decoder_ffn_dim": 4096,
|
18 |
+
"decoder_layerdrop": 0.0,
|
19 |
+
"decoder_layers": 6,
|
20 |
+
"decoder_start_token_id": 61514,
|
21 |
+
"decoder_vocab_size": 61515,
|
22 |
+
"dropout": 0.1,
|
23 |
+
"encoder_attention_heads": 16,
|
24 |
+
"encoder_ffn_dim": 4096,
|
25 |
+
"encoder_layerdrop": 0.0,
|
26 |
+
"encoder_layers": 6,
|
27 |
+
"eos_token_id": 27248,
|
28 |
+
"forced_eos_token_id": 27248,
|
29 |
+
"init_std": 0.02,
|
30 |
+
"is_encoder_decoder": true,
|
31 |
+
"max_length": 512,
|
32 |
+
"max_position_embeddings": 1024,
|
33 |
+
"model_type": "marian",
|
34 |
+
"normalize_embedding": false,
|
35 |
+
"num_beams": 4,
|
36 |
+
"num_hidden_layers": 6,
|
37 |
+
"pad_token_id": 61514,
|
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": 61515
|
45 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8e6219feb66c8deefee4831b0f54be3760df7d9d64c11c87b1a9d8b404d59abd
|
3 |
+
size 604894915
|
source.spm
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:901ac323ea14a010b9685bc54e7404b46c6ee22244336dc4a97bb769a6fad9fa
|
3 |
+
size 1041183
|
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:4db22e29afbb2ce81168fea4841f1092886b0efd3e36b41fbbe399a05e6f39a9
|
3 |
+
size 829840
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"source_lang": "zle", "target_lang": "es", "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-big_2022-03-23/zle-es", "tokenizer_class": "MarianTokenizer"}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|