Initial commit
Browse files- .gitattributes +1 -0
- README.md +171 -0
- benchmark_results.txt +8 -0
- benchmark_translations.zip +3 -0
- config.json +45 -0
- pytorch_model.bin +3 -0
- source.spm +3 -0
- special_tokens_map.json +1 -0
- target.spm +3 -0
- tokenizer_config.json +1 -0
- vocab.json +0 -0
.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,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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-pt-zle
|
14 |
+
results:
|
15 |
+
- task:
|
16 |
+
name: Translation por-rus
|
17 |
+
type: translation
|
18 |
+
args: por-rus
|
19 |
+
dataset:
|
20 |
+
name: flores101-devtest
|
21 |
+
type: flores_101
|
22 |
+
args: por rus devtest
|
23 |
+
metrics:
|
24 |
+
- name: BLEU
|
25 |
+
type: bleu
|
26 |
+
value: 26.8
|
27 |
+
- task:
|
28 |
+
name: Translation por-ukr
|
29 |
+
type: translation
|
30 |
+
args: por-ukr
|
31 |
+
dataset:
|
32 |
+
name: flores101-devtest
|
33 |
+
type: flores_101
|
34 |
+
args: por ukr devtest
|
35 |
+
metrics:
|
36 |
+
- name: BLEU
|
37 |
+
type: bleu
|
38 |
+
value: 25.1
|
39 |
+
- task:
|
40 |
+
name: Translation por-rus
|
41 |
+
type: translation
|
42 |
+
args: por-rus
|
43 |
+
dataset:
|
44 |
+
name: tatoeba-test-v2021-08-07
|
45 |
+
type: tatoeba_mt
|
46 |
+
args: por-rus
|
47 |
+
metrics:
|
48 |
+
- name: BLEU
|
49 |
+
type: bleu
|
50 |
+
value: 47.6
|
51 |
+
- task:
|
52 |
+
name: Translation por-ukr
|
53 |
+
type: translation
|
54 |
+
args: por-ukr
|
55 |
+
dataset:
|
56 |
+
name: tatoeba-test-v2021-08-07
|
57 |
+
type: tatoeba_mt
|
58 |
+
args: por-ukr
|
59 |
+
metrics:
|
60 |
+
- name: BLEU
|
61 |
+
type: bleu
|
62 |
+
value: 44.7
|
63 |
+
---
|
64 |
+
# opus-mt-tc-big-pt-zle
|
65 |
+
|
66 |
+
Neural machine translation model for translating from Portuguese (pt) to East Slavic languages (zle).
|
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): por
|
102 |
+
* target language(s): rus ukr
|
103 |
+
* valid target language labels: >>rus<< >>ukr<<
|
104 |
+
* model: transformer-big
|
105 |
+
* data: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
|
106 |
+
* tokenization: SentencePiece (spm32k,spm32k)
|
107 |
+
* original model: [opusTCv20210807_transformer-big_2022-03-23.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/por-zle/opusTCv20210807_transformer-big_2022-03-23.zip)
|
108 |
+
* more information released models: [OPUS-MT por-zle README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/por-zle/README.md)
|
109 |
+
* more information about the model: [MarianMT](https://huggingface.co/docs/transformers/model_doc/marian)
|
110 |
+
|
111 |
+
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. `>>rus<<`
|
112 |
+
|
113 |
+
## Usage
|
114 |
+
|
115 |
+
A short example code:
|
116 |
+
|
117 |
+
```python
|
118 |
+
from transformers import MarianMTModel, MarianTokenizer
|
119 |
+
|
120 |
+
src_text = [
|
121 |
+
">>ukr<< Esse é o meu lugar.",
|
122 |
+
">>rus<< Tom tem problemas de saúde."
|
123 |
+
]
|
124 |
+
|
125 |
+
model_name = "pytorch-models/opus-mt-tc-big-pt-zle"
|
126 |
+
tokenizer = MarianTokenizer.from_pretrained(model_name)
|
127 |
+
model = MarianMTModel.from_pretrained(model_name)
|
128 |
+
translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
|
129 |
+
|
130 |
+
for t in translated:
|
131 |
+
print( tokenizer.decode(t, skip_special_tokens=True) )
|
132 |
+
|
133 |
+
# expected output:
|
134 |
+
# Це моє місце.
|
135 |
+
# У Тома проблемы со здоровьем.
|
136 |
+
```
|
137 |
+
|
138 |
+
You can also use OPUS-MT models with the transformers pipelines, for example:
|
139 |
+
|
140 |
+
```python
|
141 |
+
from transformers import pipeline
|
142 |
+
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-pt-zle")
|
143 |
+
print(pipe(">>ukr<< Esse é o meu lugar."))
|
144 |
+
|
145 |
+
# expected output: Це моє місце.
|
146 |
+
```
|
147 |
+
|
148 |
+
## Benchmarks
|
149 |
+
|
150 |
+
* test set translations: [opusTCv20210807_transformer-big_2022-03-23.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/por-zle/opusTCv20210807_transformer-big_2022-03-23.test.txt)
|
151 |
+
* test set scores: [opusTCv20210807_transformer-big_2022-03-23.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/por-zle/opusTCv20210807_transformer-big_2022-03-23.eval.txt)
|
152 |
+
* benchmark results: [benchmark_results.txt](benchmark_results.txt)
|
153 |
+
* benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
|
154 |
+
|
155 |
+
| langpair | testset | chr-F | BLEU | #sent | #words |
|
156 |
+
|----------|---------|-------|-------|-------|--------|
|
157 |
+
| por-rus | tatoeba-test-v2021-08-07 | 0.67980 | 47.6 | 10000 | 65326 |
|
158 |
+
| por-ukr | tatoeba-test-v2021-08-07 | 0.65867 | 44.7 | 3372 | 18933 |
|
159 |
+
| por-rus | flores101-devtest | 0.54675 | 26.8 | 1012 | 23295 |
|
160 |
+
| por-ukr | flores101-devtest | 0.53690 | 25.1 | 1012 | 22810 |
|
161 |
+
|
162 |
+
## Acknowledgements
|
163 |
+
|
164 |
+
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.
|
165 |
+
|
166 |
+
## Model conversion info
|
167 |
+
|
168 |
+
* transformers version: 4.16.2
|
169 |
+
* OPUS-MT git hash: 1bdabf7
|
170 |
+
* port time: Thu Mar 24 03:20:20 EET 2022
|
171 |
+
* port machine: LM0-400-22516.local
|
benchmark_results.txt
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
por-bel flores101-dev 0.38682 8.8 997 23996
|
2 |
+
por-rus flores101-dev 0.54531 26.8 997 22657
|
3 |
+
por-ukr flores101-dev 0.52582 23.9 997 21841
|
4 |
+
por-bel flores101-devtest 0.38975 9.3 1012 24829
|
5 |
+
por-rus flores101-devtest 0.54675 26.8 1012 23295
|
6 |
+
por-ukr flores101-devtest 0.53690 25.1 1012 22810
|
7 |
+
por-rus tatoeba-test-v2021-08-07 0.67980 47.6 10000 65326
|
8 |
+
por-ukr tatoeba-test-v2021-08-07 0.65867 44.7 3372 18933
|
benchmark_translations.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cd2bb695f858642654cc04f1a89d8fa8fe063e371d6867cb2353fd218e041cf7
|
3 |
+
size 1735345
|
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 |
+
61344
|
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": 61344,
|
21 |
+
"decoder_vocab_size": 61345,
|
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": 27106,
|
28 |
+
"forced_eos_token_id": 27106,
|
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": 61344,
|
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": 61345
|
45 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:29de90329f122eb028f2ae451f8dc4e5c806cff0a910af9c9b4d38f2dd14dcf6
|
3 |
+
size 604198275
|
source.spm
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e9a2dea0771e44c2e2d0c09ed2a6f7f1c305fef9556a4eed28cefb2921a1be69
|
3 |
+
size 823761
|
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:56f30f06722151f0e1c0d99891d9a0d6946c0f4b305e87377054119bbe0735eb
|
3 |
+
size 1007525
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"source_lang": "pt", "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/pt-zle", "tokenizer_class": "MarianTokenizer"}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|