Andresmfs commited on
Commit
e8f2adf
1 Parent(s): 1582803

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +29 -110
README.md CHANGED
@@ -21,7 +21,7 @@ Spanish is not the exception to that. For instance, when we say “los alumnos
21
 
22
  In response to these linguistic challenges, this model offers a way to construct inclusive alternatives in accordance with official guidelines on inclusive language from various Spanish speaking countries. Its purpose is to provide grammatically correct and inclusive solutions to situations where our language choices might otherwise be exclusive.
23
  By rectifying biases ingrained in language and fostering inclusivity, it combats discrimination, amplifies the visibility of marginalized groups, and contributes to the cultivation of a more inclusive and respectful society.
24
- This is a tool that contributes to the fifth of the Sustainable Development Goals: Achieve gender equality and empower all women and girls.
25
 
26
  The model works in such a way that, given an input text, it returns the original text rewritten using inclusive language.
27
 
@@ -32,7 +32,7 @@ It achieves the following results on the validation set:
32
 
33
  ### Model Description
34
 
35
- - **Developed by:** Andrés Martínez Fernández-Salguero, Imanuel Rozenberg, Gaia Quintana Fleitas, Miguel López Pérez y Josué Sauca
36
  - **Funded by:** SomosNLP, HuggingFace
37
  - **Model type:** Language model, instruction tuned
38
  - **Language(s):** Spanish (`es-ES`, `es-AR`, `es-MX`, `es-CR`, `es-CL`)
@@ -41,40 +41,24 @@ It achieves the following results on the validation set:
41
  - **Dataset used:** [somosnlp/es-inclusive-language](https://huggingface.co/datasets/somosnlp/es-inclusive-language)
42
 
43
  ### Model Sources
44
-
45
  - **Repository:** https://github.com/Andresmfs/Traductor_inclusivo
46
  - **Demo:** https://huggingface.co/spaces/somosnlp/es-inclusive-language-demo
47
  - **Video presentation:** https://www.youtube.com/watch?v=7rrNGJIXEHU
48
 
49
 
50
  ## Uses
51
-
52
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
53
-
54
  ### Direct Use
55
-
56
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
57
-
58
  The general uses of this model are adaptations of texts in Spanish to inclusive language.
59
 
60
- It can be used to adapt news, blogposts, emails and official documents among others.
61
-
62
- ### Downstream Use [optional]
63
-
64
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
65
-
66
- [More Information Needed]
67
 
68
  ### Out-of-Scope Use
 
 
 
69
 
70
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
71
-
72
- [More Information Needed]
73
 
74
  ## Bias, Risks, and Limitations
75
-
76
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
77
-
78
  - Model has not been trained on long-complex texts.
79
  - Model has been trained mostly with sentences where the terms to be modified are at the beginning of the sentence.
80
  - Model returns only one translation option when several might also be adequate.
@@ -87,14 +71,9 @@ It can be used to adapt news, blogposts, emails and official documents among oth
87
 
88
 
89
  ### Recommendations
90
-
91
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
92
-
93
- <!-- Example: Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations. -->
94
  Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
95
 
96
  ## How to Get Started with the Model
97
-
98
  Use the code below to get started with the model in 16-bits.
99
 
100
  ```python
@@ -219,28 +198,14 @@ print(translate_es_inclusivo(input_text))
219
 
220
  ## Training Details
221
  ### Training Data
222
-
223
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
224
-
225
  Train, validation and test data splits can be found in [somosnlp/es-inclusive-language](https://huggingface.co/datasets/somosnlp/es-inclusive-language)
226
 
227
  ### Training Procedure
228
-
229
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
230
-
231
- <!-- Detallar la técnica de entrenamiento utilizada y enlazar los scripts/notebooks. -->
232
-
233
  For training we used QLoRA technique in 4-bits and rank 8
234
 
235
  Find the training script [here](https://github.com/Andresmfs/Traductor_inclusivo/tree/master)
236
 
237
- #### Preprocessing [optional]
238
-
239
- [More Information Needed]
240
-
241
  #### Training Hyperparameters
242
-
243
- <!-- Enumerar los valores de los hiperparámetros de entrenamiento. -->
244
  The following hyperparameters were used during training:
245
  - **learning_rate:** 0.0001
246
  - **train_batch_size:** 8
@@ -251,94 +216,56 @@ The following hyperparameters were used during training:
251
  - **num_epochs:** 10
252
  - **Training regime:** fp16 mixed precision
253
 
254
- #### Speeds, Sizes, Times [optional]
255
-
256
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
257
-
258
- [More Information Needed]
259
 
 
 
 
 
 
 
 
 
 
 
 
 
260
 
261
  ## Evaluation
262
-
263
- <!-- This section describes the evaluation protocols and provides the results. -->
264
-
265
  ### Testing Data, Factors & Metrics
266
-
267
  #### Testing Data
268
  Here you can find the [validation set](https://huggingface.co/datasets/somosnlp/es-inclusive-language/viewer/default/validation) used during training.
269
  Here you can find the [test set](https://huggingface.co/datasets/somosnlp/es-inclusive-language/viewer/default/test) used for evaluating model errors.
270
 
271
- #### Factors
272
-
273
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
274
-
275
- [More Information Needed]
276
-
277
  #### Metrics
278
-
279
  For test evaluation it has been used a weighted harmonic mean of metrics [bleurt](https://huggingface.co/spaces/evaluate-metric/bleurt) (60%) and [Sacrebleu](https://huggingface.co/spaces/evaluate-metric/sacrebleu) (40%).
280
 
281
  In _Sacrebleu_ metric grammatical correctness carries high weight compared to the actual words used, whereas in _Bleurt_ metric the actual words used have higher weight over grammatical correctness.
282
  Combining both metrics, we account for a grammatically correct prediction together with the use of the required specific words.
283
 
284
  ### Results
285
-
286
- <!-- Enlazar aquí los scripts/notebooks de evaluación y especificar los resultados. -->
287
-
288
- | Training Loss | Epoch | Step | Validation Loss |
289
- |:-------------:|:-----:|:----:|:---------------:|
290
- | No log | 1.0 | 402 | 0.8020 |
291
- | 1.0274 | 2.0 | 804 | 0.7019 |
292
- | 0.6745 | 3.0 | 1206 | 0.6515 |
293
- | 0.5826 | 4.0 | 1608 | 0.6236 |
294
- | 0.5104 | 5.0 | 2010 | 0.6161 |
295
- | 0.5104 | 6.0 | 2412 | 0.6149 |
296
- | 0.4579 | 7.0 | 2814 | 0.6030 |
297
- | 0.4255 | 8.0 | 3216 | 0.6151 |
298
- | 0.3898 | 9.0 | 3618 | 0.6209 |
299
- | 0.3771 | 10.0 | 4020 | 0.6292 |
300
-
301
  On [this notebook](https://github.com/Andresmfs/Traductor_inclusivo/blob/master/Error%20analysis.ipynb) you can find the results of the test evaluation.
302
 
303
  We get an average score of 68.4 (measured with the above described metric).
304
  Due to the existence of equivalent language formulas (these are inclusive language formulas that can be used indistinctly and the choice of a formula over the other is rather a stylistic decision than a language correctness decision) it is possible to argue that the real score of the model is higher.
305
 
306
- ## Model Examination [optional]
307
-
308
- <!-- Relevant interpretability work for the model goes here. -->
309
-
310
- [More Information Needed]
311
-
312
  ## Environmental Impact
313
-
314
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly. -->
315
-
316
- <!-- Rellenar la información de la lista y calcular las emisiones con la página mencionada. -->
317
-
318
  Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
319
 
320
  - **Hardware Type:** Nvidia T4 medium (8 vCPU, 30 Gb RAM, 16 Gb VRAM)
321
  - **Hours used:** 3 hours
322
  - **Cloud Provider:** Google Cloud Platform
323
- - **Compute Region:** [More Information Needed]
324
- - **Carbon Emitted:** [More Information Needed]
325
-
326
- ## Technical Specifications [optional]
327
-
328
- <!-- Esta sección es opcional porque seguramente ya habéis mencionado estos detalles más arriba, igualmente está bien incluirlos aquí de nuevo como bullet points a modo de resumen. -->
329
 
 
330
  ### Model Architecture and Objective
331
-
332
- [More Information Needed]
333
 
334
  ### Compute Infrastructure
335
-
336
- [More Information Needed]
337
-
338
  #### Hardware
339
-
340
- <!-- Indicar el hardware utilizado, podéis agradecer aquí a quien lo patrocinó. -->
341
- Hardware used was Nvidia T4 medium (8 vCPU, 30 Gb RAM, 16 Gb VRAM) patrocinated by Hugging Face
342
 
343
  #### Software
344
  - Transformers 4.30.0
@@ -348,9 +275,7 @@ Hardware used was Nvidia T4 medium (8 vCPU, 30 Gb RAM, 16 Gb VRAM) patrocinated
348
  - Peft
349
 
350
  ## License
351
- <!-- Indicar bajo qué licencia se libera el modelo explicando, si no es apache 2.0, a qué se debe la licencia más restrictiva (i.e. herencia de las licencias del modelo pre-entrenado o de los datos utilizados). -->
352
  Creative Commons (cc-by-nc-sa-4.0)
353
-
354
  This kind of license is inherited from dataset used for training.
355
 
356
  ## Citation
@@ -375,24 +300,18 @@ This kind of license is inherited from dataset used for training.
375
 
376
 
377
 
378
- ## Glossary [optional]
379
-
380
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
381
-
382
  ## More Information
383
-
384
- <!-- Indicar aquí que el marco en el que se desarrolló el proyecto, en esta sección podéis incluir agradecimientos y más información sobre los miembros del equipo. Podéis adaptar el ejemplo a vuestro gusto. -->
385
-
386
  This project was developed during the [Hackathon #Somos600M](https://somosnlp.org/hackathon) organized by SomosNLP. The model was trained using GPUs sponsored by HuggingFace.
387
 
388
  **Team:**
389
  - [**Andrés Martínez Fernández-Salguero**](https://huggingface.co/Andresmfs)
390
  - **Imanuel Rozenberg**
391
- - **Gaia Quintana Fleitas**
392
- - **Miguel López Pérez**
393
  - **Josué Sauca**
394
 
395
  ## Contact
396
 
397
  - [**Andrés Martínez Fernández-Salguero**](www.linkedin.com/in/andrés-martínez-fernández-salguero-725674214) ([email protected])
398
- - [**Gaia Quintana Fleitas**](https://www.linkedin.com/in/gaiaquintana/) ([email protected])
 
 
21
 
22
  In response to these linguistic challenges, this model offers a way to construct inclusive alternatives in accordance with official guidelines on inclusive language from various Spanish speaking countries. Its purpose is to provide grammatically correct and inclusive solutions to situations where our language choices might otherwise be exclusive.
23
  By rectifying biases ingrained in language and fostering inclusivity, it combats discrimination, amplifies the visibility of marginalized groups, and contributes to the cultivation of a more inclusive and respectful society.
24
+ This is a tool that contributes to the Sustainable Development Goals number five (_Achieve gender equality and empower all women and girls_) and ten (_Reduce inequality within and among countries_).
25
 
26
  The model works in such a way that, given an input text, it returns the original text rewritten using inclusive language.
27
 
 
32
 
33
  ### Model Description
34
 
35
+ - **Developed by:** Andrés Martínez Fernández-Salguero, Imanuel Rozenberg, Gaia Quintana Fleitas, Miguel López Pérez and Josué Sauca
36
  - **Funded by:** SomosNLP, HuggingFace
37
  - **Model type:** Language model, instruction tuned
38
  - **Language(s):** Spanish (`es-ES`, `es-AR`, `es-MX`, `es-CR`, `es-CL`)
 
41
  - **Dataset used:** [somosnlp/es-inclusive-language](https://huggingface.co/datasets/somosnlp/es-inclusive-language)
42
 
43
  ### Model Sources
 
44
  - **Repository:** https://github.com/Andresmfs/Traductor_inclusivo
45
  - **Demo:** https://huggingface.co/spaces/somosnlp/es-inclusive-language-demo
46
  - **Video presentation:** https://www.youtube.com/watch?v=7rrNGJIXEHU
47
 
48
 
49
  ## Uses
 
 
 
50
  ### Direct Use
 
 
 
51
  The general uses of this model are adaptations of texts in Spanish to inclusive language.
52
 
53
+ It can be used mainly to adapt news, blogposts, emails and official documents among others.
 
 
 
 
 
 
54
 
55
  ### Out-of-Scope Use
56
+ This model is specifically designed for translating Spanish texts to Spanish texts in inclusive language.
57
+ Using the model for unrelated tasks is considered out of scope.
58
+ This model can not be used with commercial purposes, it is intended for research or educational purposes only.
59
 
 
 
 
60
 
61
  ## Bias, Risks, and Limitations
 
 
 
62
  - Model has not been trained on long-complex texts.
63
  - Model has been trained mostly with sentences where the terms to be modified are at the beginning of the sentence.
64
  - Model returns only one translation option when several might also be adequate.
 
71
 
72
 
73
  ### Recommendations
 
 
 
 
74
  Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
75
 
76
  ## How to Get Started with the Model
 
77
  Use the code below to get started with the model in 16-bits.
78
 
79
  ```python
 
198
 
199
  ## Training Details
200
  ### Training Data
 
 
 
201
  Train, validation and test data splits can be found in [somosnlp/es-inclusive-language](https://huggingface.co/datasets/somosnlp/es-inclusive-language)
202
 
203
  ### Training Procedure
 
 
 
 
 
204
  For training we used QLoRA technique in 4-bits and rank 8
205
 
206
  Find the training script [here](https://github.com/Andresmfs/Traductor_inclusivo/tree/master)
207
 
 
 
 
 
208
  #### Training Hyperparameters
 
 
209
  The following hyperparameters were used during training:
210
  - **learning_rate:** 0.0001
211
  - **train_batch_size:** 8
 
216
  - **num_epochs:** 10
217
  - **Training regime:** fp16 mixed precision
218
 
219
+ #### Speeds, Sizes, Times
220
+ The model was trained in 10 epochs with a total duration of 2hours and 54 minutes.
 
 
 
221
 
222
+ | Training Loss | Epoch | Step | Validation Loss |
223
+ |:-------------:|:-----:|:----:|:---------------:|
224
+ | No log | 1.0 | 402 | 0.8020 |
225
+ | 1.0274 | 2.0 | 804 | 0.7019 |
226
+ | 0.6745 | 3.0 | 1206 | 0.6515 |
227
+ | 0.5826 | 4.0 | 1608 | 0.6236 |
228
+ | 0.5104 | 5.0 | 2010 | 0.6161 |
229
+ | 0.5104 | 6.0 | 2412 | 0.6149 |
230
+ | 0.4579 | 7.0 | 2814 | 0.6030 |
231
+ | 0.4255 | 8.0 | 3216 | 0.6151 |
232
+ | 0.3898 | 9.0 | 3618 | 0.6209 |
233
+ | 0.3771 | 10.0 | 4020 | 0.6292 |
234
 
235
  ## Evaluation
 
 
 
236
  ### Testing Data, Factors & Metrics
 
237
  #### Testing Data
238
  Here you can find the [validation set](https://huggingface.co/datasets/somosnlp/es-inclusive-language/viewer/default/validation) used during training.
239
  Here you can find the [test set](https://huggingface.co/datasets/somosnlp/es-inclusive-language/viewer/default/test) used for evaluating model errors.
240
 
 
 
 
 
 
 
241
  #### Metrics
 
242
  For test evaluation it has been used a weighted harmonic mean of metrics [bleurt](https://huggingface.co/spaces/evaluate-metric/bleurt) (60%) and [Sacrebleu](https://huggingface.co/spaces/evaluate-metric/sacrebleu) (40%).
243
 
244
  In _Sacrebleu_ metric grammatical correctness carries high weight compared to the actual words used, whereas in _Bleurt_ metric the actual words used have higher weight over grammatical correctness.
245
  Combining both metrics, we account for a grammatically correct prediction together with the use of the required specific words.
246
 
247
  ### Results
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  On [this notebook](https://github.com/Andresmfs/Traductor_inclusivo/blob/master/Error%20analysis.ipynb) you can find the results of the test evaluation.
249
 
250
  We get an average score of 68.4 (measured with the above described metric).
251
  Due to the existence of equivalent language formulas (these are inclusive language formulas that can be used indistinctly and the choice of a formula over the other is rather a stylistic decision than a language correctness decision) it is possible to argue that the real score of the model is higher.
252
 
 
 
 
 
 
 
253
  ## Environmental Impact
 
 
 
 
 
254
  Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
255
 
256
  - **Hardware Type:** Nvidia T4 medium (8 vCPU, 30 Gb RAM, 16 Gb VRAM)
257
  - **Hours used:** 3 hours
258
  - **Cloud Provider:** Google Cloud Platform
259
+ - **Compute Region:** europe-west
260
+ - **Carbon Emitted:** 0.13 kg CO2 eq.
 
 
 
 
261
 
262
+ ## Technical Specifications
263
  ### Model Architecture and Objective
264
+ The base model is [projecte-aina/aguila-7b](https://huggingface.co/projecte-aina/aguila-7b) finetuned in 4-bit.
 
265
 
266
  ### Compute Infrastructure
 
 
 
267
  #### Hardware
268
+ Hardware used was Nvidia T4 medium (8 vCPU, 30 Gb RAM, 16 Gb VRAM) funded by Hugging Face
 
 
269
 
270
  #### Software
271
  - Transformers 4.30.0
 
275
  - Peft
276
 
277
  ## License
 
278
  Creative Commons (cc-by-nc-sa-4.0)
 
279
  This kind of license is inherited from dataset used for training.
280
 
281
  ## Citation
 
300
 
301
 
302
 
 
 
 
 
303
  ## More Information
 
 
 
304
  This project was developed during the [Hackathon #Somos600M](https://somosnlp.org/hackathon) organized by SomosNLP. The model was trained using GPUs sponsored by HuggingFace.
305
 
306
  **Team:**
307
  - [**Andrés Martínez Fernández-Salguero**](https://huggingface.co/Andresmfs)
308
  - **Imanuel Rozenberg**
309
+ - [**Gaia Quintana Fleitas**](https://huggingface.co/gaiaquintana)
310
+ - [**Miguel López Pérez**](https://huggingface.co/Wizmik12)
311
  - **Josué Sauca**
312
 
313
  ## Contact
314
 
315
  - [**Andrés Martínez Fernández-Salguero**](www.linkedin.com/in/andrés-martínez-fernández-salguero-725674214) ([email protected])
316
+ - [**Gaia Quintana Fleitas**](https://www.linkedin.com/in/gaiaquintana/) ([email protected])
317
+ - [**Miguel López Pérez**](https://www.linkedin.com/in/miguel-lopez-perezz/)