tiedeman commited on
Commit
aa3b1c4
1 Parent(s): 5e792a1

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,243 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - da
4
+ - gmq
5
+ - nb
6
+ - no
7
+ - ru
8
+ - sv
9
+ - uk
10
+ - zle
11
+
12
+ tags:
13
+ - translation
14
+
15
+ license: cc-by-4.0
16
+ model-index:
17
+ - name: opus-mt-tc-big-zle-gmq
18
+ results:
19
+ - task:
20
+ name: Translation rus-dan
21
+ type: translation
22
+ args: rus-dan
23
+ dataset:
24
+ name: flores101-devtest
25
+ type: flores_101
26
+ args: rus dan devtest
27
+ metrics:
28
+ - name: BLEU
29
+ type: bleu
30
+ value: 28.0
31
+ - task:
32
+ name: Translation rus-nob
33
+ type: translation
34
+ args: rus-nob
35
+ dataset:
36
+ name: flores101-devtest
37
+ type: flores_101
38
+ args: rus nob devtest
39
+ metrics:
40
+ - name: BLEU
41
+ type: bleu
42
+ value: 20.6
43
+ - task:
44
+ name: Translation rus-swe
45
+ type: translation
46
+ args: rus-swe
47
+ dataset:
48
+ name: flores101-devtest
49
+ type: flores_101
50
+ args: rus swe devtest
51
+ metrics:
52
+ - name: BLEU
53
+ type: bleu
54
+ value: 26.4
55
+ - task:
56
+ name: Translation ukr-dan
57
+ type: translation
58
+ args: ukr-dan
59
+ dataset:
60
+ name: flores101-devtest
61
+ type: flores_101
62
+ args: ukr dan devtest
63
+ metrics:
64
+ - name: BLEU
65
+ type: bleu
66
+ value: 30.3
67
+ - task:
68
+ name: Translation ukr-nob
69
+ type: translation
70
+ args: ukr-nob
71
+ dataset:
72
+ name: flores101-devtest
73
+ type: flores_101
74
+ args: ukr nob devtest
75
+ metrics:
76
+ - name: BLEU
77
+ type: bleu
78
+ value: 21.1
79
+ - task:
80
+ name: Translation ukr-swe
81
+ type: translation
82
+ args: ukr-swe
83
+ dataset:
84
+ name: flores101-devtest
85
+ type: flores_101
86
+ args: ukr swe devtest
87
+ metrics:
88
+ - name: BLEU
89
+ type: bleu
90
+ value: 28.8
91
+ - task:
92
+ name: Translation rus-dan
93
+ type: translation
94
+ args: rus-dan
95
+ dataset:
96
+ name: tatoeba-test-v2021-08-07
97
+ type: tatoeba_mt
98
+ args: rus-dan
99
+ metrics:
100
+ - name: BLEU
101
+ type: bleu
102
+ value: 59.6
103
+ - task:
104
+ name: Translation rus-nob
105
+ type: translation
106
+ args: rus-nob
107
+ dataset:
108
+ name: tatoeba-test-v2021-08-07
109
+ type: tatoeba_mt
110
+ args: rus-nob
111
+ metrics:
112
+ - name: BLEU
113
+ type: bleu
114
+ value: 46.1
115
+ - task:
116
+ name: Translation rus-swe
117
+ type: translation
118
+ args: rus-swe
119
+ dataset:
120
+ name: tatoeba-test-v2021-08-07
121
+ type: tatoeba_mt
122
+ args: rus-swe
123
+ metrics:
124
+ - name: BLEU
125
+ type: bleu
126
+ value: 53.3
127
+ ---
128
+ # opus-mt-tc-big-zle-gmq
129
+
130
+ Neural machine translation model for translating from East Slavic languages (zle) to North Germanic languages (gmq).
131
+
132
+ 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).
133
+
134
+ * 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.)
135
+
136
+ ```
137
+ @inproceedings{tiedemann-thottingal-2020-opus,
138
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
139
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
140
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
141
+ month = nov,
142
+ year = "2020",
143
+ address = "Lisboa, Portugal",
144
+ publisher = "European Association for Machine Translation",
145
+ url = "https://aclanthology.org/2020.eamt-1.61",
146
+ pages = "479--480",
147
+ }
148
+
149
+ @inproceedings{tiedemann-2020-tatoeba,
150
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
151
+ author = {Tiedemann, J{\"o}rg},
152
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
153
+ month = nov,
154
+ year = "2020",
155
+ address = "Online",
156
+ publisher = "Association for Computational Linguistics",
157
+ url = "https://aclanthology.org/2020.wmt-1.139",
158
+ pages = "1174--1182",
159
+ }
160
+ ```
161
+
162
+ ## Model info
163
+
164
+ * Release: 2022-03-14
165
+ * source language(s): rus ukr
166
+ * target language(s): dan nob nor swe
167
+ * valid target language labels: >>dan<< >>nob<< >>nor<< >>swe<<
168
+ * model: transformer-big
169
+ * data: opusTCv20210807+pft ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
170
+ * tokenization: SentencePiece (spm32k,spm32k)
171
+ * original model: [opusTCv20210807+pft_transformer-big_2022-03-14.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-gmq/opusTCv20210807+pft_transformer-big_2022-03-14.zip)
172
+ * more information released models: [OPUS-MT zle-gmq README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/zle-gmq/README.md)
173
+ * more information about the model: [MarianMT](https://huggingface.co/docs/transformers/model_doc/marian)
174
+
175
+ 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. `>>dan<<`
176
+
177
+ ## Usage
178
+
179
+ A short example code:
180
+
181
+ ```python
182
+ from transformers import MarianMTModel, MarianTokenizer
183
+
184
+ src_text = [
185
+ ">>dan<< Заўтра ўжо чацвер.",
186
+ ">>swe<< Том грав з Мері в кішки-мишки."
187
+ ]
188
+
189
+ model_name = "pytorch-models/opus-mt-tc-big-zle-gmq"
190
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
191
+ model = MarianMTModel.from_pretrained(model_name)
192
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
193
+
194
+ for t in translated:
195
+ print( tokenizer.decode(t, skip_special_tokens=True) )
196
+
197
+ # expected output:
198
+ # I morgen er det torsdag.
199
+ # Tom lekte med Mary i katt-möss.
200
+ ```
201
+
202
+ You can also use OPUS-MT models with the transformers pipelines, for example:
203
+
204
+ ```python
205
+ from transformers import pipeline
206
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-zle-gmq")
207
+ print(pipe(">>dan<< Заўтра ўжо чацвер."))
208
+
209
+ # expected output: I morgen er det torsdag.
210
+ ```
211
+
212
+ ## Benchmarks
213
+
214
+ * test set translations: [opusTCv20210807+pft_transformer-big_2022-03-14.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-gmq/opusTCv20210807+pft_transformer-big_2022-03-14.test.txt)
215
+ * test set scores: [opusTCv20210807+pft_transformer-big_2022-03-14.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-gmq/opusTCv20210807+pft_transformer-big_2022-03-14.eval.txt)
216
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
217
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
218
+
219
+ | langpair | testset | chr-F | BLEU | #sent | #words |
220
+ |----------|---------|-------|-------|-------|--------|
221
+ | rus-dan | tatoeba-test-v2021-08-07 | 0.74307 | 59.6 | 1713 | 11746 |
222
+ | rus-nob | tatoeba-test-v2021-08-07 | 0.66376 | 46.1 | 1277 | 11672 |
223
+ | rus-swe | tatoeba-test-v2021-08-07 | 0.69608 | 53.3 | 1282 | 8449 |
224
+ | bel-dan | flores101-devtest | 0.47621 | 13.9 | 1012 | 24638 |
225
+ | bel-nob | flores101-devtest | 0.44966 | 10.8 | 1012 | 23873 |
226
+ | bel-swe | flores101-devtest | 0.47274 | 13.2 | 1012 | 23121 |
227
+ | rus-dan | flores101-devtest | 0.55917 | 28.0 | 1012 | 24638 |
228
+ | rus-nob | flores101-devtest | 0.50724 | 20.6 | 1012 | 23873 |
229
+ | rus-swe | flores101-devtest | 0.55812 | 26.4 | 1012 | 23121 |
230
+ | ukr-dan | flores101-devtest | 0.57829 | 30.3 | 1012 | 24638 |
231
+ | ukr-nob | flores101-devtest | 0.52271 | 21.1 | 1012 | 23873 |
232
+ | ukr-swe | flores101-devtest | 0.57499 | 28.8 | 1012 | 23121 |
233
+
234
+ ## Acknowledgements
235
+
236
+ 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.
237
+
238
+ ## Model conversion info
239
+
240
+ * transformers version: 4.16.2
241
+ * OPUS-MT git hash: 1bdabf7
242
+ * port time: Wed Mar 23 23:13:54 EET 2022
243
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ bel-dan flores101-dev 0.47553 14.2 997 23685
2
+ bel-isl flores101-dev 0.25300 2.4 997 21857
3
+ bel-nob flores101-dev 0.44469 11.4 997 23157
4
+ bel-swe flores101-dev 0.47015 13.5 997 22417
5
+ rus-dan flores101-dev 0.56354 28.5 997 23685
6
+ rus-isl flores101-dev 0.26997 4.1 997 21857
7
+ rus-nob flores101-dev 0.50953 21.2 997 23157
8
+ rus-swe flores101-dev 0.56381 27.3 997 22417
9
+ bel-dan flores101-devtest 0.47621 13.9 1012 24638
10
+ bel-isl flores101-devtest 0.24826 2.6 1012 22834
11
+ bel-nob flores101-devtest 0.44966 10.8 1012 23873
12
+ bel-swe flores101-devtest 0.47274 13.2 1012 23121
13
+ rus-dan flores101-devtest 0.55917 28.0 1012 24638
14
+ rus-isl flores101-devtest 0.26803 4.1 1012 22834
15
+ rus-nob flores101-devtest 0.50724 20.6 1012 23873
16
+ rus-swe flores101-devtest 0.55812 26.4 1012 23121
17
+ ukr-dan flores101-devtest 0.57829 30.3 1012 24638
18
+ ukr-isl flores101-devtest 0.27243 4.4 1012 22834
19
+ ukr-nob flores101-devtest 0.52271 21.1 1012 23873
20
+ ukr-swe flores101-devtest 0.57499 28.8 1012 23121
21
+ ukr-dan flores101-dev 0.57956 30.4 997 23685
22
+ ukr-isl flores101-dev 0.27258 4.3 997 21857
23
+ ukr-nob flores101-dev 0.52248 21.9 997 23157
24
+ ukr-swe flores101-dev 0.57381 28.5 997 22417
25
+ rus-dan tatoeba-test-v2020-07-28 0.74307 59.6 1713 11746
26
+ rus-nob tatoeba-test-v2020-07-28 0.66376 46.1 1277 11672
27
+ rus-swe tatoeba-test-v2020-07-28 0.69608 53.3 1282 8449
28
+ rus-dan tatoeba-test-v2021-03-30 0.74307 59.6 1713 11746
29
+ rus-nob tatoeba-test-v2021-03-30 0.66376 46.1 1277 11672
30
+ rus-swe tatoeba-test-v2021-03-30 0.69608 53.3 1282 8449
31
+ rus-dan tatoeba-test-v2021-08-07 0.74307 59.6 1713 11746
32
+ rus-nob tatoeba-test-v2021-08-07 0.66376 46.1 1277 11672
33
+ rus-swe tatoeba-test-v2021-08-07 0.69608 53.3 1282 8449
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a489801c3a11cfcec937c2c99d1b8dfac5cc58bd83d740107f1ef4379007b446
3
+ size 5109306
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
+ 61375
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": 61375,
21
+ "decoder_vocab_size": 61376,
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": 24306,
28
+ "forced_eos_token_id": 24306,
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": 61375,
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": 61376
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:70e79fad3e862f415be03907ce7b154442e1e2165e8d3bfb6ab05129d4afd502
3
+ size 604325251
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bd8cc293d1b97fb3347ab64b85da528a533573e10a8a06badb6a5b28b7b20251
3
+ size 1009426
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:910f577e8872560ea9a4eb5385ef8cda9f9d38adfc3ac6c7fc6d383c03174979
3
+ size 806068
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "zle", "target_lang": "gmq", "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+pft_transformer-big_2022-03-14/zle-gmq", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff