Downloads · 30 days
14
16% of all-time downloads
QuincySorrentino/toXibert
toXibert is a text classification model from QuincySorrentino. Use it when you need a label for a piece of text. It is set up for transformers.
ToXiBERT is a fine-tuned RoBERTa-based model specifically designed to detect and classify hate speech, offensive language, and normal content on X (formerly Twitter). The model is built on top of BERTweet and provides…
Downloads · 30 days
14
16% of all-time downloads
All-time downloads
88
Public
Parameters
135M
540 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors540 MB · 100%
From the Hugging Face model README
ToXiBERT is a fine-tuned RoBERTa-based model specifically designed to detect and classify hate speech, offensive language, and normal content on X (formerly Twitter). The model is built on top of BERTweet and provides three-class classification capabilities.
The model classifies text into three categories:
The model achieves the following performance with optimized class-specific thresholds:
| Class | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| Hate Speech | 0.624 | 0.818 | 0.708 | 1,625 |
| Offensive | 0.892 | 0.759 | 0.820 | 3,868 |
| Normal | 0.803 | 0.827 | 0.815 | 2,474 |
| Overall Accuracy | 0.792 | 7,967 | ||
| Macro Average | 0.773 | 0.801 | 0.781 | 7,967 |
| Weighted Average | 0.810 | 0.792 | 0.796 | 7,967 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load model and tokenizer
model_name = "your-username/toXibert"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
### Recommended Thresholds
For optimal performance, use the following class-specific thresholds:
```python
thresholds = {
"hate_speech": 0.560,
"offensive": 0.420,
"normal": 0.320
}