tiedeman commited on
Commit
6699caa
1 Parent(s): f4f8e0f

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,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - be
4
+ - cs
5
+ - pl
6
+ - ru
7
+ - uk
8
+ - zle
9
+ - zlw
10
+
11
+ tags:
12
+ - translation
13
+
14
+ license: cc-by-4.0
15
+ model-index:
16
+ - name: opus-mt-tc-big-zle-zlw
17
+ results:
18
+ - task:
19
+ name: Translation rus-ces
20
+ type: translation
21
+ args: rus-ces
22
+ dataset:
23
+ name: flores101-devtest
24
+ type: flores_101
25
+ args: rus ces devtest
26
+ metrics:
27
+ - name: BLEU
28
+ type: bleu
29
+ value: 23.1
30
+ - task:
31
+ name: Translation ukr-ces
32
+ type: translation
33
+ args: ukr-ces
34
+ dataset:
35
+ name: flores101-devtest
36
+ type: flores_101
37
+ args: ukr ces devtest
38
+ metrics:
39
+ - name: BLEU
40
+ type: bleu
41
+ value: 25.1
42
+ - task:
43
+ name: Translation bel-pol
44
+ type: translation
45
+ args: bel-pol
46
+ dataset:
47
+ name: tatoeba-test-v2021-08-07
48
+ type: tatoeba_mt
49
+ args: bel-pol
50
+ metrics:
51
+ - name: BLEU
52
+ type: bleu
53
+ value: 47.1
54
+ - task:
55
+ name: Translation rus-ces
56
+ type: translation
57
+ args: rus-ces
58
+ dataset:
59
+ name: tatoeba-test-v2021-08-07
60
+ type: tatoeba_mt
61
+ args: rus-ces
62
+ metrics:
63
+ - name: BLEU
64
+ type: bleu
65
+ value: 53.4
66
+ - task:
67
+ name: Translation rus-pol
68
+ type: translation
69
+ args: rus-pol
70
+ dataset:
71
+ name: tatoeba-test-v2021-08-07
72
+ type: tatoeba_mt
73
+ args: rus-pol
74
+ metrics:
75
+ - name: BLEU
76
+ type: bleu
77
+ value: 53.7
78
+ - task:
79
+ name: Translation ukr-ces
80
+ type: translation
81
+ args: ukr-ces
82
+ dataset:
83
+ name: tatoeba-test-v2021-08-07
84
+ type: tatoeba_mt
85
+ args: ukr-ces
86
+ metrics:
87
+ - name: BLEU
88
+ type: bleu
89
+ value: 58.0
90
+ - task:
91
+ name: Translation ukr-pol
92
+ type: translation
93
+ args: ukr-pol
94
+ dataset:
95
+ name: tatoeba-test-v2021-08-07
96
+ type: tatoeba_mt
97
+ args: ukr-pol
98
+ metrics:
99
+ - name: BLEU
100
+ type: bleu
101
+ value: 57.0
102
+ - task:
103
+ name: Translation rus-ces
104
+ type: translation
105
+ args: rus-ces
106
+ dataset:
107
+ name: newstest2013
108
+ type: wmt-2013-news
109
+ args: rus-ces
110
+ metrics:
111
+ - name: BLEU
112
+ type: bleu
113
+ value: 26.0
114
+ ---
115
+ # opus-mt-tc-big-zle-zlw
116
+
117
+ Neural machine translation model for translating from East Slavic languages (zle) to West Slavic languages (zlw).
118
+
119
+ 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).
120
+
121
+ * 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.)
122
+
123
+ ```
124
+ @inproceedings{tiedemann-thottingal-2020-opus,
125
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
126
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
127
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
128
+ month = nov,
129
+ year = "2020",
130
+ address = "Lisboa, Portugal",
131
+ publisher = "European Association for Machine Translation",
132
+ url = "https://aclanthology.org/2020.eamt-1.61",
133
+ pages = "479--480",
134
+ }
135
+
136
+ @inproceedings{tiedemann-2020-tatoeba,
137
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
138
+ author = {Tiedemann, J{\"o}rg},
139
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
140
+ month = nov,
141
+ year = "2020",
142
+ address = "Online",
143
+ publisher = "Association for Computational Linguistics",
144
+ url = "https://aclanthology.org/2020.wmt-1.139",
145
+ pages = "1174--1182",
146
+ }
147
+ ```
148
+
149
+ ## Model info
150
+
151
+ * Release: 2022-03-23
152
+ * source language(s): bel rus ukr
153
+ * target language(s): ces pol
154
+ * valid target language labels: >>ces<< >>pol<<
155
+ * model: transformer-big
156
+ * data: opusTCv20210807+bt ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
157
+ * tokenization: SentencePiece (spm32k,spm32k)
158
+ * original model: [opusTCv20210807+bt_transformer-big_2022-03-23.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-zlw/opusTCv20210807+bt_transformer-big_2022-03-23.zip)
159
+ * more information released models: [OPUS-MT zle-zlw README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/zle-zlw/README.md)
160
+ * more information about the model: [MarianMT](https://huggingface.co/docs/transformers/model_doc/marian)
161
+
162
+ 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. `>>ces<<`
163
+
164
+ ## Usage
165
+
166
+ A short example code:
167
+
168
+ ```python
169
+ from transformers import MarianMTModel, MarianTokenizer
170
+
171
+ src_text = [
172
+ ">>pol<< Это метафора.",
173
+ ">>pol<< Что вы делали?"
174
+ ]
175
+
176
+ model_name = "pytorch-models/opus-mt-tc-big-zle-zlw"
177
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
178
+ model = MarianMTModel.from_pretrained(model_name)
179
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
180
+
181
+ for t in translated:
182
+ print( tokenizer.decode(t, skip_special_tokens=True) )
183
+
184
+ # expected output:
185
+ # To metafora.
186
+ # Co robiliście?
187
+ ```
188
+
189
+ You can also use OPUS-MT models with the transformers pipelines, for example:
190
+
191
+ ```python
192
+ from transformers import pipeline
193
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-zle-zlw")
194
+ print(pipe(">>pol<< Это метафора."))
195
+
196
+ # expected output: To metafora.
197
+ ```
198
+
199
+ ## Benchmarks
200
+
201
+ * test set translations: [opusTCv20210807+bt_transformer-big_2022-03-23.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-zlw/opusTCv20210807+bt_transformer-big_2022-03-23.test.txt)
202
+ * test set scores: [opusTCv20210807+bt_transformer-big_2022-03-23.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-zlw/opusTCv20210807+bt_transformer-big_2022-03-23.eval.txt)
203
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
204
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
205
+
206
+ | langpair | testset | chr-F | BLEU | #sent | #words |
207
+ |----------|---------|-------|-------|-------|--------|
208
+ | bel-pol | tatoeba-test-v2021-08-07 | 0.65517 | 47.1 | 287 | 1706 |
209
+ | rus-ces | tatoeba-test-v2021-08-07 | 0.69695 | 53.4 | 2934 | 16831 |
210
+ | rus-pol | tatoeba-test-v2021-08-07 | 0.72176 | 53.7 | 3543 | 21505 |
211
+ | ukr-ces | tatoeba-test-v2021-08-07 | 0.73149 | 58.0 | 1787 | 8550 |
212
+ | ukr-pol | tatoeba-test-v2021-08-07 | 0.74649 | 57.0 | 2519 | 13201 |
213
+ | bel-ces | flores101-devtest | 0.41248 | 11.1 | 1012 | 22101 |
214
+ | bel-pol | flores101-devtest | 0.42240 | 10.2 | 1012 | 22520 |
215
+ | rus-ces | flores101-devtest | 0.50971 | 23.1 | 1012 | 22101 |
216
+ | rus-pol | flores101-devtest | 0.48672 | 18.4 | 1012 | 22520 |
217
+ | ukr-ces | flores101-devtest | 0.52482 | 25.1 | 1012 | 22101 |
218
+ | ukr-pol | flores101-devtest | 0.48790 | 18.8 | 1012 | 22520 |
219
+ | rus-ces | newstest2012 | 0.45834 | 18.8 | 3003 | 65456 |
220
+ | rus-ces | newstest2013 | 0.52364 | 26.0 | 3000 | 57250 |
221
+
222
+ ## Acknowledgements
223
+
224
+ 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.
225
+
226
+ ## Model conversion info
227
+
228
+ * transformers version: 4.16.2
229
+ * OPUS-MT git hash: 1bdabf7
230
+ * port time: Thu Mar 24 00:50:29 EET 2022
231
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ bel-ces flores101-dev 0.41108 10.4 997 21183
2
+ bel-pol flores101-dev 0.42162 10.1 997 21684
3
+ rus-ces flores101-dev 0.51311 23.4 997 21183
4
+ rus-pol flores101-dev 0.48899 18.4 997 21684
5
+ bel-ces flores101-devtest 0.41248 11.1 1012 22101
6
+ bel-pol flores101-devtest 0.42240 10.2 1012 22520
7
+ rus-ces flores101-devtest 0.50971 23.1 1012 22101
8
+ rus-pol flores101-devtest 0.48672 18.4 1012 22520
9
+ ukr-ces flores101-devtest 0.52482 25.1 1012 22101
10
+ ukr-pol flores101-devtest 0.48790 18.8 1012 22520
11
+ ukr-ces flores101-dev 0.52364 24.5 997 21183
12
+ ukr-pol flores101-dev 0.48924 19.0 997 21684
13
+ rus-ces newstest2012 0.45834 18.8 3003 65456
14
+ rus-ces newstest2013 0.52364 26.0 3000 57250
15
+ rus-ces tatoeba-test-v2020-07-28 0.70119 53.8 2500 14266
16
+ ukr-pol tatoeba-test-v2020-07-28 0.74609 56.9 2500 13098
17
+ bel-pol tatoeba-test-v2021-03-30 0.65722 47.4 289 1718
18
+ rus-ces tatoeba-test-v2021-03-30 0.69882 53.6 5060 28961
19
+ ukr-pol tatoeba-test-v2021-03-30 0.74573 56.9 4977 26119
20
+ bel-pol tatoeba-test-v2021-08-07 0.65517 47.1 287 1706
21
+ rus-ces tatoeba-test-v2021-08-07 0.69695 53.4 2934 16831
22
+ rus-pol tatoeba-test-v2021-08-07 0.72176 53.7 3543 21505
23
+ ukr-ces tatoeba-test-v2021-08-07 0.73149 58.0 1787 8550
24
+ ukr-pol tatoeba-test-v2021-08-07 0.74649 57.0 2519 13201
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4c3fe982f011143d75d5489592f0ecd35b3094198948b001c196cde6eeebd9a4
3
+ size 4290467
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
+ 61592
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": 61592,
21
+ "decoder_vocab_size": 61593,
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": 22403,
28
+ "forced_eos_token_id": 22403,
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": 61592,
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": 61593
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:01a1c76789d7cabd1b97d5a838d02b604c79316e4d959bdc645610c65799cb2d
3
+ size 605214531
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8a940b4375cacfb75b1c7e1d27d4b06a5f130dcd026489e1e693d6fd8ed2259e
3
+ size 1000541
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:f0937cb077654ee99bb4f0897f0b672b1ac19564c84d299b772b95d1f871dd1b
3
+ size 824018
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "zle", "target_lang": "zlw", "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-23/zle-zlw", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff