Initial commit
Browse files- .gitattributes +1 -0
- README.md +168 -0
- benchmark_results.txt +2 -0
- benchmark_translations.zip +3 -0
- config.json +45 -0
- pytorch_model.bin +3 -0
- source.spm +3 -0
- special_tokens_map.json +1 -0
- target.spm +3 -0
- tokenizer_config.json +1 -0
- vocab.json +0 -0
.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,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- fa
|
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-fa-gmq
|
13 |
+
results:
|
14 |
+
- task:
|
15 |
+
name: Translation fas-dan
|
16 |
+
type: translation
|
17 |
+
args: fas-dan
|
18 |
+
dataset:
|
19 |
+
name: flores101-devtest
|
20 |
+
type: flores_101
|
21 |
+
args: fas dan devtest
|
22 |
+
metrics:
|
23 |
+
- name: BLEU
|
24 |
+
type: bleu
|
25 |
+
value: 22.7
|
26 |
+
- name: chr-F
|
27 |
+
type: chrf
|
28 |
+
value: 0.50857
|
29 |
+
---
|
30 |
+
# opus-mt-tc-big-fa-gmq
|
31 |
+
|
32 |
+
## Table of Contents
|
33 |
+
- [Model Details](#model-details)
|
34 |
+
- [Uses](#uses)
|
35 |
+
- [Risks, Limitations and Biases](#risks-limitations-and-biases)
|
36 |
+
- [How to Get Started With the Model](#how-to-get-started-with-the-model)
|
37 |
+
- [Training](#training)
|
38 |
+
- [Evaluation](#evaluation)
|
39 |
+
- [Citation Information](#citation-information)
|
40 |
+
- [Acknowledgements](#acknowledgements)
|
41 |
+
|
42 |
+
## Model Details
|
43 |
+
|
44 |
+
Neural machine translation model for translating from Persian (fa) to North Germanic languages (gmq).
|
45 |
+
|
46 |
+
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).
|
47 |
+
**Model Description:**
|
48 |
+
- **Developed by:** Language Technology Research Group at the University of Helsinki
|
49 |
+
- **Model Type:** Translation (transformer-big)
|
50 |
+
- **Release**: 2022-07-23
|
51 |
+
- **License:** CC-BY-4.0
|
52 |
+
- **Language(s):**
|
53 |
+
- Source Language(s):
|
54 |
+
- Target Language(s):
|
55 |
+
- Valid Target Language Labels:
|
56 |
+
- **Original Model**: [opusTCv20210807_transformer-big_2022-07-23.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/fas-gmq/opusTCv20210807_transformer-big_2022-07-23.zip)
|
57 |
+
- **Resources for more information:**
|
58 |
+
- [OPUS-MT-train GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
|
59 |
+
- More information about released models for this language pair: [OPUS-MT fas-gmq README](https://github.com/Helsinki-NLP/Tatoeba-Challenge/tree/master/models/fas-gmq/README.md)
|
60 |
+
- [More information about MarianNMT models in the transformers library](https://huggingface.co/docs/transformers/model_doc/marian)
|
61 |
+
- [Tatoeba Translation Challenge](https://github.com/Helsinki-NLP/Tatoeba-Challenge/
|
62 |
+
|
63 |
+
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. `>><<`
|
64 |
+
|
65 |
+
## Uses
|
66 |
+
|
67 |
+
This model can be used for translation and text-to-text generation.
|
68 |
+
|
69 |
+
## Risks, Limitations and Biases
|
70 |
+
|
71 |
+
**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.**
|
72 |
+
|
73 |
+
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)).
|
74 |
+
|
75 |
+
## How to Get Started With the Model
|
76 |
+
|
77 |
+
A short example code:
|
78 |
+
|
79 |
+
```python
|
80 |
+
from transformers import MarianMTModel, MarianTokenizer
|
81 |
+
|
82 |
+
src_text = [
|
83 |
+
"از سوسک میترسم.",
|
84 |
+
"از سوسک میترسم."
|
85 |
+
]
|
86 |
+
|
87 |
+
model_name = "pytorch-models/opus-mt-tc-big-fa-gmq"
|
88 |
+
tokenizer = MarianTokenizer.from_pretrained(model_name)
|
89 |
+
model = MarianMTModel.from_pretrained(model_name)
|
90 |
+
translated = model.generate(**tokenizer(src_text, return_tensors="pt", padding=True))
|
91 |
+
|
92 |
+
for t in translated:
|
93 |
+
print( tokenizer.decode(t, skip_special_tokens=True) )
|
94 |
+
|
95 |
+
# expected output:
|
96 |
+
# Jeg er bange for kakerlakker.
|
97 |
+
# Jeg er bange for kakerlakker.
|
98 |
+
```
|
99 |
+
|
100 |
+
You can also use OPUS-MT models with the transformers pipelines, for example:
|
101 |
+
|
102 |
+
```python
|
103 |
+
from transformers import pipeline
|
104 |
+
pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-tc-big-fa-gmq")
|
105 |
+
print(pipe("از سوسک میترسم."))
|
106 |
+
|
107 |
+
# expected output: Jeg er bange for kakerlakker.
|
108 |
+
```
|
109 |
+
|
110 |
+
## Training
|
111 |
+
|
112 |
+
- **Data**: opusTCv20210807 ([source](https://github.com/Helsinki-NLP/Tatoeba-Challenge))
|
113 |
+
- **Pre-processing**: SentencePiece (spm32k,spm32k)
|
114 |
+
- **Model Type:** transformer-big
|
115 |
+
- **Original MarianNMT Model**: [opusTCv20210807_transformer-big_2022-07-23.zip](https://object.pouta.csc.fi/Tatoeba-MT-models/fas-gmq/opusTCv20210807_transformer-big_2022-07-23.zip)
|
116 |
+
- **Training Scripts**: [GitHub Repo](https://github.com/Helsinki-NLP/OPUS-MT-train)
|
117 |
+
|
118 |
+
## Evaluation
|
119 |
+
|
120 |
+
* test set translations: [opusTCv20210807_transformer-big_2022-07-23.test.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/fas-gmq/opusTCv20210807_transformer-big_2022-07-23.test.txt)
|
121 |
+
* test set scores: [opusTCv20210807_transformer-big_2022-07-23.eval.txt](https://object.pouta.csc.fi/Tatoeba-MT-models/fas-gmq/opusTCv20210807_transformer-big_2022-07-23.eval.txt)
|
122 |
+
* benchmark results: [benchmark_results.txt](benchmark_results.txt)
|
123 |
+
* benchmark output: [benchmark_translations.zip](benchmark_translations.zip)
|
124 |
+
|
125 |
+
| langpair | testset | chr-F | BLEU | #sent | #words |
|
126 |
+
|----------|---------|-------|-------|-------|--------|
|
127 |
+
| fas-dan | flores101-devtest | 0.50857 | 22.7 | 1012 | 24638 |
|
128 |
+
|
129 |
+
## Citation Information
|
130 |
+
|
131 |
+
* 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.)
|
132 |
+
|
133 |
+
```
|
134 |
+
@inproceedings{tiedemann-thottingal-2020-opus,
|
135 |
+
title = "{OPUS}-{MT} {--} Building open translation services for the World",
|
136 |
+
author = {Tiedemann, J{\"o}rg and Thottingal, Santhosh},
|
137 |
+
booktitle = "Proceedings of the 22nd Annual Conference of the European Association for Machine Translation",
|
138 |
+
month = nov,
|
139 |
+
year = "2020",
|
140 |
+
address = "Lisboa, Portugal",
|
141 |
+
publisher = "European Association for Machine Translation",
|
142 |
+
url = "https://aclanthology.org/2020.eamt-1.61",
|
143 |
+
pages = "479--480",
|
144 |
+
}
|
145 |
+
|
146 |
+
@inproceedings{tiedemann-2020-tatoeba,
|
147 |
+
title = "The Tatoeba Translation Challenge {--} Realistic Data Sets for Low Resource and Multilingual {MT}",
|
148 |
+
author = {Tiedemann, J{\"o}rg},
|
149 |
+
booktitle = "Proceedings of the Fifth Conference on Machine Translation",
|
150 |
+
month = nov,
|
151 |
+
year = "2020",
|
152 |
+
address = "Online",
|
153 |
+
publisher = "Association for Computational Linguistics",
|
154 |
+
url = "https://aclanthology.org/2020.wmt-1.139",
|
155 |
+
pages = "1174--1182",
|
156 |
+
}
|
157 |
+
```
|
158 |
+
|
159 |
+
## Acknowledgements
|
160 |
+
|
161 |
+
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.
|
162 |
+
|
163 |
+
## Model conversion info
|
164 |
+
|
165 |
+
* transformers version: 4.16.2
|
166 |
+
* OPUS-MT git hash: 8b9f0b0
|
167 |
+
* port time: Fri Aug 12 20:17:09 EEST 2022
|
168 |
+
* port machine: LM0-400-22516.local
|
benchmark_results.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
fas-dan flores101-dev 0.51347 23.7 997 23685
|
2 |
+
fas-dan flores101-devtest 0.50857 22.7 1012 24638
|
benchmark_translations.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2bc104b48e740b373c27b4ee2b47be5b3d6d4cc3d1109e418cc1732b8004a782
|
3 |
+
size 344829
|
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 |
+
58753
|
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": 58753,
|
21 |
+
"decoder_vocab_size": 58754,
|
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": 25124,
|
28 |
+
"forced_eos_token_id": 25124,
|
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": 58753,
|
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": 58754
|
45 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e1e5a49c99b6fa44d3375cd09e3e2c259e3cb587ab0da312ef87cd6318343ff6
|
3 |
+
size 593580355
|
source.spm
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b9e065549fde9a9a4b89b2a19c0a66a9a6b4b6292b43a25c1bd85d27080e0811
|
3 |
+
size 872053
|
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:a96c5c0e2bf4d22ff0a6b5f3ff9f30c0d4861a70c2364bac56adc05e451bcb75
|
3 |
+
size 807593
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"source_lang": "fa", "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/fa-gmq", "tokenizer_class": "MarianTokenizer"}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|