tiedeman commited on
Commit
6a9812d
1 Parent(s): e6c252f

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,220 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ language:
4
+ - acf
5
+ - an
6
+ - ast
7
+ - ca
8
+ - cbk
9
+ - co
10
+ - crs
11
+ - de
12
+ - egl
13
+ - en
14
+ - es
15
+ - ext
16
+ - fr
17
+ - frm
18
+ - fro
19
+ - frp
20
+ - fur
21
+ - gcf
22
+ - gl
23
+ - ht
24
+ - it
25
+ - kea
26
+ - lad
27
+ - lij
28
+ - lld
29
+ - lmo
30
+ - lou
31
+ - mfe
32
+ - mo
33
+ - mwl
34
+ - nap
35
+ - oc
36
+ - osp
37
+ - pap
38
+ - pcd
39
+ - pms
40
+ - pt
41
+ - rm
42
+ - ro
43
+ - rup
44
+ - sc
45
+ - scn
46
+ - vec
47
+ - wa
48
+
49
+ tags:
50
+ - translation
51
+ - opus-mt-tc-bible
52
+
53
+ license: apache-2.0
54
+ model-index:
55
+ - name: opus-mt-tc-bible-big-deu_eng_fra_por_spa-roa
56
+ results:
57
+ - task:
58
+ name: Translation multi-multi
59
+ type: translation
60
+ args: multi-multi
61
+ dataset:
62
+ name: tatoeba-test-v2020-07-28-v2023-09-26
63
+ type: tatoeba_mt
64
+ args: multi-multi
65
+ metrics:
66
+ - name: BLEU
67
+ type: bleu
68
+ value: 52.8
69
+ - name: chr-F
70
+ type: chrf
71
+ value: 0.70620
72
+ ---
73
+ # opus-mt-tc-bible-big-deu_eng_fra_por_spa-roa
74
+
75
+ ## Table of Contents
76
+ - [Model Details](#model-details)
77
+ - [Uses](#uses)
78
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
79
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
80
+ - [Training](#training)
81
+ - [Evaluation](#evaluation)
82
+ - [Citation Information](#citation-information)
83
+ - [Acknowledgements](#acknowledgements)
84
+
85
+ ## Model Details
86
+
87
+ Neural machine translation model for translating from unknown (deu+eng+fra+por+spa) to Romance languages (roa).
88
+
89
+ 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).
90
+ **Model Description:**
91
+ - **Developed by:** Language Technology Research Group at the University of Helsinki
92
+ - **Model Type:** Translation (transformer-big)
93
+ - **Release**: 2024-05-30
94
+ - **License:** Apache-2.0
95
+ - **Language(s):**
96
+ - Source Language(s): deu eng fra por spa
97
+ - Target Language(s): acf arg ast cat cbk cos crs egl ext fra frm fro frp fur gcf glg hat ita kea lad lij lld lmo lou mfe mol mwl nap oci osp pap pcd pms por roh ron rup scn spa srd vec wln
98
+ - Valid Target Language Labels: >>acf<< >>aoa<< >>arg<< >>ast<< >>cat<< >>cbk<< >>cbk_Latn<< >>ccd<< >>cks<< >>cos<< >>cri<< >>crs<< >>dlm<< >>drc<< >>egl<< >>ext<< >>fab<< >>fax<< >>fra<< >>frc<< >>frm<< >>frm_Latn<< >>fro<< >>fro_Latn<< >>frp<< >>fur<< >>gcf<< >>gcf_Latn<< >>gcr<< >>glg<< >>hat<< >>idb<< >>ist<< >>ita<< >>itk<< >>kea<< >>kmv<< >>lad<< >>lad_Latn<< >>lij<< >>lld<< >>lld_Latn<< >>lmo<< >>lou<< >>lou_Latn<< >>mcm<< >>mfe<< >>mol<< >>mwl<< >>mxi<< >>mzs<< >>nap<< >>nrf<< >>oci<< >>osp<< >>osp_Latn<< >>pap<< >>pcd<< >>pln<< >>pms<< >>por<< >>pov<< >>pre<< >>pro<< >>rcf<< >>rgn<< >>roh<< >>ron<< >>ruo<< >>rup<< >>ruq<< >>scf<< >>scn<< >>spa<< >>spq<< >>srd<< >>tmg<< >>tvy<< >>vec<< >>vkp<< >>wln<<
99
+ - **Original Model**: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-30.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/deu+eng+fra+por+spa-roa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-30.zip)
100
+ - **Resources for more information:**
101
+ - [OPUS-MT dashboard](https://opus.nlpl.eu/dashboard/index.php?pkg=opusmt&test=all&scoreslang=all&chart=standard&model=Tatoeba-MT-models/deu%2Beng%2Bfra%2Bpor%2Bspa-roa/opusTCv20230926max50%2Bbt%2Bjhubc_transformer-big_2024-05-30)
102
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
103
+ - [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
104
+ - [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/)
105
+ - [HPLT bilingual data v1 (as part of the Tatoeba Translation Challenge dataset)](https://hplt-project.org/datasets/v1)
106
+ - [A massively parallel Bible corpus](https://aclanthology.org/L14-1215/)
107
+
108
+ 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. `>>acf<<`
109
+
110
+ ## Uses
111
+
112
+ This model can be used for translation and text-to-text generation.
113
+
114
+ ## Risks, Limitations and Biases
115
+
116
+ **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.**
117
+
118
+ 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)).
119
+
120
+ ## How to Get Started With the Model
121
+
122
+ A short example code:
123
+
124
+ ```python
125
+ from transformers import MarianMTModel, MarianTokenizer
126
+
127
+ src_text = [
128
+ ">>acf<< Replace this with text in an accepted source language.",
129
+ ">>wln<< This is the second sentence."
130
+ ]
131
+
132
+ model_name = "pytorch-models/opus-mt-tc-bible-big-deu_eng_fra_por_spa-roa"
133
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
134
+ model = MarianMTModel.from_pretrained(model_name)
135
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
136
+
137
+ for t in translated:
138
+ print( tokenizer.decode(t, skip_special_tokens=True) )
139
+ ```
140
+
141
+ You can also use OPUS-MT models with the transformers pipelines, for example:
142
+
143
+ ```python
144
+ from transformers import pipeline
145
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-bible-big-deu_eng_fra_por_spa-roa")
146
+ print(pipe(">>acf<< Replace this with text in an accepted source language."))
147
+ ```
148
+
149
+ ## Training
150
+
151
+ - **Data**: opusTCv20230926max50+bt+jhubc ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
152
+ - **Pre-processing**: SentencePiece (spm32k,spm32k)
153
+ - **Model Type:** transformer-big
154
+ - **Original MarianNMT Model**: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-30.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/deu+eng+fra+por+spa-roa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-30.zip)
155
+ - **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
156
+
157
+ ## Evaluation
158
+
159
+ * [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/deu%2Beng%2Bfra%2Bpor%2Bspa-roa/opusTCv20230926max50%2Bbt%2Bjhubc_transformer-big_2024-05-30)
160
+ * test set translations: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-29.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/deu+eng+fra+por+spa-roa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-29.test.txt)
161
+ * test set scores: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-29.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/deu+eng+fra+por+spa-roa/opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-29.eval.txt)
162
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
163
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
164
+
165
+ | langpair | testset | chr-F | BLEU | #sent | #words |
166
+ |----------|---------|-------|-------|-------|--------|
167
+ | multi-multi | tatoeba-test-v2020-07-28-v2023-09-26 | 0.70620 | 52.8 | 10000 | 83108 |
168
+
169
+ ## Citation Information
170
+
171
+ * 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.)
172
+
173
+ ```bibtex
174
+ @article{tiedemann2023democratizing,
175
+ title={Democratizing neural machine translation with {OPUS-MT}},
176
+ 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},
177
+ journal={Language Resources and Evaluation},
178
+ number={58},
179
+ pages={713--755},
180
+ year={2023},
181
+ publisher={Springer Nature},
182
+ issn={1574-0218},
183
+ doi={10.1007/s10579-023-09704-w}
184
+ }
185
+
186
+ @inproceedings{tiedemann-thottingal-2020-opus,
187
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
188
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
189
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
190
+ month = nov,
191
+ year = "2020",
192
+ address = "Lisboa, Portugal",
193
+ publisher = "European Association for Machine Translation",
194
+ url = "https://aclanthology.org/2020.eamt-1.61",
195
+ pages = "479--480",
196
+ }
197
+
198
+ @inproceedings{tiedemann-2020-tatoeba,
199
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
200
+ author = {Tiedemann, J{\"o}rg},
201
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
202
+ month = nov,
203
+ year = "2020",
204
+ address = "Online",
205
+ publisher = "Association for Computational Linguistics",
206
+ url = "https://aclanthology.org/2020.wmt-1.139",
207
+ pages = "1174--1182",
208
+ }
209
+ ```
210
+
211
+ ## Acknowledgements
212
+
213
+ 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/).
214
+
215
+ ## Model conversion info
216
+
217
+ * transformers version: 4.45.1
218
+ * OPUS-MT git hash: 0882077
219
+ * port time: Tue Oct 8 10:28:13 EEST 2024
220
+ * 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.70620 52.8 10000 83108
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-deu_eng_fra_por_spa-roa",
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": 45375,
17
+ "decoder_vocab_size": 45376,
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": 438,
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": 45375,
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": 45376
41
+ }
generation_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bad_words_ids": [
4
+ [
5
+ 45375
6
+ ]
7
+ ],
8
+ "bos_token_id": 0,
9
+ "decoder_start_token_id": 45375,
10
+ "eos_token_id": 438,
11
+ "forced_eos_token_id": 438,
12
+ "max_length": 512,
13
+ "num_beams": 4,
14
+ "pad_token_id": 45375,
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:9927de7a0b8c89789a104e8008197394bf188637d91bf0322b43668a0158fdbc
3
+ size 891500720
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b7d9e50d12ac363cb18aa6e4ff017445db0c0a6082a885605937791777c38f1
3
+ size 891551941
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:edf450236bf419f104f9008e203a421dd1adb8c2dc68da16b7ae6e0e456bae2c
3
+ size 807299
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:75b8fa86ae155eb764e8456f037c595c998d89a37678c8d8cabbe4ef6b894df8
3
+ size 805812
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "deu+eng+fra+por+spa", "target_lang": "roa", "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/deu+eng+fra+por+spa-roa", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff