Initial commit
Browse files- .gitattributes +1 -0
- README.md +158 -0
- benchmark_results.txt +7 -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,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- fi
|
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-fi-zle
|
14 |
+
results:
|
15 |
+
- task:
|
16 |
+
name: Translation fin-rus
|
17 |
+
type: translation
|
18 |
+
args: fin-rus
|
19 |
+
dataset:
|
20 |
+
name: flores101-devtest
|
21 |
+
type: flores_101
|
22 |
+
args: fin rus devtest
|
23 |
+
metrics:
|
24 |
+
- name: BLEU
|
25 |
+
type: bleu
|
26 |
+
value: 21.4
|
27 |
+
- task:
|
28 |
+
name: Translation fin-ukr
|
29 |
+
type: translation
|
30 |
+
args: fin-ukr
|
31 |
+
dataset:
|
32 |
+
name: flores101-devtest
|
33 |
+
type: flores_101
|
34 |
+
args: fin ukr devtest
|
35 |
+
metrics:
|
36 |
+
- name: BLEU
|
37 |
+
type: bleu
|
38 |
+
value: 17.9
|
39 |
+
- task:
|
40 |
+
name: Translation fin-rus
|
41 |
+
type: translation
|
42 |
+
args: fin-rus
|
43 |
+
dataset:
|
44 |
+
name: tatoeba-test-v2021-08-07
|
45 |
+
type: tatoeba_mt
|
46 |
+
args: fin-rus
|
47 |
+
metrics:
|
48 |
+
- name: BLEU
|
49 |
+
type: bleu
|
50 |
+
value: 47.0
|
51 |
+
---
|
52 |
+
# opus-mt-tc-big-fi-zle
|
53 |
+
|
54 |
+
Neural machine translation model for translating from Finnish (fi) to East Slavic languages (zle).
|
55 |
+
|
56 |
+
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).
|
57 |
+
|
58 |
+
* 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.)
|
59 |
+
|
60 |
+
```
|
61 |
+
@inproceedings{tiedemann-thottingal-2020-opus,
|
62 |
+
title = "{OPUS}-{MT} {--} Building open translation services for the World",
|
63 |
+
author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
|
64 |
+
booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
|
65 |
+
month = nov,
|
66 |
+
year = "2020",
|
67 |
+
address = "Lisboa, Portugal",
|
68 |
+
publisher = "European Association for Machine Translation",
|
69 |
+
url = "https://aclanthology.org/2020.eamt-1.61",
|
70 |
+
pages = "479--480",
|
71 |
+
}
|
72 |
+
|
73 |
+
@inproceedings{tiedemann-2020-tatoeba,
|
74 |
+
title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
|
75 |
+
author = {Tiedemann, J{\"o}rg},
|
76 |
+
booktitle = "Proceedings of the Fifth Conference on Machine Translation",
|
77 |
+
month = nov,
|
78 |
+
year = "2020",
|
79 |
+
address = "Online",
|
80 |
+
publisher = "Association for Computational Linguistics",
|
81 |
+
url = "https://aclanthology.org/2020.wmt-1.139",
|
82 |
+
pages = "1174--1182",
|
83 |
+
}
|
84 |
+
```
|
85 |
+
|
86 |
+
## Model info
|
87 |
+
|
88 |
+
* Release: 2022-03-17
|
89 |
+
* source language(s): fin
|
90 |
+
* target language(s): rus ukr
|
91 |
+
* valid target language labels: >>rus<< >>ukr<<
|
92 |
+
* model: transformer-big
|
93 |
+
* data: opusTCv20210807+bt ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
|
94 |
+
* tokenization: SentencePiece (spm32k,spm32k)
|
95 |
+
* original model: [opusTCv20210807+bt_transformer-big_2022-03-17.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/fin-zle/opusTCv20210807+bt_transformer-big_2022-03-17.zip)
|
96 |
+
* more information released models: [OPUS-MT fin-zle README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/fin-zle/README.md)
|
97 |
+
* more information about the model: [MarianMT](https://huggingface.co/docs/transformers/model_doc/marian)
|
98 |
+
|
99 |
+
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<<`
|
100 |
+
|
101 |
+
## Usage
|
102 |
+
|
103 |
+
A short example code:
|
104 |
+
|
105 |
+
```python
|
106 |
+
from transformers import MarianMTModel, MarianTokenizer
|
107 |
+
|
108 |
+
src_text = [
|
109 |
+
">>rus<< Äänestimme jo.",
|
110 |
+
">>ukr<< Yksi, kaksi, kolme, neljä, viisi, kuusi, seitsemän, kahdeksan, yhdeksän, kymmenen."
|
111 |
+
]
|
112 |
+
|
113 |
+
model_name = "pytorch-models/opus-mt-tc-big-fi-zle"
|
114 |
+
tokenizer = MarianTokenizer.from_pretrained(model_name)
|
115 |
+
model = MarianMTModel.from_pretrained(model_name)
|
116 |
+
translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
|
117 |
+
|
118 |
+
for t in translated:
|
119 |
+
print( tokenizer.decode(t, skip_special_tokens=True) )
|
120 |
+
|
121 |
+
# expected output:
|
122 |
+
# Мы уже проголосовали.
|
123 |
+
# Один, два, три, чотири, п'ять, шість, сім, вісім, дев'ять, десять.
|
124 |
+
```
|
125 |
+
|
126 |
+
You can also use OPUS-MT models with the transformers pipelines, for example:
|
127 |
+
|
128 |
+
```python
|
129 |
+
from transformers import pipeline
|
130 |
+
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-fi-zle")
|
131 |
+
print(pipe(">>rus<< Äänestimme jo."))
|
132 |
+
|
133 |
+
# expected output: Мы уже проголосовали.
|
134 |
+
```
|
135 |
+
|
136 |
+
## Benchmarks
|
137 |
+
|
138 |
+
* test set translations: [opusTCv20210807+bt_transformer-big_2022-03-17.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/fin-zle/opusTCv20210807+bt_transformer-big_2022-03-17.test.txt)
|
139 |
+
* test set scores: [opusTCv20210807+bt_transformer-big_2022-03-17.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/fin-zle/opusTCv20210807+bt_transformer-big_2022-03-17.eval.txt)
|
140 |
+
* benchmark results: [benchmark_results.txt](benchmark_results.txt)
|
141 |
+
* benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
|
142 |
+
|
143 |
+
| langpair | testset | chr-F | BLEU | #sent | #words |
|
144 |
+
|----------|---------|-------|-------|-------|--------|
|
145 |
+
| fin-rus | tatoeba-test-v2021-08-07 | 0.67247 | 47.0 | 3643 | 21497 |
|
146 |
+
| fin-rus | flores101-devtest | 0.49920 | 21.4 | 1012 | 23295 |
|
147 |
+
| fin-ukr | flores101-devtest | 0.46935 | 17.9 | 1012 | 22810 |
|
148 |
+
|
149 |
+
## Acknowledgements
|
150 |
+
|
151 |
+
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.
|
152 |
+
|
153 |
+
## Model conversion info
|
154 |
+
|
155 |
+
* transformers version: 4.16.2
|
156 |
+
* OPUS-MT git hash: 42126b6
|
157 |
+
* port time: Thu Mar 24 09:34:57 EET 2022
|
158 |
+
* port machine: LM0-400-22516.local
|
benchmark_results.txt
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
fin-rus flores101-dev 0.49755 21.2 997 22657
|
2 |
+
fin-ukr flores101-dev 0.46145 17.3 997 21841
|
3 |
+
fin-rus flores101-devtest 0.49920 21.4 1012 23295
|
4 |
+
fin-ukr flores101-devtest 0.46935 17.9 1012 22810
|
5 |
+
fin-rus tatoeba-test-v2020-07-28 0.67236 47.0 3643 21497
|
6 |
+
fin-rus tatoeba-test-v2021-03-30 0.67236 47.0 3643 21497
|
7 |
+
fin-rus tatoeba-test-v2021-08-07 0.67247 47.0 3643 21497
|
benchmark_translations.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2be54ab03892db472984e664be74dc1a02d5ed33cf483ce5cfd6cf931f84eeb0
|
3 |
+
size 1202124
|
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 |
+
60933
|
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": 60933,
|
21 |
+
"decoder_vocab_size": 60934,
|
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": 22793,
|
28 |
+
"forced_eos_token_id": 22793,
|
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": 60933,
|
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": 60934
|
45 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:393cf66c76d48678ef2dfb2928e035778ff29312518b95eb9e4818488033df83
|
3 |
+
size 602513987
|
source.spm
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cc4435dbfab49e483192b62a87ff6854ab849847d6fb358326c96229b0033979
|
3 |
+
size 825192
|
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:05f2d644a6e13847b98b46c53bb3488b3edf887a08d694379e1bb54338c78a37
|
3 |
+
size 985365
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"source_lang": "fi", "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+bt_transformer-big_2022-03-17/fi-zle", "tokenizer_class": "MarianTokenizer"}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|