tiedeman commited on
Commit
f39a913
1 Parent(s): f76c907

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,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-en-gmq
19
+ results:
20
+ - task:
21
+ name: Translation eng-dan
22
+ type: translation
23
+ args: eng-dan
24
+ dataset:
25
+ name: flores101-devtest
26
+ type: flores_101
27
+ args: eng dan devtest
28
+ metrics:
29
+ - name: BLEU
30
+ type: bleu
31
+ value: 47.7
32
+ - task:
33
+ name: Translation eng-isl
34
+ type: translation
35
+ args: eng-isl
36
+ dataset:
37
+ name: flores101-devtest
38
+ type: flores_101
39
+ args: eng isl devtest
40
+ metrics:
41
+ - name: BLEU
42
+ type: bleu
43
+ value: 24.1
44
+ - task:
45
+ name: Translation eng-nob
46
+ type: translation
47
+ args: eng-nob
48
+ dataset:
49
+ name: flores101-devtest
50
+ type: flores_101
51
+ args: eng nob devtest
52
+ metrics:
53
+ - name: BLEU
54
+ type: bleu
55
+ value: 34.5
56
+ - task:
57
+ name: Translation eng-swe
58
+ type: translation
59
+ args: eng-swe
60
+ dataset:
61
+ name: flores101-devtest
62
+ type: flores_101
63
+ args: eng swe devtest
64
+ metrics:
65
+ - name: BLEU
66
+ type: bleu
67
+ value: 46.9
68
+ - task:
69
+ name: Translation eng-isl
70
+ type: translation
71
+ args: eng-isl
72
+ dataset:
73
+ name: newsdev2021.en-is
74
+ type: newsdev2021.en-is
75
+ args: eng-isl
76
+ metrics:
77
+ - name: BLEU
78
+ type: bleu
79
+ value: 22.6
80
+ - task:
81
+ name: Translation eng-dan
82
+ type: translation
83
+ args: eng-dan
84
+ dataset:
85
+ name: tatoeba-test-v2021-08-07
86
+ type: tatoeba_mt
87
+ args: eng-dan
88
+ metrics:
89
+ - name: BLEU
90
+ type: bleu
91
+ value: 61.6
92
+ - task:
93
+ name: Translation eng-isl
94
+ type: translation
95
+ args: eng-isl
96
+ dataset:
97
+ name: tatoeba-test-v2021-08-07
98
+ type: tatoeba_mt
99
+ args: eng-isl
100
+ metrics:
101
+ - name: BLEU
102
+ type: bleu
103
+ value: 39.9
104
+ - task:
105
+ name: Translation eng-nno
106
+ type: translation
107
+ args: eng-nno
108
+ dataset:
109
+ name: tatoeba-test-v2021-08-07
110
+ type: tatoeba_mt
111
+ args: eng-nno
112
+ metrics:
113
+ - name: BLEU
114
+ type: bleu
115
+ value: 40.1
116
+ - task:
117
+ name: Translation eng-nob
118
+ type: translation
119
+ args: eng-nob
120
+ dataset:
121
+ name: tatoeba-test-v2021-08-07
122
+ type: tatoeba_mt
123
+ args: eng-nob
124
+ metrics:
125
+ - name: BLEU
126
+ type: bleu
127
+ value: 57.3
128
+ - task:
129
+ name: Translation eng-swe
130
+ type: translation
131
+ args: eng-swe
132
+ dataset:
133
+ name: tatoeba-test-v2021-08-07
134
+ type: tatoeba_mt
135
+ args: eng-swe
136
+ metrics:
137
+ - name: BLEU
138
+ type: bleu
139
+ value: 60.9
140
+ - task:
141
+ name: Translation eng-isl
142
+ type: translation
143
+ args: eng-isl
144
+ dataset:
145
+ name: newstest2021.en-is
146
+ type: wmt-2021-news
147
+ args: eng-isl
148
+ metrics:
149
+ - name: BLEU
150
+ type: bleu
151
+ value: 21.5
152
+ ---
153
+ # opus-mt-tc-big-en-gmq
154
+
155
+ Neural machine translation model for translating from English (en) to North Germanic languages (gmq).
156
+
157
+ 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).
158
+
159
+ * 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.)
160
+
161
+ ```
162
+ @inproceedings{tiedemann-thottingal-2020-opus,
163
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
164
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
165
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
166
+ month = nov,
167
+ year = "2020",
168
+ address = "Lisboa, Portugal",
169
+ publisher = "European Association for Machine Translation",
170
+ url = "https://aclanthology.org/2020.eamt-1.61",
171
+ pages = "479--480",
172
+ }
173
+
174
+ @inproceedings{tiedemann-2020-tatoeba,
175
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
176
+ author = {Tiedemann, J{\"o}rg},
177
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
178
+ month = nov,
179
+ year = "2020",
180
+ address = "Online",
181
+ publisher = "Association for Computational Linguistics",
182
+ url = "https://aclanthology.org/2020.wmt-1.139",
183
+ pages = "1174--1182",
184
+ }
185
+ ```
186
+
187
+ ## Model info
188
+
189
+ * Release: 2022-03-17
190
+ * source language(s): eng
191
+ * target language(s): dan fao isl nno nob nor swe
192
+ * valid target language labels: >>dan<< >>fao<< >>isl<< >>nno<< >>nob<< >>nor<< >>swe<<
193
+ * model: transformer-big
194
+ * data: opusTCv20210807+bt ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
195
+ * tokenization: SentencePiece (spm32k,spm32k)
196
+ * original model: [opusTCv20210807+bt_transformer-big_2022-03-17.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-gmq/opusTCv20210807+bt_transformer-big_2022-03-17.zip)
197
+ * more information released models: [OPUS-MT eng-gmq README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/eng-gmq/README.md)
198
+ * more information about the model: [MarianMT](https://huggingface.co/docs/transformers/model_doc/marian)
199
+
200
+ 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<<`
201
+
202
+ ## Usage
203
+
204
+ A short example code:
205
+
206
+ ```python
207
+ from transformers import MarianMTModel, MarianTokenizer
208
+
209
+ src_text = [
210
+ ">>nno<< The United States borders Canada.",
211
+ ">>nob<< This is the biggest hotel in this city."
212
+ ]
213
+
214
+ model_name = "pytorch-models/opus-mt-tc-big-en-gmq"
215
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
216
+ model = MarianMTModel.from_pretrained(model_name)
217
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
218
+
219
+ for t in translated:
220
+ print( tokenizer.decode(t, skip_special_tokens=True) )
221
+
222
+ # expected output:
223
+ # USA grensar til Canada.
224
+ # Dette er det største hotellet i denne byen.
225
+ ```
226
+
227
+ You can also use OPUS-MT models with the transformers pipelines, for example:
228
+
229
+ ```python
230
+ from transformers import pipeline
231
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-en-gmq")
232
+ print(pipe(">>nno<< The United States borders Canada."))
233
+
234
+ # expected output: USA grensar til Canada.
235
+ ```
236
+
237
+ ## Benchmarks
238
+
239
+ * test set translations: [opusTCv20210807+bt_transformer-big_2022-03-17.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-gmq/opusTCv20210807+bt_transformer-big_2022-03-17.test.txt)
240
+ * test set scores: [opusTCv20210807+bt_transformer-big_2022-03-17.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-gmq/opusTCv20210807+bt_transformer-big_2022-03-17.eval.txt)
241
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
242
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
243
+
244
+ | langpair | testset | chr-F | BLEU | #sent | #words |
245
+ |----------|---------|-------|-------|-------|--------|
246
+ | eng-dan | tatoeba-test-v2021-08-07 | 0.75165 | 61.6 | 10795 | 79385 |
247
+ | eng-fao | tatoeba-test-v2021-08-07 | 0.40395 | 18.3 | 294 | 1933 |
248
+ | eng-isl | tatoeba-test-v2021-08-07 | 0.59731 | 39.9 | 2503 | 19023 |
249
+ | eng-nno | tatoeba-test-v2021-08-07 | 0.61271 | 40.1 | 460 | 3428 |
250
+ | eng-nob | tatoeba-test-v2021-08-07 | 0.72380 | 57.3 | 4539 | 36119 |
251
+ | eng-swe | tatoeba-test-v2021-08-07 | 0.74197 | 60.9 | 10362 | 68067 |
252
+ | eng-dan | flores101-devtest | 0.70810 | 47.7 | 1012 | 24638 |
253
+ | eng-isl | flores101-devtest | 0.52076 | 24.1 | 1012 | 22834 |
254
+ | eng-nob | flores101-devtest | 0.62760 | 34.5 | 1012 | 23873 |
255
+ | eng-swe | flores101-devtest | 0.70129 | 46.9 | 1012 | 23121 |
256
+ | eng-isl | newsdev2021.en-is | 0.50376 | 22.6 | 2004 | 43721 |
257
+ | eng-isl | newstest2021.en-is | 0.50516 | 21.5 | 1000 | 25233 |
258
+
259
+ ## Acknowledgements
260
+
261
+ 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.
262
+
263
+ ## Model conversion info
264
+
265
+ * transformers version: 4.16.2
266
+ * OPUS-MT git hash: 3405783
267
+ * port time: Wed Apr 13 17:14:46 EEST 2022
268
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ eng-dan flores101-dev 0.69727 46.5 997 23685
2
+ eng-isl flores101-dev 0.52713 24.8 997 21857
3
+ eng-nob flores101-dev 0.62160 34.1 997 23157
4
+ eng-swe flores101-dev 0.70140 46.5 997 22417
5
+ eng-dan flores101-devtest 0.70810 47.7 1012 24638
6
+ eng-isl flores101-devtest 0.52076 24.1 1012 22834
7
+ eng-nob flores101-devtest 0.62760 34.5 1012 23873
8
+ eng-swe flores101-devtest 0.70129 46.9 1012 23121
9
+ eng-isl newsdev2021.en-is 0.50376 22.6 2004 43721
10
+ eng-isl newstest2021.en-is 0.50516 21.5 1000 25233
11
+ eng-dan tatoeba-test-v2020-07-28 0.75072 61.5 10000 73213
12
+ eng-fao tatoeba-test-v2020-07-28 0.40395 18.3 294 1933
13
+ eng-isl tatoeba-test-v2020-07-28 0.59738 39.9 2500 18999
14
+ eng-nno tatoeba-test-v2020-07-28 0.61271 40.1 460 3428
15
+ eng-nob tatoeba-test-v2020-07-28 0.72382 57.3 4539 36119
16
+ eng-swe tatoeba-test-v2020-07-28 0.74233 61.1 10000 65581
17
+ eng-dan tatoeba-test-v2021-03-30 0.75155 61.6 10437 76467
18
+ eng-fao tatoeba-test-v2021-03-30 0.40364 18.4 297 1948
19
+ eng-isl tatoeba-test-v2021-03-30 0.59722 39.9 4994 37970
20
+ eng-nno tatoeba-test-v2021-03-30 0.61271 40.1 460 3428
21
+ eng-nob tatoeba-test-v2021-03-30 0.72382 57.3 4539 36119
22
+ eng-swe tatoeba-test-v2021-03-30 0.74248 61.1 10151 66592
23
+ eng-dan tatoeba-test-v2021-08-07 0.75165 61.6 10795 79385
24
+ eng-fao tatoeba-test-v2021-08-07 0.40395 18.3 294 1933
25
+ eng-isl tatoeba-test-v2021-08-07 0.59731 39.9 2503 19023
26
+ eng-nno tatoeba-test-v2021-08-07 0.61271 40.1 460 3428
27
+ eng-nob tatoeba-test-v2021-08-07 0.72380 57.3 4539 36119
28
+ eng-swe tatoeba-test-v2021-08-07 0.74197 60.9 10362 68067
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1786f0950d4cce6d8f306c060a874c69c17c14a1fa130bb51c713037668931ea
3
+ size 4521825
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
+ 54666
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": 54666,
21
+ "decoder_vocab_size": 54667,
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": 41839,
28
+ "forced_eos_token_id": 41839,
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": 54666,
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": 54667
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0933406c11fd3bfdd2f65c82d192e91424136ba4cb7b6e68f75d720b2c666f30
3
+ size 576831811
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:05f3dec886e0b8ce55a962aa0f1c747b9606c6068d76e3e840ed9a0d2b64ce57
3
+ size 794427
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:c8b2f0d2cf9308d2fe38257c8ddb0ed93d20fc71057d917028e3ac237a4c5b13
3
+ size 799832
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "en", "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+bt_transformer-big_2022-03-17/en-gmq", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff