Initial commit
Browse files- .gitattributes +1 -0
- README.md +196 -0
- benchmark_results.txt +17 -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,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- be
|
4 |
+
- de
|
5 |
+
- ru
|
6 |
+
- uk
|
7 |
+
- zle
|
8 |
+
|
9 |
+
tags:
|
10 |
+
- translation
|
11 |
+
|
12 |
+
license: cc-by-4.0
|
13 |
+
model-index:
|
14 |
+
- name: opus-mt-tc-big-zle-de
|
15 |
+
results:
|
16 |
+
- task:
|
17 |
+
name: Translation rus-deu
|
18 |
+
type: translation
|
19 |
+
args: rus-deu
|
20 |
+
dataset:
|
21 |
+
name: flores101-devtest
|
22 |
+
type: flores_101
|
23 |
+
args: rus deu devtest
|
24 |
+
metrics:
|
25 |
+
- name: BLEU
|
26 |
+
type: bleu
|
27 |
+
value: 26.1
|
28 |
+
- task:
|
29 |
+
name: Translation ukr-deu
|
30 |
+
type: translation
|
31 |
+
args: ukr-deu
|
32 |
+
dataset:
|
33 |
+
name: flores101-devtest
|
34 |
+
type: flores_101
|
35 |
+
args: ukr deu devtest
|
36 |
+
metrics:
|
37 |
+
- name: BLEU
|
38 |
+
type: bleu
|
39 |
+
value: 28.1
|
40 |
+
- task:
|
41 |
+
name: Translation bel-deu
|
42 |
+
type: translation
|
43 |
+
args: bel-deu
|
44 |
+
dataset:
|
45 |
+
name: tatoeba-test-v2021-08-07
|
46 |
+
type: tatoeba_mt
|
47 |
+
args: bel-deu
|
48 |
+
metrics:
|
49 |
+
- name: BLEU
|
50 |
+
type: bleu
|
51 |
+
value: 44.8
|
52 |
+
- task:
|
53 |
+
name: Translation rus-deu
|
54 |
+
type: translation
|
55 |
+
args: rus-deu
|
56 |
+
dataset:
|
57 |
+
name: tatoeba-test-v2021-08-07
|
58 |
+
type: tatoeba_mt
|
59 |
+
args: rus-deu
|
60 |
+
metrics:
|
61 |
+
- name: BLEU
|
62 |
+
type: bleu
|
63 |
+
value: 51.8
|
64 |
+
- task:
|
65 |
+
name: Translation ukr-deu
|
66 |
+
type: translation
|
67 |
+
args: ukr-deu
|
68 |
+
dataset:
|
69 |
+
name: tatoeba-test-v2021-08-07
|
70 |
+
type: tatoeba_mt
|
71 |
+
args: ukr-deu
|
72 |
+
metrics:
|
73 |
+
- name: BLEU
|
74 |
+
type: bleu
|
75 |
+
value: 54.7
|
76 |
+
- task:
|
77 |
+
name: Translation rus-deu
|
78 |
+
type: translation
|
79 |
+
args: rus-deu
|
80 |
+
dataset:
|
81 |
+
name: newstest2013
|
82 |
+
type: wmt-2013-news
|
83 |
+
args: rus-deu
|
84 |
+
metrics:
|
85 |
+
- name: BLEU
|
86 |
+
type: bleu
|
87 |
+
value: 25.2
|
88 |
+
---
|
89 |
+
# opus-mt-tc-big-zle-de
|
90 |
+
|
91 |
+
Neural machine translation model for translating from East Slavic languages (zle) to German (de).
|
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-19
|
126 |
+
* source language(s): bel rus ukr
|
127 |
+
* target language(s): deu
|
128 |
+
* model: transformer-big
|
129 |
+
* data: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
|
130 |
+
* tokenization: SentencePiece (spm32k,spm32k)
|
131 |
+
* original model: [opusTCv20210807_transformer-big_2022-03-19.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-deu/opusTCv20210807_transformer-big_2022-03-19.zip)
|
132 |
+
* more information released models: [OPUS-MT zle-deu README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/zle-deu/README.md)
|
133 |
+
|
134 |
+
## Usage
|
135 |
+
|
136 |
+
A short example code:
|
137 |
+
|
138 |
+
```python
|
139 |
+
from transformers import MarianMTModel, MarianTokenizer
|
140 |
+
|
141 |
+
src_text = [
|
142 |
+
"Это был по-настоящему прекрасный день.",
|
143 |
+
"Дождь кончился?"
|
144 |
+
]
|
145 |
+
|
146 |
+
model_name = "pytorch-models/opus-mt-tc-big-zle-de"
|
147 |
+
tokenizer = MarianTokenizer.from_pretrained(model_name)
|
148 |
+
model = MarianMTModel.from_pretrained(model_name)
|
149 |
+
translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
|
150 |
+
|
151 |
+
for t in translated:
|
152 |
+
print( tokenizer.decode(t, skip_special_tokens=True) )
|
153 |
+
|
154 |
+
# expected output:
|
155 |
+
# Es war ein wirklich schöner Tag.
|
156 |
+
# Ist der Regen vorbei?
|
157 |
+
```
|
158 |
+
|
159 |
+
You can also use OPUS-MT models with the transformers pipelines, for example:
|
160 |
+
|
161 |
+
```python
|
162 |
+
from transformers import pipeline
|
163 |
+
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-zle-de")
|
164 |
+
print(pipe("Это был по-настоящему прекрасный день."))
|
165 |
+
|
166 |
+
# expected output: Es war ein wirklich schöner Tag.
|
167 |
+
```
|
168 |
+
|
169 |
+
## Benchmarks
|
170 |
+
|
171 |
+
* test set translations: [opusTCv20210807_transformer-big_2022-03-19.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-deu/opusTCv20210807_transformer-big_2022-03-19.test.txt)
|
172 |
+
* test set scores: [opusTCv20210807_transformer-big_2022-03-19.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-deu/opusTCv20210807_transformer-big_2022-03-19.eval.txt)
|
173 |
+
* benchmark results: [benchmark_results.txt](benchmark_results.txt)
|
174 |
+
* benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
|
175 |
+
|
176 |
+
| langpair | testset | chr-F | BLEU | #sent | #words |
|
177 |
+
|----------|---------|-------|-------|-------|--------|
|
178 |
+
| bel-deu | tatoeba-test-v2021-08-07 | 0.63720 | 44.8 | 551 | 4182 |
|
179 |
+
| rus-deu | tatoeba-test-v2021-08-07 | 0.69768 | 51.8 | 12800 | 98842 |
|
180 |
+
| ukr-deu | tatoeba-test-v2021-08-07 | 0.70860 | 54.7 | 10319 | 64646 |
|
181 |
+
| bel-deu | flores101-devtest | 0.47052 | 12.9 | 1012 | 25094 |
|
182 |
+
| rus-deu | flores101-devtest | 0.56159 | 26.1 | 1012 | 25094 |
|
183 |
+
| ukr-deu | flores101-devtest | 0.57251 | 28.1 | 1012 | 25094 |
|
184 |
+
| rus-deu | newstest2012 | 0.49257 | 19.8 | 3003 | 72886 |
|
185 |
+
| rus-deu | newstest2013 | 0.54015 | 25.2 | 3000 | 63737 |
|
186 |
+
|
187 |
+
## Acknowledgements
|
188 |
+
|
189 |
+
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.
|
190 |
+
|
191 |
+
## Model conversion info
|
192 |
+
|
193 |
+
* transformers version: 4.16.2
|
194 |
+
* OPUS-MT git hash: 1bdabf7
|
195 |
+
* port time: Wed Mar 23 22:16:45 EET 2022
|
196 |
+
* port machine: LM0-400-22516.local
|
benchmark_results.txt
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
bel-deu flores101-dev 0.46864 12.9 997 24097
|
2 |
+
rus-deu flores101-dev 0.56335 26.6 997 24097
|
3 |
+
bel-deu flores101-devtest 0.47052 12.9 1012 25094
|
4 |
+
rus-deu flores101-devtest 0.56159 26.1 1012 25094
|
5 |
+
ukr-deu flores101-devtest 0.57251 28.1 1012 25094
|
6 |
+
ukr-deu flores101-dev 0.56286 27.7 997 24097
|
7 |
+
rus-deu newstest2012 0.49257 19.8 3003 72886
|
8 |
+
rus-deu newstest2013 0.54015 25.2 3000 63737
|
9 |
+
bel-deu tatoeba-test-v2020-07-28 0.63697 44.7 550 4175
|
10 |
+
rus-deu tatoeba-test-v2020-07-28 0.69789 52.1 10000 76302
|
11 |
+
ukr-deu tatoeba-test-v2020-07-28 0.70875 54.8 10000 62298
|
12 |
+
bel-deu tatoeba-test-v2021-03-30 0.63794 44.8 554 4203
|
13 |
+
rus-deu tatoeba-test-v2021-03-30 0.69829 51.9 11265 86251
|
14 |
+
ukr-deu tatoeba-test-v2021-03-30 0.70939 54.9 10174 63575
|
15 |
+
bel-deu tatoeba-test-v2021-08-07 0.63720 44.8 551 4182
|
16 |
+
rus-deu tatoeba-test-v2021-08-07 0.69768 51.8 12800 98842
|
17 |
+
ukr-deu tatoeba-test-v2021-08-07 0.70860 54.7 10319 64646
|
benchmark_translations.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2b7e8301d3288e3dbe8f235842b9c695b00f563a6df7cfd5460085eae431817d
|
3 |
+
size 4713981
|
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 |
+
61165
|
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": 61165,
|
21 |
+
"decoder_vocab_size": 61166,
|
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": 23528,
|
28 |
+
"forced_eos_token_id": 23528,
|
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": 61165,
|
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": 61166
|
45 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d04ff76f2947143a56689a164ebc3cbbb7362f58b0a8e25452a315be7f532fa4
|
3 |
+
size 603464707
|
source.spm
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ce6c0b9887274cbaef5320aec5db60c5afab66f983723ac4051aa68523f9032f
|
3 |
+
size 1008968
|
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:7c23b510033f9329f8f2c6200a5c8f2cedc03133690dbde920c0f4f14e6a8bda
|
3 |
+
size 823197
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"source_lang": "zle", "target_lang": "de", "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-19/zle-de", "tokenizer_class": "MarianTokenizer"}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|