💡 This model is part of the collection Frontier BERT Workhorses.

banner

Overview

This model was fine-tuned from UltraBERT-380M on a synthetic dataset of biased statements and questions, generated by Mistral 7B as part of the GUS-Net paper. The model is designed to identify and classify text bias into multiple categories, including racial, religious, gender, age, and other biases, making it a valuable tool for bias detection and mitigation in natural language processing tasks.


Model Details

  • Base Model: UltraBERT-380M
  • Fine-Tuning Dataset: Synthetic biased corpus
  • Number of Labels: 11
  • Problem Type: Multi-label classification
  • Language: English
  • License: Apache 2.0
  • Fine-Tuning Framework: Hugging Face Transformers

Example Usage

Here’s how to use the model with Hugging Face Transformers:

# requires transformers>=5.2:  pip install -U "transformers>=5.2"
from transformers import pipeline

# Load the model
classifier = pipeline(
    "text-classification",
    model="cirimus/ultrabert-380M-bias-type-classifier",
    top_k=None,
    trust_remote_code=True
)

text = "Tall people are so clumsy."
predictions = classifier(text)

# Print predictions
for pred in sorted(predictions[0], key=lambda x: x['score'], reverse=True)[:5]:
    print(f"{pred['label']}: {pred['score']:.3f}")

# Output:
# physical: 1.000
# gender: 0.002
# age: 0.000
# socioeconomic: 0.000
# disability: 0.000

How the Model Was Created

The model was fine-tuned for bias detection using the following hyperparameters:

  • Learning Rate: 2e-5
  • Batch Size: 16
  • Weight Decay: 0.01
  • Warmup Steps: 0
  • Optimizer: AdamW
  • Evaluation Metrics: Precision, Recall, F1 Score (weighted), Accuracy

Dataset

The synthetic dataset consists of biased statements and questions generated by Mistral 7B as part of the GUS-Net paper. It covers 11 bias categories:

  1. Racial
  2. Religious
  3. Gender
  4. Age
  5. Nationality
  6. Sexuality
  7. Socioeconomic
  8. Educational
  9. Disability
  10. Political
  11. Physical

Evaluation Results

The model was evaluated on the synthetic dataset’s test split. The overall metrics using a threshold of 0.5 are as follows:

Macro Averages:

Metric Value
Accuracy 0.984
Precision 0.942
Recall 0.910
F1 0.925
MCC 0.916

Per-Label Results:

Label Accuracy Precision Recall F1 MCC Support Threshold
Racial 0.975 0.889 0.863 0.876 0.862 388 0.5
Religious 0.994 0.967 0.967 0.967 0.964 335 0.5
Gender 0.980 0.959 0.915 0.937 0.925 615 0.5
Age 0.990 0.947 0.949 0.948 0.942 375 0.5
Nationality 0.975 0.944 0.886 0.914 0.901 554 0.5
Sexuality 0.995 0.980 0.957 0.968 0.965 301 0.5
Socioeconomic 0.960 0.875 0.829 0.852 0.829 516 0.5
Educational 0.982 0.902 0.891 0.896 0.886 330 0.5
Disability 0.987 0.954 0.873 0.911 0.906 283 0.5
Political 0.990 0.974 0.936 0.955 0.949 438 0.5
Physical 0.994 0.966 0.941 0.953 0.950 238 0.5

Intended Use

The model is designed to detect and classify bias in text across 11 categories. It can be used in applications such as:

  • Content moderation
  • Bias analysis in research
  • Ethical AI development

Limitations and Biases

  • Synthetic Nature: The dataset consists of synthetic text, which may not fully represent real-world biases.
  • Category Overlap: Certain biases may overlap, leading to challenges in precise classification.
  • Domain-Specific Generalization: The model may not generalize well to domains outside the synthetic dataset’s scope.

Environmental Impact

  • Hardware Used: NVIDIA DGX Spark (GB10)
  • Training Time: ~2 hours
  • Carbon Emissions: ~0.12 kg CO2 (calculated via ML CO2 Impact Calculator).

Citation

If you use this model, please cite it as follows:

@misc{junque2025emotion,
  title        = {Emotion and Bias Classification with Modern Encoders},
  author       = {Junqu\'e de Fortuny, Enric},
  year         = {2025},
  howpublished = {\url{https://huggingface.co/spaces/cirimus/emotion-detection}}
}
Downloads last month
34
Safetensors
Model size
0.4B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for cirimus/ultrabert-380M-bias-type-classifier

Finetuned
(19)
this model

Dataset used to train cirimus/ultrabert-380M-bias-type-classifier

Space using cirimus/ultrabert-380M-bias-type-classifier 1

Collection including cirimus/ultrabert-380M-bias-type-classifier

Paper for cirimus/ultrabert-380M-bias-type-classifier