tiedeman commited on
Commit
0ba3b42
1 Parent(s): 79b4f28

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,231 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - es
5
+
6
+ tags:
7
+ - translation
8
+
9
+ license: cc-by-4.0
10
+ model-index:
11
+ - name: opus-mt-tc-big-en-es
12
+ results:
13
+ - task:
14
+ name: Translation eng-spa
15
+ type: translation
16
+ args: eng-spa
17
+ dataset:
18
+ name: flores101-devtest
19
+ type: flores_101
20
+ args: eng spa devtest
21
+ metrics:
22
+ - name: BLEU
23
+ type: bleu
24
+ value: 28.5
25
+ - task:
26
+ name: Translation eng-spa
27
+ type: translation
28
+ args: eng-spa
29
+ dataset:
30
+ name: news-test2008
31
+ type: news-test2008
32
+ args: eng-spa
33
+ metrics:
34
+ - name: BLEU
35
+ type: bleu
36
+ value: 30.1
37
+ - task:
38
+ name: Translation eng-spa
39
+ type: translation
40
+ args: eng-spa
41
+ dataset:
42
+ name: tatoeba-test-v2021-08-07
43
+ type: tatoeba_mt
44
+ args: eng-spa
45
+ metrics:
46
+ - name: BLEU
47
+ type: bleu
48
+ value: 57.2
49
+ - task:
50
+ name: Translation eng-spa
51
+ type: translation
52
+ args: eng-spa
53
+ dataset:
54
+ name: tico19-test
55
+ type: tico19-test
56
+ args: eng-spa
57
+ metrics:
58
+ - name: BLEU
59
+ type: bleu
60
+ value: 53.0
61
+ - task:
62
+ name: Translation eng-spa
63
+ type: translation
64
+ args: eng-spa
65
+ dataset:
66
+ name: newstest2009
67
+ type: wmt-2009-news
68
+ args: eng-spa
69
+ metrics:
70
+ - name: BLEU
71
+ type: bleu
72
+ value: 30.2
73
+ - task:
74
+ name: Translation eng-spa
75
+ type: translation
76
+ args: eng-spa
77
+ dataset:
78
+ name: newstest2010
79
+ type: wmt-2010-news
80
+ args: eng-spa
81
+ metrics:
82
+ - name: BLEU
83
+ type: bleu
84
+ value: 37.6
85
+ - task:
86
+ name: Translation eng-spa
87
+ type: translation
88
+ args: eng-spa
89
+ dataset:
90
+ name: newstest2011
91
+ type: wmt-2011-news
92
+ args: eng-spa
93
+ metrics:
94
+ - name: BLEU
95
+ type: bleu
96
+ value: 38.9
97
+ - task:
98
+ name: Translation eng-spa
99
+ type: translation
100
+ args: eng-spa
101
+ dataset:
102
+ name: newstest2012
103
+ type: wmt-2012-news
104
+ args: eng-spa
105
+ metrics:
106
+ - name: BLEU
107
+ type: bleu
108
+ value: 39.5
109
+ - task:
110
+ name: Translation eng-spa
111
+ type: translation
112
+ args: eng-spa
113
+ dataset:
114
+ name: newstest2013
115
+ type: wmt-2013-news
116
+ args: eng-spa
117
+ metrics:
118
+ - name: BLEU
119
+ type: bleu
120
+ value: 35.9
121
+ ---
122
+ # opus-mt-tc-big-en-es
123
+
124
+ Neural machine translation model for translating from English (en) to Spanish (es).
125
+
126
+ 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).
127
+
128
+ * 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.)
129
+
130
+ ```
131
+ @inproceedings{tiedemann-thottingal-2020-opus,
132
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
133
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
134
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
135
+ month = nov,
136
+ year = "2020",
137
+ address = "Lisboa, Portugal",
138
+ publisher = "European Association for Machine Translation",
139
+ url = "https://aclanthology.org/2020.eamt-1.61",
140
+ pages = "479--480",
141
+ }
142
+
143
+ @inproceedings{tiedemann-2020-tatoeba,
144
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
145
+ author = {Tiedemann, J{\"o}rg},
146
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
147
+ month = nov,
148
+ year = "2020",
149
+ address = "Online",
150
+ publisher = "Association for Computational Linguistics",
151
+ url = "https://aclanthology.org/2020.wmt-1.139",
152
+ pages = "1174--1182",
153
+ }
154
+ ```
155
+
156
+ ## Model info
157
+
158
+ * Release: 2022-03-13
159
+ * source language(s): eng
160
+ * target language(s): spa
161
+ * model: transformer-big
162
+ * data: opusTCv20210807+bt ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
163
+ * tokenization: SentencePiece (spm32k,spm32k)
164
+ * original model: [opusTCv20210807+bt_transformer-big_2022-03-13.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-spa/opusTCv20210807+bt_transformer-big_2022-03-13.zip)
165
+ * more information released models: [OPUS-MT eng-spa README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/eng-spa/README.md)
166
+
167
+ ## Usage
168
+
169
+ A short example code:
170
+
171
+ ```python
172
+ from transformers import MarianMTModel, MarianTokenizer
173
+
174
+ src_text = [
175
+ "A wasp stung him and he had an allergic reaction.",
176
+ "I love nature."
177
+ ]
178
+
179
+ model_name = "pytorch-models/opus-mt-tc-big-en-es"
180
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
181
+ model = MarianMTModel.from_pretrained(model_name)
182
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
183
+
184
+ for t in translated:
185
+ print( tokenizer.decode(t, skip_special_tokens=True) )
186
+
187
+ # expected output:
188
+ # Una avispa lo picó y tuvo una reacción alérgica.
189
+ # Me encanta la naturaleza.
190
+ ```
191
+
192
+ You can also use OPUS-MT models with the transformers pipelines, for example:
193
+
194
+ ```python
195
+ from transformers import pipeline
196
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-en-es")
197
+ print(pipe("A wasp stung him and he had an allergic reaction."))
198
+
199
+ # expected output: Una avispa lo picó y tuvo una reacción alérgica.
200
+ ```
201
+
202
+ ## Benchmarks
203
+
204
+ * test set translations: [opusTCv20210807+bt_transformer-big_2022-03-13.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-spa/opusTCv20210807+bt_transformer-big_2022-03-13.test.txt)
205
+ * test set scores: [opusTCv20210807+bt_transformer-big_2022-03-13.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/eng-spa/opusTCv20210807+bt_transformer-big_2022-03-13.eval.txt)
206
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
207
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
208
+
209
+ | langpair | testset | chr-F | BLEU | #sent | #words |
210
+ |----------|---------|-------|-------|-------|--------|
211
+ | eng-spa | tatoeba-test-v2021-08-07 | 0.73863 | 57.2 | 16583 | 134710 |
212
+ | eng-spa | flores101-devtest | 0.56440 | 28.5 | 1012 | 29199 |
213
+ | eng-spa | newssyscomb2009 | 0.58415 | 31.5 | 502 | 12503 |
214
+ | eng-spa | news-test2008 | 0.56707 | 30.1 | 2051 | 52586 |
215
+ | eng-spa | newstest2009 | 0.57836 | 30.2 | 2525 | 68111 |
216
+ | eng-spa | newstest2010 | 0.62357 | 37.6 | 2489 | 65480 |
217
+ | eng-spa | newstest2011 | 0.62415 | 38.9 | 3003 | 79476 |
218
+ | eng-spa | newstest2012 | 0.63031 | 39.5 | 3003 | 79006 |
219
+ | eng-spa | newstest2013 | 0.60354 | 35.9 | 3000 | 70528 |
220
+ | eng-spa | tico19-test | 0.73554 | 53.0 | 2100 | 66563 |
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: 3405783
230
+ * port time: Wed Apr 13 18:03:53 EEST 2022
231
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ eng-spa flores101-dev 0.56008 28.0 997 27793
2
+ eng-spa flores101-devtest 0.56440 28.5 1012 29199
3
+ eng-spa newssyscomb2009 0.58415 31.5 502 12503
4
+ eng-spa news-test2008 0.56707 30.1 2051 52586
5
+ eng-spa newstest2009 0.57836 30.2 2525 68111
6
+ eng-spa newstest2010 0.62357 37.6 2489 65480
7
+ eng-spa newstest2011 0.62415 38.9 3003 79476
8
+ eng-spa newstest2012 0.63031 39.5 3003 79006
9
+ eng-spa newstest2013 0.60354 35.9 3000 70528
10
+ eng-spa tatoeba-test-v2020-07-28 0.72124 55.0 10000 77311
11
+ eng-spa tatoeba-test-v2021-03-30 0.72663 55.8 11940 93423
12
+ eng-spa tatoeba-test-v2021-08-07 0.73863 57.2 16583 134710
13
+ eng-spa tico19-test 0.73554 53.0 2100 66563
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:000a6eee9c661dcee9616318fd48347f97e6ae1b08dd0691e41b417a11935d17
3
+ size 4383457
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
+ 55026
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": 55026,
21
+ "decoder_vocab_size": 55027,
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": 44893,
28
+ "forced_eos_token_id": 44893,
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": 55026,
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": 55027
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:61126c23d10d65b44c009d9002a945685156af6ae821ccc735470d242243ec43
3
+ size 578307075
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b1763341d3a71262ed5aacc3f8287d3c3c2f2ae82295e11d03aea80879c98009
3
+ size 804235
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:c70086dcac73d9c759cca0b5f195a073033906dcd29433d6c5fe74e66b2cc8da
3
+ size 824118
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "en", "target_lang": "es", "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-es", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff