Edit model card
YAML Metadata Error: "model-index[0].results[0].dataset.type" with value "EXIST Dataset" fails to match the required pattern: /^(?:[\w-]+\/)?[\w-.]+$/

twitter_sexismo-finetuned-exist2021

This model is a fine-tuned version of pysentimiento/robertuito-base-uncased on the EXIST dataset

It achieves the following results on the evaluation set:

  • Loss: 0.47
  • Accuracy: 0.80
  • F1: 0.83
  • F2: 0.89

Model description

Model for the 'Somos NLP' Hackathon for detecting sexism in twitters in Spanish. Created by:

  • medardodt
  • MariaIsabel
  • ManRo
  • lucel172
  • robertou2

Intended uses & limitations

More information needed

Training and evaluation data

More information needed

Training procedure

The model has been trained to get the best F2 score.The F-measure is calculated as the harmonic mean of precision and recall, giving each the same weighting. It allows a model to be evaluated taking both the precision and recall into account using a single score, which is helpful when describing the performance of the model and in comparing models. The Fbeta-measure is a generalization of the F-measure that adds a configuration parameter called beta. A default beta value is 1.0, which is the same as the F-measure. A smaller beta value, such as 0.5, gives more weight to precision and less to recall, whereas a larger beta value, such as 2.0, gives less weight to precision and more weight to recall in the calculation of the score. It is a useful metric to use when both precision and recall are important but slightly more attention is needed on one or the other, such as when false negatives are more important than false positives, or the reverse.F2-measure puts more attention on minimizing false negatives. We want to detect the sexist comments.

Training hyperparameters

The following hyperparameters were used during training:

  • my_learning_rate = 5E-5
  • my_adam_epsilon = 1E-8
  • my_number_of_epochs = 8
  • my_warmup = 3
  • my_mini_batch_size = 32
  • optimizer: AdamW with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • num_epochs: 8

Training results

Epoch T. Loss V. Loss Accuracy F1 Precision Recall F2

1 0.478700 0.443148 0.804386 0.830160 0.750689 0.928450 0.886467

2 0.298000 0.460549 0.823684 0.841107 0.784661 0.906303 0.879048

3 0.063600 0.706177 0.817544 0.829508 0.799368 0.862010 0.848708

4 0.078700 1.060862 0.816667 0.836078 0.774709 0.908007 0.877800

5 0.005900 1.069239 0.808772 0.821604 0.790551 0.855196 0.841435

6 0.008300 1.184729 0.808772 0.821604 0.790551 0.855196 0.841435

7 0.001400 1.238865 0.816667 0.829388 0.796238 0.865417 0.850636

8 0.000100 1.267197 0.815789 0.827303 0.799682 0.856899 0.844810

9 0.000100 1.267815 0.808772 0.818937 0.799028 0.839864 0.831366

10 0.000300 1.275827 0.807895 0.818257 0.797735 0.839864 0.831086

Framework versions

  • Transformers 4.17.0
  • Pytorch 1.10.0+cu111
  • Tokenizers 0.11.6

Model in Action

Fast usage with pipelines:

###libraries required
!pip install transformers
from transformers import pipeline

### usage pipelines
model_checkpoint = "robertou2/twitter_sexismo-finetuned-robertuito-exist2021" 
pipeline_nlp = pipeline("text-classification", model=model_checkpoint)
pipeline_nlp("mujer al volante peligro!") 
#pipeline_nlp("¡me encanta el ipad!") 
#pipeline_nlp (["mujer al volante peligro!", "Los hombre tienen más manias que las mujeres", "me encanta el ipad!"] )

# OUTPUT MODEL #
# LABEL_0: "NON SEXISM"or LABEL_1: "SEXISM"  and score: probability of accuracy per model.

# [{'label': 'LABEL_1', 'score': 0.9967633485794067}]
# [{'label': 'LABEL_0', 'score': 0.9934417009353638}]

#[{‘label': 'LABEL_1', 'score': 0.9967633485794067},
# {'label': 'LABEL_1', 'score': 0.9755664467811584},
# {'label': 'LABEL_0', 'score': 0.9955045580863953}]

More Information Process

Retos

Uno de los principales retos que se encontró en este proceso ha sido disponer de un dataset en español. Se ha logrado conseguir (previa solicitud) el dataset utilizado en EXIST:sEXism Identification in Social neTworks, el cual fue un gran punto de partida para comenzar con el modelo. Lamentablemente este un dataset presenta limitaciones debido a licencias y políticas para ser compartido libremente. Este dataset incorpora cualquier tipo de expresión sexista o fenómenos relacionados, incluidas las afirmaciones descriptivas o informadas donde el mensaje sexista es un informe o una descripción de un comportamiento sexista. se han utilizado los 3,541 tweets etiquetados en español. Luego se logró disponer de otro dataset en español MeTwo: Machismo and Sexism Twitter Identification dataset. Este dataset contiene los id de cada tweet con su etiqueta respectiva, lo que nos permitió obtener el texto del tweet e incrementar el dataset original. Un desafío ha sido iniciar los procesos de finetuned en las prueba, esto pues se dispone de diversas variables para validar y testear (desde modelos como: BETO o Roberta, hasta hiperparámetros: como learning rate), y solo se disponede un plazo acotado de dos semanas, además de la curva de aprendizaje. Para este desafío, se han basado las primeras pruebas en los parámetros presentados por de Paula et al. (2021), lo cual brindó un punto de partida y un reto a vencer, el 0.790 de accuracy obtenidos por el trabajo previo en la identificación de tweets sexistas en español. En este ámbito se realizaron diversas pruebas en paralelo para encontrar el mejor modelo. Luego de un proceso colaborativo de finetuned se ha logrado obtener un 83% de accuracy.

Trabajos Futuros

Se propone incrementar el dataset desarrollado. Para esto es posible descargar cantidades superiores de tweets en español y aplicar técnicas de active learning para obtener un grupo reducido de tweets a etiquetar vía crowdsourcing, y en donde estos datos etiquetados puedan servir para etiquetar el resto. También se pueden utilizar técnicas de Data Augmentation, para duplicar y extender el dataset. Realizar más pruebas con otros modelos y mejorar el modelo es otro reto que se propone como trabajos futuros.

Posibles Aplicaciones

Primero es sumamente importante dar mayor visibilidad al problema de sexismo en redes sociales, principalmente en español. El proceso de Transfer Learning logra reutilizar y aprovechar modelos previamente entrenados, y lo que se desea es que nuevos grupos de investigación, estudiantes, etc. utilicen la base del actual modelo para desarrollar los propios y crear un mejor modelo. De esta manera, se podría construir una herramienta que pueda identificar en tiempo real los tweets sexistas y eliminarlos antes de su propagación.

Referencias

1 de Paula, A. F. M., da Silva, R. F., & Schlicht, I. B. (2021). Sexism Prediction in Spanish and English Tweets Using Monolingual and Multilingual BERT and Ensemble Models. arXiv preprint arXiv:2111.04551.

Rodríguez-Sánchez, F., Carrillo-de-Albornoz, J., Plaza, L., Gonzalo, J., Rosso, P., Comet, M., & Donoso, T. (2021). Overview of exist 2021: sexism identification in social networks. Procesamiento del Lenguaje Natural, 67, 195-207.

Downloads last month
53
Safetensors
Model size
109M params
Tensor type
I64
·
F32
·

Spaces using hackathon-pln-es/twitter_sexismo-finetuned-robertuito-exist2021 5

Collections including hackathon-pln-es/twitter_sexismo-finetuned-robertuito-exist2021

Evaluation results

Model card error

This model's model-index metadata is invalid: Schema validation error. "model-index[0].results[0].dataset.type" with value "EXIST Dataset" fails to match the required pattern: /^(?:[\w-]+\/)?[\w-.]+$/