BERTabaporu - Toxicity Classification for Reddit (PT-BR)

This model performs binary classification of Brazilian Portuguese comments, categorizing them as Toxic or Non-Toxic. It is the result of fine-tuning the BERTabaporu model, specifically optimized to handle the informal and noisy language characteristic of social media, such as Reddit.

Model Details

  • Base Model: BERTabaporu (pre-trained on ~238 million tweets).
  • Task: Text Classification (Binary: Toxic / Non-Toxic).
  • Language: Brazilian Portuguese (PT-BR).
  • Domain: Brazilian Reddit Communities
  • Architecture: AutoModelForSequenceClassification (Hugging Face Transformers).

The choice of BERTabaporu was motivated by the strong linguistic similarity between its pre-training domain (Twitter/X) and the target corpus of this study, both consisting of informal social media texts.

Evaluation Results

The performance of the toxicity model was evaluated on the test set (composed exclusively of human-annotated data, without synthetic data). The obtained metrics were:

Class Precision Recall F1-Score
Non-Toxic (0) 0.93 0.95 0.94
Toxic (1) 0.70 0.61 0.65
Accuracy - - 0.90
Macro Avg 0.82 0.78 0.80
Weighted Avg 0.90 0.90 0.90

Limitations and Bias

While this model is effective for its target domain, users should be aware of the following limitations:

  • Class Imbalance: Despite data augmentation efforts, there is still a noticeable performance disparity between the majority (Non-Toxic) and minority (Toxic) classes. Large-scale human validation of the classifications was unfeasible due to the high volume of data.
  • Temporal and Political Bias: The training data was collected during 2022, a highly polarized election year in Brazil. Consequently, the model's toxic lexicon is heavily tied to political debates, which may restrict its generalization to everyday hate speech or different contexts.
  • Domain Restriction: The dataset is limited to ten specific communities (subreddits). Since each subreddit has its own particularities, this scope reduces the overall diversity of topics and discussion structures the model has been exposed to.

How to Use

You can easily load and use the model through the transformers library:

from transformers import AutoTokenizer, AutoModelForSequenceClassification
from transformers import pipeline

# Load model and tokenizer
model_name = "giovanaPcarvalho/bertabaporu-toxicity-reddit-ptbr"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

# Create the classification pipeline
classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)

# Test a comment
text = "O seu post foi a coisa mais ridícula que eu já li hoje."
result = classifier(text)

print(result)

Citation

This model is part of the methodology developed for the paper "Diálogos Tóxicos: Gatilhos e Padrões de Interação no Reddit Brasileiro", published in the Proceedings of the 17th International Conference on Computational Processing of Portuguese (PROPOR 2026).

If you use this model in your research, please cite our work:

@inproceedings{piorino-etal-2026-dialogos,
    title = "Di{\'a}logos T{\'o}xicos: Gatilhos e Padr{\~o}es de Intera{\c{c}}{\~a}o no {R}eddit Brasileiro",
    author = "Piorino, Giovana  and
      Machado, Marco Ant{\^o}nio de Alc{\^a}ntara  and
      Lima, Luiz Henrique Quevedo  and
      Pagano, Adriana  and
      Silva, Ana Paula Couto da",
    editor = "Souza, Marlo  and
      de-Dios-Flores, Iria  and
      Santos, Diana  and
      Freitas, Larissa  and
      Souza, Jackson Wilke da Cruz  and
      Ribeiro, Eug{\'e}nio",
    booktitle = "Proceedings of the 17th International Conference on Computational Processing of {P}ortuguese ({PROPOR} 2026) - Vol. 1",
    month = apr,
    year = "2026",
    address = "Salvador, Brazil",
    publisher = "Association for Computational Linguistics",
    url = "[https://aclanthology.org/2026.propor-1.57/](https://aclanthology.org/2026.propor-1.57/)",
    pages = "581--590",
    ISBN = "979-8-89176-387-6"
}
Downloads last month
4
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support