Downloads · 30 days
4
9% of all-time downloads
alissonf216/parliamentary-bertimbau-auditor
parliamentary-bertimbau-auditor is a text classification model from alissonf216. Use it when you need a label for a piece of text. The card lists the license as mit.
Fine-tuned neuralmind/bert-base-portuguese-cased for 4-class offensive / hate-speech detection in Brazilian parliamentary discourse.
Downloads · 30 days
4
9% of all-time downloads
All-time downloads
47
Public
Parameters
109M
436 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors436 MB · 100%
From the Hugging Face model README
Fine-tuned neuralmind/bert-base-portuguese-cased for 4-class offensive / hate-speech detection in Brazilian parliamentary discourse.
| id | label |
|---|---|
| 0 | NEUTRAL |
| 1 | GENERIC_OFFENSE |
| 2 | TARGETED_OFFENSE |
| 3 | EXPLICIT_HATE_SPEECH |
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