HateBERT Sexism Classifier (Linear Probing / Freeze All)

This model is a fine-tuned version of GroNLP/hateBERT, trained for multi-class sexism detection on the EXIST 2023 Task 2 dataset.

Experiment Details: freeze_all

This repository contains the Linear Probing variant of our ablation study.

  • Frozen Backbone: All parameters in the base BERT model (model.bert.parameters()) were frozen during training. Only the final classification head was trained. This approach protects the pre-trained weights from catastrophic forgetting and speeds up training.
  • Weighted Loss: Because the EXIST 2023 dataset contains class imbalances, training was conducted using a weighted Cross-Entropy loss function. This ensures the model does not become heavily biased toward the majority class (e.g., Non-sexist) and adequately penalizes errors on the minority classes.

Intended Use

Categorizes English tweets into one of four sexist intentions: 0. - (Non-sexist)

  1. DIRECT (Directly sexist messages)
  2. JUDGEMENTAL (Messages condemning sexist behaviors)
  3. REPORTED (Messages reporting a sexist situation)

Preprocessing

Because HateBERT is built on bert-base-uncased, it automatically lowercases text. If you are keeping preprocessing consistent across your ablation study, ensure your inputs are cleaned accordingly:

  • Replace user mentions (@user) with the token @user
  • Replace URLs with the token http
  • (Handled by tokenizer) Lowercase all text

Evaluation Results (Test Set)

  • Macro F1: 0.3198
  • Precision: 0.3430
  • Recall: 0.3173

How to Use

from transformers import AutoTokenizer, AutoModelForSequenceClassification

repo_id = "francesco-zatto/hateBERT-freeze-all-weighted-L-sexism-detector"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForSequenceClassification.from_pretrained(repo_id)

inputs = tokenizer("Your cleaned tweet text here", return_tensors="pt")
outputs = model(**inputs)
Downloads last month
127
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for francesco-zatto/hateBERT-freeze-all-weighted-L-sexism-detector

Base model

GroNLP/hateBERT
Finetuned
(20)
this model

Collection including francesco-zatto/hateBERT-freeze-all-weighted-L-sexism-detector