Initial commit
Browse files- .gitattributes +1 -0
- README.md +209 -0
- benchmark_results.txt +1 -0
- benchmark_translations.zip +0 -0
- config.json +41 -0
- generation_config.json +16 -0
- model.safetensors +3 -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
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
*.spm filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: transformers
|
3 |
+
language:
|
4 |
+
- alt
|
5 |
+
- az
|
6 |
+
- ba
|
7 |
+
- crh
|
8 |
+
- cv
|
9 |
+
- de
|
10 |
+
- en
|
11 |
+
- es
|
12 |
+
- fr
|
13 |
+
- gag
|
14 |
+
- kaa
|
15 |
+
- kjh
|
16 |
+
- kk
|
17 |
+
- krc
|
18 |
+
- kum
|
19 |
+
- ky
|
20 |
+
- nog
|
21 |
+
- ota
|
22 |
+
- otk
|
23 |
+
- pt
|
24 |
+
- sah
|
25 |
+
- tk
|
26 |
+
- tr
|
27 |
+
- tt
|
28 |
+
- tyv
|
29 |
+
- ug
|
30 |
+
- uz
|
31 |
+
|
32 |
+
tags:
|
33 |
+
- translation
|
34 |
+
- opus-mt-tc-bible
|
35 |
+
|
36 |
+
license: apache-2.0
|
37 |
+
model-index:
|
38 |
+
- name: opus-mt-tc-bible-big-trk-deu_eng_fra_por_spa
|
39 |
+
results:
|
40 |
+
- task:
|
41 |
+
name: Translation multi-multi
|
42 |
+
type: translation
|
43 |
+
args: multi-multi
|
44 |
+
dataset:
|
45 |
+
name: tatoeba-test-v2020-07-28-v2023-09-26
|
46 |
+
type: tatoeba_mt
|
47 |
+
args: multi-multi
|
48 |
+
metrics:
|
49 |
+
- name: BLEU
|
50 |
+
type: bleu
|
51 |
+
value: 43.6
|
52 |
+
- name: chr-F
|
53 |
+
type: chrf
|
54 |
+
value: 0.60721
|
55 |
+
---
|
56 |
+
# opus-mt-tc-bible-big-trk-deu_eng_fra_por_spa
|
57 |
+
|
58 |
+
## Table of Contents
|
59 |
+
- [Model Details](#model-details)
|
60 |
+
- [Uses](#uses)
|
61 |
+
- [Risks, Limitations and Biases](#risks-limitations-and-biases)
|
62 |
+
- [How to Get Started With the Model](#how-to-get-started-with-the-model)
|
63 |
+
- [Training](#training)
|
64 |
+
- [Evaluation](#evaluation)
|
65 |
+
- [Citation Information](#citation-information)
|
66 |
+
- [Acknowledgements](#acknowledgements)
|
67 |
+
|
68 |
+
## Model Details
|
69 |
+
|
70 |
+
Neural machine translation model for translating from Turkic languages (trk) to unknown (deu+eng+fra+por+spa).
|
71 |
+
|
72 |
+
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).
|
73 |
+
**Model Description:**
|
74 |
+
- **Developed by:** Language Technology Research Group at the University of Helsinki
|
75 |
+
- **Model Type:** Translation (transformer-big)
|
76 |
+
- **Release**: 2024-05-30
|
77 |
+
- **License:** Apache-2.0
|
78 |
+
- **Language(s):**
|
79 |
+
- Source Language(s): alt aze bak chv crh gag kaa kaz kir kjh krc kum nog ota otk sah tat tuk tur tyv uig uzb
|
80 |
+
- Target Language(s): deu eng fra por spa
|
81 |
+
- Valid Target Language Labels: >>deu<< >>eng<< >>fra<< >>por<< >>spa<< >>xxx<<
|
82 |
+
- **Original Model**: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-30.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/trk-deu+eng+fra+por+spa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-30.zip)
|
83 |
+
- **Resources for more information:**
|
84 |
+
- [OPUS-MT dashboard](https://opus.nlpl.eu/dashboard/index.php?pkg=opusmt&test=all&scoreslang=all&chart=standard&model=Tatoeba-MT-models/trk-deu%2Beng%2Bfra%2Bpor%2Bspa/opusTCv20230926max50%2Bbt%2Bjhubc_transformer-big_2024-05-30)
|
85 |
+
- [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
|
86 |
+
- [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
|
87 |
+
- [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/)
|
88 |
+
- [HPLT bilingual data v1 (as part of the Tatoeba Translation Challenge dataset)](https://hplt-project.org/datasets/v1)
|
89 |
+
- [A massively parallel Bible corpus](https://aclanthology.org/L14-1215/)
|
90 |
+
|
91 |
+
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. `>>deu<<`
|
92 |
+
|
93 |
+
## Uses
|
94 |
+
|
95 |
+
This model can be used for translation and text-to-text generation.
|
96 |
+
|
97 |
+
## Risks, Limitations and Biases
|
98 |
+
|
99 |
+
**CONTENT WARNING: Readers should be aware that the model is trained on various public data sets that may contain content that is disturbing, offensive, and can propagate historical and current stereotypes.**
|
100 |
+
|
101 |
+
Significant research has explored bias and fairness issues with language models (see, e.g., [Sheng et al. (2021)](https://aclanthology.org/2021.acl-long.330.pdf) and [Bender et al. (2021)](https://dl.acm.org/doi/pdf/10.1145/3442188.3445922)).
|
102 |
+
|
103 |
+
## How to Get Started With the Model
|
104 |
+
|
105 |
+
A short example code:
|
106 |
+
|
107 |
+
```python
|
108 |
+
from transformers import MarianMTModel, MarianTokenizer
|
109 |
+
|
110 |
+
src_text = [
|
111 |
+
">>spa<< Belki doğrudur.",
|
112 |
+
">>eng<< O, izolasyon hücresinde oturuyor."
|
113 |
+
]
|
114 |
+
|
115 |
+
model_name = "pytorch-models/opus-mt-tc-bible-big-trk-deu_eng_fra_por_spa"
|
116 |
+
tokenizer = MarianTokenizer.from_pretrained(model_name)
|
117 |
+
model = MarianMTModel.from_pretrained(model_name)
|
118 |
+
translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
|
119 |
+
|
120 |
+
for t in translated:
|
121 |
+
print( tokenizer.decode(t, skip_special_tokens=True) )
|
122 |
+
|
123 |
+
# expected output:
|
124 |
+
# Tal vez sea cierto.
|
125 |
+
# He's sitting in an isolation cell.
|
126 |
+
```
|
127 |
+
|
128 |
+
You can also use OPUS-MT models with the transformers pipelines, for example:
|
129 |
+
|
130 |
+
```python
|
131 |
+
from transformers import pipeline
|
132 |
+
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-bible-big-trk-deu_eng_fra_por_spa")
|
133 |
+
print(pipe(">>spa<< Belki doğrudur."))
|
134 |
+
|
135 |
+
# expected output: Tal vez sea cierto.
|
136 |
+
```
|
137 |
+
|
138 |
+
## Training
|
139 |
+
|
140 |
+
- **Data**: opusTCv20230926max50+bt+jhubc ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
|
141 |
+
- **Pre-processing**: SentencePiece (spm32k,spm32k)
|
142 |
+
- **Model Type:** transformer-big
|
143 |
+
- **Original MarianNMT Model**: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-30.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/trk-deu+eng+fra+por+spa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-30.zip)
|
144 |
+
- **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
|
145 |
+
|
146 |
+
## Evaluation
|
147 |
+
|
148 |
+
* [Model scores at the OPUS-MT dashboard](https://opus.nlpl.eu/dashboard/index.php?pkg=opusmt&test=all&scoreslang=all&chart=standard&model=Tatoeba-MT-models/trk-deu%2Beng%2Bfra%2Bpor%2Bspa/opusTCv20230926max50%2Bbt%2Bjhubc_transformer-big_2024-05-30)
|
149 |
+
* test set translations: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-30.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/trk-deu+eng+fra+por+spa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-30.test.txt)
|
150 |
+
* test set scores: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-30.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/trk-deu+eng+fra+por+spa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-30.eval.txt)
|
151 |
+
* benchmark results: [benchmark_results.txt](benchmark_results.txt)
|
152 |
+
* benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
|
153 |
+
|
154 |
+
| langpair | testset | chr-F | BLEU | #sent | #words |
|
155 |
+
|----------|---------|-------|-------|-------|--------|
|
156 |
+
| multi-multi | tatoeba-test-v2020-07-28-v2023-09-26 | 0.60721 | 43.6 | 10000 | 74700 |
|
157 |
+
|
158 |
+
## Citation Information
|
159 |
+
|
160 |
+
* Publications: [Democratizing neural machine translation with OPUS-MT](https://doi.org/10.1007/s10579-023-09704-w) and [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.)
|
161 |
+
|
162 |
+
```bibtex
|
163 |
+
@article{tiedemann2023democratizing,
|
164 |
+
title={Democratizing neural machine translation with {OPUS-MT}},
|
165 |
+
author={Tiedemann, J{\"o}rg and Aulamo, Mikko and Bakshandaeva, Daria and Boggia, Michele and Gr{\"o}nroos, Stig-Arne and Nieminen, Tommi and Raganato, Alessandro and Scherrer, Yves and Vazquez, Raul and Virpioja, Sami},
|
166 |
+
journal={Language Resources and Evaluation},
|
167 |
+
number={58},
|
168 |
+
pages={713--755},
|
169 |
+
year={2023},
|
170 |
+
publisher={Springer Nature},
|
171 |
+
issn={1574-0218},
|
172 |
+
doi={10.1007/s10579-023-09704-w}
|
173 |
+
}
|
174 |
+
|
175 |
+
@inproceedings{tiedemann-thottingal-2020-opus,
|
176 |
+
title = "{OPUS}-{MT} {--} Building open translation services for the World",
|
177 |
+
author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
|
178 |
+
booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
|
179 |
+
month = nov,
|
180 |
+
year = "2020",
|
181 |
+
address = "Lisboa, Portugal",
|
182 |
+
publisher = "European Association for Machine Translation",
|
183 |
+
url = "https://aclanthology.org/2020.eamt-1.61",
|
184 |
+
pages = "479--480",
|
185 |
+
}
|
186 |
+
|
187 |
+
@inproceedings{tiedemann-2020-tatoeba,
|
188 |
+
title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
|
189 |
+
author = {Tiedemann, J{\"o}rg},
|
190 |
+
booktitle = "Proceedings of the Fifth Conference on Machine Translation",
|
191 |
+
month = nov,
|
192 |
+
year = "2020",
|
193 |
+
address = "Online",
|
194 |
+
publisher = "Association for Computational Linguistics",
|
195 |
+
url = "https://aclanthology.org/2020.wmt-1.139",
|
196 |
+
pages = "1174--1182",
|
197 |
+
}
|
198 |
+
```
|
199 |
+
|
200 |
+
## Acknowledgements
|
201 |
+
|
202 |
+
The work is supported by the [HPLT project](https://hplt-project.org/), funded by the European Union’s Horizon Europe research and innovation programme under grant agreement No 101070350. We are also grateful for the generous computational resources and IT infrastructure provided by [CSC -- IT Center for Science](https://www.csc.fi/), Finland, and the [EuroHPC supercomputer LUMI](https://www.lumi-supercomputer.eu/).
|
203 |
+
|
204 |
+
## Model conversion info
|
205 |
+
|
206 |
+
* transformers version: 4.45.1
|
207 |
+
* OPUS-MT git hash: 0882077
|
208 |
+
* port time: Tue Oct 8 23:33:28 EEST 2024
|
209 |
+
* port machine: LM0-400-22516.local
|
benchmark_results.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
multi-multi tatoeba-test-v2020-07-28-v2023-09-26 0.60721 43.6 10000 74700
|
benchmark_translations.zip
ADDED
File without changes
|
config.json
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "pytorch-models/opus-mt-tc-bible-big-trk-deu_eng_fra_por_spa",
|
3 |
+
"activation_dropout": 0.0,
|
4 |
+
"activation_function": "relu",
|
5 |
+
"architectures": [
|
6 |
+
"MarianMTModel"
|
7 |
+
],
|
8 |
+
"attention_dropout": 0.0,
|
9 |
+
"bos_token_id": 0,
|
10 |
+
"classifier_dropout": 0.0,
|
11 |
+
"d_model": 1024,
|
12 |
+
"decoder_attention_heads": 16,
|
13 |
+
"decoder_ffn_dim": 4096,
|
14 |
+
"decoder_layerdrop": 0.0,
|
15 |
+
"decoder_layers": 6,
|
16 |
+
"decoder_start_token_id": 60941,
|
17 |
+
"decoder_vocab_size": 60942,
|
18 |
+
"dropout": 0.1,
|
19 |
+
"encoder_attention_heads": 16,
|
20 |
+
"encoder_ffn_dim": 4096,
|
21 |
+
"encoder_layerdrop": 0.0,
|
22 |
+
"encoder_layers": 6,
|
23 |
+
"eos_token_id": 411,
|
24 |
+
"forced_eos_token_id": null,
|
25 |
+
"init_std": 0.02,
|
26 |
+
"is_encoder_decoder": true,
|
27 |
+
"max_length": null,
|
28 |
+
"max_position_embeddings": 1024,
|
29 |
+
"model_type": "marian",
|
30 |
+
"normalize_embedding": false,
|
31 |
+
"num_beams": null,
|
32 |
+
"num_hidden_layers": 6,
|
33 |
+
"pad_token_id": 60941,
|
34 |
+
"scale_embedding": true,
|
35 |
+
"share_encoder_decoder_embeddings": true,
|
36 |
+
"static_position_embeddings": true,
|
37 |
+
"torch_dtype": "float32",
|
38 |
+
"transformers_version": "4.45.1",
|
39 |
+
"use_cache": true,
|
40 |
+
"vocab_size": 60942
|
41 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_from_model_config": true,
|
3 |
+
"bad_words_ids": [
|
4 |
+
[
|
5 |
+
60941
|
6 |
+
]
|
7 |
+
],
|
8 |
+
"bos_token_id": 0,
|
9 |
+
"decoder_start_token_id": 60941,
|
10 |
+
"eos_token_id": 411,
|
11 |
+
"forced_eos_token_id": 411,
|
12 |
+
"max_length": 512,
|
13 |
+
"num_beams": 4,
|
14 |
+
"pad_token_id": 60941,
|
15 |
+
"transformers_version": "4.45.1"
|
16 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4f33b6e886683450120c62460af58d0d64818297bf4412263f641bf920c63e0c
|
3 |
+
size 955321320
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b4688def13c4d0e66374467decbdf15a20b5227e7895cbcd672d49ec59c9f3ab
|
3 |
+
size 955372549
|
source.spm
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f30cf461a852b3e45d7d837d3a95d8fb60d0c1290cbe1cc80e1accefe7c5dde0
|
3 |
+
size 862441
|
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:aefd1a4d4ec7b0c0146fc999abcb04abd847b0b30b45ac3b67a71f5279920a45
|
3 |
+
size 802510
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"source_lang": "trk", "target_lang": "deu+eng+fra+por+spa", "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/opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-30/trk-deu+eng+fra+por+spa", "tokenizer_class": "MarianTokenizer"}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|