tiedeman commited on
Commit
ca1ff8b
1 Parent(s): fb8cfd8

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,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ar
4
+ - gmq
5
+
6
+ tags:
7
+ - translation
8
+ - opus-mt-tc
9
+
10
+ license: cc-by-4.0
11
+ model-index:
12
+ - name: opus-mt-tc-big-gmq-ar
13
+ results:
14
+ - task:
15
+ name: Translation dan-ara
16
+ type: translation
17
+ args: dan-ara
18
+ dataset:
19
+ name: flores101-devtest
20
+ type: flores_101
21
+ args: dan ara devtest
22
+ metrics:
23
+ - name: BLEU
24
+ type: bleu
25
+ value: 19.9
26
+ - name: chr-F
27
+ type: chrf
28
+ value: 0.52841
29
+ - task:
30
+ name: Translation nob-ara
31
+ type: translation
32
+ args: nob-ara
33
+ dataset:
34
+ name: flores101-devtest
35
+ type: flores_101
36
+ args: nob ara devtest
37
+ metrics:
38
+ - name: BLEU
39
+ type: bleu
40
+ value: 16.8
41
+ - name: chr-F
42
+ type: chrf
43
+ value: 0.49670
44
+ - task:
45
+ name: Translation swe-ara
46
+ type: translation
47
+ args: swe-ara
48
+ dataset:
49
+ name: flores101-devtest
50
+ type: flores_101
51
+ args: swe ara devtest
52
+ metrics:
53
+ - name: BLEU
54
+ type: bleu
55
+ value: 19.3
56
+ - name: chr-F
57
+ type: chrf
58
+ value: 0.51882
59
+ ---
60
+ # opus-mt-tc-big-gmq-ar
61
+
62
+ ## Table of Contents
63
+ - [Model Details](#model-details)
64
+ - [Uses](#uses)
65
+ - [Risks, Limitations and Biases](#risks-limitations-and-biases)
66
+ - [How to Get Started With the Model](#how-to-get-started-with-the-model)
67
+ - [Training](#training)
68
+ - [Evaluation](#evaluation)
69
+ - [Citation Information](#citation-information)
70
+ - [Acknowledgements](#acknowledgements)
71
+
72
+ ## Model Details
73
+
74
+ Neural machine translation model for translating from North Germanic languages (gmq) to Arabic (ar).
75
+
76
+ 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).
77
+ **Model Description:**
78
+ - **Developed by:** Language Technology Research Group at the University of Helsinki
79
+ - **Model Type:** Translation (transformer-big)
80
+ - **Release**: 2022-07-27
81
+ - **License:** CC-BY-4.0
82
+ - **Language(s):**
83
+ - Source Language(s):
84
+ - Target Language(s):
85
+ - Valid Target Language Labels:
86
+ - **Original Model**: [opusTCv20210807_transformer-big_2022-07-27.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/gmq-ara/opusTCv20210807_transformer-big_2022-07-27.zip)
87
+ - **Resources for more information:**
88
+ - [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
89
+ - More information about released models for this language pair: [OPUS-MT gmq-ara README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/gmq-ara/README.md)
90
+ - [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
91
+ - [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/
92
+
93
+ 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. `>><<`
94
+
95
+ ## Uses
96
+
97
+ This model can be used for translation and text-to-text generation.
98
+
99
+ ## Risks, Limitations and Biases
100
+
101
+ **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.**
102
+
103
+ 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)).
104
+
105
+ ## How to Get Started With the Model
106
+
107
+ A short example code:
108
+
109
+ ```python
110
+ from transformers import MarianMTModel, MarianTokenizer
111
+
112
+ src_text = [
113
+ ">>ara<< Jeg elsker semitiske sprog.",
114
+ ">>ara<< Vad handlar boken om?"
115
+ ]
116
+
117
+ model_name = "pytorch-models/opus-mt-tc-big-gmq-ar"
118
+ tokenizer = MarianTokenizer.from_pretrained(model_name)
119
+ model = MarianMTModel.from_pretrained(model_name)
120
+ translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
121
+
122
+ for t in translated:
123
+ print( tokenizer.decode(t, skip_special_tokens=True) )
124
+
125
+ # expected output:
126
+ # أحبّ اللغات الساميّة.
127
+ # عن ماذا يتحدث الكتاب؟
128
+ ```
129
+
130
+ You can also use OPUS-MT models with the transformers pipelines, for example:
131
+
132
+ ```python
133
+ from transformers import pipeline
134
+ pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-gmq-ar")
135
+ print(pipe(">>ara<< Jeg elsker semitiske sprog."))
136
+
137
+ # expected output: أحبّ اللغات الساميّة.
138
+ ```
139
+
140
+ ## Training
141
+
142
+ - **Data**: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
143
+ - **Pre-processing**: SentencePiece (spm32k,spm32k)
144
+ - **Model Type:** transformer-big
145
+ - **Original MarianNMT Model**: [opusTCv20210807_transformer-big_2022-07-27.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/gmq-ara/opusTCv20210807_transformer-big_2022-07-27.zip)
146
+ - **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
147
+
148
+ ## Evaluation
149
+
150
+ * test set translations: [opusTCv20210807_transformer-big_2022-07-27.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/gmq-ara/opusTCv20210807_transformer-big_2022-07-27.test.txt)
151
+ * test set scores: [opusTCv20210807_transformer-big_2022-07-27.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/gmq-ara/opusTCv20210807_transformer-big_2022-07-27.eval.txt)
152
+ * benchmark results: [benchmark_results.txt](benchmark_results.txt)
153
+ * benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
154
+
155
+ | langpair | testset | chr-F | BLEU | #sent | #words |
156
+ |----------|---------|-------|-------|-------|--------|
157
+ | dan-ara | flores101-devtest | 0.52841 | 19.9 | 1012 | 21357 |
158
+ | nob-ara | flores101-devtest | 0.49670 | 16.8 | 1012 | 21357 |
159
+ | swe-ara | flores101-devtest | 0.51882 | 19.3 | 1012 | 21357 |
160
+
161
+ ## Citation Information
162
+
163
+ * 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.)
164
+
165
+ ```
166
+ @inproceedings{tiedemann-thottingal-2020-opus,
167
+ title = "{OPUS}-{MT} {--} Building open translation services for the World",
168
+ author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
169
+ booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
170
+ month = nov,
171
+ year = "2020",
172
+ address = "Lisboa, Portugal",
173
+ publisher = "European Association for Machine Translation",
174
+ url = "https://aclanthology.org/2020.eamt-1.61",
175
+ pages = "479--480",
176
+ }
177
+
178
+ @inproceedings{tiedemann-2020-tatoeba,
179
+ title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
180
+ author = {Tiedemann, J{\"o}rg},
181
+ booktitle = "Proceedings of the Fifth Conference on Machine Translation",
182
+ month = nov,
183
+ year = "2020",
184
+ address = "Online",
185
+ publisher = "Association for Computational Linguistics",
186
+ url = "https://aclanthology.org/2020.wmt-1.139",
187
+ pages = "1174--1182",
188
+ }
189
+ ```
190
+
191
+ ## Acknowledgements
192
+
193
+ 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.
194
+
195
+ ## Model conversion info
196
+
197
+ * transformers version: 4.16.2
198
+ * OPUS-MT git hash: 8b9f0b0
199
+ * port time: Fri Aug 12 17:35:27 EEST 2022
200
+ * port machine: LM0-400-22516.local
benchmark_results.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ dan-ara flores101-dev 0.52400 20.3 997 20512
2
+ nob-ara flores101-dev 0.49420 17.1 997 20512
3
+ swe-ara flores101-dev 0.51750 20.2 997 20512
4
+ dan-ara flores101-devtest 0.52841 19.9 1012 21357
5
+ nob-ara flores101-devtest 0.49670 16.8 1012 21357
6
+ swe-ara flores101-devtest 0.51882 19.3 1012 21357
benchmark_translations.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c69bb4b6c3ac7ebe5d60aa44aaca4cd7ffa6f967431d057a73b76001e5d79c12
3
+ size 1083678
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
+ 60536
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": 60536,
21
+ "decoder_vocab_size": 60537,
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": 23922,
28
+ "forced_eos_token_id": 23922,
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": 60536,
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": 60537
45
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:37807093cc4748eaea78c469c677e9c8ca6e2cbc518f70cd88729fa127df4afd
3
+ size 600887043
source.spm ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fadc0b4c5eccce49b64689b6d41ac8633a2d544eaaabfeb91b3a5269fc3ee628
3
+ size 798939
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:f71e8450d7036d20ffdd450ddef94f66dc34c310d29eb9285a40ab4f210e22e0
3
+ size 897624
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"source_lang": "gmq", "target_lang": "ar", "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-27/gmq-ar", "tokenizer_class": "MarianTokenizer"}
vocab.json ADDED
The diff for this file is too large to render. See raw diff