tiedeman commited on
Commit
5f9410b
1 Parent(s): 17185e1

Initial commit

Browse files
.gitattributes CHANGED
@@ -25,3 +25,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
25
  *.zip filter=lfs diff=lfs merge=lfs -text
26
  *.zstandard filter=lfs diff=lfs merge=lfs -text
27
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
25
  *.zip filter=lfs diff=lfs merge=lfs -text
26
  *.zstandard filter=lfs diff=lfs merge=lfs -text
27
  *tfevents* filter=lfs diff=lfs merge=lfs -text
28
+ *.spm filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - be
4
+ - fr
5
+ - ru
6
+ - uk
7
+ - zle
8
+
9
+ tags:
10
+ - translation
11
+
12
+ license: cc-by-4.0
13
+ model-index:
14
+ - name: opus-mt-tc-big-fr-zle
15
+ results:
16
+ - task:
17
+ name: Translation fra-rus
18
+ type: translation
19
+ args: fra-rus
20
+ dataset:
21
+ name: flores101-devtest
22
+ type: flores_101
23
+ args: fra rus devtest
24
+ metrics:
25
+ - name: BLEU
26
+ type: bleu
27
+ value: 25.8
28
+ - task:
29
+ name: Translation fra-ukr
30
+ type: translation
31
+ args: fra-ukr
32
+ dataset:
33
+ name: flores101-devtest
34
+ type: flores_101
35
+ args: fra ukr devtest
36
+ metrics:
37
+ - name: BLEU
38
+ type: bleu
39
+ value: 23.1
40
+ - task:
41
+ name: Translation fra-bel
42
+ type: translation
43
+ args: fra-bel
44
+ dataset:
45
+ name: tatoeba-test-v2021-08-07
46
+ type: tatoeba_mt
47
+ args: fra-bel
48
+ metrics:
49
+ - name: BLEU
50
+ type: bleu
51
+ value: 31.1
52
+ - task:
53
+ name: Translation fra-rus
54
+ type: translation
55
+ args: fra-rus
56
+ dataset:
57
+ name: tatoeba-test-v2021-08-07
58
+ type: tatoeba_mt
59
+ args: fra-rus
60
+ metrics:
61
+ - name: BLEU
62
+ type: bleu
63
+ value: 46.1
64
+ - task:
65
+ name: Translation fra-ukr
66
+ type: translation
67
+ args: fra-ukr
68
+ dataset:
69
+ name: tatoeba-test-v2021-08-07
70
+ type: tatoeba_mt
71
+ args: fra-ukr
72
+ metrics:
73
+ - name: BLEU
74
+ type: bleu
75
+ value: 39.9
76
+ - task:
77
+ name: Translation fra-rus
78
+ type: translation
79
+ args: fra-rus
80
+ dataset:
81
+ name: newstest2012
82
+ type: wmt-2012-news
83
+ args: fra-rus
84
+ metrics:
85
+ - name: BLEU
86
+ type: bleu
87
+ value: 23.1
88
+ - task:
89
+ name: Translation fra-rus
90
+ type: translation
91
+ args: fra-rus
92
+ dataset:
93
+ name: newstest2013
94
+ type: wmt-2013-news
95
+ args: fra-rus
96
+ metrics:
97
+ - name: BLEU
98
+ type: bleu
99
+ value: 24.8
100
+ ---
101
+ # opus-mt-tc-big-fr-zle
102
+
103
+ Neural machine translation model for translating from French (fr) to East Slavic languages (zle).
104
+
105
+ 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).
106
+
107
+ * 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.)
108
+
109
+ ```
110
+ @inproceedings{tiedemann-thottingal-2020-opus,
111
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
112
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
113
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
114
+ month = nov,
115
+ year = "2020",
116
+ address = "Lisboa, Portugal",
117
+ publisher = "European Association for Machine Translation",
118
+ url = "https://aclanthology.org/2020.eamt-1.61",
119
+ pages = "479--480",
120
+ }
121
+
122
+ @inproceedings{tiedemann-2020-tatoeba,
123
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
124
+ author = {Tiedemann, J{\"o}rg},
125
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
126
+ month = nov,
127
+ year = "2020",
128
+ address = "Online",
129
+ publisher = "Association for Computational Linguistics",
130
+ url = "https://aclanthology.org/2020.wmt-1.139",
131
+ pages = "1174--1182",
132
+ }
133
+ ```
134
+
135
+ ## Model info
136
+
137
+ * Release: 2022-03-23
138
+ * source language(s): fra
139
+ * target language(s): bel rus ukr
140
+ * valid target language labels: >>bel<< >>rus<< >>ukr<<
141
+ * model: transformer-big
142
+ * data: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
143
+ * tokenization: SentencePiece (spm32k,spm32k)
144
+ * original model: [opusTCv20210807_transformer-big_2022-03-23.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/fra-zle/opusTCv20210807_transformer-big_2022-03-23.zip)
145
+ * more information released models: [OPUS-MT fra-zle README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/fra-zle/README.md)
146
+ * more information about the model: [MarianMT](https://huggingface.co/docs/transformers/model_doc/marian)
147
+
148
+ 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. `>>bel<<`
149
+
150
+ ## Usage
151
+
152
+ A short example code:
153
+
154
+ ```python
155
+ from transformers import MarianMTModel, MarianTokenizer
156
+
157
+ src_text = [
158
+ ">>rus<< Ils ont acheté un très bon appareil photo.",
159
+ ">>ukr<< Il s'est soudain mis à pleuvoir."
160
+ ]
161
+
162
+ model_name = "pytorch-models/opus-mt-tc-big-fr-zle"
163
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
164
+ model = MarianMTModel.from_pretrained(model_name)
165
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
166
+
167
+ for t in translated:
168
+ print( tokenizer.decode(t, skip_special_tokens=True) )
169
+
170
+ # expected output:
171
+ # Они купили очень хорошую камеру.
172
+ # Раптом почався дощ.
173
+ ```
174
+
175
+ You can also use OPUS-MT models with the transformers pipelines, for example:
176
+
177
+ ```python
178
+ from transformers import pipeline
179
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-fr-zle")
180
+ print(pipe(">>rus<< Ils ont acheté un très bon appareil photo."))
181
+
182
+ # expected output: Они купили очень хорошую камеру.
183
+ ```
184
+
185
+ ## Benchmarks
186
+
187
+ * test set translations: [opusTCv20210807_transformer-big_2022-03-23.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/fra-zle/opusTCv20210807_transformer-big_2022-03-23.test.txt)
188
+ * test set scores: [opusTCv20210807_transformer-big_2022-03-23.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/fra-zle/opusTCv20210807_transformer-big_2022-03-23.eval.txt)
189
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
190
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
191
+
192
+ | langpair | testset | chr-F | BLEU | #sent | #words |
193
+ |----------|---------|-------|-------|-------|--------|
194
+ | fra-bel | tatoeba-test-v2021-08-07 | 0.52711 | 31.1 | 283 | 1703 |
195
+ | fra-rus | tatoeba-test-v2021-08-07 | 0.66502 | 46.1 | 11490 | 70123 |
196
+ | fra-ukr | tatoeba-test-v2021-08-07 | 0.61860 | 39.9 | 10035 | 54372 |
197
+ | fra-rus | flores101-devtest | 0.54106 | 25.8 | 1012 | 23295 |
198
+ | fra-ukr | flores101-devtest | 0.52733 | 23.1 | 1012 | 22810 |
199
+ | fra-rus | newstest2012 | 0.51254 | 23.1 | 3003 | 64790 |
200
+ | fra-rus | newstest2013 | 0.52342 | 24.8 | 3000 | 58560 |
201
+
202
+ ## Acknowledgements
203
+
204
+ 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.
205
+
206
+ ## Model conversion info
207
+
208
+ * transformers version: 4.16.2
209
+ * OPUS-MT git hash: 1bdabf7
210
+ * port time: Thu Mar 24 02:05:04 EET 2022
211
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fra-bel flores101-dev 0.37320 8.0 997 23996
2
+ fra-rus flores101-dev 0.54119 25.7 997 22657
3
+ fra-ukr flores101-dev 0.52081 23.0 997 21841
4
+ fra-bel flores101-devtest 0.38238 8.5 1012 24829
5
+ fra-rus flores101-devtest 0.54106 25.8 1012 23295
6
+ fra-ukr flores101-devtest 0.52733 23.1 1012 22810
7
+ fra-rus newstest2012 0.51254 23.1 3003 64790
8
+ fra-rus newstest2013 0.52342 24.8 3000 58560
9
+ fra-rus tatoeba-test-v2020-07-28 0.66758 46.5 10000 60792
10
+ fra-ukr tatoeba-test-v2020-07-28 0.61833 39.8 10000 54082
11
+ fra-bel tatoeba-test-v2021-03-30 0.52817 31.4 285 1714
12
+ fra-rus tatoeba-test-v2021-03-30 0.66540 46.3 10633 64648
13
+ fra-ukr tatoeba-test-v2021-03-30 0.61860 39.8 10035 54263
14
+ fra-bel tatoeba-test-v2021-08-07 0.52711 31.1 283 1703
15
+ fra-rus tatoeba-test-v2021-08-07 0.66502 46.1 11490 70123
16
+ fra-ukr tatoeba-test-v2021-08-07 0.61860 39.9 10035 54372
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ca44558460b32e8adae21a418091140ff8b1e6c8a41d3b1bc92207231f80bd1c
3
+ size 4595735
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
+ 61391
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": 61391,
21
+ "decoder_vocab_size": 61392,
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": 27214,
28
+ "forced_eos_token_id": 27214,
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": 61391,
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": 61392
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c0bbdc389a299036f722ee7a3d2222434d1c266cac27b5af384e98c6714c70c5
3
+ size 604390851
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a552ab37e1013e599492a306a13f3bc6e163549d494ac162efc252f9d201a71f
3
+ size 824258
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:90e397a3ef99dc67d483405e86144399218afb25355aeb8caea483aef9b650b6
3
+ size 1035951
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "fr", "target_lang": "zle", "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_transformer-big_2022-03-23/fr-zle", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff