tiedeman commited on
Commit
2c511d9
1 Parent(s): 214e8c1

Initial commit

Browse files
.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,316 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - be
4
+ - en
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-en-zle
15
+ results:
16
+ - task:
17
+ name: Translation eng-rus
18
+ type: translation
19
+ args: eng-rus
20
+ dataset:
21
+ name: flores101-devtest
22
+ type: flores_101
23
+ args: eng rus devtest
24
+ metrics:
25
+ - name: BLEU
26
+ type: bleu
27
+ value: 32.7
28
+ - task:
29
+ name: Translation eng-ukr
30
+ type: translation
31
+ args: eng-ukr
32
+ dataset:
33
+ name: flores101-devtest
34
+ type: flores_101
35
+ args: eng ukr devtest
36
+ metrics:
37
+ - name: BLEU
38
+ type: bleu
39
+ value: 32.1
40
+ - task:
41
+ name: Translation eng-bel
42
+ type: translation
43
+ args: eng-bel
44
+ dataset:
45
+ name: tatoeba-test-v2021-08-07
46
+ type: tatoeba_mt
47
+ args: eng-bel
48
+ metrics:
49
+ - name: BLEU
50
+ type: bleu
51
+ value: 24.9
52
+ - task:
53
+ name: Translation eng-rus
54
+ type: translation
55
+ args: eng-rus
56
+ dataset:
57
+ name: tatoeba-test-v2021-08-07
58
+ type: tatoeba_mt
59
+ args: eng-rus
60
+ metrics:
61
+ - name: BLEU
62
+ type: bleu
63
+ value: 45.5
64
+ - task:
65
+ name: Translation eng-ukr
66
+ type: translation
67
+ args: eng-ukr
68
+ dataset:
69
+ name: tatoeba-test-v2021-08-07
70
+ type: tatoeba_mt
71
+ args: eng-ukr
72
+ metrics:
73
+ - name: BLEU
74
+ type: bleu
75
+ value: 37.7
76
+ - task:
77
+ name: Translation eng-rus
78
+ type: translation
79
+ args: eng-rus
80
+ dataset:
81
+ name: tico19-test
82
+ type: tico19-test
83
+ args: eng-rus
84
+ metrics:
85
+ - name: BLEU
86
+ type: bleu
87
+ value: 33.7
88
+ - task:
89
+ name: Translation eng-rus
90
+ type: translation
91
+ args: eng-rus
92
+ dataset:
93
+ name: newstest2012
94
+ type: wmt-2012-news
95
+ args: eng-rus
96
+ metrics:
97
+ - name: BLEU
98
+ type: bleu
99
+ value: 36.8
100
+ - task:
101
+ name: Translation eng-rus
102
+ type: translation
103
+ args: eng-rus
104
+ dataset:
105
+ name: newstest2013
106
+ type: wmt-2013-news
107
+ args: eng-rus
108
+ metrics:
109
+ - name: BLEU
110
+ type: bleu
111
+ value: 26.9
112
+ - task:
113
+ name: Translation eng-rus
114
+ type: translation
115
+ args: eng-rus
116
+ dataset:
117
+ name: newstest2014
118
+ type: wmt-2014-news
119
+ args: eng-rus
120
+ metrics:
121
+ - name: BLEU
122
+ type: bleu
123
+ value: 43.5
124
+ - task:
125
+ name: Translation eng-rus
126
+ type: translation
127
+ args: eng-rus
128
+ dataset:
129
+ name: newstest2015
130
+ type: wmt-2015-news
131
+ args: eng-rus
132
+ metrics:
133
+ - name: BLEU
134
+ type: bleu
135
+ value: 34.9
136
+ - task:
137
+ name: Translation eng-rus
138
+ type: translation
139
+ args: eng-rus
140
+ dataset:
141
+ name: newstest2016
142
+ type: wmt-2016-news
143
+ args: eng-rus
144
+ metrics:
145
+ - name: BLEU
146
+ type: bleu
147
+ value: 33.1
148
+ - task:
149
+ name: Translation eng-rus
150
+ type: translation
151
+ args: eng-rus
152
+ dataset:
153
+ name: newstest2017
154
+ type: wmt-2017-news
155
+ args: eng-rus
156
+ metrics:
157
+ - name: BLEU
158
+ type: bleu
159
+ value: 37.3
160
+ - task:
161
+ name: Translation eng-rus
162
+ type: translation
163
+ args: eng-rus
164
+ dataset:
165
+ name: newstest2018
166
+ type: wmt-2018-news
167
+ args: eng-rus
168
+ metrics:
169
+ - name: BLEU
170
+ type: bleu
171
+ value: 32.9
172
+ - task:
173
+ name: Translation eng-rus
174
+ type: translation
175
+ args: eng-rus
176
+ dataset:
177
+ name: newstest2019
178
+ type: wmt-2019-news
179
+ args: eng-rus
180
+ metrics:
181
+ - name: BLEU
182
+ type: bleu
183
+ value: 31.8
184
+ - task:
185
+ name: Translation eng-rus
186
+ type: translation
187
+ args: eng-rus
188
+ dataset:
189
+ name: newstest2020
190
+ type: wmt-2020-news
191
+ args: eng-rus
192
+ metrics:
193
+ - name: BLEU
194
+ type: bleu
195
+ value: 25.5
196
+ ---
197
+ # opus-mt-tc-big-en-zle
198
+
199
+ Neural machine translation model for translating from English (en) to East Slavic languages (zle).
200
+
201
+ 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).
202
+
203
+ * 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.)
204
+
205
+ ```
206
+ @inproceedings{tiedemann-thottingal-2020-opus,
207
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
208
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
209
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
210
+ month = nov,
211
+ year = "2020",
212
+ address = "Lisboa, Portugal",
213
+ publisher = "European Association for Machine Translation",
214
+ url = "https://aclanthology.org/2020.eamt-1.61",
215
+ pages = "479--480",
216
+ }
217
+
218
+ @inproceedings{tiedemann-2020-tatoeba,
219
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
220
+ author = {Tiedemann, J{\"o}rg},
221
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
222
+ month = nov,
223
+ year = "2020",
224
+ address = "Online",
225
+ publisher = "Association for Computational Linguistics",
226
+ url = "https://aclanthology.org/2020.wmt-1.139",
227
+ pages = "1174--1182",
228
+ }
229
+ ```
230
+
231
+ ## Model info
232
+
233
+ * Release: 2022-03-13
234
+ * source language(s): eng
235
+ * target language(s): bel rus ukr
236
+ * valid target language labels: >>bel<< >>rus<< >>ukr<<
237
+ * model: transformer-big
238
+ * data: opusTCv20210807+bt ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
239
+ * tokenization: SentencePiece (spm32k,spm32k)
240
+ * original model: [opusTCv20210807+bt_transformer-big_2022-03-13.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-zle/opusTCv20210807+bt_transformer-big_2022-03-13.zip)
241
+ * more information released models: [OPUS-MT eng-zle README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/eng-zle/README.md)
242
+ * more information about the model: [MarianMT](https://huggingface.co/docs/transformers/model_doc/marian)
243
+
244
+ 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. `>>bel<<`
245
+
246
+ ## Usage
247
+
248
+ A short example code:
249
+
250
+ ```python
251
+ from transformers import MarianMTModel, MarianTokenizer
252
+
253
+ src_text = [
254
+ ">>rus<< Are they coming as well?",
255
+ ">>rus<< I didn't let Tom do what he wanted to do."
256
+ ]
257
+
258
+ model_name = "pytorch-models/opus-mt-tc-big-en-zle"
259
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
260
+ model = MarianMTModel.from_pretrained(model_name)
261
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
262
+
263
+ for t in translated:
264
+ print( tokenizer.decode(t, skip_special_tokens=True) )
265
+
266
+ # expected output:
267
+ # Они тоже приедут?
268
+ # Я не позволил Тому сделать то, что он хотел.
269
+ ```
270
+
271
+ You can also use OPUS-MT models with the transformers pipelines, for example:
272
+
273
+ ```python
274
+ from transformers import pipeline
275
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-en-zle")
276
+ print(pipe(">>rus<< Are they coming as well?"))
277
+
278
+ # expected output: Они тоже приедут?
279
+ ```
280
+
281
+ ## Benchmarks
282
+
283
+ * test set translations: [opusTCv20210807+bt_transformer-big_2022-03-13.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-zle/opusTCv20210807+bt_transformer-big_2022-03-13.test.txt)
284
+ * test set scores: [opusTCv20210807+bt_transformer-big_2022-03-13.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-zle/opusTCv20210807+bt_transformer-big_2022-03-13.eval.txt)
285
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
286
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
287
+
288
+ | langpair | testset | chr-F | BLEU | #sent | #words |
289
+ |----------|---------|-------|-------|-------|--------|
290
+ | eng-bel | tatoeba-test-v2021-08-07 | 0.50345 | 24.9 | 2500 | 16237 |
291
+ | eng-rus | tatoeba-test-v2021-08-07 | 0.66182 | 45.5 | 19425 | 134296 |
292
+ | eng-ukr | tatoeba-test-v2021-08-07 | 0.60175 | 37.7 | 13127 | 80998 |
293
+ | eng-bel | flores101-devtest | 0.42078 | 11.2 | 1012 | 24829 |
294
+ | eng-rus | flores101-devtest | 0.59654 | 32.7 | 1012 | 23295 |
295
+ | eng-ukr | flores101-devtest | 0.60131 | 32.1 | 1012 | 22810 |
296
+ | eng-rus | newstest2012 | 0.62842 | 36.8 | 3003 | 64790 |
297
+ | eng-rus | newstest2013 | 0.54627 | 26.9 | 3000 | 58560 |
298
+ | eng-rus | newstest2014 | 0.68348 | 43.5 | 3003 | 61603 |
299
+ | eng-rus | newstest2015 | 0.62621 | 34.9 | 2818 | 55915 |
300
+ | eng-rus | newstest2016 | 0.60595 | 33.1 | 2998 | 62014 |
301
+ | eng-rus | newstest2017 | 0.64249 | 37.3 | 3001 | 60253 |
302
+ | eng-rus | newstest2018 | 0.61219 | 32.9 | 3000 | 61907 |
303
+ | eng-rus | newstest2019 | 0.57902 | 31.8 | 1997 | 48147 |
304
+ | eng-rus | newstest2020 | 0.52939 | 25.5 | 2002 | 47083 |
305
+ | eng-rus | tico19-test | 0.59314 | 33.7 | 2100 | 55843 |
306
+
307
+ ## Acknowledgements
308
+
309
+ 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.
310
+
311
+ ## Model conversion info
312
+
313
+ * transformers version: 4.16.2
314
+ * OPUS-MT git hash: 1bdabf7
315
+ * port time: Thu Mar 24 01:58:40 EET 2022
316
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ eng-bel flores101-dev 0.40686 9.9 997 23996
2
+ eng-rus flores101-dev 0.59726 32.8 997 22657
3
+ eng-ukr flores101-dev 0.59100 30.8 997 21841
4
+ eng-bel flores101-devtest 0.42078 11.2 1012 24829
5
+ eng-rus flores101-devtest 0.59654 32.7 1012 23295
6
+ eng-ukr flores101-devtest 0.60131 32.1 1012 22810
7
+ eng-rus newstest2012 0.62842 36.8 3003 64790
8
+ eng-rus newstest2013 0.54627 26.9 3000 58560
9
+ eng-rus newstest2014 0.68348 43.5 3003 61603
10
+ eng-rus newstest2015 0.62621 34.9 2818 55915
11
+ eng-rus newstest2016 0.60595 33.1 2998 62014
12
+ eng-rus newstest2017 0.64249 37.3 3001 60253
13
+ eng-rus newstest2018 0.61219 32.9 3000 61907
14
+ eng-rus newstest2019 0.57902 31.8 1997 48147
15
+ eng-rus newstest2020 0.52939 25.5 2002 47083
16
+ eng-bel tatoeba-test-v2020-07-28 0.50348 24.9 2500 16237
17
+ eng-rus tatoeba-test-v2020-07-28 0.66185 46.3 10000 66872
18
+ eng-ukr tatoeba-test-v2020-07-28 0.59540 37.4 10000 60756
19
+ eng-bel tatoeba-test-v2021-03-30 0.50348 24.9 2500 16237
20
+ eng-rus tatoeba-test-v2021-03-30 0.65983 45.2 15118 101983
21
+ eng-ukr tatoeba-test-v2021-03-30 0.60091 37.7 11969 73416
22
+ eng-bel tatoeba-test-v2021-08-07 0.50345 24.9 2500 16237
23
+ eng-rus tatoeba-test-v2021-08-07 0.66182 45.5 19425 134296
24
+ eng-ukr tatoeba-test-v2021-08-07 0.60175 37.7 13127 80998
25
+ eng-rus tico19-test 0.59314 33.7 2100 55843
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2322cd6a816a5ef2a85b72d5777633752b5eaad00add02cd323cc1f74d9c60fb
3
+ size 9010742
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
+ 61576
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": 61576,
21
+ "decoder_vocab_size": 61577,
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": 25539,
28
+ "forced_eos_token_id": 25539,
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": 61576,
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": 61577
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc5a9daea3f56682428e0d37ff93de2232a1e5fa89dc14c89f2cd250f0d92361
3
+ size 605148995
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3612abfe04bf08344ba91115f0e15e228a7a15a621ea856bfd548097dbaeb43c
3
+ size 802747
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:22940e744b3a9fd166a04880938fb61f7dfa8ba4b5d2d3f6371a6c4ba8f3b019
3
+ size 1017004
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "en", "target_lang": "zle", "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+bt_transformer-big_2022-03-13/en-zle", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff