tiedeman commited on
Commit
bf9eb52
1 Parent(s): 92dd57e

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