Initial commit
Browse files- .gitattributes +1 -0
- README.md +217 -0
- benchmark_results.txt +13 -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,217 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
- fi
|
5 |
+
|
6 |
+
tags:
|
7 |
+
- translation
|
8 |
+
|
9 |
+
license: cc-by-4.0
|
10 |
+
model-index:
|
11 |
+
- name: opus-mt-tc-big-fi-en
|
12 |
+
results:
|
13 |
+
- task:
|
14 |
+
name: Translation fin-eng
|
15 |
+
type: translation
|
16 |
+
args: fin-eng
|
17 |
+
dataset:
|
18 |
+
name: flores101-devtest
|
19 |
+
type: flores_101
|
20 |
+
args: fin eng devtest
|
21 |
+
metrics:
|
22 |
+
- name: BLEU
|
23 |
+
type: bleu
|
24 |
+
value: 35.4
|
25 |
+
- task:
|
26 |
+
name: Translation fin-eng
|
27 |
+
type: translation
|
28 |
+
args: fin-eng
|
29 |
+
dataset:
|
30 |
+
name: newsdev2015
|
31 |
+
type: newsdev2015
|
32 |
+
args: fin-eng
|
33 |
+
metrics:
|
34 |
+
- name: BLEU
|
35 |
+
type: bleu
|
36 |
+
value: 28.6
|
37 |
+
- task:
|
38 |
+
name: Translation fin-eng
|
39 |
+
type: translation
|
40 |
+
args: fin-eng
|
41 |
+
dataset:
|
42 |
+
name: tatoeba-test-v2021-08-07
|
43 |
+
type: tatoeba_mt
|
44 |
+
args: fin-eng
|
45 |
+
metrics:
|
46 |
+
- name: BLEU
|
47 |
+
type: bleu
|
48 |
+
value: 57.4
|
49 |
+
- task:
|
50 |
+
name: Translation fin-eng
|
51 |
+
type: translation
|
52 |
+
args: fin-eng
|
53 |
+
dataset:
|
54 |
+
name: newstest2015
|
55 |
+
type: wmt-2015-news
|
56 |
+
args: fin-eng
|
57 |
+
metrics:
|
58 |
+
- name: BLEU
|
59 |
+
type: bleu
|
60 |
+
value: 29.9
|
61 |
+
- task:
|
62 |
+
name: Translation fin-eng
|
63 |
+
type: translation
|
64 |
+
args: fin-eng
|
65 |
+
dataset:
|
66 |
+
name: newstest2016
|
67 |
+
type: wmt-2016-news
|
68 |
+
args: fin-eng
|
69 |
+
metrics:
|
70 |
+
- name: BLEU
|
71 |
+
type: bleu
|
72 |
+
value: 34.3
|
73 |
+
- task:
|
74 |
+
name: Translation fin-eng
|
75 |
+
type: translation
|
76 |
+
args: fin-eng
|
77 |
+
dataset:
|
78 |
+
name: newstest2017
|
79 |
+
type: wmt-2017-news
|
80 |
+
args: fin-eng
|
81 |
+
metrics:
|
82 |
+
- name: BLEU
|
83 |
+
type: bleu
|
84 |
+
value: 37.3
|
85 |
+
- task:
|
86 |
+
name: Translation fin-eng
|
87 |
+
type: translation
|
88 |
+
args: fin-eng
|
89 |
+
dataset:
|
90 |
+
name: newstest2018
|
91 |
+
type: wmt-2018-news
|
92 |
+
args: fin-eng
|
93 |
+
metrics:
|
94 |
+
- name: BLEU
|
95 |
+
type: bleu
|
96 |
+
value: 27.1
|
97 |
+
- task:
|
98 |
+
name: Translation fin-eng
|
99 |
+
type: translation
|
100 |
+
args: fin-eng
|
101 |
+
dataset:
|
102 |
+
name: newstest2019
|
103 |
+
type: wmt-2019-news
|
104 |
+
args: fin-eng
|
105 |
+
metrics:
|
106 |
+
- name: BLEU
|
107 |
+
type: bleu
|
108 |
+
value: 32.7
|
109 |
+
---
|
110 |
+
# opus-mt-tc-big-fi-en
|
111 |
+
|
112 |
+
Neural machine translation model for translating from Finnish (fi) to English (en).
|
113 |
+
|
114 |
+
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).
|
115 |
+
|
116 |
+
* 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.)
|
117 |
+
|
118 |
+
```
|
119 |
+
@inproceedings{tiedemann-thottingal-2020-opus,
|
120 |
+
title = "{OPUS}-{MT} {--} Building open translation services for the World",
|
121 |
+
author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
|
122 |
+
booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
|
123 |
+
month = nov,
|
124 |
+
year = "2020",
|
125 |
+
address = "Lisboa, Portugal",
|
126 |
+
publisher = "European Association for Machine Translation",
|
127 |
+
url = "https://aclanthology.org/2020.eamt-1.61",
|
128 |
+
pages = "479--480",
|
129 |
+
}
|
130 |
+
|
131 |
+
@inproceedings{tiedemann-2020-tatoeba,
|
132 |
+
title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
|
133 |
+
author = {Tiedemann, J{\"o}rg},
|
134 |
+
booktitle = "Proceedings of the Fifth Conference on Machine Translation",
|
135 |
+
month = nov,
|
136 |
+
year = "2020",
|
137 |
+
address = "Online",
|
138 |
+
publisher = "Association for Computational Linguistics",
|
139 |
+
url = "https://aclanthology.org/2020.wmt-1.139",
|
140 |
+
pages = "1174--1182",
|
141 |
+
}
|
142 |
+
```
|
143 |
+
|
144 |
+
## Model info
|
145 |
+
|
146 |
+
* Release: 2021-12-08
|
147 |
+
* source language(s): fin
|
148 |
+
* target language(s): eng
|
149 |
+
* valid target language labels: >>eng<<
|
150 |
+
* model: transformer-big (big)
|
151 |
+
* data: opusTCv20210807+bt ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
|
152 |
+
* tokenization: SentencePiece (spm32k,spm32k)
|
153 |
+
* original model: [opusTCv20210807+bt-2021-12-08.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/fin-eng/opusTCv20210807+bt-2021-12-08.zip)
|
154 |
+
* more information released models: [OPUS-MT fin-eng README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/fin-eng/README.md)
|
155 |
+
* more information about the model: [MarianMT](https://huggingface.co/docs/transformers/model_doc/marian)
|
156 |
+
|
157 |
+
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. `>>eng<<`
|
158 |
+
|
159 |
+
## Usage
|
160 |
+
|
161 |
+
A short example code:
|
162 |
+
|
163 |
+
```python
|
164 |
+
from transformers import MarianMTModel, MarianTokenizer
|
165 |
+
|
166 |
+
src_text = [
|
167 |
+
">>eng<< Replace this with text in an accepted source language.",
|
168 |
+
">>eng<< This is the second sentence."
|
169 |
+
]
|
170 |
+
|
171 |
+
model_name = "pytorch-models/opus-mt-tc-big-fi-en"
|
172 |
+
tokenizer = MarianTokenizer.from_pretrained(model_name)
|
173 |
+
model = MarianMTModel.from_pretrained(model_name)
|
174 |
+
translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
|
175 |
+
|
176 |
+
for t in translated:
|
177 |
+
print( tokenizer.decode(t, skip_special_tokens=True) )
|
178 |
+
```
|
179 |
+
|
180 |
+
You can also use OPUS-MT models with the transformers pipelines, for example:
|
181 |
+
|
182 |
+
```python
|
183 |
+
from transformers import pipeline
|
184 |
+
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-fi-en")
|
185 |
+
print(pipe(">>eng<< Replace this with text in an accepted source language."))
|
186 |
+
```
|
187 |
+
|
188 |
+
## Benchmarks
|
189 |
+
|
190 |
+
* test set translations: [opusTCv20210807+bt-2021-12-08.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/fin-eng/opusTCv20210807+bt-2021-12-08.test.txt)
|
191 |
+
* test set scores: [opusTCv20210807+bt-2021-12-08.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/fin-eng/opusTCv20210807+bt-2021-12-08.eval.txt)
|
192 |
+
* benchmark results: [benchmark_results.txt](benchmark_results.txt)
|
193 |
+
* benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
|
194 |
+
|
195 |
+
| langpair | testset | chr-F | BLEU | #sent | #words |
|
196 |
+
|----------|---------|-------|-------|-------|--------|
|
197 |
+
| fin-eng | tatoeba-test-v2021-08-07 | 0.72298 | 57.4 | 10690 | 80552 |
|
198 |
+
| fin-eng | flores101-devtest | 0.62521 | 35.4 | 1012 | 24721 |
|
199 |
+
| fin-eng | newsdev2015 | 0.56232 | 28.6 | 1500 | 32012 |
|
200 |
+
| fin-eng | newstest2015 | 0.57469 | 29.9 | 1370 | 27270 |
|
201 |
+
| fin-eng | newstest2016 | 0.60715 | 34.3 | 3000 | 62945 |
|
202 |
+
| fin-eng | newstest2017 | 0.63050 | 37.3 | 3002 | 61846 |
|
203 |
+
| fin-eng | newstest2018 | 0.54199 | 27.1 | 3000 | 62325 |
|
204 |
+
| fin-eng | newstest2019 | 0.59620 | 32.7 | 1996 | 36215 |
|
205 |
+
| fin-eng | newstestB2016 | 0.55472 | 27.9 | 3000 | 62945 |
|
206 |
+
| fin-eng | newstestB2017 | 0.58847 | 31.1 | 3002 | 61846 |
|
207 |
+
|
208 |
+
## Acknowledgements
|
209 |
+
|
210 |
+
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.
|
211 |
+
|
212 |
+
## Model conversion info
|
213 |
+
|
214 |
+
* transformers version: 4.16.2
|
215 |
+
* OPUS-MT git hash: f084bad
|
216 |
+
* port time: Tue Mar 22 14:39:22 EET 2022
|
217 |
+
* port machine: LM0-400-22516.local
|
benchmark_results.txt
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
fin-eng flores101-dev 0.63325 36.3 997 23555
|
2 |
+
fin-eng flores101-devtest 0.62521 35.4 1012 24721
|
3 |
+
fin-eng newsdev2015 0.56232 28.6 1500 32012
|
4 |
+
fin-eng newstest2015 0.57469 29.9 1370 27270
|
5 |
+
fin-eng newstest2016 0.60715 34.3 3000 62945
|
6 |
+
fin-eng newstest2017 0.63050 37.3 3002 61846
|
7 |
+
fin-eng newstest2018 0.54199 27.1 3000 62325
|
8 |
+
fin-eng newstest2019 0.59620 32.7 1996 36215
|
9 |
+
fin-eng newstestB2016 0.55472 27.9 3000 62945
|
10 |
+
fin-eng newstestB2017 0.58847 31.1 3002 61846
|
11 |
+
fin-eng tatoeba-test-v2020-07-28 0.72286 57.4 10000 74651
|
12 |
+
fin-eng tatoeba-test-v2021-03-30 0.72288 57.4 10186 76206
|
13 |
+
fin-eng tatoeba-test-v2021-08-07 0.72298 57.4 10690 80552
|
benchmark_translations.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4485d62be0f6aa88d0b10d656ec3f1d0a5e7348ecf6ea8aef39d1723ff0001f0
|
3 |
+
size 3769431
|
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 |
+
57829
|
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": 57829,
|
21 |
+
"decoder_vocab_size": 57830,
|
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": 41756,
|
28 |
+
"forced_eos_token_id": 41756,
|
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": 6,
|
36 |
+
"num_hidden_layers": 6,
|
37 |
+
"pad_token_id": 57829,
|
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": 57830
|
45 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:af5a3c434e32768e3ed331321d0be7420b697d181b0abe45f7916efba845c046
|
3 |
+
size 589793795
|
source.spm
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:82fcb74f79c5f5b5bf0fe73f7dfb6a646efa50ffb4b2a0cd564a1193c78a032e
|
3 |
+
size 831865
|
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:ec7b44af3bba8e0439b9cf203adf29e37921ae6711491d138e219b9f1b69d84c
|
3 |
+
size 789795
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"source_lang": "fi", "target_lang": "en", "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-2021-12-08/fi-en", "tokenizer_class": "MarianTokenizer"}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|