tiedeman commited on
Commit
d92c0ca
1 Parent(s): bfd1799

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,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ language:
4
+ - ace
5
+ - akl
6
+ - ban
7
+ - bcl
8
+ - bik
9
+ - btd
10
+ - bth
11
+ - bto
12
+ - bts
13
+ - btx
14
+ - bug
15
+ - ceb
16
+ - cgc
17
+ - ch
18
+ - de
19
+ - dtp
20
+ - en
21
+ - es
22
+ - fil
23
+ - fr
24
+ - gor
25
+ - hil
26
+ - iba
27
+ - id
28
+ - ify
29
+ - ilo
30
+ - jv
31
+ - krj
32
+ - ljp
33
+ - mad
34
+ - mak
35
+ - mbb
36
+ - mbt
37
+ - mg
38
+ - mhy
39
+ - mog
40
+ - mrw
41
+ - ms
42
+ - msm
43
+ - mta
44
+ - mwv
45
+ - nia
46
+ - nij
47
+ - obo
48
+ - pag
49
+ - pam
50
+ - pau
51
+ - pt
52
+ - rej
53
+ - sas
54
+ - sda
55
+ - sml
56
+ - su
57
+ - sxn
58
+ - tbl
59
+ - war
60
+
61
+ tags:
62
+ - translation
63
+ - opus-mt-tc-bible
64
+
65
+ license: apache-2.0
66
+ model-index:
67
+ - name: opus-mt-tc-bible-big-deu_eng_fra_por_spa-pqw
68
+ results:
69
+ - task:
70
+ name: Translation multi-multi
71
+ type: translation
72
+ args: multi-multi
73
+ dataset:
74
+ name: tatoeba-test-v2020-07-28-v2023-09-26
75
+ type: tatoeba_mt
76
+ args: multi-multi
77
+ metrics:
78
+ - name: BLEU
79
+ type: bleu
80
+ value: 20.1
81
+ - name: chr-F
82
+ type: chrf
83
+ value: 0.46165
84
+ ---
85
+ # opus-mt-tc-bible-big-deu_eng_fra_por_spa-pqw
86
+
87
+ ## Table of Contents
88
+ - [Model Details](#model-details)
89
+ - [Uses](#uses)
90
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
91
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
92
+ - [Training](#training)
93
+ - [Evaluation](#evaluation)
94
+ - [Citation Information](#citation-information)
95
+ - [Acknowledgements](#acknowledgements)
96
+
97
+ ## Model Details
98
+
99
+ Neural machine translation model for translating from unknown (deu+eng+fra+por+spa) to Western Malayo-Polynesian languages (pqw).
100
+
101
+ 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).
102
+ **Model Description:**
103
+ - **Developed by:** Language Technology Research Group at the University of Helsinki
104
+ - **Model Type:** Translation (transformer-big)
105
+ - **Release**: 2024-05-30
106
+ - **License:** Apache-2.0
107
+ - **Language(s):**
108
+ - Source Language(s): deu eng fra por spa
109
+ - Target Language(s): ace akl ban bcl bik btd bth bto bts btx bug ceb cgc cha dtp fil gor hil iba ify ilo ind jak jav krj ljp mad mak max mbb mbt mhy mlg mog mrw msa msm mta mwv nia nij obo pag pam pau plt rej sas sda sml sun sxn tbl tmw war zlm zsm
110
+ - Valid Target Language Labels: >>abl<< >>abs<< >>abx<< >>ace<< >>agk<< >>agz<< >>akb<< >>akl<< >>akl_Latn<< >>atd<< >>atl<< >>ban<< >>bbc<< >>bcl<< >>bdg<< >>bdl<< >>bdr<< >>beg<< >>bew<< >>bgs<< >>bik<< >>bkd<< >>bkz<< >>blf<< >>bno<< >>bnq<< >>bsu<< >>btd<< >>bth<< >>btm<< >>bto<< >>bts<< >>btx<< >>btz<< >>buc<< >>bug<< >>ceb<< >>cgc<< >>cha<< >>cia<< >>cja<< >>cje<< >>cjm<< >>cps<< >>dbj<< >>drg<< >>dtp<< >>dtr<< >>dun<< >>duq<< >>duw<< >>eno<< >>fil<< >>gay<< >>goq<< >>gor<< >>hil<< >>hro<< >>huq<< >>iba<< >>ibg<< >>ibh<< >>ibl<< >>ify<< >>ilk<< >>ilo<< >>ind<< >>jak_Latn<< >>jav<< >>jav_Java<< >>jra<< >>kak<< >>kaw<< >>kge<< >>kjc<< >>kjk<< >>kqr<< >>krj<< >>ktq<< >>kyi<< >>kyj<< >>kyk<< >>kys<< >>lbw<< >>lbx<< >>ley<< >>ljp<< >>llk<< >>loc<< >>lra<< >>mad<< >>mak<< >>max_Latn<< >>mba<< >>mbb<< >>mbd<< >>mbi<< >>mbs<< >>mbt<< >>mdh<< >>mdr<< >>mhy<< >>mkm<< >>mkx<< >>mlg<< >>mog<< >>mqk<< >>mqn<< >>mrw<< >>msa<< >>msa_Arab<< >>msa_Latn<< >>msb<< >>msm<< >>mta<< >>mtd<< >>mwv<< >>mxr<< >>myl<< >>mzq<< >>nia<< >>nij<< >>nrm<< >>obo<< >>otd<< >>pag<< >>pam<< >>pau<< >>pdo<< >>pku<< >>plt<< >>rad<< >>raz<< >>ree<< >>rej<< >>rgs<< >>roc<< >>rog<< >>rth<< >>sas<< >>sda<< >>sdo<< >>sgd<< >>sjm<< >>skh<< >>slm<< >>sml<< >>sml_Latn<< >>smr<< >>smw<< >>sne<< >>snl<< >>snv<< >>ssb<< >>sse<< >>sun<< >>sxn<< >>sya<< >>tbl<< >>tdi<< >>tdn<< >>tjg<< >>tlk<< >>tmw_Latn<< >>tnt<< >>tnw<< >>tom<< >>twy<< >>txs<< >>ulu<< >>vkl<< >>vko<< >>war<< >>wow<< >>wru<< >>xkq<< >>xmz<< >>yka<< >>zbc<< >>zbe<< >>zbw<< >>zlm_Arab<< >>zlm_Latn<< >>zsm_Arab<< >>zsm_Latn<<
111
+ - **Original Model**: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-30.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/deu+eng+fra+por+spa-pqw/opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-30.zip)
112
+ - **Resources for more information:**
113
+ - [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-pqw/opusTCv20230926max50%2Bbt%2Bjhubc_transformer-big_2024-05-30)
114
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
115
+ - [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
116
+ - [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/)
117
+ - [HPLT bilingual data v1 (as part of the Tatoeba Translation Challenge dataset)](https://hplt-project.org/datasets/v1)
118
+ - [A massively parallel Bible corpus](https://aclanthology.org/L14-1215/)
119
+
120
+ 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. `>>ace<<`
121
+
122
+ ## Uses
123
+
124
+ This model can be used for translation and text-to-text generation.
125
+
126
+ ## Risks, Limitations and Biases
127
+
128
+ **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.**
129
+
130
+ 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)).
131
+
132
+ ## How to Get Started With the Model
133
+
134
+ A short example code:
135
+
136
+ ```python
137
+ from transformers import MarianMTModel, MarianTokenizer
138
+
139
+ src_text = [
140
+ ">>ace<< Replace this with text in an accepted source language.",
141
+ ">>zsm<< This is the second sentence."
142
+ ]
143
+
144
+ model_name = "pytorch-models/opus-mt-tc-bible-big-deu_eng_fra_por_spa-pqw"
145
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
146
+ model = MarianMTModel.from_pretrained(model_name)
147
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
148
+
149
+ for t in translated:
150
+ print( tokenizer.decode(t, skip_special_tokens=True) )
151
+ ```
152
+
153
+ You can also use OPUS-MT models with the transformers pipelines, for example:
154
+
155
+ ```python
156
+ from transformers import pipeline
157
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-bible-big-deu_eng_fra_por_spa-pqw")
158
+ print(pipe(">>ace<< Replace this with text in an accepted source language."))
159
+ ```
160
+
161
+ ## Training
162
+
163
+ - **Data**: opusTCv20230926max50+bt+jhubc ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
164
+ - **Pre-processing**: SentencePiece (spm32k,spm32k)
165
+ - **Model Type:** transformer-big
166
+ - **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-pqw/opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-30.zip)
167
+ - **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
168
+
169
+ ## Evaluation
170
+
171
+ * [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-pqw/opusTCv20230926max50%2Bbt%2Bjhubc_transformer-big_2024-05-30)
172
+ * 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-pqw/opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-29.test.txt)
173
+ * 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-pqw/opusTCv20230926max50+bt+jhubc_transformer-big_2024-05-29.eval.txt)
174
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
175
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
176
+
177
+ | langpair | testset | chr-F | BLEU | #sent | #words |
178
+ |----------|---------|-------|-------|-------|--------|
179
+ | multi-multi | tatoeba-test-v2020-07-28-v2023-09-26 | 0.46165 | 20.1 | 10000 | 66909 |
180
+
181
+ ## Citation Information
182
+
183
+ * 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.)
184
+
185
+ ```bibtex
186
+ @article{tiedemann2023democratizing,
187
+ title={Democratizing neural machine translation with {OPUS-MT}},
188
+ 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},
189
+ journal={Language Resources and Evaluation},
190
+ number={58},
191
+ pages={713--755},
192
+ year={2023},
193
+ publisher={Springer Nature},
194
+ issn={1574-0218},
195
+ doi={10.1007/s10579-023-09704-w}
196
+ }
197
+
198
+ @inproceedings{tiedemann-thottingal-2020-opus,
199
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
200
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
201
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
202
+ month = nov,
203
+ year = "2020",
204
+ address = "Lisboa, Portugal",
205
+ publisher = "European Association for Machine Translation",
206
+ url = "https://aclanthology.org/2020.eamt-1.61",
207
+ pages = "479--480",
208
+ }
209
+
210
+ @inproceedings{tiedemann-2020-tatoeba,
211
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
212
+ author = {Tiedemann, J{\"o}rg},
213
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
214
+ month = nov,
215
+ year = "2020",
216
+ address = "Online",
217
+ publisher = "Association for Computational Linguistics",
218
+ url = "https://aclanthology.org/2020.wmt-1.139",
219
+ pages = "1174--1182",
220
+ }
221
+ ```
222
+
223
+ ## Acknowledgements
224
+
225
+ 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/).
226
+
227
+ ## Model conversion info
228
+
229
+ * transformers version: 4.45.1
230
+ * OPUS-MT git hash: 0882077
231
+ * port time: Tue Oct 8 10:24:47 EEST 2024
232
+ * 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.46165 20.1 10000 66909
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-pqw",
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": 59519,
17
+ "decoder_vocab_size": 59520,
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": 401,
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": 59519,
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": 59520
41
+ }
generation_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bad_words_ids": [
4
+ [
5
+ 59519
6
+ ]
7
+ ],
8
+ "bos_token_id": 0,
9
+ "decoder_start_token_id": 59519,
10
+ "eos_token_id": 401,
11
+ "forced_eos_token_id": 401,
12
+ "max_length": 512,
13
+ "num_beams": 4,
14
+ "pad_token_id": 59519,
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:d432339e74f73d5a392f4b6d121a890a07ffa217629a602a7ffd300e6b8bb383
3
+ size 949491120
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e015f232124702267b2dd97772b087e0b73087bc983faaea2157fa602e8af7ce
3
+ size 949542341
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d45a33bc5f39dd7d67ae9e236975358233ba2c5ba163b06fafd39e4b0216d546
3
+ size 807970
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:763236b50942637ba17dca12ad3704afef41cb9a972b3076cfd46aa94b73bd18
3
+ size 783938
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "deu+eng+fra+por+spa", "target_lang": "pqw", "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-pqw", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff