tiedeman commited on
Commit
acecdb7
1 Parent(s): 2e95290

Initial commit

Browse files
.gitattributes CHANGED
@@ -26,3 +26,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
26
  *.zip filter=lfs diff=lfs merge=lfs -text
27
  *.zstandard filter=lfs diff=lfs merge=lfs -text
28
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
26
  *.zip filter=lfs diff=lfs merge=lfs -text
27
  *.zstandard filter=lfs diff=lfs merge=lfs -text
28
  *tfevents* filter=lfs diff=lfs merge=lfs -text
29
+ *.spm filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,276 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - da
4
+ - en
5
+ - fo
6
+ - gmq
7
+ - is
8
+ - nb
9
+ - nn
10
+ - no
11
+ - sv
12
+
13
+ tags:
14
+ - translation
15
+
16
+ license: cc-by-4.0
17
+ model-index:
18
+ - name: opus-mt-tc-big-gmq-en
19
+ results:
20
+ - task:
21
+ name: Translation dan-eng
22
+ type: translation
23
+ args: dan-eng
24
+ dataset:
25
+ name: flores101-devtest
26
+ type: flores_101
27
+ args: dan eng devtest
28
+ metrics:
29
+ - name: BLEU
30
+ type: bleu
31
+ value: 49.3
32
+ - task:
33
+ name: Translation isl-eng
34
+ type: translation
35
+ args: isl-eng
36
+ dataset:
37
+ name: flores101-devtest
38
+ type: flores_101
39
+ args: isl eng devtest
40
+ metrics:
41
+ - name: BLEU
42
+ type: bleu
43
+ value: 34.2
44
+ - task:
45
+ name: Translation nob-eng
46
+ type: translation
47
+ args: nob-eng
48
+ dataset:
49
+ name: flores101-devtest
50
+ type: flores_101
51
+ args: nob eng devtest
52
+ metrics:
53
+ - name: BLEU
54
+ type: bleu
55
+ value: 44.2
56
+ - task:
57
+ name: Translation swe-eng
58
+ type: translation
59
+ args: swe-eng
60
+ dataset:
61
+ name: flores101-devtest
62
+ type: flores_101
63
+ args: swe eng devtest
64
+ metrics:
65
+ - name: BLEU
66
+ type: bleu
67
+ value: 49.8
68
+ - task:
69
+ name: Translation isl-eng
70
+ type: translation
71
+ args: isl-eng
72
+ dataset:
73
+ name: newsdev2021.is-en
74
+ type: newsdev2021.is-en
75
+ args: isl-eng
76
+ metrics:
77
+ - name: BLEU
78
+ type: bleu
79
+ value: 30.4
80
+ - task:
81
+ name: Translation dan-eng
82
+ type: translation
83
+ args: dan-eng
84
+ dataset:
85
+ name: tatoeba-test-v2021-08-07
86
+ type: tatoeba_mt
87
+ args: dan-eng
88
+ metrics:
89
+ - name: BLEU
90
+ type: bleu
91
+ value: 65.9
92
+ - task:
93
+ name: Translation fao-eng
94
+ type: translation
95
+ args: fao-eng
96
+ dataset:
97
+ name: tatoeba-test-v2021-08-07
98
+ type: tatoeba_mt
99
+ args: fao-eng
100
+ metrics:
101
+ - name: BLEU
102
+ type: bleu
103
+ value: 30.1
104
+ - task:
105
+ name: Translation isl-eng
106
+ type: translation
107
+ args: isl-eng
108
+ dataset:
109
+ name: tatoeba-test-v2021-08-07
110
+ type: tatoeba_mt
111
+ args: isl-eng
112
+ metrics:
113
+ - name: BLEU
114
+ type: bleu
115
+ value: 53.3
116
+ - task:
117
+ name: Translation nno-eng
118
+ type: translation
119
+ args: nno-eng
120
+ dataset:
121
+ name: tatoeba-test-v2021-08-07
122
+ type: tatoeba_mt
123
+ args: nno-eng
124
+ metrics:
125
+ - name: BLEU
126
+ type: bleu
127
+ value: 56.1
128
+ - task:
129
+ name: Translation nob-eng
130
+ type: translation
131
+ args: nob-eng
132
+ dataset:
133
+ name: tatoeba-test-v2021-08-07
134
+ type: tatoeba_mt
135
+ args: nob-eng
136
+ metrics:
137
+ - name: BLEU
138
+ type: bleu
139
+ value: 60.2
140
+ - task:
141
+ name: Translation swe-eng
142
+ type: translation
143
+ args: swe-eng
144
+ dataset:
145
+ name: tatoeba-test-v2021-08-07
146
+ type: tatoeba_mt
147
+ args: swe-eng
148
+ metrics:
149
+ - name: BLEU
150
+ type: bleu
151
+ value: 66.4
152
+ - task:
153
+ name: Translation isl-eng
154
+ type: translation
155
+ args: isl-eng
156
+ dataset:
157
+ name: newstest2021.is-en
158
+ type: wmt-2021-news
159
+ args: isl-eng
160
+ metrics:
161
+ - name: BLEU
162
+ type: bleu
163
+ value: 34.4
164
+ ---
165
+ # opus-mt-tc-big-gmq-en
166
+
167
+ Neural machine translation model for translating from North Germanic languages (gmq) to English (en).
168
+
169
+ 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).
170
+
171
+ * 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.)
172
+
173
+ ```
174
+ @inproceedings{tiedemann-thottingal-2020-opus,
175
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
176
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
177
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
178
+ month = nov,
179
+ year = "2020",
180
+ address = "Lisboa, Portugal",
181
+ publisher = "European Association for Machine Translation",
182
+ url = "https://aclanthology.org/2020.eamt-1.61",
183
+ pages = "479--480",
184
+ }
185
+
186
+ @inproceedings{tiedemann-2020-tatoeba,
187
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
188
+ author = {Tiedemann, J{\"o}rg},
189
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
190
+ month = nov,
191
+ year = "2020",
192
+ address = "Online",
193
+ publisher = "Association for Computational Linguistics",
194
+ url = "https://aclanthology.org/2020.wmt-1.139",
195
+ pages = "1174--1182",
196
+ }
197
+ ```
198
+
199
+ ## Model info
200
+
201
+ * Release: 2022-03-09
202
+ * source language(s): dan fao isl nno nob nor swe
203
+ * target language(s): eng
204
+ * model: transformer-big
205
+ * data: opusTCv20210807+bt ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
206
+ * tokenization: SentencePiece (spm32k,spm32k)
207
+ * original model: [opusTCv20210807+bt_transformer-big_2022-03-09.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/gmq-eng/opusTCv20210807+bt_transformer-big_2022-03-09.zip)
208
+ * more information released models: [OPUS-MT gmq-eng README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/gmq-eng/README.md)
209
+
210
+ ## Usage
211
+
212
+ A short example code:
213
+
214
+ ```python
215
+ from transformers import MarianMTModel, MarianTokenizer
216
+
217
+ src_text = [
218
+ "Han var synligt nervøs.",
219
+ "Inte ens Tom själv var övertygad."
220
+ ]
221
+
222
+ model_name = "pytorch-models/opus-mt-tc-big-gmq-en"
223
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
224
+ model = MarianMTModel.from_pretrained(model_name)
225
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
226
+
227
+ for t in translated:
228
+ print( tokenizer.decode(t, skip_special_tokens=True) )
229
+
230
+ # expected output:
231
+ # He was visibly nervous.
232
+ # Even Tom was not convinced.
233
+ ```
234
+
235
+ You can also use OPUS-MT models with the transformers pipelines, for example:
236
+
237
+ ```python
238
+ from transformers import pipeline
239
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-gmq-en")
240
+ print(pipe("Han var synligt nervøs."))
241
+
242
+ # expected output: He was visibly nervous.
243
+ ```
244
+
245
+ ## Benchmarks
246
+
247
+ * test set translations: [opusTCv20210807+bt_transformer-big_2022-03-09.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/gmq-eng/opusTCv20210807+bt_transformer-big_2022-03-09.test.txt)
248
+ * test set scores: [opusTCv20210807+bt_transformer-big_2022-03-09.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/gmq-eng/opusTCv20210807+bt_transformer-big_2022-03-09.eval.txt)
249
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
250
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
251
+
252
+ | langpair | testset | chr-F | BLEU | #sent | #words |
253
+ |----------|---------|-------|-------|-------|--------|
254
+ | dan-eng | tatoeba-test-v2021-08-07 | 0.78292 | 65.9 | 10795 | 79684 |
255
+ | fao-eng | tatoeba-test-v2021-08-07 | 0.47467 | 30.1 | 294 | 1984 |
256
+ | isl-eng | tatoeba-test-v2021-08-07 | 0.68346 | 53.3 | 2503 | 19788 |
257
+ | nno-eng | tatoeba-test-v2021-08-07 | 0.69788 | 56.1 | 460 | 3524 |
258
+ | nob-eng | tatoeba-test-v2021-08-07 | 0.73524 | 60.2 | 4539 | 36823 |
259
+ | swe-eng | tatoeba-test-v2021-08-07 | 0.77665 | 66.4 | 10362 | 68513 |
260
+ | dan-eng | flores101-devtest | 0.72322 | 49.3 | 1012 | 24721 |
261
+ | isl-eng | flores101-devtest | 0.59616 | 34.2 | 1012 | 24721 |
262
+ | nob-eng | flores101-devtest | 0.68224 | 44.2 | 1012 | 24721 |
263
+ | swe-eng | flores101-devtest | 0.72042 | 49.8 | 1012 | 24721 |
264
+ | isl-eng | newsdev2021.is-en | 0.56709 | 30.4 | 2004 | 46383 |
265
+ | isl-eng | newstest2021.is-en | 0.57756 | 34.4 | 1000 | 22529 |
266
+
267
+ ## Acknowledgements
268
+
269
+ 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.
270
+
271
+ ## Model conversion info
272
+
273
+ * transformers version: 4.16.2
274
+ * OPUS-MT git hash: 3405783
275
+ * port time: Wed Apr 13 19:13:11 EEST 2022
276
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ dan-eng flores101-dev 0.72535 49.7 997 23555
2
+ isl-eng flores101-dev 0.60060 34.7 997 23555
3
+ nob-eng flores101-dev 0.68464 43.7 997 23555
4
+ swe-eng flores101-dev 0.72445 50.6 997 23555
5
+ dan-eng flores101-devtest 0.72322 49.3 1012 24721
6
+ isl-eng flores101-devtest 0.59616 34.2 1012 24721
7
+ nob-eng flores101-devtest 0.68224 44.2 1012 24721
8
+ swe-eng flores101-devtest 0.72042 49.8 1012 24721
9
+ isl-eng newsdev2021.is-en 0.56709 30.4 2004 46383
10
+ isl-eng newstest2021.is-en 0.57756 34.4 1000 22529
11
+ dan-eng tatoeba-test-v2020-07-28 0.78295 65.9 10000 73617
12
+ fao-eng tatoeba-test-v2020-07-28 0.47467 30.1 294 1984
13
+ isl-eng tatoeba-test-v2020-07-28 0.68350 53.4 2500 19763
14
+ nno-eng tatoeba-test-v2020-07-28 0.69788 56.1 460 3524
15
+ nob-eng tatoeba-test-v2020-07-28 0.73524 60.2 4539 36823
16
+ swe-eng tatoeba-test-v2020-07-28 0.77685 66.6 10000 66002
17
+ dan-eng tatoeba-test-v2021-03-30 0.78345 65.9 10437 76848
18
+ fao-eng tatoeba-test-v2021-03-30 0.47446 30.1 297 2001
19
+ isl-eng tatoeba-test-v2021-03-30 0.68341 53.3 4994 39502
20
+ nno-eng tatoeba-test-v2021-03-30 0.69788 56.1 460 3524
21
+ nob-eng tatoeba-test-v2021-03-30 0.73524 60.2 4539 36823
22
+ swe-eng tatoeba-test-v2021-03-30 0.77689 66.6 10151 67008
23
+ dan-eng tatoeba-test-v2021-08-07 0.78292 65.9 10795 79684
24
+ fao-eng tatoeba-test-v2021-08-07 0.47467 30.1 294 1984
25
+ isl-eng tatoeba-test-v2021-08-07 0.68346 53.3 2503 19788
26
+ nno-eng tatoeba-test-v2021-08-07 0.69788 56.1 460 3524
27
+ nob-eng tatoeba-test-v2021-08-07 0.73524 60.2 4539 36823
28
+ swe-eng tatoeba-test-v2021-08-07 0.77665 66.4 10362 68513
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cc2861a126af3f77c25c86112019a4e5f15003916f956af0bb40ab72de6da156
3
+ size 4420129
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
+ 54764
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": 54764,
21
+ "decoder_vocab_size": 54765,
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": 41977,
28
+ "forced_eos_token_id": 41977,
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": 54764,
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": 54765
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e16aaade22b71f4d1f7dc28c289f40d76cecf9bfadf3ff1363dcc8d0c097b323
3
+ size 577233411
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:20dd2029ff0a4b6dd7b89442035d57fb03e9a9efbbd36543d5aae5e2aa866bad
3
+ size 799747
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:c51247265dd2c7773c3be3669b63c5152ce145baeb54a17975145309eb422cf2
3
+ size 795929
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
1
+ {"source_lang": "gmq", "target_lang": "en", "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-09/gmq-en", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff