tiedeman commited on
Commit
6b8bbf7
1 Parent(s): fec6d31

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,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ language:
4
+ - anp
5
+ - as
6
+ - awa
7
+ - bal
8
+ - bho
9
+ - bn
10
+ - bpy
11
+ - diq
12
+ - dv
13
+ - en
14
+ - fa
15
+ - gbm
16
+ - glk
17
+ - gu
18
+ - hi
19
+ - hif
20
+ - hne
21
+ - hns
22
+ - jdt
23
+ - kok
24
+ - ks
25
+ - ku
26
+ - lah
27
+ - lrc
28
+ - mag
29
+ - mai
30
+ - mr
31
+ - mzn
32
+ - ne
33
+ - or
34
+ - os
35
+ - pa
36
+ - pal
37
+ - pi
38
+ - ps
39
+ - rhg
40
+ - rmy
41
+ - rom
42
+ - sa
43
+ - sd
44
+ - si
45
+ - skr
46
+ - syl
47
+ - tg
48
+ - tly
49
+ - ur
50
+ - zza
51
+
52
+ tags:
53
+ - translation
54
+ - opus-mt-tc-bible
55
+
56
+ license: apache-2.0
57
+ model-index:
58
+ - name: opus-mt-tc-bible-big-iir-en
59
+ results:
60
+ - task:
61
+ name: Translation multi-eng
62
+ type: translation
63
+ args: multi-eng
64
+ dataset:
65
+ name: tatoeba-test-v2020-07-28-v2023-09-26
66
+ type: tatoeba_mt
67
+ args: multi-eng
68
+ metrics:
69
+ - name: BLEU
70
+ type: bleu
71
+ value: 36.4
72
+ - name: chr-F
73
+ type: chrf
74
+ value: 0.55062
75
+ ---
76
+ # opus-mt-tc-bible-big-iir-en
77
+
78
+ ## Table of Contents
79
+ - [Model Details](#model-details)
80
+ - [Uses](#uses)
81
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
82
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
83
+ - [Training](#training)
84
+ - [Evaluation](#evaluation)
85
+ - [Citation Information](#citation-information)
86
+ - [Acknowledgements](#acknowledgements)
87
+
88
+ ## Model Details
89
+
90
+ Neural machine translation model for translating from Indo-Iranian languages (iir) to English (en).
91
+
92
+ 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).
93
+ **Model Description:**
94
+ - **Developed by:** Language Technology Research Group at the University of Helsinki
95
+ - **Model Type:** Translation (transformer-big)
96
+ - **Release**: 2024-08-17
97
+ - **License:** Apache-2.0
98
+ - **Language(s):**
99
+ - Source Language(s): anp asm awa bal ben bho bpy ckb diq div dty fas gbm glk guj hif hin hne hns jdt kas kmr kok kur lah lrc mag mai mar mzn nep npi ori oss pal pan pes pli prs pus rhg rmy rom san sdh sin skr snd syl tgk tly urd zza
100
+ - Target Language(s): eng
101
+ - **Original Model**: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/iir-eng/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip)
102
+ - **Resources for more information:**
103
+ - [OPUS-MT dashboard](https://opus.nlpl.eu/dashboard/index.php?pkg=opusmt&test=all&scoreslang=all&chart=standard&model=Tatoeba-MT-models/iir-eng/opusTCv20230926max50%2Bbt%2Bjhubc_transformer-big_2024-08-17)
104
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
105
+ - [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
106
+ - [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/)
107
+ - [HPLT bilingual data v1 (as part of the Tatoeba Translation Challenge dataset)](https://hplt-project.org/datasets/v1)
108
+ - [A massively parallel Bible corpus](https://aclanthology.org/L14-1215/)
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
+ "یک جراح خوب دارای چشمی همانند عقاب، دلی مثل شیر و دستی زنانه است.",
129
+ "میں اتنی اونچی چھلانگ کیسے لگائو؟"
130
+ ]
131
+
132
+ model_name = "pytorch-models/opus-mt-tc-bible-big-iir-en"
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
+ # expected output:
141
+ # A healthy man has a good eye, as the eagle's, and a lion's heart, and a woman's hand.
142
+ # How did I get so high?
143
+ ```
144
+
145
+ You can also use OPUS-MT models with the transformers pipelines, for example:
146
+
147
+ ```python
148
+ from transformers import pipeline
149
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-bible-big-iir-en")
150
+ print(pipe("یک جراح خوب دارا�� چشمی همانند عقاب، دلی مثل شیر و دستی زنانه است."))
151
+
152
+ # expected output: A healthy man has a good eye, as the eagle's, and a lion's heart, and a woman's hand.
153
+ ```
154
+
155
+ ## Training
156
+
157
+ - **Data**: opusTCv20230926max50+bt+jhubc ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
158
+ - **Pre-processing**: SentencePiece (spm32k,spm32k)
159
+ - **Model Type:** transformer-big
160
+ - **Original MarianNMT Model**: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/iir-eng/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip)
161
+ - **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
162
+
163
+ ## Evaluation
164
+
165
+ * [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/iir-eng/opusTCv20230926max50%2Bbt%2Bjhubc_transformer-big_2024-08-17)
166
+ * test set translations: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/iir-eng/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.test.txt)
167
+ * test set scores: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/iir-eng/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.eval.txt)
168
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
169
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
170
+
171
+ | langpair | testset | chr-F | BLEU | #sent | #words |
172
+ |----------|---------|-------|-------|-------|--------|
173
+ | multi-eng | tatoeba-test-v2020-07-28-v2023-09-26 | 0.55062 | 36.4 | 10000 | 67843 |
174
+
175
+ ## Citation Information
176
+
177
+ * 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.)
178
+
179
+ ```bibtex
180
+ @article{tiedemann2023democratizing,
181
+ title={Democratizing neural machine translation with {OPUS-MT}},
182
+ 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},
183
+ journal={Language Resources and Evaluation},
184
+ number={58},
185
+ pages={713--755},
186
+ year={2023},
187
+ publisher={Springer Nature},
188
+ issn={1574-0218},
189
+ doi={10.1007/s10579-023-09704-w}
190
+ }
191
+
192
+ @inproceedings{tiedemann-thottingal-2020-opus,
193
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
194
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
195
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
196
+ month = nov,
197
+ year = "2020",
198
+ address = "Lisboa, Portugal",
199
+ publisher = "European Association for Machine Translation",
200
+ url = "https://aclanthology.org/2020.eamt-1.61",
201
+ pages = "479--480",
202
+ }
203
+
204
+ @inproceedings{tiedemann-2020-tatoeba,
205
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
206
+ author = {Tiedemann, J{\"o}rg},
207
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
208
+ month = nov,
209
+ year = "2020",
210
+ address = "Online",
211
+ publisher = "Association for Computational Linguistics",
212
+ url = "https://aclanthology.org/2020.wmt-1.139",
213
+ pages = "1174--1182",
214
+ }
215
+ ```
216
+
217
+ ## Acknowledgements
218
+
219
+ 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/).
220
+
221
+ ## Model conversion info
222
+
223
+ * transformers version: 4.45.1
224
+ * OPUS-MT git hash: 0882077
225
+ * port time: Tue Oct 8 11:36:11 EEST 2024
226
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ multi-eng tatoeba-test-v2020-07-28-v2023-09-26 0.55062 36.4 10000 67843
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-iir-en",
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": 62112,
17
+ "decoder_vocab_size": 62113,
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": 685,
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": 62112,
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": 62113
41
+ }
generation_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bad_words_ids": [
4
+ [
5
+ 62112
6
+ ]
7
+ ],
8
+ "bos_token_id": 0,
9
+ "decoder_start_token_id": 62112,
10
+ "eos_token_id": 685,
11
+ "forced_eos_token_id": 685,
12
+ "max_length": 512,
13
+ "num_beams": 4,
14
+ "pad_token_id": 62112,
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:df6c43b78ac38a2c4ecc15dfe5f2a2ca0e3831511a0ab397bd5b3ef895e37a6a
3
+ size 960122420
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:697a11c45f9098a2bcc2e8cf12815355669e9dcb7445068f95e5058b2496722c
3
+ size 960173701
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:423ba04a04d0f1df264ffccee78640a730b000fb8408dadd00e79ac90d97f1fa
3
+ size 962418
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:3fac8c86efc07a2f22b35e2687f2450dde397b076cf05df1fbaa226014541dd3
3
+ size 803081
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "iir", "target_lang": "en", "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/iir-en", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff