tiedeman commited on
Commit
d82f98c
1 Parent(s): b572bcc

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,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ language:
4
+ - am
5
+ - ar
6
+ - bcw
7
+ - cop
8
+ - daa
9
+ - dsh
10
+ - es
11
+ - fr
12
+ - gde
13
+ - gnd
14
+ - ha
15
+ - hbo
16
+ - he
17
+ - hig
18
+ - irk
19
+ - it
20
+ - jpa
21
+ - kab
22
+ - ker
23
+ - kqp
24
+ - ktb
25
+ - kxc
26
+ - lln
27
+ - lme
28
+ - meq
29
+ - mfh
30
+ - mfi
31
+ - mfk
32
+ - mif
33
+ - mpg
34
+ - mqb
35
+ - mt
36
+ - muy
37
+ - oar
38
+ - pbi
39
+ - phn
40
+ - pt
41
+ - rif
42
+ - sgw
43
+ - shi
44
+ - shy
45
+ - so
46
+ - sur
47
+ - syc
48
+ - thv
49
+ - ti
50
+ - tmc
51
+ - tmh
52
+ - tmr
53
+ - ttr
54
+ - wal
55
+ - xed
56
+ - zgh
57
+
58
+ tags:
59
+ - translation
60
+ - opus-mt-tc-bible
61
+
62
+ license: apache-2.0
63
+ model-index:
64
+ - name: opus-mt-tc-bible-big-afa-fra_ita_por_spa
65
+ results:
66
+ - task:
67
+ name: Translation multi-multi
68
+ type: translation
69
+ args: multi-multi
70
+ dataset:
71
+ name: tatoeba-test-v2020-07-28-v2023-09-26
72
+ type: tatoeba_mt
73
+ args: multi-multi
74
+ metrics:
75
+ - name: BLEU
76
+ type: bleu
77
+ value: 25.6
78
+ - name: chr-F
79
+ type: chrf
80
+ value: 0.44153
81
+ ---
82
+ # opus-mt-tc-bible-big-afa-fra_ita_por_spa
83
+
84
+ ## Table of Contents
85
+ - [Model Details](#model-details)
86
+ - [Uses](#uses)
87
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
88
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
89
+ - [Training](#training)
90
+ - [Evaluation](#evaluation)
91
+ - [Citation Information](#citation-information)
92
+ - [Acknowledgements](#acknowledgements)
93
+
94
+ ## Model Details
95
+
96
+ Neural machine translation model for translating from Afro-Asiatic languages (afa) to unknown (fra+ita+por+spa).
97
+
98
+ 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).
99
+ **Model Description:**
100
+ - **Developed by:** Language Technology Research Group at the University of Helsinki
101
+ - **Model Type:** Translation (transformer-big)
102
+ - **Release**: 2024-08-17
103
+ - **License:** Apache-2.0
104
+ - **Language(s):**
105
+ - Source Language(s): amh apc ara arq arz bcw cop daa dsh gde gnd hau hbo heb hig irk jpa kab ker kqp ktb kxc lln lme meq mfh mfi mfk mif mlt mpg mqb muy oar pbi phn rif sgw shi shy som sur syc thv tir tmc tmh tmr ttr wal xed zgh
106
+ - Target Language(s): fra ita por spa
107
+ - Valid Target Language Labels: >>fra<< >>ita<< >>por<< >>spa<< >>xxx<<
108
+ - **Original Model**: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/afa-fra+ita+por+spa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip)
109
+ - **Resources for more information:**
110
+ - [OPUS-MT dashboard](https://opus.nlpl.eu/dashboard/index.php?pkg=opusmt&test=all&scoreslang=all&chart=standard&model=Tatoeba-MT-models/afa-fra%2Bita%2Bpor%2Bspa/opusTCv20230926max50%2Bbt%2Bjhubc_transformer-big_2024-08-17)
111
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
112
+ - [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
113
+ - [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/)
114
+ - [HPLT bilingual data v1 (as part of the Tatoeba Translation Challenge dataset)](https://hplt-project.org/datasets/v1)
115
+ - [A massively parallel Bible corpus](https://aclanthology.org/L14-1215/)
116
+
117
+ 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<<`
118
+
119
+ ## Uses
120
+
121
+ This model can be used for translation and text-to-text generation.
122
+
123
+ ## Risks, Limitations and Biases
124
+
125
+ **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.**
126
+
127
+ 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)).
128
+
129
+ ## How to Get Started With the Model
130
+
131
+ A short example code:
132
+
133
+ ```python
134
+ from transformers import MarianMTModel, MarianTokenizer
135
+
136
+ src_text = [
137
+ ">>fra<< Aqcic amenzu yessaweḍ ad yesleg tukkest-is.",
138
+ ">>fra<< Aɣet ihi adlis."
139
+ ]
140
+
141
+ model_name = "pytorch-models/opus-mt-tc-bible-big-afa-fra_ita_por_spa"
142
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
143
+ model = MarianMTModel.from_pretrained(model_name)
144
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
145
+
146
+ for t in translated:
147
+ print( tokenizer.decode(t, skip_special_tokens=True) )
148
+
149
+ # expected output:
150
+ # L'enfant a réussi à l'enlever.
151
+ # Alors, rédigez un livre.
152
+ ```
153
+
154
+ You can also use OPUS-MT models with the transformers pipelines, for example:
155
+
156
+ ```python
157
+ from transformers import pipeline
158
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-bible-big-afa-fra_ita_por_spa")
159
+ print(pipe(">>fra<< Aqcic amenzu yessaweḍ ad yesleg tukkest-is."))
160
+
161
+ # expected output: L'enfant a réussi à l'enlever.
162
+ ```
163
+
164
+ ## Training
165
+
166
+ - **Data**: opusTCv20230926max50+bt+jhubc ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
167
+ - **Pre-processing**: SentencePiece (spm32k,spm32k)
168
+ - **Model Type:** transformer-big
169
+ - **Original MarianNMT Model**: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/afa-fra+ita+por+spa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip)
170
+ - **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
171
+
172
+ ## Evaluation
173
+
174
+ * [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/afa-fra%2Bita%2Bpor%2Bspa/opusTCv20230926max50%2Bbt%2Bjhubc_transformer-big_2024-08-17)
175
+ * test set translations: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/afa-fra+ita+por+spa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.test.txt)
176
+ * test set scores: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/afa-fra+ita+por+spa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.eval.txt)
177
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
178
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
179
+
180
+ | langpair | testset | chr-F | BLEU | #sent | #words |
181
+ |----------|---------|-------|-------|-------|--------|
182
+ | multi-multi | tatoeba-test-v2020-07-28-v2023-09-26 | 0.44153 | 25.6 | 10000 | 78439 |
183
+
184
+ ## Citation Information
185
+
186
+ * 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.)
187
+
188
+ ```bibtex
189
+ @article{tiedemann2023democratizing,
190
+ title={Democratizing neural machine translation with {OPUS-MT}},
191
+ 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},
192
+ journal={Language Resources and Evaluation},
193
+ number={58},
194
+ pages={713--755},
195
+ year={2023},
196
+ publisher={Springer Nature},
197
+ issn={1574-0218},
198
+ doi={10.1007/s10579-023-09704-w}
199
+ }
200
+
201
+ @inproceedings{tiedemann-thottingal-2020-opus,
202
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
203
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
204
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
205
+ month = nov,
206
+ year = "2020",
207
+ address = "Lisboa, Portugal",
208
+ publisher = "European Association for Machine Translation",
209
+ url = "https://aclanthology.org/2020.eamt-1.61",
210
+ pages = "479--480",
211
+ }
212
+
213
+ @inproceedings{tiedemann-2020-tatoeba,
214
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
215
+ author = {Tiedemann, J{\"o}rg},
216
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
217
+ month = nov,
218
+ year = "2020",
219
+ address = "Online",
220
+ publisher = "Association for Computational Linguistics",
221
+ url = "https://aclanthology.org/2020.wmt-1.139",
222
+ pages = "1174--1182",
223
+ }
224
+ ```
225
+
226
+ ## Acknowledgements
227
+
228
+ 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/).
229
+
230
+ ## Model conversion info
231
+
232
+ * transformers version: 4.45.1
233
+ * OPUS-MT git hash: a0ea3b3
234
+ * port time: Mon Oct 7 16:15:50 EEST 2024
235
+ * 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.44153 25.6 10000 78439
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-afa-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": 61870,
17
+ "decoder_vocab_size": 61871,
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": 331,
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": 61870,
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": 61871
41
+ }
generation_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bad_words_ids": [
4
+ [
5
+ 61870
6
+ ]
7
+ ],
8
+ "bos_token_id": 0,
9
+ "decoder_start_token_id": 61870,
10
+ "eos_token_id": 331,
11
+ "forced_eos_token_id": 331,
12
+ "max_length": 512,
13
+ "num_beams": 4,
14
+ "pad_token_id": 61870,
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:b15d9e462cb2b77dad0de05527120c137b5cbf7343f8956b1bd0fa2618c1a67b
3
+ size 959130220
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cd2ec15aadb9d5b67e99c5b1a91fcf7095928923dcd8f73517dd024c9424854a
3
+ size 959181445
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b672a33f6c98f8c94b81a720bb8541eee25154c256c4a26ac9cbe6f82d840cb8
3
+ size 822390
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:ac67981ec12816b6aee6952b3857436ca10e6b90f0e6283e51ac77bc3f988792
3
+ size 817329
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "afa", "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/afa-fra+ita+por+spa", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff