Update README.md
Browse files
README.md
CHANGED
@@ -1,32 +1,20 @@
|
|
1 |
---
|
2 |
-
license:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
4 |
-
## Projecte Aina’s French-Catalan
|
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 on a combination of Catalan-French datasets, which after filtering and
|
|
|
30 |
|
31 |
## Intended uses and limitations
|
32 |
|
@@ -46,7 +34,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("Bienvenue au projet Aina!")
|
@@ -56,6 +44,10 @@ translated = translator.translate_batch([tokenized[0]])
|
|
56 |
print(tokenizer.detokenize(translated[0][0]['tokens']))
|
57 |
```
|
58 |
|
|
|
|
|
|
|
|
|
59 |
## Training
|
60 |
|
61 |
### Training data
|
@@ -78,12 +70,15 @@ The model was trained on a combination of the following datasets:
|
|
78 |
|
79 |
### Data preparation
|
80 |
|
81 |
-
All datasets are deduplicated and filtered to remove any sentence pairs with a cosine similarity of less than 0.75.
|
82 |
-
|
|
|
|
|
83 |
|
84 |
#### Tokenization
|
85 |
|
86 |
-
All data is tokenized using sentencepiece, with 50 thousand token sentencepiece model learned from the combination of all filtered training data.
|
|
|
87 |
|
88 |
#### Hyperparameters
|
89 |
|
@@ -111,19 +106,21 @@ The following hyperparamenters were set on the Fairseq toolkit:
|
|
111 |
| Dropout | 0.1 |
|
112 |
| Label smoothing | 0.1 |
|
113 |
|
114 |
-
The model was trained using shards of 10 million sentences, for a total of 8.548 updates.
|
|
|
115 |
|
116 |
## Evaluation
|
117 |
|
118 |
### Variable and metrics
|
119 |
|
120 |
-
We use the BLEU score for evaluation on
|
121 |
|
122 |
### Evaluation results
|
123 |
|
124 |
-
Below are the evaluation results on the machine translation from French to Catalan compared to [Softcatalà](https://www.softcatala.org/) and
|
|
|
125 |
|
126 |
-
| Test set | SoftCatalà | Google Translate |
|
127 |
|----------------------|------------|------------------|---------------|
|
128 |
| Flores 101 dev | 30,9 | **37,0** | 33,0 |
|
129 |
| Flores 101 devtest | 31,3 | **37,1** | 34,4 |
|
@@ -133,27 +130,34 @@ Below are the evaluation results on the machine translation from French to Catal
|
|
133 |
## Additional information
|
134 |
|
135 |
### Author
|
136 |
-
Language Technologies Unit
|
137 |
|
138 |
-
### Contact
|
139 |
-
For further information, send an email to <langtech@bsc.es
|
140 |
|
141 |
### Copyright
|
142 |
-
Copyright Language Technologies Unit
|
143 |
|
144 |
-
###
|
145 |
-
|
146 |
|
147 |
### Funding
|
148 |
-
This work has been promoted and financed by the Generalitat de Catalunya through the [Aina project]
|
149 |
-
|
150 |
-
## Limitations and Bias
|
151 |
-
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.
|
152 |
|
153 |
### Disclaimer
|
154 |
|
155 |
<details>
|
156 |
<summary>Click to expand</summary>
|
157 |
|
158 |
-
The
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
</details>
|
|
|
1 |
---
|
2 |
+
license: apache-2.0
|
3 |
+
datasets:
|
4 |
+
- projecte-aina/CA-FR_Parallel_Corpus
|
5 |
+
language:
|
6 |
+
- fr
|
7 |
+
- ca
|
8 |
+
metrics:
|
9 |
+
- bleu
|
10 |
+
library_name: fairseq
|
11 |
---
|
12 |
+
## Projecte Aina’s French-Catalan machine translation model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
## Model description
|
15 |
|
16 |
+
This model was trained from scratch using the Fairseq toolkit on a combination of Catalan-French datasets, which after filtering and
|
17 |
+
cleaning comprised 18.634.844 sentence pairs. The model is evaluated on the Flores and NTREX evaluation sets.
|
18 |
|
19 |
## Intended uses and limitations
|
20 |
|
|
|
34 |
import ctranslate2
|
35 |
import pyonmttok
|
36 |
from huggingface_hub import snapshot_download
|
37 |
+
model_dir = snapshot_download(repo_id="projecte-aina/aina-translator-fr-ca", revision="main")
|
38 |
|
39 |
tokenizer=pyonmttok.Tokenizer(mode="none", sp_model_path = model_dir + "/spm.model")
|
40 |
tokenized=tokenizer.tokenize("Bienvenue au projet Aina!")
|
|
|
44 |
print(tokenizer.detokenize(translated[0][0]['tokens']))
|
45 |
```
|
46 |
|
47 |
+
## Limitations and bias
|
48 |
+
At the time of submission, no measures have been taken to estimate the bias and toxicity embedded in the model.
|
49 |
+
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.
|
50 |
+
|
51 |
## Training
|
52 |
|
53 |
### Training data
|
|
|
70 |
|
71 |
### Data preparation
|
72 |
|
73 |
+
All datasets are deduplicated and filtered to remove any sentence pairs with a cosine similarity of less than 0.75.
|
74 |
+
This is done using sentence embeddings calculated using [LaBSE](https://huggingface.co/sentence-transformers/LaBSE).
|
75 |
+
The filtered datasets are then concatenated to form a final corpus of 6.159.631 and before training the punctuation is normalized using a
|
76 |
+
modified version of the join-single-file.py script from [SoftCatalà](https://github.com/Softcatala/nmt-models/blob/master/data-processing-tools/join-single-file.py).
|
77 |
|
78 |
#### Tokenization
|
79 |
|
80 |
+
All data is tokenized using sentencepiece, with 50 thousand token sentencepiece model learned from the combination of all filtered training data.
|
81 |
+
This model is included.
|
82 |
|
83 |
#### Hyperparameters
|
84 |
|
|
|
106 |
| Dropout | 0.1 |
|
107 |
| Label smoothing | 0.1 |
|
108 |
|
109 |
+
The model was trained using shards of 10 million sentences, for a total of 8.548 updates.
|
110 |
+
Weights were saved every 1000 updates and reported results are the average of the last 8 checkpoints.
|
111 |
|
112 |
## Evaluation
|
113 |
|
114 |
### Variable and metrics
|
115 |
|
116 |
+
We use the BLEU score for evaluation on the [Flores-101](https://github.com/facebookresearch/flores) and [NTREX](https://github.com/MicrosoftTranslator/NTREX) test sets.
|
117 |
|
118 |
### Evaluation results
|
119 |
|
120 |
+
Below are the evaluation results on the machine translation from French to Catalan compared to [Softcatalà](https://www.softcatala.org/) and
|
121 |
+
[Google Translate](https://translate.google.es/?hl=es):
|
122 |
|
123 |
+
| Test set | SoftCatalà | Google Translate | aina-translator-fr-ca |
|
124 |
|----------------------|------------|------------------|---------------|
|
125 |
| Flores 101 dev | 30,9 | **37,0** | 33,0 |
|
126 |
| Flores 101 devtest | 31,3 | **37,1** | 34,4 |
|
|
|
130 |
## Additional information
|
131 |
|
132 |
### Author
|
133 |
+
The Language Technologies Unit from Barcelona Supercomputing Center.
|
134 |
|
135 |
+
### Contact
|
136 |
+
For further information, please send an email to <langtech@bsc.es>.
|
137 |
|
138 |
### Copyright
|
139 |
+
Copyright(c) 2023 by Language Technologies Unit, Barcelona Supercomputing Center.
|
140 |
|
141 |
+
### License
|
142 |
+
[Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
143 |
|
144 |
### Funding
|
145 |
+
This work has been promoted and financed by the Generalitat de Catalunya through the [Aina project](https://projecteaina.cat/).
|
|
|
|
|
|
|
146 |
|
147 |
### Disclaimer
|
148 |
|
149 |
<details>
|
150 |
<summary>Click to expand</summary>
|
151 |
|
152 |
+
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.
|
153 |
+
|
154 |
+
Be aware that the model may have biases and/or any other undesirable distortions.
|
155 |
+
|
156 |
+
When third parties deploy or provide systems and/or services to other parties using this model (or any system based on it)
|
157 |
+
or become users of the model, they should note that it is their responsibility to mitigate the risks arising from its use and,
|
158 |
+
in any event, to comply with applicable regulations, including regulations regarding the use of Artificial Intelligence.
|
159 |
+
|
160 |
+
In no event shall the owner and creator of the model (Barcelona Supercomputing Center)
|
161 |
+
be liable for any results arising from the use made by third parties.
|
162 |
+
|
163 |
</details>
|