tiedeman commited on
Commit
abee3bc
1 Parent(s): ed404b8

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,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - aa
4
+ - am
5
+ - ar
6
+ - arc
7
+ - bcw
8
+ - byn
9
+ - cop
10
+ - daa
11
+ - dsh
12
+ - en
13
+ - gde
14
+ - gnd
15
+ - ha
16
+ - hbo
17
+ - he
18
+ - hig
19
+ - irk
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
+ - om
39
+ - pbi
40
+ - phn
41
+ - rif
42
+ - sgw
43
+ - shi
44
+ - shy
45
+ - so
46
+ - sur
47
+ - syc
48
+ - syr
49
+ - taq
50
+ - ti
51
+ - tig
52
+ - tmc
53
+ - tmh
54
+ - tmr
55
+ - ttr
56
+ - tzm
57
+ - wal
58
+ - xed
59
+ - zgh
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-afa-en
68
+ results:
69
+ - task:
70
+ name: Translation multi-eng
71
+ type: translation
72
+ args: multi-eng
73
+ dataset:
74
+ name: tatoeba-test-v2020-07-28-v2023-09-26
75
+ type: tatoeba_mt
76
+ args: multi-eng
77
+ metrics:
78
+ - name: BLEU
79
+ type: bleu
80
+ value: 39.0
81
+ - name: chr-F
82
+ type: chrf
83
+ value: 0.56433
84
+ ---
85
+ # opus-mt-tc-bible-big-afa-en
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 Afro-Asiatic languages (afa) to English (en).
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-08-17
106
+ - **License:** Apache-2.0
107
+ - **Language(s):**
108
+ - Source Language(s): aar acm afb amh apc ara arc arq arz bcw byn 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 multi muy oar orm pbi phn rif sgw shi shy som sur syc syr taq tig tir tmc tmh tmr ttr tzm wal xed zgh
109
+ - Target Language(s): eng
110
+ - Valid Target Language Labels:
111
+ - **Original Model**: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/afa-eng/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip)
112
+ - **Resources for more information:**
113
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
114
+ - More information about released models for this language pair: [OPUS-MT afa-eng README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/afa-eng/README.md)
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
+ - [A massively parallel Bible corpus](https://aclanthology.org/L14-1215/)
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
+ "لا أريد أن أبدو غبيّا.",
138
+ "أكيليز بطل أسطوري عند الإغريق."
139
+ ]
140
+
141
+ model_name = "pytorch-models/opus-mt-tc-bible-big-afa-en"
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
+ # I don't want to look stupid.
151
+ # Achilles is a legendary hero of the Greeks.
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-en")
159
+ print(pipe("لا أريد أن أبدو غبيّا."))
160
+
161
+ # expected output: I don't want to look stupid.
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-eng/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
+ * test set translations: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/afa-eng/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.test.txt)
175
+ * test set scores: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/afa-eng/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.eval.txt)
176
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
177
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
178
+
179
+ | langpair | testset | chr-F | BLEU | #sent | #words |
180
+ |----------|---------|-------|-------|-------|--------|
181
+ | multi-eng | tatoeba-test-v2020-07-28-v2023-09-26 | 0.56433 | 39.0 | 10000 | 72071 |
182
+
183
+ ## Citation Information
184
+
185
+ * 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.)
186
+
187
+ ```
188
+ @article{tiedemann2023democratizing,
189
+ title={Democratizing neural machine translation with {OPUS-MT}},
190
+ 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},
191
+ journal={Language Resources and Evaluation},
192
+ number={58},
193
+ pages={713--755},
194
+ year={2023},
195
+ publisher={Springer Nature},
196
+ issn={1574-0218},
197
+ doi={10.1007/s10579-023-09704-w}
198
+ }
199
+
200
+ @inproceedings{tiedemann-thottingal-2020-opus,
201
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
202
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
203
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
204
+ month = nov,
205
+ year = "2020",
206
+ address = "Lisboa, Portugal",
207
+ publisher = "European Association for Machine Translation",
208
+ url = "https://aclanthology.org/2020.eamt-1.61",
209
+ pages = "479--480",
210
+ }
211
+
212
+ @inproceedings{tiedemann-2020-tatoeba,
213
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
214
+ author = {Tiedemann, J{\"o}rg},
215
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
216
+ month = nov,
217
+ year = "2020",
218
+ address = "Online",
219
+ publisher = "Association for Computational Linguistics",
220
+ url = "https://aclanthology.org/2020.wmt-1.139",
221
+ pages = "1174--1182",
222
+ }
223
+ ```
224
+
225
+ ## Acknowledgements
226
+
227
+ 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/).
228
+
229
+ ## Model conversion info
230
+
231
+ * transformers version: 4.45.1
232
+ * OPUS-MT git hash: a44ab31
233
+ * port time: Sun Oct 6 18:15:21 EEST 2024
234
+ * 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.56433 39.0 10000 72071
benchmark_translations.zip ADDED
File without changes
config.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation_dropout": 0.0,
3
+ "activation_function": "relu",
4
+ "architectures": [
5
+ "MarianMTModel"
6
+ ],
7
+ "attention_dropout": 0.0,
8
+ "bad_words_ids": [
9
+ [
10
+ 61388
11
+ ]
12
+ ],
13
+ "bos_token_id": 0,
14
+ "classifier_dropout": 0.0,
15
+ "d_model": 1024,
16
+ "decoder_attention_heads": 16,
17
+ "decoder_ffn_dim": 4096,
18
+ "decoder_layerdrop": 0.0,
19
+ "decoder_layers": 6,
20
+ "decoder_start_token_id": 61388,
21
+ "decoder_vocab_size": 61389,
22
+ "dropout": 0.1,
23
+ "encoder_attention_heads": 16,
24
+ "encoder_ffn_dim": 4096,
25
+ "encoder_layerdrop": 0.0,
26
+ "encoder_layers": 6,
27
+ "eos_token_id": 835,
28
+ "forced_eos_token_id": 835,
29
+ "init_std": 0.02,
30
+ "is_encoder_decoder": true,
31
+ "max_length": 512,
32
+ "max_position_embeddings": 1024,
33
+ "model_type": "marian",
34
+ "normalize_embedding": false,
35
+ "num_beams": 4,
36
+ "num_hidden_layers": 6,
37
+ "pad_token_id": 61388,
38
+ "scale_embedding": true,
39
+ "share_encoder_decoder_embeddings": true,
40
+ "static_position_embeddings": true,
41
+ "torch_dtype": "float16",
42
+ "transformers_version": "4.18.0.dev0",
43
+ "use_cache": true,
44
+ "vocab_size": 61389
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:02602a02e6bd7f4147f67725c7f153e20913fd60470db4c55006d1ab07ce0d91
3
+ size 604378563
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b7b8ced5502cb37f9bfb041612109ff1543cd99d9b36fb2173d0f8a3be53b546
3
+ size 810863
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:d63ee1eb34c6275299fc49cffddd014844f3f230570632dd706c01e277d9c899
3
+ size 806049
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "afa", "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/afa-en", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff