tiedeman commited on
Commit
8db20f2
1 Parent(s): e7a34e0

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,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - be
4
+ - ru
5
+ - uk
6
+ - zle
7
+
8
+ tags:
9
+ - translation
10
+
11
+ license: cc-by-4.0
12
+ model-index:
13
+ - name: opus-mt-tc-big-zle-zle
14
+ results:
15
+ - task:
16
+ name: Translation rus-ukr
17
+ type: translation
18
+ args: rus-ukr
19
+ dataset:
20
+ name: flores101-devtest
21
+ type: flores_101
22
+ args: rus ukr devtest
23
+ metrics:
24
+ - name: BLEU
25
+ type: bleu
26
+ value: 25.5
27
+ - task:
28
+ name: Translation ukr-rus
29
+ type: translation
30
+ args: ukr-rus
31
+ dataset:
32
+ name: flores101-devtest
33
+ type: flores_101
34
+ args: ukr rus devtest
35
+ metrics:
36
+ - name: BLEU
37
+ type: bleu
38
+ value: 28.3
39
+ - task:
40
+ name: Translation bel-rus
41
+ type: translation
42
+ args: bel-rus
43
+ dataset:
44
+ name: tatoeba-test-v2021-08-07
45
+ type: tatoeba_mt
46
+ args: bel-rus
47
+ metrics:
48
+ - name: BLEU
49
+ type: bleu
50
+ value: 68.6
51
+ - task:
52
+ name: Translation bel-ukr
53
+ type: translation
54
+ args: bel-ukr
55
+ dataset:
56
+ name: tatoeba-test-v2021-08-07
57
+ type: tatoeba_mt
58
+ args: bel-ukr
59
+ metrics:
60
+ - name: BLEU
61
+ type: bleu
62
+ value: 65.5
63
+ - task:
64
+ name: Translation rus-bel
65
+ type: translation
66
+ args: rus-bel
67
+ dataset:
68
+ name: tatoeba-test-v2021-08-07
69
+ type: tatoeba_mt
70
+ args: rus-bel
71
+ metrics:
72
+ - name: BLEU
73
+ type: bleu
74
+ value: 50.3
75
+ - task:
76
+ name: Translation rus-ukr
77
+ type: translation
78
+ args: rus-ukr
79
+ dataset:
80
+ name: tatoeba-test-v2021-08-07
81
+ type: tatoeba_mt
82
+ args: rus-ukr
83
+ metrics:
84
+ - name: BLEU
85
+ type: bleu
86
+ value: 70.1
87
+ - task:
88
+ name: Translation ukr-bel
89
+ type: translation
90
+ args: ukr-bel
91
+ dataset:
92
+ name: tatoeba-test-v2021-08-07
93
+ type: tatoeba_mt
94
+ args: ukr-bel
95
+ metrics:
96
+ - name: BLEU
97
+ type: bleu
98
+ value: 58.9
99
+ - task:
100
+ name: Translation ukr-rus
101
+ type: translation
102
+ args: ukr-rus
103
+ dataset:
104
+ name: tatoeba-test-v2021-08-07
105
+ type: tatoeba_mt
106
+ args: ukr-rus
107
+ metrics:
108
+ - name: BLEU
109
+ type: bleu
110
+ value: 75.7
111
+ ---
112
+ # opus-mt-tc-big-zle-zle
113
+
114
+ Neural machine translation model for translating from East Slavic languages (zle) to East Slavic languages (zle).
115
+
116
+ 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).
117
+
118
+ * 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.)
119
+
120
+ ```
121
+ @inproceedings{tiedemann-thottingal-2020-opus,
122
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
123
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
124
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
125
+ month = nov,
126
+ year = "2020",
127
+ address = "Lisboa, Portugal",
128
+ publisher = "European Association for Machine Translation",
129
+ url = "https://aclanthology.org/2020.eamt-1.61",
130
+ pages = "479--480",
131
+ }
132
+
133
+ @inproceedings{tiedemann-2020-tatoeba,
134
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
135
+ author = {Tiedemann, J{\"o}rg},
136
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
137
+ month = nov,
138
+ year = "2020",
139
+ address = "Online",
140
+ publisher = "Association for Computational Linguistics",
141
+ url = "https://aclanthology.org/2020.wmt-1.139",
142
+ pages = "1174--1182",
143
+ }
144
+ ```
145
+
146
+ ## Model info
147
+
148
+ * Release: 2022-03-07
149
+ * source language(s): bel rus ukr
150
+ * target language(s): bel rus ukr
151
+ * valid target language labels: >>bel<< >>rus<< >>ukr<<
152
+ * model: transformer-big
153
+ * data: opusTCv20210807+bt ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
154
+ * tokenization: SentencePiece (spm32k,spm32k)
155
+ * original model: [opusTCv20210807+bt_transformer-big_2022-03-07.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-zle/opusTCv20210807+bt_transformer-big_2022-03-07.zip)
156
+ * more information released models: [OPUS-MT zle-zle README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/zle-zle/README.md)
157
+ * more information about the model: [MarianMT](https://huggingface.co/docs/transformers/model_doc/marian)
158
+
159
+ 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<<`
160
+
161
+ ## Usage
162
+
163
+ A short example code:
164
+
165
+ ```python
166
+ from transformers import MarianMTModel, MarianTokenizer
167
+
168
+ src_text = [
169
+ ">>ukr<< Кот мёртвый.",
170
+ ">>bel<< Джон живе в Нью-Йорку."
171
+ ]
172
+
173
+ model_name = "pytorch-models/opus-mt-tc-big-zle-zle"
174
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
175
+ model = MarianMTModel.from_pretrained(model_name)
176
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
177
+
178
+ for t in translated:
179
+ print( tokenizer.decode(t, skip_special_tokens=True) )
180
+
181
+ # expected output:
182
+ # Кіт мертвий.
183
+ # Джон жыве ў Нью-Йорку.
184
+ ```
185
+
186
+ You can also use OPUS-MT models with the transformers pipelines, for example:
187
+
188
+ ```python
189
+ from transformers import pipeline
190
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-zle-zle")
191
+ print(pipe(">>ukr<< Кот мёртвый."))
192
+
193
+ # expected output: Кіт мертвий.
194
+ ```
195
+
196
+ ## Benchmarks
197
+
198
+ * test set translations: [opusTCv20210807+bt_transformer-big_2022-03-07.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-zle/opusTCv20210807+bt_transformer-big_2022-03-07.test.txt)
199
+ * test set scores: [opusTCv20210807+bt_transformer-big_2022-03-07.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-zle/opusTCv20210807+bt_transformer-big_2022-03-07.eval.txt)
200
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
201
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
202
+
203
+ | langpair | testset | chr-F | BLEU | #sent | #words |
204
+ |----------|---------|-------|-------|-------|--------|
205
+ | bel-rus | tatoeba-test-v2021-08-07 | 0.82526 | 68.6 | 2500 | 18895 |
206
+ | bel-ukr | tatoeba-test-v2021-08-07 | 0.81036 | 65.5 | 2355 | 15179 |
207
+ | rus-bel | tatoeba-test-v2021-08-07 | 0.66943 | 50.3 | 2500 | 18756 |
208
+ | rus-ukr | tatoeba-test-v2021-08-07 | 0.83639 | 70.1 | 10000 | 60212 |
209
+ | ukr-bel | tatoeba-test-v2021-08-07 | 0.75368 | 58.9 | 2355 | 15175 |
210
+ | ukr-rus | tatoeba-test-v2021-08-07 | 0.86806 | 75.7 | 10000 | 60387 |
211
+ | bel-rus | flores101-devtest | 0.47960 | 14.5 | 1012 | 23295 |
212
+ | bel-ukr | flores101-devtest | 0.47335 | 12.8 | 1012 | 22810 |
213
+ | rus-ukr | flores101-devtest | 0.55287 | 25.5 | 1012 | 22810 |
214
+ | ukr-rus | flores101-devtest | 0.56224 | 28.3 | 1012 | 23295 |
215
+
216
+ ## Acknowledgements
217
+
218
+ 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.
219
+
220
+ ## Model conversion info
221
+
222
+ * transformers version: 4.16.2
223
+ * OPUS-MT git hash: 1bdabf7
224
+ * port time: Thu Mar 24 00:15:39 EET 2022
225
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ bel-rus flores101-dev 0.47944 13.8 997 22657
2
+ bel-ukr flores101-dev 0.47149 12.2 997 21841
3
+ rus-bel flores101-dev 0.31702 8.0 997 23996
4
+ rus-ukr flores101-dev 0.54870 24.7 997 21841
5
+ bel-rus flores101-devtest 0.47960 14.5 1012 23295
6
+ bel-ukr flores101-devtest 0.47335 12.8 1012 22810
7
+ rus-bel flores101-devtest 0.31398 8.4 1012 24829
8
+ rus-ukr flores101-devtest 0.55287 25.5 1012 22810
9
+ ukr-bel flores101-devtest 0.37165 10.6 1012 24829
10
+ ukr-rus flores101-devtest 0.56224 28.3 1012 23295
11
+ ukr-bel flores101-dev 0.37071 10.0 997 23996
12
+ ukr-rus flores101-dev 0.55575 27.4 997 22657
13
+ bel-rus tatoeba-test-v2020-07-28 0.82526 68.6 2500 18895
14
+ bel-ukr tatoeba-test-v2020-07-28 0.81036 65.5 2355 15179
15
+ rus-bel tatoeba-test-v2020-07-28 0.66942 50.3 2500 18756
16
+ rus-ukr tatoeba-test-v2020-07-28 0.83639 70.1 10000 60212
17
+ ukr-bel tatoeba-test-v2020-07-28 0.75362 58.9 2355 15175
18
+ ukr-rus tatoeba-test-v2020-07-28 0.86806 75.7 10000 60387
19
+ bel-rus tatoeba-test-v2021-03-30 0.82526 68.6 2500 18895
20
+ bel-ukr tatoeba-test-v2021-03-30 0.81036 65.5 2355 15179
21
+ rus-bel tatoeba-test-v2021-03-30 0.66942 50.3 2500 18756
22
+ rus-ukr tatoeba-test-v2021-03-30 0.83639 70.1 10000 60212
23
+ ukr-bel tatoeba-test-v2021-03-30 0.75362 58.9 2355 15175
24
+ ukr-rus tatoeba-test-v2021-03-30 0.86806 75.7 10000 60387
25
+ bel-rus tatoeba-test-v2021-08-07 0.82526 68.6 2500 18895
26
+ bel-ukr tatoeba-test-v2021-08-07 0.81036 65.5 2355 15179
27
+ rus-bel tatoeba-test-v2021-08-07 0.66943 50.3 2500 18756
28
+ rus-ukr tatoeba-test-v2021-08-07 0.83639 70.1 10000 60212
29
+ ukr-bel tatoeba-test-v2021-08-07 0.75368 58.9 2355 15175
30
+ ukr-rus tatoeba-test-v2021-08-07 0.86806 75.7 10000 60387
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b71500515d5512f8a8a40f6de36212f3aac0607a128f420d4f7c7d8c4792a05b
3
+ size 6062613
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
+ 36262
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": 36262,
21
+ "decoder_vocab_size": 36263,
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": 2171,
28
+ "forced_eos_token_id": 2171,
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": 36262,
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": 36263
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8935f9beb8f15e2ba68a3e06f5be58e2629ed90bcc758f545ca6860a8dd5ff05
3
+ size 501412227
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9b49b740c96c0d82a918f7986274b4352cce26420bf166db9dddd9a2e96e40aa
3
+ size 1012800
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:4c5be1deafcea3cd0a23b164ea9645df09e394a91959e35bfd5140db879c5ff9
3
+ size 1012444
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "zle", "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-07/zle-zle", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff