Initial commit
Browse files- .gitattributes +1 -0
- README.md +114 -0
- benchmark_results.txt +2 -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,114 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- fi
|
4 |
+
- uk
|
5 |
+
|
6 |
+
tags:
|
7 |
+
- translation
|
8 |
+
|
9 |
+
license: cc-by-4.0
|
10 |
+
model-index:
|
11 |
+
- name: opus-mt-tc-base-uk-fi
|
12 |
+
results:
|
13 |
+
---
|
14 |
+
# opus-mt-tc-base-uk-fi
|
15 |
+
|
16 |
+
Neural machine translation model for translating from Ukrainian (uk) to Finnish (fi).
|
17 |
+
|
18 |
+
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).
|
19 |
+
|
20 |
+
* 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.)
|
21 |
+
|
22 |
+
```
|
23 |
+
@inproceedings{tiedemann-thottingal-2020-opus,
|
24 |
+
title = "{OPUS}-{MT} {--} Building open translation services for the World",
|
25 |
+
author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
|
26 |
+
booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
|
27 |
+
month = nov,
|
28 |
+
year = "2020",
|
29 |
+
address = "Lisboa, Portugal",
|
30 |
+
publisher = "European Association for Machine Translation",
|
31 |
+
url = "https://aclanthology.org/2020.eamt-1.61",
|
32 |
+
pages = "479--480",
|
33 |
+
}
|
34 |
+
|
35 |
+
@inproceedings{tiedemann-2020-tatoeba,
|
36 |
+
title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
|
37 |
+
author = {Tiedemann, J{\"o}rg},
|
38 |
+
booktitle = "Proceedings of the Fifth Conference on Machine Translation",
|
39 |
+
month = nov,
|
40 |
+
year = "2020",
|
41 |
+
address = "Online",
|
42 |
+
publisher = "Association for Computational Linguistics",
|
43 |
+
url = "https://aclanthology.org/2020.wmt-1.139",
|
44 |
+
pages = "1174--1182",
|
45 |
+
}
|
46 |
+
```
|
47 |
+
|
48 |
+
## Model info
|
49 |
+
|
50 |
+
* Release: 2022-03-17
|
51 |
+
* source language(s): ukr
|
52 |
+
* target language(s): fin
|
53 |
+
* model: transformer-align (base)
|
54 |
+
* data: opusTCv20210807+pft+pbt ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
|
55 |
+
* tokenization: SentencePiece (spm32k,spm32k)
|
56 |
+
* original model: [opusTCv20210807+pft+pbt_transformer-align_2022-03-17.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/ukr-fin/opusTCv20210807+pft+pbt_transformer-align_2022-03-17.zip)
|
57 |
+
* more information released models: [OPUS-MT ukr-fin README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/ukr-fin/README.md)
|
58 |
+
|
59 |
+
## Usage
|
60 |
+
|
61 |
+
A short example code:
|
62 |
+
|
63 |
+
```python
|
64 |
+
from transformers import MarianMTModel, MarianTokenizer
|
65 |
+
|
66 |
+
src_text = [
|
67 |
+
"Африка є колискою людства.",
|
68 |
+
"Один, два, три, чотири, п'ять, шість, сім, вісім, дев'ять, десять."
|
69 |
+
]
|
70 |
+
|
71 |
+
model_name = "pytorch-models/opus-mt-tc-base-uk-fi"
|
72 |
+
tokenizer = MarianTokenizer.from_pretrained(model_name)
|
73 |
+
model = MarianMTModel.from_pretrained(model_name)
|
74 |
+
translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
|
75 |
+
|
76 |
+
for t in translated:
|
77 |
+
print( tokenizer.decode(t, skip_special_tokens=True) )
|
78 |
+
|
79 |
+
# expected output:
|
80 |
+
# Afrikka on ihmiskunnan kehto.
|
81 |
+
# Yksi, kaksi, kolme, neljä, viisi, kuusi, seitsemän, kahdeksan, yhdeksän, kymmenen.
|
82 |
+
```
|
83 |
+
|
84 |
+
You can also use OPUS-MT models with the transformers pipelines, for example:
|
85 |
+
|
86 |
+
```python
|
87 |
+
from transformers import pipeline
|
88 |
+
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-base-uk-fi")
|
89 |
+
print(pipe("Африка є колискою людства."))
|
90 |
+
|
91 |
+
# expected output: Afrikka on ihmiskunnan kehto.
|
92 |
+
```
|
93 |
+
|
94 |
+
## Benchmarks
|
95 |
+
|
96 |
+
* test set translations: [opusTCv20210807+pft+pbt_transformer-align_2022-03-17.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/ukr-fin/opusTCv20210807+pft+pbt_transformer-align_2022-03-17.test.txt)
|
97 |
+
* test set scores: [opusTCv20210807+pft+pbt_transformer-align_2022-03-17.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/ukr-fin/opusTCv20210807+pft+pbt_transformer-align_2022-03-17.eval.txt)
|
98 |
+
* benchmark results: [benchmark_results.txt](benchmark_results.txt)
|
99 |
+
* benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
|
100 |
+
|
101 |
+
| langpair | testset | chr-F | BLEU | #sent | #words |
|
102 |
+
|----------|---------|-------|-------|-------|--------|
|
103 |
+
| ukr-fin | flores101-devtest | 0.54827 | 19.6 | 1012 | 18781 |
|
104 |
+
|
105 |
+
## Acknowledgements
|
106 |
+
|
107 |
+
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.
|
108 |
+
|
109 |
+
## Model conversion info
|
110 |
+
|
111 |
+
* transformers version: 4.16.2
|
112 |
+
* OPUS-MT git hash: f084bad
|
113 |
+
* port time: Wed Mar 23 21:02:02 EET 2022
|
114 |
+
* port machine: LM0-400-22516.local
|
benchmark_results.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
ukr-fin flores101-devtest 0.54827 19.6 1012 18781
|
2 |
+
ukr-fin flores101-dev 0.54009 19.6 997 17938
|
benchmark_translations.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:16fae1a5d2e11fb4740118912061e49d9e0179d10a106830853f81a658f145a3
|
3 |
+
size 370567
|
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 |
+
60734
|
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": 60734,
|
21 |
+
"decoder_vocab_size": 60735,
|
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": 23096,
|
28 |
+
"forced_eos_token_id": 23096,
|
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": 60734,
|
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": 60735
|
45 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8055d33b85dd76f306add7fbe6c70e3c184c5f7f7bc285cb240d4c84e5506026
|
3 |
+
size 212875395
|
source.spm
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:93f1b326d44225aa6fca7cb8cbfd1f9b030c6cfc13ea0d832b4c15f09f788ca5
|
3 |
+
size 1000715
|
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:94886ee0cf3259fe334f705401ea10e9729cad2358dca396f6d4cf06f82940c1
|
3 |
+
size 834304
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"source_lang": "uk", "target_lang": "fi", "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+pbt_transformer-align_2022-03-17/uk-fi", "tokenizer_class": "MarianTokenizer"}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|