tiedeman commited on
Commit
54e63e1
1 Parent(s): 445f8b2

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,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ro
4
+ - uk
5
+
6
+ tags:
7
+ - translation
8
+
9
+ license: cc-by-4.0
10
+ model-index:
11
+ - name: opus-mt-tc-base-uk-ro
12
+ results:
13
+ - task:
14
+ name: Translation ukr-ron
15
+ type: translation
16
+ args: ukr-ron
17
+ dataset:
18
+ name: flores101-devtest
19
+ type: flores_101
20
+ args: ukr ron devtest
21
+ metrics:
22
+ - name: BLEU
23
+ type: bleu
24
+ value: 27.7
25
+ ---
26
+ # opus-mt-tc-base-uk-ro
27
+
28
+ Neural machine translation model for translating from Ukrainian (uk) to Romanian (ro).
29
+
30
+ 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).
31
+
32
+ * 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.)
33
+
34
+ ```
35
+ @inproceedings{tiedemann-thottingal-2020-opus,
36
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
37
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
38
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
39
+ month = nov,
40
+ year = "2020",
41
+ address = "Lisboa, Portugal",
42
+ publisher = "European Association for Machine Translation",
43
+ url = "https://aclanthology.org/2020.eamt-1.61",
44
+ pages = "479--480",
45
+ }
46
+
47
+ @inproceedings{tiedemann-2020-tatoeba,
48
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
49
+ author = {Tiedemann, J{\"o}rg},
50
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
51
+ month = nov,
52
+ year = "2020",
53
+ address = "Online",
54
+ publisher = "Association for Computational Linguistics",
55
+ url = "https://aclanthology.org/2020.wmt-1.139",
56
+ pages = "1174--1182",
57
+ }
58
+ ```
59
+
60
+ ## Model info
61
+
62
+ * Release: 2022-03-08
63
+ * source language(s):
64
+ * target language(s):
65
+ * valid target language labels:
66
+ * model: transformer-align
67
+ * data: opusTCv20210807+pft ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
68
+ * tokenization: SentencePiece (spm32k,spm32k)
69
+ * original model: [opusTCv20210807+pft_transformer-align_2022-03-08.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/ukr-ron/opusTCv20210807+pft_transformer-align_2022-03-08.zip)
70
+ * more information released models: [OPUS-MT ukr-ron README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/ukr-ron/README.md)
71
+ * more information about the model: [MarianMT](https://huggingface.co/docs/transformers/model_doc/marian)
72
+
73
+ 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. `>><<`
74
+
75
+ ## Usage
76
+
77
+ A short example code:
78
+
79
+ ```python
80
+ from transformers import MarianMTModel, MarianTokenizer
81
+
82
+ src_text = [
83
+ ">>ron<< Стаття висловлює особисту думку автора.",
84
+ ">>ron<< Качкодзьоби живуть на сході Австрії."
85
+ ]
86
+
87
+ model_name = "pytorch-models/opus-mt-tc-base-uk-ro"
88
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
89
+ model = MarianMTModel.from_pretrained(model_name)
90
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
91
+
92
+ for t in translated:
93
+ print( tokenizer.decode(t, skip_special_tokens=True) )
94
+
95
+ # expected output:
96
+ # Articolul exprimă opinia personală a autorului.
97
+ # Kachkojiobi trăiesc în estul Austriei.
98
+ ```
99
+
100
+ You can also use OPUS-MT models with the transformers pipelines, for example:
101
+
102
+ ```python
103
+ from transformers import pipeline
104
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-base-uk-ro")
105
+ print(pipe(">>ron<< Стаття висловлює особисту думку автора."))
106
+
107
+ # expected output: Articolul exprimă opinia personală a autorului.
108
+ ```
109
+
110
+ ## Benchmarks
111
+
112
+ * test set translations: [opusTCv20210807+pft_transformer-align_2022-03-08.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/ukr-ron/opusTCv20210807+pft_transformer-align_2022-03-08.test.txt)
113
+ * test set scores: [opusTCv20210807+pft_transformer-align_2022-03-08.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/ukr-ron/opusTCv20210807+pft_transformer-align_2022-03-08.eval.txt)
114
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
115
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
116
+
117
+ | langpair | testset | chr-F | BLEU | #sent | #words |
118
+ |----------|---------|-------|-------|-------|--------|
119
+ | ukr-ron | flores101-devtest | 0.55343 | 27.7 | 1012 | 26799 |
120
+
121
+ ## Acknowledgements
122
+
123
+ 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.
124
+
125
+ ## Model conversion info
126
+
127
+ * transformers version: 4.16.2
128
+ * OPUS-MT git hash: f084bad
129
+ * port time: Wed Mar 23 21:48:27 EET 2022
130
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ukr-ron flores101-devtest 0.55343 27.7 1012 26799
2
+ ukr-ron flores101-dev 0.55091 27.8 997 25616
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4ef05af4951e22e9c57df6f8e2b28df59f1d5baa48e851b165550fdf3a2c023
3
+ size 383084
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
+ 60356
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": 60356,
21
+ "decoder_vocab_size": 60357,
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": 25601,
28
+ "forced_eos_token_id": 25601,
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": 60356,
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": 60357
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e311f95c5f5654768973d94b3ff550b9a4a3f0dddd643e8bc0133d14f1638ad8
3
+ size 212100547
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:988b0cbad5e7679cc8b801c7685b28dbdb6582ddb34105d905e644eda78ece80
3
+ size 1007877
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:891e738aa9226cfbbb8c2103ff29e9b8812a89c2395556dc8641b473da83e974
3
+ size 825160
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "uk", "target_lang": "ro", "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-08/uk-ro", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff