tiedeman commited on
Commit
d011eb2
1 Parent(s): b6322e7

Initial commit

Browse files
.gitattributes CHANGED
@@ -29,3 +29,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
29
  *.zip filter=lfs diff=lfs merge=lfs -text
30
  *.zst filter=lfs diff=lfs merge=lfs -text
31
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
29
  *.zip filter=lfs diff=lfs merge=lfs -text
30
  *.zst filter=lfs diff=lfs merge=lfs -text
31
  *tfevents* filter=lfs diff=lfs merge=lfs -text
32
+ *.spm filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,320 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - bg
4
+ - bs
5
+ - de
6
+ - hr
7
+ - mk
8
+ - sh
9
+ - sl
10
+ - sr
11
+ - zls
12
+ language_bcp47:
13
+ - bs_Latn
14
+ - sr_Cyrl
15
+ - sr_Latn
16
+
17
+ tags:
18
+ - translation
19
+ - opus-mt-tc
20
+
21
+ license: cc-by-4.0
22
+ model-index:
23
+ - name: opus-mt-tc-big-zls-de
24
+ results:
25
+ - task:
26
+ name: Translation bul-deu
27
+ type: translation
28
+ args: bul-deu
29
+ dataset:
30
+ name: flores101-devtest
31
+ type: flores_101
32
+ args: bul deu devtest
33
+ metrics:
34
+ - name: BLEU
35
+ type: bleu
36
+ value: 28.4
37
+ - name: chr-F
38
+ type: chrf
39
+ value: 0.57688
40
+ - task:
41
+ name: Translation hrv-deu
42
+ type: translation
43
+ args: hrv-deu
44
+ dataset:
45
+ name: flores101-devtest
46
+ type: flores_101
47
+ args: hrv deu devtest
48
+ metrics:
49
+ - name: BLEU
50
+ type: bleu
51
+ value: 27.4
52
+ - name: chr-F
53
+ type: chrf
54
+ value: 0.56674
55
+ - task:
56
+ name: Translation mkd-deu
57
+ type: translation
58
+ args: mkd-deu
59
+ dataset:
60
+ name: flores101-devtest
61
+ type: flores_101
62
+ args: mkd deu devtest
63
+ metrics:
64
+ - name: BLEU
65
+ type: bleu
66
+ value: 29.3
67
+ - name: chr-F
68
+ type: chrf
69
+ value: 0.57688
70
+ - task:
71
+ name: Translation slv-deu
72
+ type: translation
73
+ args: slv-deu
74
+ dataset:
75
+ name: flores101-devtest
76
+ type: flores_101
77
+ args: slv deu devtest
78
+ metrics:
79
+ - name: BLEU
80
+ type: bleu
81
+ value: 26.7
82
+ - name: chr-F
83
+ type: chrf
84
+ value: 0.56258
85
+ - task:
86
+ name: Translation srp_Cyrl-deu
87
+ type: translation
88
+ args: srp_Cyrl-deu
89
+ dataset:
90
+ name: flores101-devtest
91
+ type: flores_101
92
+ args: srp_Cyrl deu devtest
93
+ metrics:
94
+ - name: BLEU
95
+ type: bleu
96
+ value: 30.7
97
+ - name: chr-F
98
+ type: chrf
99
+ value: 0.59271
100
+ - task:
101
+ name: Translation bul-deu
102
+ type: translation
103
+ args: bul-deu
104
+ dataset:
105
+ name: tatoeba-test-v2021-08-07
106
+ type: tatoeba_mt
107
+ args: bul-deu
108
+ metrics:
109
+ - name: BLEU
110
+ type: bleu
111
+ value: 54.5
112
+ - name: chr-F
113
+ type: chrf
114
+ value: 0.71220
115
+ - task:
116
+ name: Translation hbs-deu
117
+ type: translation
118
+ args: hbs-deu
119
+ dataset:
120
+ name: tatoeba-test-v2021-08-07
121
+ type: tatoeba_mt
122
+ args: hbs-deu
123
+ metrics:
124
+ - name: BLEU
125
+ type: bleu
126
+ value: 54.8
127
+ - name: chr-F
128
+ type: chrf
129
+ value: 0.71283
130
+ - task:
131
+ name: Translation hrv-deu
132
+ type: translation
133
+ args: hrv-deu
134
+ dataset:
135
+ name: tatoeba-test-v2021-08-07
136
+ type: tatoeba_mt
137
+ args: hrv-deu
138
+ metrics:
139
+ - name: BLEU
140
+ type: bleu
141
+ value: 53.1
142
+ - name: chr-F
143
+ type: chrf
144
+ value: 0.69448
145
+ - task:
146
+ name: Translation slv-deu
147
+ type: translation
148
+ args: slv-deu
149
+ dataset:
150
+ name: tatoeba-test-v2021-08-07
151
+ type: tatoeba_mt
152
+ args: slv-deu
153
+ metrics:
154
+ - name: BLEU
155
+ type: bleu
156
+ value: 21.1
157
+ - name: chr-F
158
+ type: chrf
159
+ value: 0.36339
160
+ - task:
161
+ name: Translation srp_Latn-deu
162
+ type: translation
163
+ args: srp_Latn-deu
164
+ dataset:
165
+ name: tatoeba-test-v2021-08-07
166
+ type: tatoeba_mt
167
+ args: srp_Latn-deu
168
+ metrics:
169
+ - name: BLEU
170
+ type: bleu
171
+ value: 56.0
172
+ - name: chr-F
173
+ type: chrf
174
+ value: 0.72489
175
+ ---
176
+ # opus-mt-tc-big-zls-de
177
+
178
+ ## Table of Contents
179
+ - [Model Details](#model-details)
180
+ - [Uses](#uses)
181
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
182
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
183
+ - [Training](#training)
184
+ - [Evaluation](#evaluation)
185
+ - [Citation Information](#citation-information)
186
+ - [Acknowledgements](#acknowledgements)
187
+
188
+ ## Model Details
189
+
190
+ Neural machine translation model for translating from South Slavic languages (zls) to German (de).
191
+
192
+ 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).
193
+ **Model Description:**
194
+ - **Developed by:** Language Technology Research Group at the University of Helsinki
195
+ - **Model Type:** Translation (transformer-big)
196
+ - **Release**: 2022-07-26
197
+ - **License:** CC-BY-4.0
198
+ - **Language(s):**
199
+ - Source Language(s): bos_Latn bul hbs hrv mkd slv srp_Cyrl srp_Latn
200
+ - Target Language(s): deu
201
+ - **Original Model**: [opusTCv20210807_transformer-big_2022-07-26.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/zls-deu/opusTCv20210807_transformer-big_2022-07-26.zip)
202
+ - **Resources for more information:**
203
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
204
+ - More information about released models for this language pair: [OPUS-MT zls-deu README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/zls-deu/README.md)
205
+ - [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
206
+ - [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/
207
+
208
+ ## Uses
209
+
210
+ This model can be used for translation and text-to-text generation.
211
+
212
+ ## Risks, Limitations and Biases
213
+
214
+ **CONTENT WARNING: Readers should be aware that the model is trained on various public data sets that may contain content that is disturbing, offensive, and can propagate historical and current stereotypes.**
215
+
216
+ Significant research has explored bias and fairness issues with language models (see, e.g., [Sheng et al. (2021)](https://aclanthology.org/2021.acl-long.330.pdf) and [Bender et al. (2021)](https://dl.acm.org/doi/pdf/10.1145/3442188.3445922)).
217
+
218
+ ## How to Get Started With the Model
219
+
220
+ A short example code:
221
+
222
+ ```python
223
+ from transformers import MarianMTModel, MarianTokenizer
224
+
225
+ src_text = [
226
+ "Jesi li ti student?",
227
+ "Dve stvari deca treba da dobiju od svojih roditelja: korene i krila."
228
+ ]
229
+
230
+ model_name = "pytorch-models/opus-mt-tc-big-zls-de"
231
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
232
+ model = MarianMTModel.from_pretrained(model_name)
233
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
234
+
235
+ for t in translated:
236
+ print( tokenizer.decode(t, skip_special_tokens=True) )
237
+
238
+ # expected output:
239
+ # Sind Sie Student?
240
+ # Zwei Dinge sollten Kinder von ihren Eltern bekommen: Wurzeln und Flügel.
241
+ ```
242
+
243
+ You can also use OPUS-MT models with the transformers pipelines, for example:
244
+
245
+ ```python
246
+ from transformers import pipeline
247
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-zls-de")
248
+ print(pipe("Jesi li ti student?"))
249
+
250
+ # expected output: Sind Sie Student?
251
+ ```
252
+
253
+ ## Training
254
+
255
+ - **Data**: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
256
+ - **Pre-processing**: SentencePiece (spm32k,spm32k)
257
+ - **Model Type:** transformer-big
258
+ - **Original MarianNMT Model**: [opusTCv20210807_transformer-big_2022-07-26.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/zls-deu/opusTCv20210807_transformer-big_2022-07-26.zip)
259
+ - **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
260
+
261
+ ## Evaluation
262
+
263
+ * test set translations: [opusTCv20210807_transformer-big_2022-07-26.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zls-deu/opusTCv20210807_transformer-big_2022-07-26.test.txt)
264
+ * test set scores: [opusTCv20210807_transformer-big_2022-07-26.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zls-deu/opusTCv20210807_transformer-big_2022-07-26.eval.txt)
265
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
266
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
267
+
268
+ | langpair | testset | chr-F | BLEU | #sent | #words |
269
+ |----------|---------|-------|-------|-------|--------|
270
+ | bul-deu | tatoeba-test-v2021-08-07 | 0.71220 | 54.5 | 314 | 2224 |
271
+ | hbs-deu | tatoeba-test-v2021-08-07 | 0.71283 | 54.8 | 1959 | 15559 |
272
+ | hrv-deu | tatoeba-test-v2021-08-07 | 0.69448 | 53.1 | 782 | 5734 |
273
+ | slv-deu | tatoeba-test-v2021-08-07 | 0.36339 | 21.1 | 492 | 3003 |
274
+ | srp_Latn-deu | tatoeba-test-v2021-08-07 | 0.72489 | 56.0 | 986 | 8500 |
275
+ | bul-deu | flores101-devtest | 0.57688 | 28.4 | 1012 | 25094 |
276
+ | hrv-deu | flores101-devtest | 0.56674 | 27.4 | 1012 | 25094 |
277
+ | mkd-deu | flores101-devtest | 0.57688 | 29.3 | 1012 | 25094 |
278
+ | slv-deu | flores101-devtest | 0.56258 | 26.7 | 1012 | 25094 |
279
+ | srp_Cyrl-deu | flores101-devtest | 0.59271 | 30.7 | 1012 | 25094 |
280
+
281
+ ## Citation Information
282
+
283
+ * 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.)
284
+
285
+ ```
286
+ @inproceedings{tiedemann-thottingal-2020-opus,
287
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
288
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
289
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
290
+ month = nov,
291
+ year = "2020",
292
+ address = "Lisboa, Portugal",
293
+ publisher = "European Association for Machine Translation",
294
+ url = "https://aclanthology.org/2020.eamt-1.61",
295
+ pages = "479--480",
296
+ }
297
+
298
+ @inproceedings{tiedemann-2020-tatoeba,
299
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
300
+ author = {Tiedemann, J{\"o}rg},
301
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
302
+ month = nov,
303
+ year = "2020",
304
+ address = "Online",
305
+ publisher = "Association for Computational Linguistics",
306
+ url = "https://aclanthology.org/2020.wmt-1.139",
307
+ pages = "1174--1182",
308
+ }
309
+ ```
310
+
311
+ ## Acknowledgements
312
+
313
+ 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.
314
+
315
+ ## Model conversion info
316
+
317
+ * transformers version: 4.16.2
318
+ * OPUS-MT git hash: 8b9f0b0
319
+ * port time: Fri Aug 12 17:51:01 EEST 2022
320
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ bul-deu flores101-dev 0.57481 28.6 997 24097
2
+ hrv-deu flores101-dev 0.56440 28.1 997 24097
3
+ mkd-deu flores101-dev 0.57002 28.5 997 24097
4
+ slv-deu flores101-dev 0.56476 28.1 997 24097
5
+ srp_Cyrl-deu flores101-dev 0.59127 31.0 997 24097
6
+ bul-deu flores101-devtest 0.57688 28.4 1012 25094
7
+ hrv-deu flores101-devtest 0.56674 27.4 1012 25094
8
+ mkd-deu flores101-devtest 0.57688 29.3 1012 25094
9
+ slv-deu flores101-devtest 0.56258 26.7 1012 25094
10
+ srp_Cyrl-deu flores101-devtest 0.59271 30.7 1012 25094
11
+ bul-deu tatoeba-test-v2020-07-28 0.71149 54.4 313 2218
12
+ slv-deu tatoeba-test-v2020-07-28 0.37921 23.1 389 2294
13
+ bul-deu tatoeba-test-v2021-03-30 0.71076 54.3 315 2232
14
+ slv-deu tatoeba-test-v2021-03-30 0.37733 22.9 399 2341
15
+ bul-deu tatoeba-test-v2021-08-07 0.71220 54.5 314 2224
16
+ hbs-deu tatoeba-test-v2021-08-07 0.71283 54.8 1959 15559
17
+ hrv-deu tatoeba-test-v2021-08-07 0.69448 53.1 782 5734
18
+ slv-deu tatoeba-test-v2021-08-07 0.36339 21.1 492 3003
19
+ srp_Latn-deu tatoeba-test-v2021-08-07 0.72489 56.0 986 8500
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:79685b5ae70444748609412fd31eb24b25f69f898cdd25c27c2e7fc95450c713
3
+ size 2014030
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
+ 59518
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": 59518,
21
+ "decoder_vocab_size": 59519,
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": 32962,
28
+ "forced_eos_token_id": 32962,
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": 59518,
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": 59519
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:47cfa3adecc69a60ce376735828915a5f1c90ff407080ea573fd010f1f714eee
3
+ size 596715267
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7431625fbe1826063967afce19f306cc50c99e3036b6891d1c180003a55c82fc
3
+ size 875699
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:ca8877cf736a38c07bc99425429666e716d68680a612ce9e17d30c287bcfc065
3
+ size 821723
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "zls", "target_lang": "de", "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-07-26/zls-de", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff