tiedeman commited on
Commit
31365fd
1 Parent(s): 25fa45a

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,322 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - fr
5
+
6
+ tags:
7
+ - translation
8
+
9
+ license: cc-by-4.0
10
+ model-index:
11
+ - name: opus-mt-tc-big-fr-en
12
+ results:
13
+ - task:
14
+ name: Translation fra-eng
15
+ type: translation
16
+ args: fra-eng
17
+ dataset:
18
+ name: flores101-devtest
19
+ type: flores_101
20
+ args: fra eng devtest
21
+ metrics:
22
+ - name: BLEU
23
+ type: bleu
24
+ value: 46.0
25
+ - task:
26
+ name: Translation fra-eng
27
+ type: translation
28
+ args: fra-eng
29
+ dataset:
30
+ name: multi30k_test_2016_flickr
31
+ type: multi30k-2016_flickr
32
+ args: fra-eng
33
+ metrics:
34
+ - name: BLEU
35
+ type: bleu
36
+ value: 49.7
37
+ - task:
38
+ name: Translation fra-eng
39
+ type: translation
40
+ args: fra-eng
41
+ dataset:
42
+ name: multi30k_test_2017_flickr
43
+ type: multi30k-2017_flickr
44
+ args: fra-eng
45
+ metrics:
46
+ - name: BLEU
47
+ type: bleu
48
+ value: 52.0
49
+ - task:
50
+ name: Translation fra-eng
51
+ type: translation
52
+ args: fra-eng
53
+ dataset:
54
+ name: multi30k_test_2017_mscoco
55
+ type: multi30k-2017_mscoco
56
+ args: fra-eng
57
+ metrics:
58
+ - name: BLEU
59
+ type: bleu
60
+ value: 50.6
61
+ - task:
62
+ name: Translation fra-eng
63
+ type: translation
64
+ args: fra-eng
65
+ dataset:
66
+ name: multi30k_test_2018_flickr
67
+ type: multi30k-2018_flickr
68
+ args: fra-eng
69
+ metrics:
70
+ - name: BLEU
71
+ type: bleu
72
+ value: 44.9
73
+ - task:
74
+ name: Translation fra-eng
75
+ type: translation
76
+ args: fra-eng
77
+ dataset:
78
+ name: news-test2008
79
+ type: news-test2008
80
+ args: fra-eng
81
+ metrics:
82
+ - name: BLEU
83
+ type: bleu
84
+ value: 26.5
85
+ - task:
86
+ name: Translation fra-eng
87
+ type: translation
88
+ args: fra-eng
89
+ dataset:
90
+ name: newsdiscussdev2015
91
+ type: newsdiscussdev2015
92
+ args: fra-eng
93
+ metrics:
94
+ - name: BLEU
95
+ type: bleu
96
+ value: 34.4
97
+ - task:
98
+ name: Translation fra-eng
99
+ type: translation
100
+ args: fra-eng
101
+ dataset:
102
+ name: newsdiscusstest2015
103
+ type: newsdiscusstest2015
104
+ args: fra-eng
105
+ metrics:
106
+ - name: BLEU
107
+ type: bleu
108
+ value: 40.2
109
+ - task:
110
+ name: Translation fra-eng
111
+ type: translation
112
+ args: fra-eng
113
+ dataset:
114
+ name: tatoeba-test-v2021-08-07
115
+ type: tatoeba_mt
116
+ args: fra-eng
117
+ metrics:
118
+ - name: BLEU
119
+ type: bleu
120
+ value: 59.8
121
+ - task:
122
+ name: Translation fra-eng
123
+ type: translation
124
+ args: fra-eng
125
+ dataset:
126
+ name: tico19-test
127
+ type: tico19-test
128
+ args: fra-eng
129
+ metrics:
130
+ - name: BLEU
131
+ type: bleu
132
+ value: 41.3
133
+ - task:
134
+ name: Translation fra-eng
135
+ type: translation
136
+ args: fra-eng
137
+ dataset:
138
+ name: newstest2009
139
+ type: wmt-2009-news
140
+ args: fra-eng
141
+ metrics:
142
+ - name: BLEU
143
+ type: bleu
144
+ value: 30.4
145
+ - task:
146
+ name: Translation fra-eng
147
+ type: translation
148
+ args: fra-eng
149
+ dataset:
150
+ name: newstest2010
151
+ type: wmt-2010-news
152
+ args: fra-eng
153
+ metrics:
154
+ - name: BLEU
155
+ type: bleu
156
+ value: 33.4
157
+ - task:
158
+ name: Translation fra-eng
159
+ type: translation
160
+ args: fra-eng
161
+ dataset:
162
+ name: newstest2011
163
+ type: wmt-2011-news
164
+ args: fra-eng
165
+ metrics:
166
+ - name: BLEU
167
+ type: bleu
168
+ value: 33.8
169
+ - task:
170
+ name: Translation fra-eng
171
+ type: translation
172
+ args: fra-eng
173
+ dataset:
174
+ name: newstest2012
175
+ type: wmt-2012-news
176
+ args: fra-eng
177
+ metrics:
178
+ - name: BLEU
179
+ type: bleu
180
+ value: 33.6
181
+ - task:
182
+ name: Translation fra-eng
183
+ type: translation
184
+ args: fra-eng
185
+ dataset:
186
+ name: newstest2013
187
+ type: wmt-2013-news
188
+ args: fra-eng
189
+ metrics:
190
+ - name: BLEU
191
+ type: bleu
192
+ value: 34.8
193
+ - task:
194
+ name: Translation fra-eng
195
+ type: translation
196
+ args: fra-eng
197
+ dataset:
198
+ name: newstest2014
199
+ type: wmt-2014-news
200
+ args: fra-eng
201
+ metrics:
202
+ - name: BLEU
203
+ type: bleu
204
+ value: 39.4
205
+ ---
206
+ # opus-mt-tc-big-fr-en
207
+
208
+ Neural machine translation model for translating from French (fr) to English (en).
209
+
210
+ 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).
211
+
212
+ * 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.)
213
+
214
+ ```
215
+ @inproceedings{tiedemann-thottingal-2020-opus,
216
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
217
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
218
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
219
+ month = nov,
220
+ year = "2020",
221
+ address = "Lisboa, Portugal",
222
+ publisher = "European Association for Machine Translation",
223
+ url = "https://aclanthology.org/2020.eamt-1.61",
224
+ pages = "479--480",
225
+ }
226
+
227
+ @inproceedings{tiedemann-2020-tatoeba,
228
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
229
+ author = {Tiedemann, J{\"o}rg},
230
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
231
+ month = nov,
232
+ year = "2020",
233
+ address = "Online",
234
+ publisher = "Association for Computational Linguistics",
235
+ url = "https://aclanthology.org/2020.wmt-1.139",
236
+ pages = "1174--1182",
237
+ }
238
+ ```
239
+
240
+ ## Model info
241
+
242
+ * Release: 2022-03-09
243
+ * source language(s): fra
244
+ * target language(s): eng
245
+ * model: transformer-big
246
+ * data: opusTCv20210807+bt ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
247
+ * tokenization: SentencePiece (spm32k,spm32k)
248
+ * original model: [opusTCv20210807+bt_transformer-big_2022-03-09.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/fra-eng/opusTCv20210807+bt_transformer-big_2022-03-09.zip)
249
+ * more information released models: [OPUS-MT fra-eng README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/fra-eng/README.md)
250
+
251
+ ## Usage
252
+
253
+ A short example code:
254
+
255
+ ```python
256
+ from transformers import MarianMTModel, MarianTokenizer
257
+
258
+ src_text = [
259
+ "J'ai adoré l'Angleterre.",
260
+ "C'était la seule chose à faire."
261
+ ]
262
+
263
+ model_name = "pytorch-models/opus-mt-tc-big-fr-en"
264
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
265
+ model = MarianMTModel.from_pretrained(model_name)
266
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
267
+
268
+ for t in translated:
269
+ print( tokenizer.decode(t, skip_special_tokens=True) )
270
+
271
+ # expected output:
272
+ # I loved England.
273
+ # It was the only thing to do.
274
+ ```
275
+
276
+ You can also use OPUS-MT models with the transformers pipelines, for example:
277
+
278
+ ```python
279
+ from transformers import pipeline
280
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-fr-en")
281
+ print(pipe("J'ai adoré l'Angleterre."))
282
+
283
+ # expected output: I loved England.
284
+ ```
285
+
286
+ ## Benchmarks
287
+
288
+ * test set translations: [opusTCv20210807+bt_transformer-big_2022-03-09.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/fra-eng/opusTCv20210807+bt_transformer-big_2022-03-09.test.txt)
289
+ * test set scores: [opusTCv20210807+bt_transformer-big_2022-03-09.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/fra-eng/opusTCv20210807+bt_transformer-big_2022-03-09.eval.txt)
290
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
291
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
292
+
293
+ | langpair | testset | chr-F | BLEU | #sent | #words |
294
+ |----------|---------|-------|-------|-------|--------|
295
+ | fra-eng | tatoeba-test-v2021-08-07 | 0.73772 | 59.8 | 12681 | 101754 |
296
+ | fra-eng | flores101-devtest | 0.69350 | 46.0 | 1012 | 24721 |
297
+ | fra-eng | multi30k_test_2016_flickr | 0.68005 | 49.7 | 1000 | 12955 |
298
+ | fra-eng | multi30k_test_2017_flickr | 0.70596 | 52.0 | 1000 | 11374 |
299
+ | fra-eng | multi30k_test_2017_mscoco | 0.69356 | 50.6 | 461 | 5231 |
300
+ | fra-eng | multi30k_test_2018_flickr | 0.65751 | 44.9 | 1071 | 14689 |
301
+ | fra-eng | newsdiscussdev2015 | 0.59008 | 34.4 | 1500 | 27759 |
302
+ | fra-eng | newsdiscusstest2015 | 0.62603 | 40.2 | 1500 | 26982 |
303
+ | fra-eng | newssyscomb2009 | 0.57488 | 31.1 | 502 | 11818 |
304
+ | fra-eng | news-test2008 | 0.54316 | 26.5 | 2051 | 49380 |
305
+ | fra-eng | newstest2009 | 0.56959 | 30.4 | 2525 | 65399 |
306
+ | fra-eng | newstest2010 | 0.59561 | 33.4 | 2489 | 61711 |
307
+ | fra-eng | newstest2011 | 0.60271 | 33.8 | 3003 | 74681 |
308
+ | fra-eng | newstest2012 | 0.59507 | 33.6 | 3003 | 72812 |
309
+ | fra-eng | newstest2013 | 0.59691 | 34.8 | 3000 | 64505 |
310
+ | fra-eng | newstest2014 | 0.64533 | 39.4 | 3003 | 70708 |
311
+ | fra-eng | tico19-test | 0.63326 | 41.3 | 2100 | 56323 |
312
+
313
+ ## Acknowledgements
314
+
315
+ 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.
316
+
317
+ ## Model conversion info
318
+
319
+ * transformers version: 4.16.2
320
+ * OPUS-MT git hash: 3405783
321
+ * port time: Wed Apr 13 19:02:28 EEST 2022
322
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fra-eng flores101-dev 0.69835 47.0 997 23555
2
+ fra-eng flores101-devtest 0.69350 46.0 1012 24721
3
+ fra-eng multi30k_test_2016_flickr 0.68005 49.7 1000 12955
4
+ fra-eng multi30k_test_2017_flickr 0.70596 52.0 1000 11374
5
+ fra-eng multi30k_test_2017_mscoco 0.69356 50.6 461 5231
6
+ fra-eng multi30k_test_2018_flickr 0.65751 44.9 1071 14689
7
+ fra-eng newsdiscussdev2015 0.59008 34.4 1500 27759
8
+ fra-eng newsdiscusstest2015 0.62603 40.2 1500 26982
9
+ fra-eng newssyscomb2009 0.57488 31.1 502 11818
10
+ fra-eng news-test2008 0.54316 26.5 2051 49380
11
+ fra-eng newstest2009 0.56959 30.4 2525 65399
12
+ fra-eng newstest2010 0.59561 33.4 2489 61711
13
+ fra-eng newstest2011 0.60271 33.8 3003 74681
14
+ fra-eng newstest2012 0.59507 33.6 3003 72812
15
+ fra-eng newstest2013 0.59691 34.8 3000 64505
16
+ fra-eng newstest2014 0.64533 39.4 3003 70708
17
+ fra-eng tatoeba-test-v2020-07-28 0.73088 59.2 10000 77174
18
+ fra-eng tatoeba-test-v2021-03-30 0.73444 59.5 10892 85143
19
+ fra-eng tatoeba-test-v2021-08-07 0.73772 59.8 12681 101754
20
+ fra-eng tico19-test 0.63326 41.3 2100 56323
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d78d3b99c29f1e921ab63e40307476685a974cbfc366134fcde3a73ebe713cb6
3
+ size 5073980
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
+ 53016
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": 53016,
21
+ "decoder_vocab_size": 53017,
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": 43311,
28
+ "forced_eos_token_id": 43311,
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": 53016,
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": 53017
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:55b838843ecdde1246e437dcdd948c62b81590d8c6cb29cb7c9ec23bb2c105d3
3
+ size 570070083
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:622a0fef37ea7c6d7cd4a6530c2279d4688987c5417bba26fba9ae416f8b7758
3
+ size 819955
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:69e8272c2d215294ae2e19c6fcef39fc26b386fcf64cd07f376b965740c80592
3
+ size 802408
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "fr", "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/fr-en", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff