tiedeman commited on
Commit
80e6d78
1 Parent(s): 78debb7

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,173 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-it-zle
15
+ results:
16
+ - task:
17
+ name: Translation ita-rus
18
+ type: translation
19
+ args: ita-rus
20
+ dataset:
21
+ name: flores101-devtest
22
+ type: flores_101
23
+ args: ita rus devtest
24
+ metrics:
25
+ - name: BLEU
26
+ type: bleu
27
+ value: 21.3
28
+ - task:
29
+ name: Translation ita-bel
30
+ type: translation
31
+ args: ita-bel
32
+ dataset:
33
+ name: tatoeba-test-v2021-08-07
34
+ type: tatoeba_mt
35
+ args: ita-bel
36
+ metrics:
37
+ - name: BLEU
38
+ type: bleu
39
+ value: 33.3
40
+ - task:
41
+ name: Translation ita-rus
42
+ type: translation
43
+ args: ita-rus
44
+ dataset:
45
+ name: tatoeba-test-v2021-08-07
46
+ type: tatoeba_mt
47
+ args: ita-rus
48
+ metrics:
49
+ - name: BLEU
50
+ type: bleu
51
+ value: 46.7
52
+ - task:
53
+ name: Translation ita-ukr
54
+ type: translation
55
+ args: ita-ukr
56
+ dataset:
57
+ name: tatoeba-test-v2021-08-07
58
+ type: tatoeba_mt
59
+ args: ita-ukr
60
+ metrics:
61
+ - name: BLEU
62
+ type: bleu
63
+ value: 48.4
64
+ ---
65
+ # opus-mt-tc-big-it-zle
66
+
67
+ Neural machine translation model for translating from Italian (it) to East Slavic languages (zle).
68
+
69
+ 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).
70
+
71
+ * 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.)
72
+
73
+ ```
74
+ @inproceedings{tiedemann-thottingal-2020-opus,
75
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
76
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
77
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
78
+ month = nov,
79
+ year = "2020",
80
+ address = "Lisboa, Portugal",
81
+ publisher = "European Association for Machine Translation",
82
+ url = "https://aclanthology.org/2020.eamt-1.61",
83
+ pages = "479--480",
84
+ }
85
+
86
+ @inproceedings{tiedemann-2020-tatoeba,
87
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
88
+ author = {Tiedemann, J{\"o}rg},
89
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
90
+ month = nov,
91
+ year = "2020",
92
+ address = "Online",
93
+ publisher = "Association for Computational Linguistics",
94
+ url = "https://aclanthology.org/2020.wmt-1.139",
95
+ pages = "1174--1182",
96
+ }
97
+ ```
98
+
99
+ ## Model info
100
+
101
+ * Release: 2022-03-23
102
+ * source language(s): ita
103
+ * target language(s): bel rus ukr
104
+ * valid target language labels: >>bel<< >>rus<< >>ukr<<
105
+ * model: transformer-big
106
+ * data: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
107
+ * tokenization: SentencePiece (spm32k,spm32k)
108
+ * original model: [opusTCv20210807_transformer-big_2022-03-23.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/ita-zle/opusTCv20210807_transformer-big_2022-03-23.zip)
109
+ * more information released models: [OPUS-MT ita-zle README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/ita-zle/README.md)
110
+ * more information about the model: [MarianMT](https://huggingface.co/docs/transformers/model_doc/marian)
111
+
112
+ 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<<`
113
+
114
+ ## Usage
115
+
116
+ A short example code:
117
+
118
+ ```python
119
+ from transformers import MarianMTModel, MarianTokenizer
120
+
121
+ src_text = [
122
+ ">>ukr<< Alcune cose non cambiano mai.",
123
+ ">>rus<< Puoi sederti."
124
+ ]
125
+
126
+ model_name = "pytorch-models/opus-mt-tc-big-it-zle"
127
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
128
+ model = MarianMTModel.from_pretrained(model_name)
129
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
130
+
131
+ for t in translated:
132
+ print( tokenizer.decode(t, skip_special_tokens=True) )
133
+
134
+ # expected output:
135
+ # Деякі речі ніколи не змінюються.
136
+ # Можешь присесть.
137
+ ```
138
+
139
+ You can also use OPUS-MT models with the transformers pipelines, for example:
140
+
141
+ ```python
142
+ from transformers import pipeline
143
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-it-zle")
144
+ print(pipe(">>ukr<< Alcune cose non cambiano mai."))
145
+
146
+ # expected output: Деякі речі ніколи не змінюються.
147
+ ```
148
+
149
+ ## Benchmarks
150
+
151
+ * test set translations: [opusTCv20210807_transformer-big_2022-03-23.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/ita-zle/opusTCv20210807_transformer-big_2022-03-23.test.txt)
152
+ * test set scores: [opusTCv20210807_transformer-big_2022-03-23.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/ita-zle/opusTCv20210807_transformer-big_2022-03-23.eval.txt)
153
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
154
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
155
+
156
+ | langpair | testset | chr-F | BLEU | #sent | #words |
157
+ |----------|---------|-------|-------|-------|--------|
158
+ | ita-bel | tatoeba-test-v2021-08-07 | 0.55727 | 33.3 | 264 | 1513 |
159
+ | ita-rus | tatoeba-test-v2021-08-07 | 0.66083 | 46.7 | 10045 | 65968 |
160
+ | ita-ukr | tatoeba-test-v2021-08-07 | 0.67674 | 48.4 | 5000 | 25353 |
161
+ | ita-rus | flores101-devtest | 0.50323 | 21.3 | 1012 | 23295 |
162
+ | ita-ukr | flores101-devtest | 0.47658 | 18.3 | 1012 | 22810 |
163
+
164
+ ## Acknowledgements
165
+
166
+ 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.
167
+
168
+ ## Model conversion info
169
+
170
+ * transformers version: 4.16.2
171
+ * OPUS-MT git hash: 1bdabf7
172
+ * port time: Thu Mar 24 02:49:36 EET 2022
173
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ita-bel flores101-dev 0.37687 8.4 997 23996
2
+ ita-rus flores101-dev 0.50482 21.4 997 22657
3
+ ita-ukr flores101-dev 0.46648 17.2 997 21841
4
+ ita-bel flores101-devtest 0.38250 8.7 1012 24829
5
+ ita-rus flores101-devtest 0.50323 21.3 1012 23295
6
+ ita-ukr flores101-devtest 0.47658 18.3 1012 22810
7
+ ita-rus tatoeba-test-v2020-07-28 0.66106 46.7 10000 65658
8
+ ita-bel tatoeba-test-v2021-03-30 0.55902 33.6 265 1519
9
+ ita-rus tatoeba-test-v2021-03-30 0.66104 46.7 10010 65710
10
+ ita-bel tatoeba-test-v2021-08-07 0.55727 33.3 264 1513
11
+ ita-rus tatoeba-test-v2021-08-07 0.66083 46.7 10045 65968
12
+ ita-ukr tatoeba-test-v2021-08-07 0.67674 48.4 5000 25353
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e870473dfe8565bf88234c87dba0c7e52a578efa76c813c02e0c843394fa45ac
3
+ size 2673730
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
+ 60954
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": 60954,
21
+ "decoder_vocab_size": 60955,
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": 25705,
28
+ "forced_eos_token_id": 25705,
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": 60954,
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": 60955
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:67eae247d2dd524c173e20bed86526fdc911c84d8972390c2c252beb8d475850
3
+ size 602600003
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e66a61f38c3f85b94e9f6e47e3467b0ca315db67a5bfa0875cc8619933a4ee8
3
+ size 817116
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:6dda9bcad25c2c922f184225cba8177a7d9be6d936d35864a2c17bdbcbb92f62
3
+ size 992897
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
1
+ {"source_lang": "it", "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/it-zle", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff