Views
No views yet
1) or non-toxic (0) using class-weighted Focal Loss and evaluation strategies suitable for imbalanced classification tasks.1: toxic, severe_toxic, obscene, threat, insult, identity_hate0.850| Metric | Value |
|---|---|
| F1 Score | 0.850 |
| Accuracy | ~0.84 |
| Confusion Matrix & PR Curves | [Saved and visualized during training] |
1from transformers import AutoModelForSequenceClassification, AutoTokenizer, pipeline
2
3model = AutoModelForSequenceClassification.from_pretrained("Jensvollends/hatebert-finetuned_v5")
4tokenizer = AutoTokenizer.from_pretrained("Jensvollends/hatebert-finetuned_v5")
5
6pipe = pipeline("text-classification", model=model, tokenizer=tokenizer, top_k=None)
7
8text = "You are a kind person"
9result = pipe(text)
10print(result)