tiedeman commited on
Commit
c11d60e
1 Parent(s): b2d987c

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
+ - ca
4
+ - cat+oci+spa
5
+ - en
6
+ - es
7
+
8
+ tags:
9
+ - translation
10
+
11
+ license: cc-by-4.0
12
+ model-index:
13
+ - name: opus-mt-tc-big-en-cat_oci_spa
14
+ results:
15
+ - task:
16
+ name: Translation eng-cat
17
+ type: translation
18
+ args: eng-cat
19
+ dataset:
20
+ name: flores101-devtest
21
+ type: flores_101
22
+ args: eng cat devtest
23
+ metrics:
24
+ - name: BLEU
25
+ type: bleu
26
+ value: 41.5
27
+ - task:
28
+ name: Translation eng-oci
29
+ type: translation
30
+ args: eng-oci
31
+ dataset:
32
+ name: flores101-devtest
33
+ type: flores_101
34
+ args: eng oci devtest
35
+ metrics:
36
+ - name: BLEU
37
+ type: bleu
38
+ value: 25.4
39
+ - task:
40
+ name: Translation eng-spa
41
+ type: translation
42
+ args: eng-spa
43
+ dataset:
44
+ name: flores101-devtest
45
+ type: flores_101
46
+ args: eng spa devtest
47
+ metrics:
48
+ - name: BLEU
49
+ type: bleu
50
+ value: 28.1
51
+ - task:
52
+ name: Translation eng-spa
53
+ type: translation
54
+ args: eng-spa
55
+ dataset:
56
+ name: news-test2008
57
+ type: news-test2008
58
+ args: eng-spa
59
+ metrics:
60
+ - name: BLEU
61
+ type: bleu
62
+ value: 30.0
63
+ - task:
64
+ name: Translation eng-cat
65
+ type: translation
66
+ args: eng-cat
67
+ dataset:
68
+ name: tatoeba-test-v2021-08-07
69
+ type: tatoeba_mt
70
+ args: eng-cat
71
+ metrics:
72
+ - name: BLEU
73
+ type: bleu
74
+ value: 47.8
75
+ - task:
76
+ name: Translation eng-spa
77
+ type: translation
78
+ args: eng-spa
79
+ dataset:
80
+ name: tatoeba-test-v2021-08-07
81
+ type: tatoeba_mt
82
+ args: eng-spa
83
+ metrics:
84
+ - name: BLEU
85
+ type: bleu
86
+ value: 57.0
87
+ - task:
88
+ name: Translation eng-spa
89
+ type: translation
90
+ args: eng-spa
91
+ dataset:
92
+ name: tico19-test
93
+ type: tico19-test
94
+ args: eng-spa
95
+ metrics:
96
+ - name: BLEU
97
+ type: bleu
98
+ value: 52.5
99
+ - task:
100
+ name: Translation eng-spa
101
+ type: translation
102
+ args: eng-spa
103
+ dataset:
104
+ name: newstest2009
105
+ type: wmt-2009-news
106
+ args: eng-spa
107
+ metrics:
108
+ - name: BLEU
109
+ type: bleu
110
+ value: 30.5
111
+ - task:
112
+ name: Translation eng-spa
113
+ type: translation
114
+ args: eng-spa
115
+ dataset:
116
+ name: newstest2010
117
+ type: wmt-2010-news
118
+ args: eng-spa
119
+ metrics:
120
+ - name: BLEU
121
+ type: bleu
122
+ value: 37.4
123
+ - task:
124
+ name: Translation eng-spa
125
+ type: translation
126
+ args: eng-spa
127
+ dataset:
128
+ name: newstest2011
129
+ type: wmt-2011-news
130
+ args: eng-spa
131
+ metrics:
132
+ - name: BLEU
133
+ type: bleu
134
+ value: 39.1
135
+ - task:
136
+ name: Translation eng-spa
137
+ type: translation
138
+ args: eng-spa
139
+ dataset:
140
+ name: newstest2012
141
+ type: wmt-2012-news
142
+ args: eng-spa
143
+ metrics:
144
+ - name: BLEU
145
+ type: bleu
146
+ value: 39.6
147
+ - task:
148
+ name: Translation eng-spa
149
+ type: translation
150
+ args: eng-spa
151
+ dataset:
152
+ name: newstest2013
153
+ type: wmt-2013-news
154
+ args: eng-spa
155
+ metrics:
156
+ - name: BLEU
157
+ type: bleu
158
+ value: 35.8
159
+ ---
160
+ # opus-mt-tc-big-en-cat_oci_spa
161
+
162
+ Neural machine translation model for translating from English (en) to unknown (cat+oci+spa).
163
+
164
+ 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).
165
+
166
+ * 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.)
167
+
168
+ ```
169
+ @inproceedings{tiedemann-thottingal-2020-opus,
170
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
171
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
172
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
173
+ month = nov,
174
+ year = "2020",
175
+ address = "Lisboa, Portugal",
176
+ publisher = "European Association for Machine Translation",
177
+ url = "https://aclanthology.org/2020.eamt-1.61",
178
+ pages = "479--480",
179
+ }
180
+
181
+ @inproceedings{tiedemann-2020-tatoeba,
182
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
183
+ author = {Tiedemann, J{\"o}rg},
184
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
185
+ month = nov,
186
+ year = "2020",
187
+ address = "Online",
188
+ publisher = "Association for Computational Linguistics",
189
+ url = "https://aclanthology.org/2020.wmt-1.139",
190
+ pages = "1174--1182",
191
+ }
192
+ ```
193
+
194
+ ## Model info
195
+
196
+ * Release: 2022-03-13
197
+ * source language(s): eng
198
+ * target language(s): cat spa
199
+ * valid target language labels: >>cat<< >>spa<<
200
+ * model: transformer-big
201
+ * data: opusTCv20210807+bt ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
202
+ * tokenization: SentencePiece (spm32k,spm32k)
203
+ * original model: [opusTCv20210807+bt_transformer-big_2022-03-13.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-cat+oci+spa/opusTCv20210807+bt_transformer-big_2022-03-13.zip)
204
+ * more information released models: [OPUS-MT eng-cat+oci+spa README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/eng-cat+oci+spa/README.md)
205
+ * more information about the model: [MarianMT](https://huggingface.co/docs/transformers/model_doc/marian)
206
+
207
+ 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. `>>cat<<`
208
+
209
+ ## Usage
210
+
211
+ A short example code:
212
+
213
+ ```python
214
+ from transformers import MarianMTModel, MarianTokenizer
215
+
216
+ src_text = [
217
+ ">>spa<< Why do you want Tom to go there with me?",
218
+ ">>spa<< She forced him to eat spinach."
219
+ ]
220
+
221
+ model_name = "pytorch-models/opus-mt-tc-big-en-cat_oci_spa"
222
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
223
+ model = MarianMTModel.from_pretrained(model_name)
224
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
225
+
226
+ for t in translated:
227
+ print( tokenizer.decode(t, skip_special_tokens=True) )
228
+
229
+ # expected output:
230
+ # ¿Por qué quieres que Tom vaya conmigo?
231
+ # Ella lo obligó a comer espinacas.
232
+ ```
233
+
234
+ You can also use OPUS-MT models with the transformers pipelines, for example:
235
+
236
+ ```python
237
+ from transformers import pipeline
238
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-en-cat_oci_spa")
239
+ print(pipe(">>spa<< Why do you want Tom to go there with me?"))
240
+
241
+ # expected output: ¿Por qué quieres que Tom vaya conmigo?
242
+ ```
243
+
244
+ ## Benchmarks
245
+
246
+ * test set translations: [opusTCv20210807+bt_transformer-big_2022-03-13.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-cat+oci+spa/opusTCv20210807+bt_transformer-big_2022-03-13.test.txt)
247
+ * test set scores: [opusTCv20210807+bt_transformer-big_2022-03-13.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-cat+oci+spa/opusTCv20210807+bt_transformer-big_2022-03-13.eval.txt)
248
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
249
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
250
+
251
+ | langpair | testset | chr-F | BLEU | #sent | #words |
252
+ |----------|---------|-------|-------|-------|--------|
253
+ | eng-cat | tatoeba-test-v2021-08-07 | 0.66414 | 47.8 | 1631 | 12344 |
254
+ | eng-spa | tatoeba-test-v2021-08-07 | 0.73725 | 57.0 | 16583 | 134710 |
255
+ | eng-cat | flores101-devtest | 0.66071 | 41.5 | 1012 | 27304 |
256
+ | eng-oci | flores101-devtest | 0.56192 | 25.4 | 1012 | 27305 |
257
+ | eng-spa | flores101-devtest | 0.56288 | 28.1 | 1012 | 29199 |
258
+ | eng-spa | newssyscomb2009 | 0.58431 | 31.4 | 502 | 12503 |
259
+ | eng-spa | news-test2008 | 0.56622 | 30.0 | 2051 | 52586 |
260
+ | eng-spa | newstest2009 | 0.57988 | 30.5 | 2525 | 68111 |
261
+ | eng-spa | newstest2010 | 0.62343 | 37.4 | 2489 | 65480 |
262
+ | eng-spa | newstest2011 | 0.62424 | 39.1 | 3003 | 79476 |
263
+ | eng-spa | newstest2012 | 0.63006 | 39.6 | 3003 | 79006 |
264
+ | eng-spa | newstest2013 | 0.60291 | 35.8 | 3000 | 70528 |
265
+ | eng-spa | tico19-test | 0.73224 | 52.5 | 2100 | 66563 |
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 16:40:45 EEST 2022
276
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ eng-cat flores101-dev 0.65604 41.5 997 25962
2
+ eng-oci flores101-dev 0.56013 26.2 997 25819
3
+ eng-spa flores101-dev 0.55897 27.9 997 27793
4
+ eng-cat flores101-devtest 0.66071 41.5 1012 27304
5
+ eng-oci flores101-devtest 0.56192 25.4 1012 27305
6
+ eng-spa flores101-devtest 0.56288 28.1 1012 29199
7
+ eng-spa newssyscomb2009 0.58431 31.4 502 12503
8
+ eng-spa news-test2008 0.56622 30.0 2051 52586
9
+ eng-spa newstest2009 0.57988 30.5 2525 68111
10
+ eng-spa newstest2010 0.62343 37.4 2489 65480
11
+ eng-spa newstest2011 0.62424 39.1 3003 79476
12
+ eng-spa newstest2012 0.63006 39.6 3003 79006
13
+ eng-spa newstest2013 0.60291 35.8 3000 70528
14
+ eng-cat tatoeba-test-v2020-07-28 0.66414 47.8 1631 12344
15
+ eng-oci tatoeba-test-v2020-07-28 0.29240 7.6 841 5219
16
+ eng-spa tatoeba-test-v2020-07-28 0.71865 54.7 10000 77311
17
+ eng-cat tatoeba-test-v2021-03-30 0.66414 47.8 1631 12344
18
+ eng-oci tatoeba-test-v2021-03-30 0.29229 7.6 842 5225
19
+ eng-spa tatoeba-test-v2021-03-30 0.72447 55.6 11940 93423
20
+ eng-cat tatoeba-test-v2021-08-07 0.66414 47.8 1631 12344
21
+ eng-oci tatoeba-test-v2021-08-07 0.29240 7.6 841 5219
22
+ eng-spa tatoeba-test-v2021-08-07 0.73725 57.0 16583 134710
23
+ eng-spa tico19-test 0.73224 52.5 2100 66563
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:872a0364c4eedd24febbe771fb4862d05f1d4c3115d5228814700ca1ea764b8a
3
+ size 5252802
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
+ 54659
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": 54659,
21
+ "decoder_vocab_size": 54660,
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": 44542,
28
+ "forced_eos_token_id": 44542,
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": 54659,
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": 54660
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9013edf4646ea69306618cbb47a8cc3d8aefd2e131241ea37d7e69670bf67ad8
3
+ size 576803139
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:80a586743ff7dccadac4e1839fbc31698a16c5aadec719c5d0d0ad2667cf6b38
3
+ size 802599
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:af7471aac423933fb52d9bbea0d1d90f2888a898150fc43fc32cb4fbc20bab84
3
+ size 819513
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "en", "target_lang": "cat+oci+spa", "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-13/en-cat+oci+spa", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff