tiedeman commited on
Commit
6457ac4
1 Parent(s): c142c2d

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,309 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - cs
4
+ - da
5
+ - gmq
6
+ - no
7
+ - pl
8
+ - sv
9
+ - zlw
10
+ language_bcp47:
11
+ - cs
12
+ - da
13
+ - gmq
14
+ - no
15
+ - pl
16
+ - sv
17
+ - zlw
18
+
19
+ tags:
20
+ - translation
21
+ - opus-mt-tc
22
+
23
+ license: cc-by-4.0
24
+ model-index:
25
+ - name: opus-mt-tc-big-gmq-zlw
26
+ results:
27
+ - task:
28
+ name: Translation dan-ces
29
+ type: translation
30
+ args: dan-ces
31
+ dataset:
32
+ name: flores101-devtest
33
+ type: flores_101
34
+ args: dan ces devtest
35
+ metrics:
36
+ - name: BLEU
37
+ type: bleu
38
+ value: 26.7
39
+ - name: chr-F
40
+ type: chrf
41
+ value: 0.54065
42
+ - task:
43
+ name: Translation dan-pol
44
+ type: translation
45
+ args: dan-pol
46
+ dataset:
47
+ name: flores101-devtest
48
+ type: flores_101
49
+ args: dan pol devtest
50
+ metrics:
51
+ - name: BLEU
52
+ type: bleu
53
+ value: 18.8
54
+ - name: chr-F
55
+ type: chrf
56
+ value: 0.48389
57
+ - task:
58
+ name: Translation isl-ces
59
+ type: translation
60
+ args: isl-ces
61
+ dataset:
62
+ name: flores101-devtest
63
+ type: flores_101
64
+ args: isl ces devtest
65
+ metrics:
66
+ - name: BLEU
67
+ type: bleu
68
+ value: 17.7
69
+ - name: chr-F
70
+ type: chrf
71
+ value: 0.43582
72
+ - task:
73
+ name: Translation isl-pol
74
+ type: translation
75
+ args: isl-pol
76
+ dataset:
77
+ name: flores101-devtest
78
+ type: flores_101
79
+ args: isl pol devtest
80
+ metrics:
81
+ - name: BLEU
82
+ type: bleu
83
+ value: 13.9
84
+ - name: chr-F
85
+ type: chrf
86
+ value: 0.41929
87
+ - task:
88
+ name: Translation nob-ces
89
+ type: translation
90
+ args: nob-ces
91
+ dataset:
92
+ name: flores101-devtest
93
+ type: flores_101
94
+ args: nob ces devtest
95
+ metrics:
96
+ - name: BLEU
97
+ type: bleu
98
+ value: 22.3
99
+ - name: chr-F
100
+ type: chrf
101
+ value: 0.50336
102
+ - task:
103
+ name: Translation nob-pol
104
+ type: translation
105
+ args: nob-pol
106
+ dataset:
107
+ name: flores101-devtest
108
+ type: flores_101
109
+ args: nob pol devtest
110
+ metrics:
111
+ - name: BLEU
112
+ type: bleu
113
+ value: 16.3
114
+ - name: chr-F
115
+ type: chrf
116
+ value: 0.46130
117
+ - task:
118
+ name: Translation swe-ces
119
+ type: translation
120
+ args: swe-ces
121
+ dataset:
122
+ name: flores101-devtest
123
+ type: flores_101
124
+ args: swe ces devtest
125
+ metrics:
126
+ - name: BLEU
127
+ type: bleu
128
+ value: 25.7
129
+ - name: chr-F
130
+ type: chrf
131
+ value: 0.53188
132
+ - task:
133
+ name: Translation swe-pol
134
+ type: translation
135
+ args: swe-pol
136
+ dataset:
137
+ name: flores101-devtest
138
+ type: flores_101
139
+ args: swe pol devtest
140
+ metrics:
141
+ - name: BLEU
142
+ type: bleu
143
+ value: 18.6
144
+ - name: chr-F
145
+ type: chrf
146
+ value: 0.48163
147
+ - task:
148
+ name: Translation swe-pol
149
+ type: translation
150
+ args: swe-pol
151
+ dataset:
152
+ name: tatoeba-test-v2021-08-07
153
+ type: tatoeba_mt
154
+ args: swe-pol
155
+ metrics:
156
+ - name: BLEU
157
+ type: bleu
158
+ value: 46.2
159
+ - name: chr-F
160
+ type: chrf
161
+ value: 0.66326
162
+ ---
163
+ # opus-mt-tc-big-gmq-zlw
164
+
165
+ ## Table of Contents
166
+ - [Model Details](#model-details)
167
+ - [Uses](#uses)
168
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
169
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
170
+ - [Training](#training)
171
+ - [Evaluation](#evaluation)
172
+ - [Citation Information](#citation-information)
173
+ - [Acknowledgements](#acknowledgements)
174
+
175
+ ## Model Details
176
+
177
+ Neural machine translation model for translating from North Germanic languages (gmq) to West Slavic languages (zlw).
178
+
179
+ 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).
180
+ **Model Description:**
181
+ - **Developed by:** Language Technology Research Group at the University of Helsinki
182
+ - **Model Type:** Translation (transformer-big)
183
+ - **Release**: 2022-08-03
184
+ - **License:** CC-BY-4.0
185
+ - **Language(s):**
186
+ - Source Language(s): dan nor swe
187
+ - Target Language(s): ces pol
188
+ - Valid Target Language Labels: >>ces<< >>pol<<
189
+ - **Original Model**: [opusTCv20210807_transformer-big_2022-08-03.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/gmq-zlw/opusTCv20210807_transformer-big_2022-08-03.zip)
190
+ - **Resources for more information:**
191
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
192
+ - More information about released models for this language pair: [OPUS-MT gmq-zlw README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/gmq-zlw/README.md)
193
+ - [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
194
+ - [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/
195
+
196
+ 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. `>>ces<<`
197
+
198
+ ## Uses
199
+
200
+ This model can be used for translation and text-to-text generation.
201
+
202
+ ## Risks, Limitations and Biases
203
+
204
+ **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.**
205
+
206
+ 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)).
207
+
208
+ ## How to Get Started With the Model
209
+
210
+ A short example code:
211
+
212
+ ```python
213
+ from transformers import MarianMTModel, MarianTokenizer
214
+
215
+ src_text = [
216
+ ">>ces<< Normalt er jeg hjemme hele weekenden.",
217
+ ">>pol<< Lev ditt liv."
218
+ ]
219
+
220
+ model_name = "pytorch-models/opus-mt-tc-big-gmq-zlw"
221
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
222
+ model = MarianMTModel.from_pretrained(model_name)
223
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
224
+
225
+ for t in translated:
226
+ print( tokenizer.decode(t, skip_special_tokens=True) )
227
+
228
+ # expected output:
229
+ # Většinou jsem doma celý víkend.
230
+ # Żyj swoim życiem.
231
+ ```
232
+
233
+ You can also use OPUS-MT models with the transformers pipelines, for example:
234
+
235
+ ```python
236
+ from transformers import pipeline
237
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-gmq-zlw")
238
+ print(pipe(">>ces<< Normalt er jeg hjemme hele weekenden."))
239
+
240
+ # expected output: Většinou jsem doma celý víkend.
241
+ ```
242
+
243
+ ## Training
244
+
245
+ - **Data**: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
246
+ - **Pre-processing**: SentencePiece (spm32k,spm32k)
247
+ - **Model Type:** transformer-big
248
+ - **Original MarianNMT Model**: [opusTCv20210807_transformer-big_2022-08-03.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/gmq-zlw/opusTCv20210807_transformer-big_2022-08-03.zip)
249
+ - **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
250
+
251
+ ## Evaluation
252
+
253
+ * test set translations: [opusTCv20210807_transformer-big_2022-08-03.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/gmq-zlw/opusTCv20210807_transformer-big_2022-08-03.test.txt)
254
+ * test set scores: [opusTCv20210807_transformer-big_2022-08-03.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/gmq-zlw/opusTCv20210807_transformer-big_2022-08-03.eval.txt)
255
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
256
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
257
+
258
+ | langpair | testset | chr-F | BLEU | #sent | #words |
259
+ |----------|---------|-------|-------|-------|--------|
260
+ | swe-pol | tatoeba-test-v2021-08-07 | 0.66326 | 46.2 | 1392 | 8157 |
261
+ | dan-ces | flores101-devtest | 0.54065 | 26.7 | 1012 | 22101 |
262
+ | dan-pol | flores101-devtest | 0.48389 | 18.8 | 1012 | 22520 |
263
+ | isl-ces | flores101-devtest | 0.43582 | 17.7 | 1012 | 22101 |
264
+ | isl-pol | flores101-devtest | 0.41929 | 13.9 | 1012 | 22520 |
265
+ | nob-ces | flores101-devtest | 0.50336 | 22.3 | 1012 | 22101 |
266
+ | nob-pol | flores101-devtest | 0.46130 | 16.3 | 1012 | 22520 |
267
+ | swe-ces | flores101-devtest | 0.53188 | 25.7 | 1012 | 22101 |
268
+ | swe-pol | flores101-devtest | 0.48163 | 18.6 | 1012 | 22520 |
269
+
270
+ ## Citation Information
271
+
272
+ * 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.)
273
+
274
+ ```
275
+ @inproceedings{tiedemann-thottingal-2020-opus,
276
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
277
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
278
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
279
+ month = nov,
280
+ year = "2020",
281
+ address = "Lisboa, Portugal",
282
+ publisher = "European Association for Machine Translation",
283
+ url = "https://aclanthology.org/2020.eamt-1.61",
284
+ pages = "479--480",
285
+ }
286
+
287
+ @inproceedings{tiedemann-2020-tatoeba,
288
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
289
+ author = {Tiedemann, J{\"o}rg},
290
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
291
+ month = nov,
292
+ year = "2020",
293
+ address = "Online",
294
+ publisher = "Association for Computational Linguistics",
295
+ url = "https://aclanthology.org/2020.wmt-1.139",
296
+ pages = "1174--1182",
297
+ }
298
+ ```
299
+
300
+ ## Acknowledgements
301
+
302
+ 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.
303
+
304
+ ## Model conversion info
305
+
306
+ * transformers version: 4.16.2
307
+ * OPUS-MT git hash: 8b9f0b0
308
+ * port time: Fri Aug 12 15:46:50 EEST 2022
309
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ dan-ces flores101-dev 0.53605 26.5 997 21183
2
+ dan-pol flores101-dev 0.48620 19.0 997 21684
3
+ isl-ces flores101-dev 0.44149 18.2 997 21183
4
+ isl-pol flores101-dev 0.42374 14.3 997 21684
5
+ nob-ces flores101-dev 0.50065 22.2 997 21183
6
+ nob-pol flores101-dev 0.45935 16.6 997 21684
7
+ swe-ces flores101-dev 0.53239 25.9 997 21183
8
+ swe-pol flores101-dev 0.48268 18.5 997 21684
9
+ dan-ces flores101-devtest 0.54065 26.7 1012 22101
10
+ dan-pol flores101-devtest 0.48389 18.8 1012 22520
11
+ isl-ces flores101-devtest 0.43582 17.7 1012 22101
12
+ isl-pol flores101-devtest 0.41929 13.9 1012 22520
13
+ nob-ces flores101-devtest 0.50336 22.3 1012 22101
14
+ nob-pol flores101-devtest 0.46130 16.3 1012 22520
15
+ swe-ces flores101-devtest 0.53188 25.7 1012 22101
16
+ swe-pol flores101-devtest 0.48163 18.6 1012 22520
17
+ swe-pol tatoeba-test-v2021-08-07 0.66326 46.2 1392 8157
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0408eea28222ad0db938edc18d14de7277b2eb0a4cb31a3ff37de1c8ae2d6765
3
+ size 2686349
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
+ 58520
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": 58520,
21
+ "decoder_vocab_size": 58521,
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": 41563,
28
+ "forced_eos_token_id": 41563,
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": 58520,
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": 58521
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b8f7860ede2ad35577f22d826aa32af717e803c13104dd6c41fce5b491fccdf0
3
+ size 592625475
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e747a195ad32c54d2d485b137f7e15317f57b7a6944dddc18127242dc64d51bf
3
+ size 806037
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:aa58c44faa9cafc8a6cfc2c961e0114ecd352b2ebec5e8276ed27ddc7572c6d0
3
+ size 826094
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
1
+ {"source_lang": "gmq", "target_lang": "zlw", "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-08-03/gmq-zlw", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff