readme: ---
  license: apache-2.0
  tags:
  - sexism detector
  datasets:
  - EXIST_Dataset
  
  
  widget:
  - text: "manejas muy bien para ser mujer"
  - text: "En temas políticos hombres y mujeres son iguales"
  - text: "Los ipad son unos equipos electrónicos"
  
  metrics:
  - accuracy
  model-index:
  - name: twitter_sexismo-finetuned-exist2021
    results:
    - task:
        name: Text Classification
        type: text-classification
      dataset:
        name: EXIST Dataset
        type: EXIST Dataset
        args: es
      metrics:
      - name: Accuracy
        type: accuracy
        value: 0.80
      - name: F2
        type: F-measure
        value: 0.89
  ---
  
  # twitter_sexismo-finetuned-exist2021
  
  This model is a fine-tuned version of [pysentimiento/robertuito-base-uncased](https://huggingface.co/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:
  ``` python
  ###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](http://nlp.uned.es/exist2021/), 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 