HateBERT Sexism Classifier (Freeze Embeddings / Unweighted Loss)

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_embeddings

This repository contains the Freeze Embeddings variant of our ablation study.

  • Frozen Embeddings: Only the base embedding layer (model.bert.embeddings.parameters()) was frozen during training. All subsequent transformer encoder layers and the classification head were fully fine-tuned. This allows the model to learn task-specific attention patterns while anchoring the fundamental word representations.
  • Standard Loss: Training was conducted using a standard (unweighted) Cross-Entropy loss function to establish a baseline for how the architecture handles the natural class imbalances present in the EXIST dataset.

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.4391
  • Precision: 0.4461
  • Recall: 0.5500

How to Use

from transformers import AutoTokenizer, AutoModelForSequenceClassification

repo_id = "francesco-zatto/hateBERT-freeze-embeddings-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
109
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-embeddings-sexism-detector

Base model

GroNLP/hateBERT
Finetuned
(20)
this model

Collection including francesco-zatto/hateBERT-freeze-embeddings-sexism-detector