tiedeman commited on
Commit
241ecef
1 Parent(s): 220f235

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,255 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - be
4
+ - cs
5
+ - dsb
6
+ - hsb
7
+ - pl
8
+ - ru
9
+ - uk
10
+ - zle
11
+ - zlw
12
+
13
+ tags:
14
+ - translation
15
+
16
+ license: cc-by-4.0
17
+ model-index:
18
+ - name: opus-mt-tc-big-zlw-zle
19
+ results:
20
+ - task:
21
+ name: Translation ces-rus
22
+ type: translation
23
+ args: ces-rus
24
+ dataset:
25
+ name: flores101-devtest
26
+ type: flores_101
27
+ args: ces rus devtest
28
+ metrics:
29
+ - name: BLEU
30
+ type: bleu
31
+ value: 24.2
32
+ - task:
33
+ name: Translation ces-ukr
34
+ type: translation
35
+ args: ces-ukr
36
+ dataset:
37
+ name: flores101-devtest
38
+ type: flores_101
39
+ args: ces ukr devtest
40
+ metrics:
41
+ - name: BLEU
42
+ type: bleu
43
+ value: 22.9
44
+ - task:
45
+ name: Translation pol-rus
46
+ type: translation
47
+ args: pol-rus
48
+ dataset:
49
+ name: flores101-devtest
50
+ type: flores_101
51
+ args: pol rus devtest
52
+ metrics:
53
+ - name: BLEU
54
+ type: bleu
55
+ value: 20.1
56
+ - task:
57
+ name: Translation ces-rus
58
+ type: translation
59
+ args: ces-rus
60
+ dataset:
61
+ name: tatoeba-test-v2021-08-07
62
+ type: tatoeba_mt
63
+ args: ces-rus
64
+ metrics:
65
+ - name: BLEU
66
+ type: bleu
67
+ value: 56.4
68
+ - task:
69
+ name: Translation ces-ukr
70
+ type: translation
71
+ args: ces-ukr
72
+ dataset:
73
+ name: tatoeba-test-v2021-08-07
74
+ type: tatoeba_mt
75
+ args: ces-ukr
76
+ metrics:
77
+ - name: BLEU
78
+ type: bleu
79
+ value: 53.0
80
+ - task:
81
+ name: Translation pol-bel
82
+ type: translation
83
+ args: pol-bel
84
+ dataset:
85
+ name: tatoeba-test-v2021-08-07
86
+ type: tatoeba_mt
87
+ args: pol-bel
88
+ metrics:
89
+ - name: BLEU
90
+ type: bleu
91
+ value: 29.4
92
+ - task:
93
+ name: Translation pol-rus
94
+ type: translation
95
+ args: pol-rus
96
+ dataset:
97
+ name: tatoeba-test-v2021-08-07
98
+ type: tatoeba_mt
99
+ args: pol-rus
100
+ metrics:
101
+ - name: BLEU
102
+ type: bleu
103
+ value: 55.3
104
+ - task:
105
+ name: Translation pol-ukr
106
+ type: translation
107
+ args: pol-ukr
108
+ dataset:
109
+ name: tatoeba-test-v2021-08-07
110
+ type: tatoeba_mt
111
+ args: pol-ukr
112
+ metrics:
113
+ - name: BLEU
114
+ type: bleu
115
+ value: 48.6
116
+ - task:
117
+ name: Translation ces-rus
118
+ type: translation
119
+ args: ces-rus
120
+ dataset:
121
+ name: newstest2012
122
+ type: wmt-2012-news
123
+ args: ces-rus
124
+ metrics:
125
+ - name: BLEU
126
+ type: bleu
127
+ value: 21.0
128
+ - task:
129
+ name: Translation ces-rus
130
+ type: translation
131
+ args: ces-rus
132
+ dataset:
133
+ name: newstest2013
134
+ type: wmt-2013-news
135
+ args: ces-rus
136
+ metrics:
137
+ - name: BLEU
138
+ type: bleu
139
+ value: 27.2
140
+ ---
141
+ # opus-mt-tc-big-zlw-zle
142
+
143
+ Neural machine translation model for translating from West Slavic languages (zlw) to East Slavic languages (zle).
144
+
145
+ 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).
146
+
147
+ * 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.)
148
+
149
+ ```
150
+ @inproceedings{tiedemann-thottingal-2020-opus,
151
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
152
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
153
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
154
+ month = nov,
155
+ year = "2020",
156
+ address = "Lisboa, Portugal",
157
+ publisher = "European Association for Machine Translation",
158
+ url = "https://aclanthology.org/2020.eamt-1.61",
159
+ pages = "479--480",
160
+ }
161
+
162
+ @inproceedings{tiedemann-2020-tatoeba,
163
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
164
+ author = {Tiedemann, J{\"o}rg},
165
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
166
+ month = nov,
167
+ year = "2020",
168
+ address = "Online",
169
+ publisher = "Association for Computational Linguistics",
170
+ url = "https://aclanthology.org/2020.wmt-1.139",
171
+ pages = "1174--1182",
172
+ }
173
+ ```
174
+
175
+ ## Model info
176
+
177
+ * Release: 2022-03-19
178
+ * source language(s): ces dsb hsb pol
179
+ * target language(s): bel rus ukr
180
+ * valid target language labels: >>bel<< >>rus<< >>ukr<<
181
+ * model: transformer-big
182
+ * data: opusTCv20210807+bt ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
183
+ * tokenization: SentencePiece (spm32k,spm32k)
184
+ * original model: [opusTCv20210807+bt_transformer-big_2022-03-19.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/zlw-zle/opusTCv20210807+bt_transformer-big_2022-03-19.zip)
185
+ * more information released models: [OPUS-MT zlw-zle README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/zlw-zle/README.md)
186
+ * more information about the model: [MarianMT](https://huggingface.co/docs/transformers/model_doc/marian)
187
+
188
+ 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<<`
189
+
190
+ ## Usage
191
+
192
+ A short example code:
193
+
194
+ ```python
195
+ from transformers import MarianMTModel, MarianTokenizer
196
+
197
+ src_text = [
198
+ ">>rus<< Je vystudovaný právník.",
199
+ ">>rus<< Gdzie jest moja książka ?"
200
+ ]
201
+
202
+ model_name = "pytorch-models/opus-mt-tc-big-zlw-zle"
203
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
204
+ model = MarianMTModel.from_pretrained(model_name)
205
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
206
+
207
+ for t in translated:
208
+ print( tokenizer.decode(t, skip_special_tokens=True) )
209
+
210
+ # expected output:
211
+ # Он дипломированный юрист.
212
+ # Где моя книга?
213
+ ```
214
+
215
+ You can also use OPUS-MT models with the transformers pipelines, for example:
216
+
217
+ ```python
218
+ from transformers import pipeline
219
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-zlw-zle")
220
+ print(pipe(">>rus<< Je vystudovaný právník."))
221
+
222
+ # expected output: Он дипломированный юрист.
223
+ ```
224
+
225
+ ## Benchmarks
226
+
227
+ * test set translations: [opusTCv20210807+bt_transformer-big_2022-03-19.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zlw-zle/opusTCv20210807+bt_transformer-big_2022-03-19.test.txt)
228
+ * test set scores: [opusTCv20210807+bt_transformer-big_2022-03-19.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zlw-zle/opusTCv20210807+bt_transformer-big_2022-03-19.eval.txt)
229
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
230
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
231
+
232
+ | langpair | testset | chr-F | BLEU | #sent | #words |
233
+ |----------|---------|-------|-------|-------|--------|
234
+ | ces-rus | tatoeba-test-v2021-08-07 | 0.73154 | 56.4 | 2934 | 17790 |
235
+ | ces-ukr | tatoeba-test-v2021-08-07 | 0.69934 | 53.0 | 1787 | 8891 |
236
+ | pol-bel | tatoeba-test-v2021-08-07 | 0.51039 | 29.4 | 287 | 1730 |
237
+ | pol-rus | tatoeba-test-v2021-08-07 | 0.73156 | 55.3 | 3543 | 22067 |
238
+ | pol-ukr | tatoeba-test-v2021-08-07 | 0.68247 | 48.6 | 2519 | 13535 |
239
+ | ces-rus | flores101-devtest | 0.52316 | 24.2 | 1012 | 23295 |
240
+ | ces-ukr | flores101-devtest | 0.52261 | 22.9 | 1012 | 22810 |
241
+ | pol-rus | flores101-devtest | 0.49414 | 20.1 | 1012 | 23295 |
242
+ | pol-ukr | flores101-devtest | 0.48250 | 18.3 | 1012 | 22810 |
243
+ | ces-rus | newstest2012 | 0.49469 | 21.0 | 3003 | 64790 |
244
+ | ces-rus | newstest2013 | 0.54197 | 27.2 | 3000 | 58560 |
245
+
246
+ ## Acknowledgements
247
+
248
+ 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.
249
+
250
+ ## Model conversion info
251
+
252
+ * transformers version: 4.16.2
253
+ * OPUS-MT git hash: 1bdabf7
254
+ * port time: Thu Mar 24 04:13:23 EET 2022
255
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ces-bel flores101-dev 0.26213 5.4 997 23996
2
+ ces-rus flores101-dev 0.52210 24.0 997 22657
3
+ ces-ukr flores101-dev 0.51171 21.6 997 21841
4
+ pol-bel flores101-dev 0.24387 4.8 997 23996
5
+ pol-rus flores101-dev 0.49391 20.2 997 22657
6
+ pol-ukr flores101-dev 0.47783 18.0 997 21841
7
+ ces-bel flores101-devtest 0.25834 5.2 1012 24829
8
+ ces-rus flores101-devtest 0.52316 24.2 1012 23295
9
+ ces-ukr flores101-devtest 0.52261 22.9 1012 22810
10
+ pol-bel flores101-devtest 0.24450 4.9 1012 24829
11
+ pol-rus flores101-devtest 0.49414 20.1 1012 23295
12
+ pol-ukr flores101-devtest 0.48250 18.3 1012 22810
13
+ ces-rus newstest2012 0.49469 21.0 3003 64790
14
+ ces-rus newstest2013 0.54197 27.2 3000 58560
15
+ ces-rus tatoeba-test-v2020-07-28 0.73377 56.5 2500 15084
16
+ ces-ukr tatoeba-test-v2020-07-28 0.69934 53.0 1787 8891
17
+ pol-bel tatoeba-test-v2020-07-28 0.51039 29.4 287 1730
18
+ pol-rus tatoeba-test-v2020-07-28 0.73156 55.3 3543 22067
19
+ pol-ukr tatoeba-test-v2020-07-28 0.68259 48.6 2500 13434
20
+ ces-rus tatoeba-test-v2021-03-30 0.73212 56.3 5060 30636
21
+ ces-ukr tatoeba-test-v2021-03-30 0.69934 53.0 1787 8891
22
+ pol-bel tatoeba-test-v2021-03-30 0.51120 29.5 289 1743
23
+ pol-rus tatoeba-test-v2021-03-30 0.73156 55.3 3543 22067
24
+ pol-ukr tatoeba-test-v2021-03-30 0.68225 48.6 4977 26782
25
+ ces-rus tatoeba-test-v2021-08-07 0.73154 56.4 2934 17790
26
+ ces-ukr tatoeba-test-v2021-08-07 0.69934 53.0 1787 8891
27
+ pol-bel tatoeba-test-v2021-08-07 0.51039 29.4 287 1730
28
+ pol-rus tatoeba-test-v2021-08-07 0.73156 55.3 3543 22067
29
+ pol-ukr tatoeba-test-v2021-08-07 0.68247 48.6 2519 13535
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:054fd9c90666b9e06ccc2174e27cd804bf0e71d2accb1e8a7022cff5c1a97dd9
3
+ size 4936411
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
+ 61591
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": 61591,
21
+ "decoder_vocab_size": 61592,
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": 22414,
28
+ "forced_eos_token_id": 22414,
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": 61591,
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": 61592
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6d0320e9b7a3ea1b078173dc813c5f934caf4040731f3bf420de5cd9a4e54a8
3
+ size 605210435
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:355a0b36cf3875b624259bb8bb4de72ec71f7476ec2b822a1c4ca1d25db96438
3
+ size 823630
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:553cd1bd0e78c767ead25854e48c4cd1a10b244c70a7cbdce5ccac9c9f945e81
3
+ size 1000034
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "zlw", "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-19/zlw-zle", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff