tiedeman commited on
Commit
1cdc548
1 Parent(s): 397ff98

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,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ language:
4
+ - en
5
+ - lt
6
+ - lv
7
+ - prg
8
+ - sgs
9
+
10
+ tags:
11
+ - translation
12
+ - opus-mt-tc-bible
13
+
14
+ license: apache-2.0
15
+ model-index:
16
+ - name: opus-mt-tc-bible-big-bat-en
17
+ results:
18
+ - task:
19
+ name: Translation multi-eng
20
+ type: translation
21
+ args: multi-eng
22
+ dataset:
23
+ name: tatoeba-test-v2020-07-28-v2023-09-26
24
+ type: tatoeba_mt
25
+ args: multi-eng
26
+ metrics:
27
+ - name: BLEU
28
+ type: bleu
29
+ value: 59.7
30
+ - name: chr-F
31
+ type: chrf
32
+ value: 0.73795
33
+ ---
34
+ # opus-mt-tc-bible-big-bat-en
35
+
36
+ ## Table of Contents
37
+ - [Model Details](#model-details)
38
+ - [Uses](#uses)
39
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
40
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
41
+ - [Training](#training)
42
+ - [Evaluation](#evaluation)
43
+ - [Citation Information](#citation-information)
44
+ - [Acknowledgements](#acknowledgements)
45
+
46
+ ## Model Details
47
+
48
+ Neural machine translation model for translating from Baltic languages (bat) to English (en).
49
+
50
+ 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).
51
+ **Model Description:**
52
+ - **Developed by:** Language Technology Research Group at the University of Helsinki
53
+ - **Model Type:** Translation (transformer-big)
54
+ - **Release**: 2024-08-17
55
+ - **License:** Apache-2.0
56
+ - **Language(s):**
57
+ - Source Language(s): lav lit prg sgs
58
+ - Target Language(s): eng
59
+ - **Original Model**: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/bat-eng/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip)
60
+ - **Resources for more information:**
61
+ - [OPUS-MT dashboard](https://opus.nlpl.eu/dashboard/index.php?pkg=opusmt&test=all&scoreslang=all&chart=standard&model=Tatoeba-MT-models/bat-eng/opusTCv20230926max50%2Bbt%2Bjhubc_transformer-big_2024-08-17)
62
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
63
+ - [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
64
+ - [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/)
65
+ - [HPLT bilingual data v1 (as part of the Tatoeba Translation Challenge dataset)](https://hplt-project.org/datasets/v1)
66
+ - [A massively parallel Bible corpus](https://aclanthology.org/L14-1215/)
67
+
68
+ ## Uses
69
+
70
+ This model can be used for translation and text-to-text generation.
71
+
72
+ ## Risks, Limitations and Biases
73
+
74
+ **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.**
75
+
76
+ 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)).
77
+
78
+ ## How to Get Started With the Model
79
+
80
+ A short example code:
81
+
82
+ ```python
83
+ from transformers import MarianMTModel, MarianTokenizer
84
+
85
+ src_text = [
86
+ "Dienai ir divdesmit četras stundas.",
87
+ "Jukiko mėgsta bulves."
88
+ ]
89
+
90
+ model_name = "pytorch-models/opus-mt-tc-bible-big-bat-en"
91
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
92
+ model = MarianMTModel.from_pretrained(model_name)
93
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
94
+
95
+ for t in translated:
96
+ print( tokenizer.decode(t, skip_special_tokens=True) )
97
+
98
+ # expected output:
99
+ # The day is twenty-four hours.
100
+ # Yukiko likes potatoes.
101
+ ```
102
+
103
+ You can also use OPUS-MT models with the transformers pipelines, for example:
104
+
105
+ ```python
106
+ from transformers import pipeline
107
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-bible-big-bat-en")
108
+ print(pipe("Dienai ir divdesmit četras stundas."))
109
+
110
+ # expected output: The day is twenty-four hours.
111
+ ```
112
+
113
+ ## Training
114
+
115
+ - **Data**: opusTCv20230926max50+bt+jhubc ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
116
+ - **Pre-processing**: SentencePiece (spm32k,spm32k)
117
+ - **Model Type:** transformer-big
118
+ - **Original MarianNMT Model**: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/bat-eng/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.zip)
119
+ - **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
120
+
121
+ ## Evaluation
122
+
123
+ * [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/bat-eng/opusTCv20230926max50%2Bbt%2Bjhubc_transformer-big_2024-08-17)
124
+ * test set translations: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/bat-eng/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.test.txt)
125
+ * test set scores: [opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/bat-eng/opusTCv20230926max50+bt+jhubc_transformer-big_2024-08-17.eval.txt)
126
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
127
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
128
+
129
+ | langpair | testset | chr-F | BLEU | #sent | #words |
130
+ |----------|---------|-------|-------|-------|--------|
131
+ | multi-eng | tatoeba-test-v2020-07-28-v2023-09-26 | 0.73795 | 59.7 | 4216 | 29456 |
132
+
133
+ ## Citation Information
134
+
135
+ * 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.)
136
+
137
+ ```bibtex
138
+ @article{tiedemann2023democratizing,
139
+ title={Democratizing neural machine translation with {OPUS-MT}},
140
+ 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},
141
+ journal={Language Resources and Evaluation},
142
+ number={58},
143
+ pages={713--755},
144
+ year={2023},
145
+ publisher={Springer Nature},
146
+ issn={1574-0218},
147
+ doi={10.1007/s10579-023-09704-w}
148
+ }
149
+
150
+ @inproceedings{tiedemann-thottingal-2020-opus,
151
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
152
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
153
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
154
+ month = nov,
155
+ year = "2020",
156
+ address = "Lisboa, Portugal",
157
+ publisher = "European Association for Machine Translation",
158
+ url = "https://aclanthology.org/2020.eamt-1.61",
159
+ pages = "479--480",
160
+ }
161
+
162
+ @inproceedings{tiedemann-2020-tatoeba,
163
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
164
+ author = {Tiedemann, J{\"o}rg},
165
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
166
+ month = nov,
167
+ year = "2020",
168
+ address = "Online",
169
+ publisher = "Association for Computational Linguistics",
170
+ url = "https://aclanthology.org/2020.wmt-1.139",
171
+ pages = "1174--1182",
172
+ }
173
+ ```
174
+
175
+ ## Acknowledgements
176
+
177
+ 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/).
178
+
179
+ ## Model conversion info
180
+
181
+ * transformers version: 4.45.1
182
+ * OPUS-MT git hash: a0ea3b3
183
+ * port time: Mon Oct 7 20:25:09 EEST 2024
184
+ * 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.73795 59.7 4216 29456
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-bat-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": 58701,
17
+ "decoder_vocab_size": 58702,
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": 1540,
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": 58701,
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": 58702
41
+ }
generation_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bad_words_ids": [
4
+ [
5
+ 58701
6
+ ]
7
+ ],
8
+ "bos_token_id": 0,
9
+ "decoder_start_token_id": 58701,
10
+ "eos_token_id": 1540,
11
+ "forced_eos_token_id": 1540,
12
+ "max_length": 512,
13
+ "num_beams": 4,
14
+ "pad_token_id": 58701,
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:e82195ce53a91493197936a8a9960f1f13575536f2c207fd72a6beced703de9b
3
+ size 946137320
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24dae2acaf11e50293048e119dbd460a156f65e012db0c5ddfd822f262bf7e83
3
+ size 946188549
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:20d525d03bb9e0bd1a14e753ccee76a8bc24989924e524437cc74df7c4d8e2c0
3
+ size 830298
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:f76493af91cbe2c74f78f87bd8fc101fafcb0ea2555ba5c2c37bf1bd9a2e09a5
3
+ size 796998
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "bat", "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/bat-en", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff