tiedeman commited on
Commit
b2796d2
·
1 Parent(s): a1faa87

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,168 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - pt
4
+ - ru
5
+ - uk
6
+ - zle
7
+
8
+ tags:
9
+ - translation
10
+
11
+ license: cc-by-4.0
12
+ model-index:
13
+ - name: opus-mt-tc-big-zle-pt
14
+ results:
15
+ - task:
16
+ name: Translation rus-por
17
+ type: translation
18
+ args: rus-por
19
+ dataset:
20
+ name: flores101-devtest
21
+ type: flores_101
22
+ args: rus por devtest
23
+ metrics:
24
+ - name: BLEU
25
+ type: bleu
26
+ value: 31.9
27
+ - task:
28
+ name: Translation ukr-por
29
+ type: translation
30
+ args: ukr-por
31
+ dataset:
32
+ name: flores101-devtest
33
+ type: flores_101
34
+ args: ukr por devtest
35
+ metrics:
36
+ - name: BLEU
37
+ type: bleu
38
+ value: 33.6
39
+ - task:
40
+ name: Translation rus-por
41
+ type: translation
42
+ args: rus-por
43
+ dataset:
44
+ name: tatoeba-test-v2021-08-07
45
+ type: tatoeba_mt
46
+ args: rus-por
47
+ metrics:
48
+ - name: BLEU
49
+ type: bleu
50
+ value: 42.8
51
+ - task:
52
+ name: Translation ukr-por
53
+ type: translation
54
+ args: ukr-por
55
+ dataset:
56
+ name: tatoeba-test-v2021-08-07
57
+ type: tatoeba_mt
58
+ args: ukr-por
59
+ metrics:
60
+ - name: BLEU
61
+ type: bleu
62
+ value: 45.2
63
+ ---
64
+ # opus-mt-tc-big-zle-pt
65
+
66
+ Neural machine translation model for translating from East Slavic languages (zle) to Portuguese (pt).
67
+
68
+ 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).
69
+
70
+ * 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.)
71
+
72
+ ```
73
+ @inproceedings{tiedemann-thottingal-2020-opus,
74
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
75
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
76
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
77
+ month = nov,
78
+ year = "2020",
79
+ address = "Lisboa, Portugal",
80
+ publisher = "European Association for Machine Translation",
81
+ url = "https://aclanthology.org/2020.eamt-1.61",
82
+ pages = "479--480",
83
+ }
84
+
85
+ @inproceedings{tiedemann-2020-tatoeba,
86
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
87
+ author = {Tiedemann, J{\"o}rg},
88
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
89
+ month = nov,
90
+ year = "2020",
91
+ address = "Online",
92
+ publisher = "Association for Computational Linguistics",
93
+ url = "https://aclanthology.org/2020.wmt-1.139",
94
+ pages = "1174--1182",
95
+ }
96
+ ```
97
+
98
+ ## Model info
99
+
100
+ * Release: 2022-03-23
101
+ * source language(s): rus ukr
102
+ * target language(s): por
103
+ * model: transformer-big
104
+ * data: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
105
+ * tokenization: SentencePiece (spm32k,spm32k)
106
+ * original model: [opusTCv20210807_transformer-big_2022-03-23.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-por/opusTCv20210807_transformer-big_2022-03-23.zip)
107
+ * more information released models: [OPUS-MT zle-por README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/zle-por/README.md)
108
+
109
+ ## Usage
110
+
111
+ A short example code:
112
+
113
+ ```python
114
+ from transformers import MarianMTModel, MarianTokenizer
115
+
116
+ src_text = [
117
+ ">>por<< Я маленькая.",
118
+ ">>por<< Я войду первым."
119
+ ]
120
+
121
+ model_name = "pytorch-models/opus-mt-tc-big-zle-pt"
122
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
123
+ model = MarianMTModel.from_pretrained(model_name)
124
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
125
+
126
+ for t in translated:
127
+ print( tokenizer.decode(t, skip_special_tokens=True) )
128
+
129
+ # expected output:
130
+ # Sou pequena.
131
+ # Eu entro primeiro.
132
+ ```
133
+
134
+ You can also use OPUS-MT models with the transformers pipelines, for example:
135
+
136
+ ```python
137
+ from transformers import pipeline
138
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-zle-pt")
139
+ print(pipe(">>por<< Я маленькая."))
140
+
141
+ # expected output: Sou pequena.
142
+ ```
143
+
144
+ ## Benchmarks
145
+
146
+ * test set translations: [opusTCv20210807_transformer-big_2022-03-23.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-por/opusTCv20210807_transformer-big_2022-03-23.test.txt)
147
+ * test set scores: [opusTCv20210807_transformer-big_2022-03-23.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/zle-por/opusTCv20210807_transformer-big_2022-03-23.eval.txt)
148
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
149
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
150
+
151
+ | langpair | testset | chr-F | BLEU | #sent | #words |
152
+ |----------|---------|-------|-------|-------|--------|
153
+ | rus-por | tatoeba-test-v2021-08-07 | 0.63749 | 42.8 | 10000 | 74713 |
154
+ | ukr-por | tatoeba-test-v2021-08-07 | 0.65288 | 45.2 | 3372 | 21315 |
155
+ | bel-por | flores101-devtest | 0.48481 | 16.2 | 1012 | 26519 |
156
+ | rus-por | flores101-devtest | 0.58567 | 31.9 | 1012 | 26519 |
157
+ | ukr-por | flores101-devtest | 0.59378 | 33.6 | 1012 | 26519 |
158
+
159
+ ## Acknowledgements
160
+
161
+ 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.
162
+
163
+ ## Model conversion info
164
+
165
+ * transformers version: 4.16.2
166
+ * OPUS-MT git hash: 1bdabf7
167
+ * port time: Wed Mar 23 23:45:22 EET 2022
168
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ bel-por flores101-dev 0.48010 15.3 997 25287
2
+ rus-por flores101-dev 0.58125 30.6 997 25287
3
+ bel-por flores101-devtest 0.48481 16.2 1012 26519
4
+ rus-por flores101-devtest 0.58567 31.9 1012 26519
5
+ ukr-por flores101-devtest 0.59378 33.6 1012 26519
6
+ ukr-por flores101-dev 0.58622 32.5 997 25287
7
+ rus-por tatoeba-test-v2021-08-07 0.63749 42.8 10000 74713
8
+ ukr-por tatoeba-test-v2021-08-07 0.65288 45.2 3372 21315
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6683feb665750cdf09a2b86337fd1595d385ef07040119dc5d1408078e1f65f
3
+ size 1654796
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
+ 61345
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": 61345,
21
+ "decoder_vocab_size": 61346,
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": 27129,
28
+ "forced_eos_token_id": 27129,
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": 61345,
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": 61346
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f3eebb11a9cc28608f19cec73c165f05c80d8dd13dc26e99ab6e3d6d16ffd4b0
3
+ size 604202371
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a1699e46f517b7666064c39fffad71f6b0d7da30029d6f1dad7d9e9a4907d6cf
3
+ size 1007440
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:10eded6500eb7745a1619f128c4663c4f88a854c0874eb7daf9fa39b4e308191
3
+ size 824046
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "zle", "target_lang": "pt", "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/zle-pt", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff