Initial commit
Browse files- .gitattributes +1 -0
- README.md +143 -0
- benchmark_results.txt +5 -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,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- tr
|
| 4 |
+
- uk
|
| 5 |
+
|
| 6 |
+
tags:
|
| 7 |
+
- translation
|
| 8 |
+
|
| 9 |
+
license: cc-by-4.0
|
| 10 |
+
model-index:
|
| 11 |
+
- name: opus-mt-tc-base-uk-tr
|
| 12 |
+
results:
|
| 13 |
+
- task:
|
| 14 |
+
name: Translation ukr-tur
|
| 15 |
+
type: translation
|
| 16 |
+
args: ukr-tur
|
| 17 |
+
dataset:
|
| 18 |
+
name: flores101-devtest
|
| 19 |
+
type: flores_101
|
| 20 |
+
args: ukr tur devtest
|
| 21 |
+
metrics:
|
| 22 |
+
- name: BLEU
|
| 23 |
+
type: bleu
|
| 24 |
+
value: 20.5
|
| 25 |
+
- task:
|
| 26 |
+
name: Translation ukr-tur
|
| 27 |
+
type: translation
|
| 28 |
+
args: ukr-tur
|
| 29 |
+
dataset:
|
| 30 |
+
name: tatoeba-test-v2021-08-07
|
| 31 |
+
type: tatoeba_mt
|
| 32 |
+
args: ukr-tur
|
| 33 |
+
metrics:
|
| 34 |
+
- name: BLEU
|
| 35 |
+
type: bleu
|
| 36 |
+
value: 45.2
|
| 37 |
+
---
|
| 38 |
+
# opus-mt-tc-base-uk-tr
|
| 39 |
+
|
| 40 |
+
Neural machine translation model for translating from Ukrainian (uk) to Turkish (tr).
|
| 41 |
+
|
| 42 |
+
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).
|
| 43 |
+
|
| 44 |
+
* 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.)
|
| 45 |
+
|
| 46 |
+
```
|
| 47 |
+
@inproceedings{tiedemann-thottingal-2020-opus,
|
| 48 |
+
title = "{OPUS}-{MT} {--} Building open translation services for the World",
|
| 49 |
+
author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
|
| 50 |
+
booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
|
| 51 |
+
month = nov,
|
| 52 |
+
year = "2020",
|
| 53 |
+
address = "Lisboa, Portugal",
|
| 54 |
+
publisher = "European Association for Machine Translation",
|
| 55 |
+
url = "https://aclanthology.org/2020.eamt-1.61",
|
| 56 |
+
pages = "479--480",
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
@inproceedings{tiedemann-2020-tatoeba,
|
| 60 |
+
title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
|
| 61 |
+
author = {Tiedemann, J{\"o}rg},
|
| 62 |
+
booktitle = "Proceedings of the Fifth Conference on Machine Translation",
|
| 63 |
+
month = nov,
|
| 64 |
+
year = "2020",
|
| 65 |
+
address = "Online",
|
| 66 |
+
publisher = "Association for Computational Linguistics",
|
| 67 |
+
url = "https://aclanthology.org/2020.wmt-1.139",
|
| 68 |
+
pages = "1174--1182",
|
| 69 |
+
}
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
## Model info
|
| 73 |
+
|
| 74 |
+
* Release: 2022-03-07
|
| 75 |
+
* source language(s): ukr
|
| 76 |
+
* target language(s):
|
| 77 |
+
* valid target language labels:
|
| 78 |
+
* model: transformer-align
|
| 79 |
+
* data: opusTCv20210807+pft ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
|
| 80 |
+
* tokenization: SentencePiece (spm32k,spm32k)
|
| 81 |
+
* original model: [opusTCv20210807+pft_transformer-align_2022-03-07.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/ukr-tur/opusTCv20210807+pft_transformer-align_2022-03-07.zip)
|
| 82 |
+
* more information released models: [OPUS-MT ukr-tur README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/ukr-tur/README.md)
|
| 83 |
+
* more information about the model: [MarianMT](https://huggingface.co/docs/transformers/model_doc/marian)
|
| 84 |
+
|
| 85 |
+
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. `>><<`
|
| 86 |
+
|
| 87 |
+
## Usage
|
| 88 |
+
|
| 89 |
+
A short example code:
|
| 90 |
+
|
| 91 |
+
```python
|
| 92 |
+
from transformers import MarianMTModel, MarianTokenizer
|
| 93 |
+
|
| 94 |
+
src_text = [
|
| 95 |
+
">>tur<< Тисячі єн достатньо?",
|
| 96 |
+
">>tur<< Цюріх — місто у Швейцарії."
|
| 97 |
+
]
|
| 98 |
+
|
| 99 |
+
model_name = "pytorch-models/opus-mt-tc-base-uk-tr"
|
| 100 |
+
tokenizer = MarianTokenizer.from_pretrained(model_name)
|
| 101 |
+
model = MarianMTModel.from_pretrained(model_name)
|
| 102 |
+
translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
|
| 103 |
+
|
| 104 |
+
for t in translated:
|
| 105 |
+
print( tokenizer.decode(t, skip_special_tokens=True) )
|
| 106 |
+
|
| 107 |
+
# expected output:
|
| 108 |
+
# Binlerce yen yeterli mi?
|
| 109 |
+
# Zürih, İsviçre'de bir şehirdir.
|
| 110 |
+
```
|
| 111 |
+
|
| 112 |
+
You can also use OPUS-MT models with the transformers pipelines, for example:
|
| 113 |
+
|
| 114 |
+
```python
|
| 115 |
+
from transformers import pipeline
|
| 116 |
+
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-base-uk-tr")
|
| 117 |
+
print(pipe(">>tur<< Тисячі єн достатньо?"))
|
| 118 |
+
|
| 119 |
+
# expected output: Binlerce yen yeterli mi?
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
## Benchmarks
|
| 123 |
+
|
| 124 |
+
* test set translations: [opusTCv20210807+pft_transformer-align_2022-03-07.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/ukr-tur/opusTCv20210807+pft_transformer-align_2022-03-07.test.txt)
|
| 125 |
+
* test set scores: [opusTCv20210807+pft_transformer-align_2022-03-07.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/ukr-tur/opusTCv20210807+pft_transformer-align_2022-03-07.eval.txt)
|
| 126 |
+
* benchmark results: [benchmark_results.txt](benchmark_results.txt)
|
| 127 |
+
* benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
|
| 128 |
+
|
| 129 |
+
| langpair | testset | chr-F | BLEU | #sent | #words |
|
| 130 |
+
|----------|---------|-------|-------|-------|--------|
|
| 131 |
+
| ukr-tur | tatoeba-test-v2021-08-07 | 0.70938 | 45.2 | 2520 | 11927 |
|
| 132 |
+
| ukr-tur | flores101-devtest | 0.54001 | 20.5 | 1012 | 20253 |
|
| 133 |
+
|
| 134 |
+
## Acknowledgements
|
| 135 |
+
|
| 136 |
+
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.
|
| 137 |
+
|
| 138 |
+
## Model conversion info
|
| 139 |
+
|
| 140 |
+
* transformers version: 4.16.2
|
| 141 |
+
* OPUS-MT git hash: 1bdabf7
|
| 142 |
+
* port time: Wed Mar 23 22:02:24 EET 2022
|
| 143 |
+
* port machine: LM0-400-22516.local
|
benchmark_results.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
ukr-tur flores101-devtest 0.54001 20.5 1012 20253
|
| 2 |
+
ukr-tur flores101-dev 0.54073 20.2 997 19181
|
| 3 |
+
ukr-tur tatoeba-test-v2020-07-28 0.70910 45.2 2500 11844
|
| 4 |
+
ukr-tur tatoeba-test-v2021-03-30 0.70940 45.2 4972 23561
|
| 5 |
+
ukr-tur tatoeba-test-v2021-08-07 0.70938 45.2 2520 11927
|
benchmark_translations.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4792b8c9fa2f757f36b6df2ab4a12e7805830ec679e1d28bf2868ee6adddb613
|
| 3 |
+
size 665154
|
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 |
+
60667
|
| 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": 60667,
|
| 21 |
+
"decoder_vocab_size": 60668,
|
| 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": 24255,
|
| 28 |
+
"forced_eos_token_id": 24255,
|
| 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": 60667,
|
| 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": 60668
|
| 45 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:81af44075b6e8509c99880525bfd0a7a5771cea4c140907f4cdfaee31a3f0bd9
|
| 3 |
+
size 212738051
|
source.spm
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:199e7098c4f5cc1babaa5bc1cb619c0461e0e94358b108b79ee3a8bd7b22af33
|
| 3 |
+
size 1005573
|
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:dad154fc1be558befd91b0e2b0a2ca28601b1646ee94e74908c76901ad5624e9
|
| 3 |
+
size 835601
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"source_lang": "uk", "target_lang": "tr", "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-07/uk-tr", "tokenizer_class": "MarianTokenizer"}
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|