tiedeman commited on
Commit
4ea978a
1 Parent(s): f02fcae

Initial commit

Browse files
.gitattributes CHANGED
@@ -29,3 +29,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
29
  *.zip filter=lfs diff=lfs merge=lfs -text
30
  *.zst filter=lfs diff=lfs merge=lfs -text
31
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
29
  *.zip filter=lfs diff=lfs merge=lfs -text
30
  *.zst filter=lfs diff=lfs merge=lfs -text
31
  *tfevents* filter=lfs diff=lfs merge=lfs -text
32
+ *.spm filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - da
4
+ - gmq
5
+ - he
6
+ - no
7
+
8
+ tags:
9
+ - translation
10
+ - opus-mt-tc
11
+
12
+ license: cc-by-4.0
13
+ model-index:
14
+ - name: opus-mt-tc-big-he-gmq
15
+ results:
16
+ - task:
17
+ name: Translation heb-dan
18
+ type: translation
19
+ args: heb-dan
20
+ dataset:
21
+ name: flores101-devtest
22
+ type: flores_101
23
+ args: heb dan devtest
24
+ metrics:
25
+ - name: BLEU
26
+ type: bleu
27
+ value: 31.4
28
+ - name: chr-F
29
+ type: chrf
30
+ value: 0.58023
31
+ - task:
32
+ name: Translation heb-isl
33
+ type: translation
34
+ args: heb-isl
35
+ dataset:
36
+ name: flores101-devtest
37
+ type: flores_101
38
+ args: heb isl devtest
39
+ metrics:
40
+ - name: BLEU
41
+ type: bleu
42
+ value: 14.0
43
+ - name: chr-F
44
+ type: chrf
45
+ value: 0.41998
46
+ - task:
47
+ name: Translation heb-nob
48
+ type: translation
49
+ args: heb-nob
50
+ dataset:
51
+ name: flores101-devtest
52
+ type: flores_101
53
+ args: heb nob devtest
54
+ metrics:
55
+ - name: BLEU
56
+ type: bleu
57
+ value: 23.7
58
+ - name: chr-F
59
+ type: chrf
60
+ value: 0.53086
61
+ - task:
62
+ name: Translation heb-swe
63
+ type: translation
64
+ args: heb-swe
65
+ dataset:
66
+ name: flores101-devtest
67
+ type: flores_101
68
+ args: heb swe devtest
69
+ metrics:
70
+ - name: BLEU
71
+ type: bleu
72
+ value: 29.6
73
+ - name: chr-F
74
+ type: chrf
75
+ value: 0.56881
76
+ ---
77
+ # opus-mt-tc-big-he-gmq
78
+
79
+ ## Table of Contents
80
+ - [Model Details](#model-details)
81
+ - [Uses](#uses)
82
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
83
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
84
+ - [Training](#training)
85
+ - [Evaluation](#evaluation)
86
+ - [Citation Information](#citation-information)
87
+ - [Acknowledgements](#acknowledgements)
88
+
89
+ ## Model Details
90
+
91
+ Neural machine translation model for translating from Hebrew (he) to North Germanic languages (gmq).
92
+
93
+ 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).
94
+ **Model Description:**
95
+ - **Developed by:** Language Technology Research Group at the University of Helsinki
96
+ - **Model Type:** Translation (transformer-big)
97
+ - **Release**: 2022-07-23
98
+ - **License:** CC-BY-4.0
99
+ - **Language(s):**
100
+ - Source Language(s): heb
101
+ - Target Language(s): dan nor
102
+ - Valid Target Language Labels: >>dan<< >>nor<<
103
+ - **Original Model**: [opusTCv20210807_transformer-big_2022-07-23.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/heb-gmq/opusTCv20210807_transformer-big_2022-07-23.zip)
104
+ - **Resources for more information:**
105
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
106
+ - More information about released models for this language pair: [OPUS-MT heb-gmq README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/heb-gmq/README.md)
107
+ - [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
108
+ - [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/
109
+
110
+ 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. `>>dan<<`
111
+
112
+ ## Uses
113
+
114
+ This model can be used for translation and text-to-text generation.
115
+
116
+ ## Risks, Limitations and Biases
117
+
118
+ **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.**
119
+
120
+ 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)).
121
+
122
+ ## How to Get Started With the Model
123
+
124
+ A short example code:
125
+
126
+ ```python
127
+ from transformers import MarianMTModel, MarianTokenizer
128
+
129
+ src_text = [
130
+ ">>dan<< כל שלושת הילדים של אליעזר לודוויג זמנהוף נרצחו בשואה.",
131
+ ">>swe<< הסתבר שטום היה מרגל."
132
+ ]
133
+
134
+ model_name = "pytorch-models/opus-mt-tc-big-he-gmq"
135
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
136
+ model = MarianMTModel.from_pretrained(model_name)
137
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
138
+
139
+ for t in translated:
140
+ print( tokenizer.decode(t, skip_special_tokens=True) )
141
+
142
+ # expected output:
143
+ # Alle tre børn af Eliezer Ludwig Zamenhof blev dræbt i Holocaust.
144
+ # Det visade sig att Tom var en spion.
145
+ ```
146
+
147
+ You can also use OPUS-MT models with the transformers pipelines, for example:
148
+
149
+ ```python
150
+ from transformers import pipeline
151
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-he-gmq")
152
+ print(pipe(">>dan<< כל שלושת הילדים של אליעזר לודוויג זמנהוף נרצחו בשואה."))
153
+
154
+ # expected output: Alle tre børn af Eliezer Ludwig Zamenhof blev dræbt i Holocaust.
155
+ ```
156
+
157
+ ## Training
158
+
159
+ - **Data**: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
160
+ - **Pre-processing**: SentencePiece (spm32k,spm32k)
161
+ - **Model Type:** transformer-big
162
+ - **Original MarianNMT Model**: [opusTCv20210807_transformer-big_2022-07-23.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/heb-gmq/opusTCv20210807_transformer-big_2022-07-23.zip)
163
+ - **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
164
+
165
+ ## Evaluation
166
+
167
+ * test set translations: [opusTCv20210807_transformer-big_2022-07-23.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/heb-gmq/opusTCv20210807_transformer-big_2022-07-23.test.txt)
168
+ * test set scores: [opusTCv20210807_transformer-big_2022-07-23.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/heb-gmq/opusTCv20210807_transformer-big_2022-07-23.eval.txt)
169
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
170
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
171
+
172
+ | langpair | testset | chr-F | BLEU | #sent | #words |
173
+ |----------|---------|-------|-------|-------|--------|
174
+ | heb-dan | flores101-devtest | 0.58023 | 31.4 | 1012 | 24638 |
175
+ | heb-isl | flores101-devtest | 0.41998 | 14.0 | 1012 | 22834 |
176
+ | heb-nob | flores101-devtest | 0.53086 | 23.7 | 1012 | 23873 |
177
+ | heb-swe | flores101-devtest | 0.56881 | 29.6 | 1012 | 23121 |
178
+
179
+ ## Citation Information
180
+
181
+ * Publications: [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.)
182
+
183
+ ```
184
+ @inproceedings{tiedemann-thottingal-2020-opus,
185
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
186
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
187
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
188
+ month = nov,
189
+ year = "2020",
190
+ address = "Lisboa, Portugal",
191
+ publisher = "European Association for Machine Translation",
192
+ url = "https://aclanthology.org/2020.eamt-1.61",
193
+ pages = "479--480",
194
+ }
195
+
196
+ @inproceedings{tiedemann-2020-tatoeba,
197
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
198
+ author = {Tiedemann, J{\"o}rg},
199
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
200
+ month = nov,
201
+ year = "2020",
202
+ address = "Online",
203
+ publisher = "Association for Computational Linguistics",
204
+ url = "https://aclanthology.org/2020.wmt-1.139",
205
+ pages = "1174--1182",
206
+ }
207
+ ```
208
+
209
+ ## Acknowledgements
210
+
211
+ The work is supported by the [European Language Grid](https://www.european-language-grid.eu/) as [pilot project 2866](https://live.european-language-grid.eu/catalogue/#/resource/projects/2866), by the [FoTran project](https://www.helsinki.fi/en/researchgroups/natural-language-understanding-with-cross-lingual-grounding), funded by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 771113), and the [MeMAD project](https://memad.eu/), funded by the European Union’s Horizon 2020 Research and Innovation Programme under grant agreement No 780069. We are also grateful for the generous computational resources and IT infrastructure provided by [CSC -- IT Center for Science](https://www.csc.fi/), Finland.
212
+
213
+ ## Model conversion info
214
+
215
+ * transformers version: 4.16.2
216
+ * OPUS-MT git hash: 8b9f0b0
217
+ * port time: Fri Aug 12 19:14:22 EEST 2022
218
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ heb-dan flores101-dev 0.58306 32.3 997 23685
2
+ heb-isl flores101-dev 0.41889 14.1 997 21857
3
+ heb-nob flores101-dev 0.52182 23.4 997 23157
4
+ heb-swe flores101-dev 0.56814 29.8 997 22417
5
+ heb-dan flores101-devtest 0.58023 31.4 1012 24638
6
+ heb-isl flores101-devtest 0.41998 14.0 1012 22834
7
+ heb-nob flores101-devtest 0.53086 23.7 1012 23873
8
+ heb-swe flores101-devtest 0.56881 29.6 1012 23121
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d925aaa55c3e547d37dd2e200539d9a42d6691330feff850ae903ede4175e6a
3
+ size 1301900
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
+ 60232
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": 60232,
21
+ "decoder_vocab_size": 60233,
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": 23870,
28
+ "forced_eos_token_id": 23870,
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": 60232,
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": 60233
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:08f979feceea46a187aa8809763e54dfe18cff14fd33fbbc7a3a3b8d6b086e1b
3
+ size 599641283
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0ad2a7d021da764002850a77a2e7dee1986e8ff6b162a53160d5ea49b2acdf7f
3
+ size 877792
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:1690a1765ceaa7a23ec037bdc81e535399921f2f25a2d88fd615d54a8a46162f
3
+ size 790045
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
1
+ {"source_lang": "he", "target_lang": "gmq", "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/opusTCv20210807_transformer-big_2022-07-23/he-gmq", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff