Update README.md
Browse files
README.md
CHANGED
@@ -2,31 +2,12 @@
|
|
2 |
license: apache-2.0
|
3 |
---
|
4 |
## Aina Project's Catalan-English machine translation model
|
5 |
-
|
6 |
-
## Table of Contents
|
7 |
-
- [Model Description](#model-description)
|
8 |
-
- [Intended Uses and Limitations](#intended-use)
|
9 |
-
- [How to Use](#how-to-use)
|
10 |
-
- [Training](#training)
|
11 |
-
- [Training data](#training-data)
|
12 |
-
- [Training procedure](#training-procedure)
|
13 |
-
- [Data Preparation](#data-preparation)
|
14 |
-
- [Tokenization](#tokenization)
|
15 |
-
- [Hyperparameters](#hyperparameters)
|
16 |
-
- [Evaluation](#evaluation)
|
17 |
-
- [Variable and Metrics](#variable-and-metrics)
|
18 |
-
- [Evaluation Results](#evaluation-results)
|
19 |
-
- [Additional Information](#additional-information)
|
20 |
-
- [Author](#author)
|
21 |
-
- [Contact Information](#contact-information)
|
22 |
-
- [Copyright](#copyright)
|
23 |
-
- [Licensing Information](#licensing-information)
|
24 |
-
- [Funding](#funding)
|
25 |
-
- [Disclaimer](#disclaimer)
|
26 |
|
27 |
## Model description
|
28 |
|
29 |
-
This model was trained from scratch using the [Fairseq toolkit](https://fairseq.readthedocs.io/en/latest/) on a combination of Catalan-English datasets,
|
|
|
|
|
30 |
|
31 |
## Intended uses and limitations
|
32 |
|
@@ -46,7 +27,7 @@ Translate a sentence using python
|
|
46 |
import ctranslate2
|
47 |
import pyonmttok
|
48 |
from huggingface_hub import snapshot_download
|
49 |
-
model_dir = snapshot_download(repo_id="projecte-aina/
|
50 |
|
51 |
tokenizer=pyonmttok.Tokenizer(mode="none", sp_model_path = model_dir + "/spm.model")
|
52 |
tokenized=tokenizer.tokenize("Benvingut al projecte Aina!")
|
@@ -56,6 +37,10 @@ translated = translator.translate_batch([tokenized[0]])
|
|
56 |
print(tokenizer.detokenize(translated[0][0]['tokens']))
|
57 |
```
|
58 |
|
|
|
|
|
|
|
|
|
59 |
## Training
|
60 |
|
61 |
### Training data
|
@@ -91,12 +76,15 @@ The model was trained on a combination of the following datasets:
|
|
91 |
|
92 |
### Data preparation
|
93 |
|
94 |
-
All datasets are concatenated and filtered using the [mBERT Gencata parallel filter](https://huggingface.co/projecte-aina/mbert-base-gencata).
|
|
|
|
|
95 |
|
96 |
|
97 |
#### Tokenization
|
98 |
|
99 |
-
All data is tokenized using sentencepiece, using 50 thousand token sentencepiece model
|
|
|
100 |
|
101 |
#### Hyperparameters
|
102 |
|
@@ -130,14 +118,20 @@ The model was trained for a total of 35.000 updates. Weights were saved every 10
|
|
130 |
|
131 |
### Variable and metrics
|
132 |
|
133 |
-
We use the BLEU score for evaluation on test sets: [Flores-101](https://github.com/facebookresearch/flores),
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
### Evaluation results
|
136 |
|
137 |
-
Below are the evaluation results on the machine translation from Catalan to English compared to [Softcatalà](https://www.softcatala.org/) and
|
|
|
138 |
|
139 |
|
140 |
-
| Test set | SoftCatalà | Google Translate |
|
141 |
|----------------------|------------|------------------|---------------|
|
142 |
| Spanish Constitution | 35,8 | **43,2** | 40,3 |
|
143 |
| United Nations | 44,4 | **47,4** | 44,8 |
|
@@ -150,34 +144,37 @@ Below are the evaluation results on the machine translation from Catalan to Engl
|
|
150 |
| wmt 13 news | 37,8 | **39,8** | 39,3 |
|
151 |
| Average | 39,2 | **45,0** | 41,6 |
|
152 |
|
153 |
-
|
154 |
## Additional information
|
155 |
|
156 |
### Author
|
157 |
-
|
158 |
|
159 |
-
### Contact
|
160 |
-
For further information, send an email to
|
161 |
|
162 |
### Copyright
|
163 |
-
Copyright
|
164 |
|
165 |
-
|
166 |
-
### Licensing Information
|
167 |
[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
168 |
|
169 |
### Funding
|
170 |
-
This work
|
171 |
|
172 |
-
|
173 |
-
At the time of submission, no measures have been taken to estimate the bias and toxicity embedded in the model. However, we are aware that our models may be biased since the corpora have been collected using crawling techniques on multiple web sources. We intend to conduct research in these areas in the future, and if completed, this model card will be updated.
|
174 |
|
175 |
-
## Disclaimer
|
176 |
<details>
|
177 |
<summary>Click to expand</summary>
|
178 |
|
179 |
-
The
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
|
181 |
-
|
|
|
182 |
|
183 |
-
|
|
|
2 |
license: apache-2.0
|
3 |
---
|
4 |
## Aina Project's Catalan-English machine translation model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
## Model description
|
7 |
|
8 |
+
This model was trained from scratch using the [Fairseq toolkit](https://fairseq.readthedocs.io/en/latest/) on a combination of Catalan-English datasets,
|
9 |
+
up to 11 million sentences. Additionally, the model is evaluated on several public datasecomprising 5 different domains (general, adminstrative, technology,
|
10 |
+
biomedical, and news).
|
11 |
|
12 |
## Intended uses and limitations
|
13 |
|
|
|
27 |
import ctranslate2
|
28 |
import pyonmttok
|
29 |
from huggingface_hub import snapshot_download
|
30 |
+
model_dir = snapshot_download(repo_id="projecte-aina/aina-translator-ca-en", revision="main")
|
31 |
|
32 |
tokenizer=pyonmttok.Tokenizer(mode="none", sp_model_path = model_dir + "/spm.model")
|
33 |
tokenized=tokenizer.tokenize("Benvingut al projecte Aina!")
|
|
|
37 |
print(tokenizer.detokenize(translated[0][0]['tokens']))
|
38 |
```
|
39 |
|
40 |
+
## Limitations and bias
|
41 |
+
At the time of submission, no measures have been taken to estimate the bias and toxicity embedded in the model.
|
42 |
+
However, we are well aware that our models may be biased. We intend to conduct research in these areas in the future, and if completed, this model card will be updated.
|
43 |
+
|
44 |
## Training
|
45 |
|
46 |
### Training data
|
|
|
76 |
|
77 |
### Data preparation
|
78 |
|
79 |
+
All datasets are concatenated and filtered using the [mBERT Gencata parallel filter](https://huggingface.co/projecte-aina/mbert-base-gencata).
|
80 |
+
Before training, the punctuation is normalized using a modified version of the join-single-file.py script from
|
81 |
+
[SoftCatalà](https://github.com/Softcatala/nmt-models/blob/master/data-processing-tools/join-single-file.py)
|
82 |
|
83 |
|
84 |
#### Tokenization
|
85 |
|
86 |
+
All data is tokenized using sentencepiece, using 50 thousand token sentencepiece model learned from the combination of all filtered training data.
|
87 |
+
This model is included.
|
88 |
|
89 |
#### Hyperparameters
|
90 |
|
|
|
118 |
|
119 |
### Variable and metrics
|
120 |
|
121 |
+
We use the BLEU score for evaluation on test sets: [Flores-101](https://github.com/facebookresearch/flores),
|
122 |
+
[TaCon](https://elrc-share.eu/repository/browse/tacon-spanish-constitution-mt-test-set/84a96138b98611ec9c1a00155d02670628f3e6857b0f422abd82abc3795ec8c2/),
|
123 |
+
[United Nations](https://zenodo.org/record/3888414#.Y33-_tLMIW0),
|
124 |
+
[Cybersecurity](https://elrc-share.eu/repository/browse/cyber-mt-test-set/2bd93faab98c11ec9c1a00155d026706b96a490ed3e140f0a29a80a08c46e91e/),
|
125 |
+
[wmt19 biomedical test set](http://www.statmt.org/wmt19/biomedical-translation-task.html),
|
126 |
+
[wmt13 news test set](https://elrc-share.eu/repository/browse/catalan-wmt2013-machine-translation-shared-task-test-set/84a96139b98611ec9c1a00155d0267061a0aa1b62e2248e89aab4952f3c230fc/), [aina aapp]()
|
127 |
|
128 |
### Evaluation results
|
129 |
|
130 |
+
Below are the evaluation results on the machine translation from Catalan to English compared to [Softcatalà](https://www.softcatala.org/) and
|
131 |
+
[Google Translate](https://translate.google.es/?hl=es):
|
132 |
|
133 |
|
134 |
+
| Test set | SoftCatalà | Google Translate | aina-translator-ca-en |
|
135 |
|----------------------|------------|------------------|---------------|
|
136 |
| Spanish Constitution | 35,8 | **43,2** | 40,3 |
|
137 |
| United Nations | 44,4 | **47,4** | 44,8 |
|
|
|
144 |
| wmt 13 news | 37,8 | **39,8** | 39,3 |
|
145 |
| Average | 39,2 | **45,0** | 41,6 |
|
146 |
|
|
|
147 |
## Additional information
|
148 |
|
149 |
### Author
|
150 |
+
The Language Technologies Unit from Barcelona Supercomputing Center.
|
151 |
|
152 |
+
### Contact
|
153 |
+
For further information, please send an email to <langtech@bsc.es>.
|
154 |
|
155 |
### Copyright
|
156 |
+
Copyright(c) 2023 by Language Technologies Unit, Barcelona Supercomputing Center.
|
157 |
|
158 |
+
### License
|
|
|
159 |
[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
160 |
|
161 |
### Funding
|
162 |
+
This work has been promoted and financed by the Generalitat de Catalunya through the [Aina project](https://projecteaina.cat/).
|
163 |
|
164 |
+
### Disclaimer
|
|
|
165 |
|
|
|
166 |
<details>
|
167 |
<summary>Click to expand</summary>
|
168 |
|
169 |
+
The model published in this repository is intended for a generalist purpose and is available to third parties under a permissive Apache License, Version 2.0.
|
170 |
+
|
171 |
+
Be aware that the model may have biases and/or any other undesirable distortions.
|
172 |
+
|
173 |
+
When third parties deploy or provide systems and/or services to other parties using this model (or any system based on it)
|
174 |
+
or become users of the model, they should note that it is their responsibility to mitigate the risks arising from its use and,
|
175 |
+
in any event, to comply with applicable regulations, including regulations regarding the use of Artificial Intelligence.
|
176 |
|
177 |
+
In no event shall the owner and creator of the model (Barcelona Supercomputing Center)
|
178 |
+
be liable for any results arising from the use made by third parties.
|
179 |
|
180 |
+
</details>
|