tiedeman commited on
Commit
5c96f3a
1 Parent(s): 3341c85

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,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ces+slk
4
+ - cs
5
+ - uk
6
+
7
+ tags:
8
+ - translation
9
+
10
+ license: cc-by-4.0
11
+ model-index:
12
+ - name: opus-mt-tc-base-uk-ces_slk
13
+ results:
14
+ - task:
15
+ name: Translation ukr-ces
16
+ type: translation
17
+ args: ukr-ces
18
+ dataset:
19
+ name: flores101-devtest
20
+ type: flores_101
21
+ args: ukr ces devtest
22
+ metrics:
23
+ - name: BLEU
24
+ type: bleu
25
+ value: 23.0
26
+ - task:
27
+ name: Translation ukr-slk
28
+ type: translation
29
+ args: ukr-slk
30
+ dataset:
31
+ name: flores101-devtest
32
+ type: flores_101
33
+ args: ukr slk devtest
34
+ metrics:
35
+ - name: BLEU
36
+ type: bleu
37
+ value: 22.1
38
+ - task:
39
+ name: Translation ukr-ces
40
+ type: translation
41
+ args: ukr-ces
42
+ dataset:
43
+ name: tatoeba-test-v2021-08-07
44
+ type: tatoeba_mt
45
+ args: ukr-ces
46
+ metrics:
47
+ - name: BLEU
48
+ type: bleu
49
+ value: 54.2
50
+ ---
51
+ # opus-mt-tc-base-uk-ces_slk
52
+
53
+ Neural machine translation model for translating from Ukrainian (uk) to unknown (ces+slk).
54
+
55
+ 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).
56
+
57
+ * 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.)
58
+
59
+ ```
60
+ @inproceedings{tiedemann-thottingal-2020-opus,
61
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
62
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
63
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
64
+ month = nov,
65
+ year = "2020",
66
+ address = "Lisboa, Portugal",
67
+ publisher = "European Association for Machine Translation",
68
+ url = "https://aclanthology.org/2020.eamt-1.61",
69
+ pages = "479--480",
70
+ }
71
+
72
+ @inproceedings{tiedemann-2020-tatoeba,
73
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
74
+ author = {Tiedemann, J{\"o}rg},
75
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
76
+ month = nov,
77
+ year = "2020",
78
+ address = "Online",
79
+ publisher = "Association for Computational Linguistics",
80
+ url = "https://aclanthology.org/2020.wmt-1.139",
81
+ pages = "1174--1182",
82
+ }
83
+ ```
84
+
85
+ ## Model info
86
+
87
+ * Release: align_2022-03-17
88
+ * source language(s): ukr
89
+ * target language(s): ces
90
+ * valid target language labels: >>ces<< >>slk<<
91
+ * model: transformer-align (base)
92
+ * data: opusTCv20210807+pft ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
93
+ * tokenization: SentencePiece (spm32k,spm32k)
94
+ * original model: [opusTCv20210807+pft_transformer-align_2022-03-17.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/ukr-ces+slk/opusTCv20210807+pft_transformer-align_2022-03-17.zip)
95
+ * more information released models: [OPUS-MT ukr-ces+slk README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/ukr-ces+slk/README.md)
96
+ * more information about the model: [MarianMT](https://huggingface.co/docs/transformers/model_doc/marian)
97
+
98
+ 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<<`
99
+
100
+ ## Usage
101
+
102
+ A short example code:
103
+
104
+ ```python
105
+ from transformers import MarianMTModel, MarianTokenizer
106
+
107
+ src_text = [
108
+ ">>ces<< А чого так?",
109
+ ">>ces<< Я загубив свої окуляри."
110
+ ]
111
+
112
+ model_name = "pytorch-models/opus-mt-tc-base-uk-ces_slk"
113
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
114
+ model = MarianMTModel.from_pretrained(model_name)
115
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
116
+
117
+ for t in translated:
118
+ print( tokenizer.decode(t, skip_special_tokens=True) )
119
+
120
+ # expected output:
121
+ # Proč to tak je?
122
+ # Ztratil jsem brýle.
123
+ ```
124
+
125
+ You can also use OPUS-MT models with the transformers pipelines, for example:
126
+
127
+ ```python
128
+ from transformers import pipeline
129
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-base-uk-ces_slk")
130
+ print(pipe(">>ces<< А чого так?"))
131
+
132
+ # expected output: Proč to tak je?
133
+ ```
134
+
135
+ ## Benchmarks
136
+
137
+ * test set translations: [opusTCv20210807+pft_transformer-align_2022-03-17.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/ukr-ces+slk/opusTCv20210807+pft_transformer-align_2022-03-17.test.txt)
138
+ * test set scores: [opusTCv20210807+pft_transformer-align_2022-03-17.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/ukr-ces+slk/opusTCv20210807+pft_transformer-align_2022-03-17.eval.txt)
139
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
140
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
141
+
142
+ | langpair | testset | chr-F | BLEU | #sent | #words |
143
+ |----------|---------|-------|-------|-------|--------|
144
+ | ukr-ces | tatoeba-test-v2021-08-07 | 0.70661 | 54.2 | 1787 | 8550 |
145
+ | ukr-ces | flores101-devtest | 0.51283 | 23.0 | 1012 | 22101 |
146
+ | ukr-slk | flores101-devtest | 0.51043 | 22.1 | 1012 | 22543 |
147
+
148
+ ## Acknowledgements
149
+
150
+ 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.
151
+
152
+ ## Model conversion info
153
+
154
+ * transformers version: 4.16.2
155
+ * OPUS-MT git hash: f084bad
156
+ * port time: Wed Mar 23 20:10:11 EET 2022
157
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ ukr-ces flores101-devtest 0.51283 23.0 1012 22101
2
+ ukr-slk flores101-devtest 0.51043 22.1 1012 22543
3
+ ukr-ces flores101-dev 0.50743 22.3 997 21183
4
+ ukr-slk flores101-dev 0.50624 22.0 997 21796
5
+ ukr-ces tatoeba-test-v2020-07-28 0.70661 54.2 1787 8550
6
+ ukr-ces tatoeba-test-v2021-03-30 0.70661 54.2 1787 8550
7
+ ukr-ces tatoeba-test-v2021-08-07 0.70661 54.2 1787 8550
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f6596d5dea654f84e7f31ee7253bcf4d50381cb0b5f47f3c1a1d197f8f3eeddf
3
+ size 922017
config.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation_dropout": 0.0,
3
+ "activation_function": "swish",
4
+ "architectures": [
5
+ "MarianMTModel"
6
+ ],
7
+ "attention_dropout": 0.0,
8
+ "bad_words_ids": [
9
+ [
10
+ 60825
11
+ ]
12
+ ],
13
+ "bos_token_id": 0,
14
+ "classifier_dropout": 0.0,
15
+ "d_model": 512,
16
+ "decoder_attention_heads": 8,
17
+ "decoder_ffn_dim": 2048,
18
+ "decoder_layerdrop": 0.0,
19
+ "decoder_layers": 6,
20
+ "decoder_start_token_id": 60825,
21
+ "decoder_vocab_size": 60826,
22
+ "dropout": 0.1,
23
+ "encoder_attention_heads": 8,
24
+ "encoder_ffn_dim": 2048,
25
+ "encoder_layerdrop": 0.0,
26
+ "encoder_layers": 6,
27
+ "eos_token_id": 22670,
28
+ "forced_eos_token_id": 22670,
29
+ "init_std": 0.02,
30
+ "is_encoder_decoder": true,
31
+ "max_length": 512,
32
+ "max_position_embeddings": 512,
33
+ "model_type": "marian",
34
+ "normalize_embedding": false,
35
+ "num_beams": 4,
36
+ "num_hidden_layers": 6,
37
+ "pad_token_id": 60825,
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": 60826
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8dbb6af5fc7ab8c9c383d985547aacc0ed24539456e2157553afe983be7fe14
3
+ size 213061955
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:505ae657b4e46fb462df66c8844aa1daa9e63c9f8a8d69b76f8e6154a667b866
3
+ size 1007137
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:8017501fb0b2b2b0da4b6c09dae24c0436ef1e118a76d014bba875de54a215c3
3
+ size 828600
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "uk", "target_lang": "ces+slk", "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+pft_transformer-align_2022-03-17/uk-ces+slk", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff