tiedeman commited on
Commit
ed1ec8d
1 Parent(s): c38d5ae

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,278 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - de
4
+ - es
5
+
6
+ tags:
7
+ - translation
8
+ - opus-mt-tc
9
+
10
+ license: cc-by-4.0
11
+ model-index:
12
+ - name: opus-mt-tc-big-de-es
13
+ results:
14
+ - task:
15
+ name: Translation deu-spa
16
+ type: translation
17
+ args: deu-spa
18
+ dataset:
19
+ name: flores101-devtest
20
+ type: flores_101
21
+ args: deu spa devtest
22
+ metrics:
23
+ - name: BLEU
24
+ type: bleu
25
+ value: 24.9
26
+ - name: chr-F
27
+ type: chrf
28
+ value: 0.53208
29
+ - task:
30
+ name: Translation deu-spa
31
+ type: translation
32
+ args: deu-spa
33
+ dataset:
34
+ name: news-test2008
35
+ type: news-test2008
36
+ args: deu-spa
37
+ metrics:
38
+ - name: BLEU
39
+ type: bleu
40
+ value: 26.6
41
+ - name: chr-F
42
+ type: chrf
43
+ value: 0.54400
44
+ - task:
45
+ name: Translation deu-spa
46
+ type: translation
47
+ args: deu-spa
48
+ dataset:
49
+ name: tatoeba-test-v2021-08-07
50
+ type: tatoeba_mt
51
+ args: deu-spa
52
+ metrics:
53
+ - name: BLEU
54
+ type: bleu
55
+ value: 50.8
56
+ - name: chr-F
57
+ type: chrf
58
+ value: 0.69105
59
+ - task:
60
+ name: Translation deu-spa
61
+ type: translation
62
+ args: deu-spa
63
+ dataset:
64
+ name: newstest2009
65
+ type: wmt-2009-news
66
+ args: deu-spa
67
+ metrics:
68
+ - name: BLEU
69
+ type: bleu
70
+ value: 25.9
71
+ - name: chr-F
72
+ type: chrf
73
+ value: 0.53934
74
+ - task:
75
+ name: Translation deu-spa
76
+ type: translation
77
+ args: deu-spa
78
+ dataset:
79
+ name: newstest2010
80
+ type: wmt-2010-news
81
+ args: deu-spa
82
+ metrics:
83
+ - name: BLEU
84
+ type: bleu
85
+ value: 33.8
86
+ - name: chr-F
87
+ type: chrf
88
+ value: 0.60102
89
+ - task:
90
+ name: Translation deu-spa
91
+ type: translation
92
+ args: deu-spa
93
+ dataset:
94
+ name: newstest2011
95
+ type: wmt-2011-news
96
+ args: deu-spa
97
+ metrics:
98
+ - name: BLEU
99
+ type: bleu
100
+ value: 31.3
101
+ - name: chr-F
102
+ type: chrf
103
+ value: 0.57133
104
+ - task:
105
+ name: Translation deu-spa
106
+ type: translation
107
+ args: deu-spa
108
+ dataset:
109
+ name: newstest2012
110
+ type: wmt-2012-news
111
+ args: deu-spa
112
+ metrics:
113
+ - name: BLEU
114
+ type: bleu
115
+ value: 32.6
116
+ - name: chr-F
117
+ type: chrf
118
+ value: 0.58119
119
+ - task:
120
+ name: Translation deu-spa
121
+ type: translation
122
+ args: deu-spa
123
+ dataset:
124
+ name: newstest2013
125
+ type: wmt-2013-news
126
+ args: deu-spa
127
+ metrics:
128
+ - name: BLEU
129
+ type: bleu
130
+ value: 32.4
131
+ - name: chr-F
132
+ type: chrf
133
+ value: 0.57559
134
+ ---
135
+ # opus-mt-tc-big-de-es
136
+
137
+ ## Table of Contents
138
+ - [Model Details](#model-details)
139
+ - [Uses](#uses)
140
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
141
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
142
+ - [Training](#training)
143
+ - [Evaluation](#evaluation)
144
+ - [Citation Information](#citation-information)
145
+ - [Acknowledgements](#acknowledgements)
146
+
147
+ ## Model Details
148
+
149
+ Neural machine translation model for translating from German (de) to Spanish (es).
150
+
151
+ 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).
152
+ **Model Description:**
153
+ - **Developed by:** Language Technology Research Group at the University of Helsinki
154
+ - **Model Type:** Translation (transformer-big)
155
+ - **Release**: 2022-07-26
156
+ - **License:** CC-BY-4.0
157
+ - **Language(s):**
158
+ - Source Language(s): deu
159
+ - Target Language(s): spa
160
+ - **Original Model**: [opusTCv20210807_transformer-big_2022-07-26.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/deu-spa/opusTCv20210807_transformer-big_2022-07-26.zip)
161
+ - **Resources for more information:**
162
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
163
+ - More information about released models for this language pair: [OPUS-MT deu-spa README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/deu-spa/README.md)
164
+ - [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
165
+ - [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/
166
+
167
+ ## Uses
168
+
169
+ This model can be used for translation and text-to-text generation.
170
+
171
+ ## Risks, Limitations and Biases
172
+
173
+ **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.**
174
+
175
+ 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)).
176
+
177
+ ## How to Get Started With the Model
178
+
179
+ A short example code:
180
+
181
+ ```python
182
+ from transformers import MarianMTModel, MarianTokenizer
183
+
184
+ src_text = [
185
+ "Ich verstehe nicht, worüber ihr redet.",
186
+ "Die Vögel singen in den Bäumen."
187
+ ]
188
+
189
+ model_name = "pytorch-models/opus-mt-tc-big-de-es"
190
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
191
+ model = MarianMTModel.from_pretrained(model_name)
192
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
193
+
194
+ for t in translated:
195
+ print( tokenizer.decode(t, skip_special_tokens=True) )
196
+
197
+ # expected output:
198
+ # No entiendo de qué están hablando.
199
+ # Los pájaros cantan en los árboles.
200
+ ```
201
+
202
+ You can also use OPUS-MT models with the transformers pipelines, for example:
203
+
204
+ ```python
205
+ from transformers import pipeline
206
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-de-es")
207
+ print(pipe("Ich verstehe nicht, worüber ihr redet."))
208
+
209
+ # expected output: No entiendo de qué están hablando.
210
+ ```
211
+
212
+ ## Training
213
+
214
+ - **Data**: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
215
+ - **Pre-processing**: SentencePiece (spm32k,spm32k)
216
+ - **Model Type:** transformer-big
217
+ - **Original MarianNMT Model**: [opusTCv20210807_transformer-big_2022-07-26.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/deu-spa/opusTCv20210807_transformer-big_2022-07-26.zip)
218
+ - **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
219
+
220
+ ## Evaluation
221
+
222
+ * test set translations: [opusTCv20210807_transformer-big_2022-07-26.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/deu-spa/opusTCv20210807_transformer-big_2022-07-26.test.txt)
223
+ * test set scores: [opusTCv20210807_transformer-big_2022-07-26.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/deu-spa/opusTCv20210807_transformer-big_2022-07-26.eval.txt)
224
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
225
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
226
+
227
+ | langpair | testset | chr-F | BLEU | #sent | #words |
228
+ |----------|---------|-------|-------|-------|--------|
229
+ | deu-spa | tatoeba-test-v2021-08-07 | 0.69105 | 50.8 | 10521 | 82570 |
230
+ | deu-spa | flores101-devtest | 0.53208 | 24.9 | 1012 | 29199 |
231
+ | deu-spa | newssyscomb2009 | 0.55547 | 28.3 | 502 | 12503 |
232
+ | deu-spa | news-test2008 | 0.54400 | 26.6 | 2051 | 52586 |
233
+ | deu-spa | newstest2009 | 0.53934 | 25.9 | 2525 | 68111 |
234
+ | deu-spa | newstest2010 | 0.60102 | 33.8 | 2489 | 65480 |
235
+ | deu-spa | newstest2011 | 0.57133 | 31.3 | 3003 | 79476 |
236
+ | deu-spa | newstest2012 | 0.58119 | 32.6 | 3003 | 79006 |
237
+ | deu-spa | newstest2013 | 0.57559 | 32.4 | 3000 | 70528 |
238
+
239
+ ## Citation Information
240
+
241
+ * 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.)
242
+
243
+ ```
244
+ @inproceedings{tiedemann-thottingal-2020-opus,
245
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
246
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
247
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
248
+ month = nov,
249
+ year = "2020",
250
+ address = "Lisboa, Portugal",
251
+ publisher = "European Association for Machine Translation",
252
+ url = "https://aclanthology.org/2020.eamt-1.61",
253
+ pages = "479--480",
254
+ }
255
+
256
+ @inproceedings{tiedemann-2020-tatoeba,
257
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
258
+ author = {Tiedemann, J{\"o}rg},
259
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
260
+ month = nov,
261
+ year = "2020",
262
+ address = "Online",
263
+ publisher = "Association for Computational Linguistics",
264
+ url = "https://aclanthology.org/2020.wmt-1.139",
265
+ pages = "1174--1182",
266
+ }
267
+ ```
268
+
269
+ ## Acknowledgements
270
+
271
+ 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.
272
+
273
+ ## Model conversion info
274
+
275
+ * transformers version: 4.16.2
276
+ * OPUS-MT git hash: 8b9f0b0
277
+ * port time: Fri Aug 12 18:20:59 EEST 2022
278
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ deu-spa flores101-dev 0.52144 24.4 997 27793
2
+ deu-spa flores101-devtest 0.53208 24.9 1012 29199
3
+ deu-spa newssyscomb2009 0.55547 28.3 502 12503
4
+ deu-spa news-test2008 0.54400 26.6 2051 52586
5
+ deu-spa newstest2009 0.53934 25.9 2525 68111
6
+ deu-spa newstest2010 0.60102 33.8 2489 65480
7
+ deu-spa newstest2011 0.57133 31.3 3003 79476
8
+ deu-spa newstest2012 0.58119 32.6 3003 79006
9
+ deu-spa newstest2013 0.57559 32.4 3000 70528
10
+ deu-spa tatoeba-test-v2020-07-28 0.68981 50.6 10000 77529
11
+ deu-spa tatoeba-test-v2021-03-30 0.68991 50.6 10138 78787
12
+ deu-spa tatoeba-test-v2021-08-07 0.69105 50.8 10521 82570
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:47afc5fae527355fe4d87cbfb93732a183d2957c4f58b9a842a793e939b2bdd0
3
+ size 4131323
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
+ 56846
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": 56846,
21
+ "decoder_vocab_size": 56847,
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": 44507,
28
+ "forced_eos_token_id": 44507,
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": 56846,
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": 56847
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:26ec10a00d665da390b942f747c8a8be9fbe109afec6a2be1e4ba0e095120fd0
3
+ size 585765443
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:15109e85cedefb51d3bc87b0fb316198c0106bfe32dfd986db38dded1f5cd6d0
3
+ size 823219
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:de1e8af342bb1d70588df5877a9106a145dde28bacd86959438e9299f90454ca
3
+ size 822887
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "de", "target_lang": "es", "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/de-es", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff