tiedeman commited on
Commit
9279324
1 Parent(s): a77b7de

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
+ - de
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-de-zle
15
+ results:
16
+ - task:
17
+ name: Translation deu-rus
18
+ type: translation
19
+ args: deu-rus
20
+ dataset:
21
+ name: flores101-devtest
22
+ type: flores_101
23
+ args: deu rus devtest
24
+ metrics:
25
+ - name: BLEU
26
+ type: bleu
27
+ value: 26.3
28
+ - task:
29
+ name: Translation deu-ukr
30
+ type: translation
31
+ args: deu-ukr
32
+ dataset:
33
+ name: flores101-devtest
34
+ type: flores_101
35
+ args: deu ukr devtest
36
+ metrics:
37
+ - name: BLEU
38
+ type: bleu
39
+ value: 24.2
40
+ - task:
41
+ name: Translation deu-bel
42
+ type: translation
43
+ args: deu-bel
44
+ dataset:
45
+ name: tatoeba-test-v2021-08-07
46
+ type: tatoeba_mt
47
+ args: deu-bel
48
+ metrics:
49
+ - name: BLEU
50
+ type: bleu
51
+ value: 29.5
52
+ - task:
53
+ name: Translation deu-rus
54
+ type: translation
55
+ args: deu-rus
56
+ dataset:
57
+ name: tatoeba-test-v2021-08-07
58
+ type: tatoeba_mt
59
+ args: deu-rus
60
+ metrics:
61
+ - name: BLEU
62
+ type: bleu
63
+ value: 46.1
64
+ - task:
65
+ name: Translation deu-ukr
66
+ type: translation
67
+ args: deu-ukr
68
+ dataset:
69
+ name: tatoeba-test-v2021-08-07
70
+ type: tatoeba_mt
71
+ args: deu-ukr
72
+ metrics:
73
+ - name: BLEU
74
+ type: bleu
75
+ value: 40.7
76
+ - task:
77
+ name: Translation deu-rus
78
+ type: translation
79
+ args: deu-rus
80
+ dataset:
81
+ name: newstest2012
82
+ type: wmt-2012-news
83
+ args: deu-rus
84
+ metrics:
85
+ - name: BLEU
86
+ type: bleu
87
+ value: 20.8
88
+ - task:
89
+ name: Translation deu-rus
90
+ type: translation
91
+ args: deu-rus
92
+ dataset:
93
+ name: newstest2013
94
+ type: wmt-2013-news
95
+ args: deu-rus
96
+ metrics:
97
+ - name: BLEU
98
+ type: bleu
99
+ value: 24.9
100
+ ---
101
+ # opus-mt-tc-big-de-zle
102
+
103
+ Neural machine translation model for translating from German (de) 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): deu
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/deu-zle/opusTCv20210807_transformer-big_2022-03-23.zip)
145
+ * more information released models: [OPUS-MT deu-zle README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/deu-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
+ ">>ukr<< Der Soldat hat mir Wasser gegeben.",
159
+ ">>ukr<< Ich will hier nicht essen."
160
+ ]
161
+
162
+ model_name = "pytorch-models/opus-mt-tc-big-de-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-de-zle")
180
+ print(pipe(">>ukr<< Der Soldat hat mir Wasser gegeben."))
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/deu-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/deu-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
+ | deu-bel | tatoeba-test-v2021-08-07 | 0.53128 | 29.5 | 551 | 3601 |
195
+ | deu-rus | tatoeba-test-v2021-08-07 | 0.67143 | 46.1 | 12800 | 87296 |
196
+ | deu-ukr | tatoeba-test-v2021-08-07 | 0.62737 | 40.7 | 10319 | 56287 |
197
+ | deu-rus | flores101-devtest | 0.54152 | 26.3 | 1012 | 23295 |
198
+ | deu-ukr | flores101-devtest | 0.53286 | 24.2 | 1012 | 22810 |
199
+ | deu-rus | newstest2012 | 0.49409 | 20.8 | 3003 | 64790 |
200
+ | deu-rus | newstest2013 | 0.52631 | 24.9 | 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 01:29:09 EET 2022
211
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ deu-bel flores101-dev 0.38483 9.3 997 23996
2
+ deu-rus flores101-dev 0.54342 26.4 997 22657
3
+ deu-ukr flores101-dev 0.52143 23.3 997 21841
4
+ deu-bel flores101-devtest 0.39045 9.8 1012 24829
5
+ deu-rus flores101-devtest 0.54152 26.3 1012 23295
6
+ deu-ukr flores101-devtest 0.53286 24.2 1012 22810
7
+ deu-rus newstest2012 0.49409 20.8 3003 64790
8
+ deu-rus newstest2013 0.52631 24.9 3000 58560
9
+ deu-bel tatoeba-test-v2020-07-28 0.53161 29.5 550 3595
10
+ deu-rus tatoeba-test-v2020-07-28 0.67044 46.1 10000 67433
11
+ deu-ukr tatoeba-test-v2020-07-28 0.62698 40.8 10000 54213
12
+ deu-bel tatoeba-test-v2021-03-30 0.53247 29.5 554 3617
13
+ deu-rus tatoeba-test-v2021-03-30 0.66964 45.8 11265 76204
14
+ deu-ukr tatoeba-test-v2021-03-30 0.62795 40.8 10174 55335
15
+ deu-bel tatoeba-test-v2021-08-07 0.53128 29.5 551 3601
16
+ deu-rus tatoeba-test-v2021-08-07 0.67143 46.1 12800 87296
17
+ deu-ukr tatoeba-test-v2021-08-07 0.62737 40.7 10319 56287
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d199b5c82be3eb2488358ce9d0fd2638d5d05978f4130074ec37486b668f24dd
3
+ size 4940129
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
+ 61130
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": 61130,
21
+ "decoder_vocab_size": 61131,
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": 23541,
28
+ "forced_eos_token_id": 23541,
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": 61130,
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": 61131
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6e6822077cba0dff5e91a5a8b5a7a2aed7996635769325cce198e4f6ec8fc7b9
3
+ size 603321283
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dde526685600b958138d2b3863bf9b8be10774bf8a99573aede7db619c9b5eb0
3
+ size 822915
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:3341e4c42304e509ef8068c1b0726be116a8ad90b513c62638db210bf47b4fb6
3
+ size 1009491
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
1
+ {"source_lang": "de", "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/de-zle", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff