Parliamentary BERTimbau Auditor
Fine-tuned neuralmind/bert-base-portuguese-cased for 4-class offensive / hate-speech detection in Brazilian parliamentary discourse.
Labels
| id | label |
|---|---|
| 0 | NEUTRAL |
| 1 | GENERIC_OFFENSE |
| 2 | TARGETED_OFFENSE |
| 3 | EXPLICIT_HATE_SPEECH |
Usage
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
repo = "parliamentary-bertimbau-auditor" # or your HF repo id
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForSequenceClassification.from_pretrained(repo)
text = "Senhor presidente, peço a palavra."
inputs = tok(text, return_tensors="pt", truncation=True, max_length=128)
with torch.no_grad():
probs = torch.softmax(model(**inputs).logits, dim=-1)[0]
pred = int(probs.argmax())
print(model.config.id2label[pred], float(probs[pred]))
Best validation Macro-F1 (this run): 0.3970
- Downloads last month
- 6