tiedeman commited on
Commit
35a5da0
1 Parent(s): ddd620d

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,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - be
4
+ - it
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-zle-it
15
+ results:
16
+ - task:
17
+ name: Translation rus-ita
18
+ type: translation
19
+ args: rus-ita
20
+ dataset:
21
+ name: flores101-devtest
22
+ type: flores_101
23
+ args: rus ita devtest
24
+ metrics:
25
+ - name: BLEU
26
+ type: bleu
27
+ value: 23.7
28
+ - task:
29
+ name: Translation ukr-ita
30
+ type: translation
31
+ args: ukr-ita
32
+ dataset:
33
+ name: flores101-devtest
34
+ type: flores_101
35
+ args: ukr ita devtest
36
+ metrics:
37
+ - name: BLEU
38
+ type: bleu
39
+ value: 23.2
40
+ - task:
41
+ name: Translation bel-ita
42
+ type: translation
43
+ args: bel-ita
44
+ dataset:
45
+ name: tatoeba-test-v2021-08-07
46
+ type: tatoeba_mt
47
+ args: bel-ita
48
+ metrics:
49
+ - name: BLEU
50
+ type: bleu
51
+ value: 49.3
52
+ - task:
53
+ name: Translation rus-ita
54
+ type: translation
55
+ args: rus-ita
56
+ dataset:
57
+ name: tatoeba-test-v2021-08-07
58
+ type: tatoeba_mt
59
+ args: rus-ita
60
+ metrics:
61
+ - name: BLEU
62
+ type: bleu
63
+ value: 43.5
64
+ - task:
65
+ name: Translation ukr-ita
66
+ type: translation
67
+ args: ukr-ita
68
+ dataset:
69
+ name: tatoeba-test-v2021-08-07
70
+ type: tatoeba_mt
71
+ args: ukr-ita
72
+ metrics:
73
+ - name: BLEU
74
+ type: bleu
75
+ value: 50.0
76
+ ---
77
+ # opus-mt-tc-big-zle-it
78
+
79
+ Neural machine translation model for translating from East Slavic languages (zle) to Italian (it).
80
+
81
+ 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).
82
+
83
+ * 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.)
84
+
85
+ ```
86
+ @inproceedings{tiedemann-thottingal-2020-opus,
87
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
88
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
89
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
90
+ month = nov,
91
+ year = "2020",
92
+ address = "Lisboa, Portugal",
93
+ publisher = "European Association for Machine Translation",
94
+ url = "https://aclanthology.org/2020.eamt-1.61",
95
+ pages = "479--480",
96
+ }
97
+
98
+ @inproceedings{tiedemann-2020-tatoeba,
99
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
100
+ author = {Tiedemann, J{\"o}rg},
101
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
102
+ month = nov,
103
+ year = "2020",
104
+ address = "Online",
105
+ publisher = "Association for Computational Linguistics",
106
+ url = "https://aclanthology.org/2020.wmt-1.139",
107
+ pages = "1174--1182",
108
+ }
109
+ ```
110
+
111
+ ## Model info
112
+
113
+ * Release: 2022-03-19
114
+ * source language(s): bel rus ukr
115
+ * target language(s): ita
116
+ * model: transformer-big
117
+ * data: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
118
+ * tokenization: SentencePiece (spm32k,spm32k)
119
+ * original model: [opusTCv20210807_transformer-big_2022-03-19.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-ita/opusTCv20210807_transformer-big_2022-03-19.zip)
120
+ * more information released models: [OPUS-MT zle-ita README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/zle-ita/README.md)
121
+
122
+ ## Usage
123
+
124
+ A short example code:
125
+
126
+ ```python
127
+ from transformers import MarianMTModel, MarianTokenizer
128
+
129
+ src_text = [
130
+ "Вони не ідіоти.",
131
+ "Я не хочу идти в банк."
132
+ ]
133
+
134
+ model_name = "pytorch-models/opus-mt-tc-big-zle-it"
135
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
136
+ model = MarianMTModel.from_pretrained(model_name)
137
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
138
+
139
+ for t in translated:
140
+ print( tokenizer.decode(t, skip_special_tokens=True) )
141
+
142
+ # expected output:
143
+ # Non sono idioti.
144
+ # Non voglio andare in banca.
145
+ ```
146
+
147
+ You can also use OPUS-MT models with the transformers pipelines, for example:
148
+
149
+ ```python
150
+ from transformers import pipeline
151
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-zle-it")
152
+ print(pipe("Вони не ідіоти."))
153
+
154
+ # expected output: Non sono idioti.
155
+ ```
156
+
157
+ ## Benchmarks
158
+
159
+ * test set translations: [opusTCv20210807_transformer-big_2022-03-19.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-ita/opusTCv20210807_transformer-big_2022-03-19.test.txt)
160
+ * test set scores: [opusTCv20210807_transformer-big_2022-03-19.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-ita/opusTCv20210807_transformer-big_2022-03-19.eval.txt)
161
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
162
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
163
+
164
+ | langpair | testset | chr-F | BLEU | #sent | #words |
165
+ |----------|---------|-------|-------|-------|--------|
166
+ | bel-ita | tatoeba-test-v2021-08-07 | 0.65945 | 49.3 | 264 | 1681 |
167
+ | rus-ita | tatoeba-test-v2021-08-07 | 0.64037 | 43.5 | 10045 | 71584 |
168
+ | ukr-ita | tatoeba-test-v2021-08-07 | 0.69570 | 50.0 | 5000 | 27846 |
169
+ | bel-ita | flores101-devtest | 0.46311 | 13.5 | 1012 | 27306 |
170
+ | rus-ita | flores101-devtest | 0.53054 | 23.7 | 1012 | 27306 |
171
+ | ukr-ita | flores101-devtest | 0.52783 | 23.2 | 1012 | 27306 |
172
+
173
+ ## Acknowledgements
174
+
175
+ 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.
176
+
177
+ ## Model conversion info
178
+
179
+ * transformers version: 4.16.2
180
+ * OPUS-MT git hash: 1bdabf7
181
+ * port time: Wed Mar 23 23:17:47 EET 2022
182
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ bel-ita flores101-dev 0.46392 12.8 997 25840
2
+ rus-ita flores101-dev 0.52834 22.8 997 25840
3
+ bel-ita flores101-devtest 0.46311 13.5 1012 27306
4
+ rus-ita flores101-devtest 0.53054 23.7 1012 27306
5
+ ukr-ita flores101-devtest 0.52783 23.2 1012 27306
6
+ ukr-ita flores101-dev 0.52237 22.2 997 25840
7
+ bel-ita tatoeba-test-v2020-07-28 0.65945 49.3 264 1681
8
+ rus-ita tatoeba-test-v2020-07-28 0.64027 43.4 10000 71254
9
+ ukr-ita tatoeba-test-v2020-07-28 0.69570 50.0 5000 27846
10
+ bel-ita tatoeba-test-v2021-03-30 0.66073 49.5 265 1687
11
+ rus-ita tatoeba-test-v2021-03-30 0.64033 43.5 10010 71323
12
+ ukr-ita tatoeba-test-v2021-03-30 0.69570 50.0 5000 27846
13
+ bel-ita tatoeba-test-v2021-08-07 0.65945 49.3 264 1681
14
+ rus-ita tatoeba-test-v2021-08-07 0.64037 43.5 10045 71584
15
+ ukr-ita tatoeba-test-v2021-08-07 0.69570 50.0 5000 27846
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:766e810d199f2ceb5bda7b1bb3c974dd2493450a63e0b05c4e4cce984615e1aa
3
+ size 2851746
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
+ 60973
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": 60973,
21
+ "decoder_vocab_size": 60974,
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": 25691,
28
+ "forced_eos_token_id": 25691,
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": 60973,
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": 60974
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7779b99eab19325d1b7cc7bfcdfff050dcaca5c465d05b983448e44e8e916b0f
3
+ size 602677891
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9aa841167e336fcb86b6c52ef9074103e8aa3975f7dba392cbc2f50f814d92b2
3
+ size 991369
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:92d831168fc04bd759416636e72f3540dea31f349878bb8d4e3fcab5c734eb4a
3
+ size 816995
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
1
+ {"source_lang": "zle", "target_lang": "it", "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-19/zle-it", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff