tiedeman commited on
Commit
8ebfad1
1 Parent(s): 529a489

Initial commit

Browse files
.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,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ language:
4
+ - bru
5
+ - cmo
6
+ - es
7
+ - fr
8
+ - hoc
9
+ - it
10
+ - jun
11
+ - kha
12
+ - km
13
+ - kxm
14
+ - pt
15
+ - vi
16
+ - wbm
17
+
18
+ tags:
19
+ - translation
20
+ - opus-mt-tc-bible
21
+
22
+ license: apache-2.0
23
+ model-index:
24
+ - name: opus-mt-tc-bible-big-aav-fra_ita_por_spa
25
+ results:
26
+ - task:
27
+ name: Translation multi-multi
28
+ type: translation
29
+ args: multi-multi
30
+ dataset:
31
+ name: tatoeba-test-v2020-07-28-v2023-09-26
32
+ type: tatoeba_mt
33
+ args: multi-multi
34
+ metrics:
35
+ - name: BLEU
36
+ type: bleu
37
+ value: 29.3
38
+ - name: chr-F
39
+ type: chrf
40
+ value: 0.48590
41
+ ---
42
+ # opus-mt-tc-bible-big-aav-fra_ita_por_spa
43
+
44
+ ## Table of Contents
45
+ - [Model Details](#model-details)
46
+ - [Uses](#uses)
47
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
48
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
49
+ - [Training](#training)
50
+ - [Evaluation](#evaluation)
51
+ - [Citation Information](#citation-information)
52
+ - [Acknowledgements](#acknowledgements)
53
+
54
+ ## Model Details
55
+
56
+ Neural machine translation model for translating from Austro-Asiatic languages (aav) to unknown (fra+ita+por+spa).
57
+
58
+ 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).
59
+ **Model Description:**
60
+ - **Developed by:** Language Technology Research Group at the University of Helsinki
61
+ - **Model Type:** Translation (transformer-big)
62
+ - **Release**: 2024-08-17
63
+ - **License:** Apache-2.0
64
+ - **Language(s):**
65
+ - Source Language(s): bru cmo hoc jun kha khm kxm vie wbm
66
+ - Target Language(s): fra ita por spa
67
+ - Valid Target Language Labels: >>fra<< >>ita<< >>por<< >>spa<< >>xxx<<
68
+ - **Original Model**: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/aav-fra+ita+por+spa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip)
69
+ - **Resources for more information:**
70
+ - [OPUS-MT dashboard](https://opus.nlpl.eu/dashboard/index.php?pkg=opusmt&test=all&scoreslang=all&chart=standard&model=Tatoeba-MT-models/aav-fra%2Bita%2Bpor%2Bspa/opusTCv20230926max50%2Bbt%2Bjhubc_transformer-big_2024-08-17)
71
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
72
+ - [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
73
+ - [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/)
74
+ - [HPLT bilingual data v1 (as part of the Tatoeba Translation Challenge dataset)](https://hplt-project.org/datasets/v1)
75
+ - [A massively parallel Bible corpus](https://aclanthology.org/L14-1215/)
76
+
77
+ 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. `>>fra<<`
78
+
79
+ ## Uses
80
+
81
+ This model can be used for translation and text-to-text generation.
82
+
83
+ ## Risks, Limitations and Biases
84
+
85
+ **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.**
86
+
87
+ 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)).
88
+
89
+ ## How to Get Started With the Model
90
+
91
+ A short example code:
92
+
93
+ ```python
94
+ from transformers import MarianMTModel, MarianTokenizer
95
+
96
+ src_text = [
97
+ ">>spa<< Ani jur lyer bha shane kynsan-kynsan.",
98
+ ">>spa<< Con bận à?"
99
+ ]
100
+
101
+ model_name = "pytorch-models/opus-mt-tc-bible-big-aav-fra_ita_por_spa"
102
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
103
+ model = MarianMTModel.from_pretrained(model_name)
104
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
105
+
106
+ for t in translated:
107
+ print( tokenizer.decode(t, skip_special_tokens=True) )
108
+
109
+ # expected output:
110
+ # Ani jur lyer bha shane kynsan-kynsan.
111
+ # ¿Estás ocupado?
112
+ ```
113
+
114
+ You can also use OPUS-MT models with the transformers pipelines, for example:
115
+
116
+ ```python
117
+ from transformers import pipeline
118
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-bible-big-aav-fra_ita_por_spa")
119
+ print(pipe(">>spa<< Ani jur lyer bha shane kynsan-kynsan."))
120
+
121
+ # expected output: Ani jur lyer bha shane kynsan-kynsan.
122
+ ```
123
+
124
+ ## Training
125
+
126
+ - **Data**: opusTCv20230926max50+bt+jhubc ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
127
+ - **Pre-processing**: SentencePiece (spm32k,spm32k)
128
+ - **Model Type:** transformer-big
129
+ - **Original MarianNMT Model**: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/aav-fra+ita+por+spa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip)
130
+ - **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
131
+
132
+ ## Evaluation
133
+
134
+ * [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/aav-fra%2Bita%2Bpor%2Bspa/opusTCv20230926max50%2Bbt%2Bjhubc_transformer-big_2024-08-17)
135
+ * test set translations: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/aav-fra+ita+por+spa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.test.txt)
136
+ * test set scores: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/aav-fra+ita+por+spa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.eval.txt)
137
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
138
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
139
+
140
+ | langpair | testset | chr-F | BLEU | #sent | #words |
141
+ |----------|---------|-------|-------|-------|--------|
142
+ | multi-multi | tatoeba-test-v2020-07-28-v2023-09-26 | 0.48590 | 29.3 | 3861 | 27219 |
143
+
144
+ ## Citation Information
145
+
146
+ * 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.)
147
+
148
+ ```bibtex
149
+ @article{tiedemann2023democratizing,
150
+ title={Democratizing neural machine translation with {OPUS-MT}},
151
+ 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},
152
+ journal={Language Resources and Evaluation},
153
+ number={58},
154
+ pages={713--755},
155
+ year={2023},
156
+ publisher={Springer Nature},
157
+ issn={1574-0218},
158
+ doi={10.1007/s10579-023-09704-w}
159
+ }
160
+
161
+ @inproceedings{tiedemann-thottingal-2020-opus,
162
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
163
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
164
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
165
+ month = nov,
166
+ year = "2020",
167
+ address = "Lisboa, Portugal",
168
+ publisher = "European Association for Machine Translation",
169
+ url = "https://aclanthology.org/2020.eamt-1.61",
170
+ pages = "479--480",
171
+ }
172
+
173
+ @inproceedings{tiedemann-2020-tatoeba,
174
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
175
+ author = {Tiedemann, J{\"o}rg},
176
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
177
+ month = nov,
178
+ year = "2020",
179
+ address = "Online",
180
+ publisher = "Association for Computational Linguistics",
181
+ url = "https://aclanthology.org/2020.wmt-1.139",
182
+ pages = "1174--1182",
183
+ }
184
+ ```
185
+
186
+ ## Acknowledgements
187
+
188
+ 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/).
189
+
190
+ ## Model conversion info
191
+
192
+ * transformers version: 4.45.1
193
+ * OPUS-MT git hash: a0ea3b3
194
+ * port time: Mon Oct 7 15:54:19 EEST 2024
195
+ * 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.48590 29.3 3861 27219
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-aav-fra_ita_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": 58473,
17
+ "decoder_vocab_size": 58474,
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": 953,
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": 58473,
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": 58474
41
+ }
generation_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bad_words_ids": [
4
+ [
5
+ 58473
6
+ ]
7
+ ],
8
+ "bos_token_id": 0,
9
+ "decoder_start_token_id": 58473,
10
+ "eos_token_id": 953,
11
+ "forced_eos_token_id": 953,
12
+ "max_length": 512,
13
+ "num_beams": 4,
14
+ "pad_token_id": 58473,
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:c417af568b8acf75fef541cbffb2f136651e69e92783a046c1a740b1527f1266
3
+ size 945202520
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:778316d89d20c1ada57794af6e110cbdc0518dfaea4de9ea75532274fdb2f3d4
3
+ size 945253765
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d8de85a68b889f40fde45eead96284328ca01486f92c8f4087e4b96b9acd7a2
3
+ size 888191
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:688ade90f483bcc123dc198312a862457c52ba50a105dffe442161a1197abd84
3
+ size 816173
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "aav", "target_lang": "fra+ita+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-08-17/aav-fra+ita+por+spa", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff