Views
No views yet
pipelinePerformance metrics are reported on a held-out validation set.
| Metric | Score |
|---|---|
| Precision | 0.9249 |
| Recal | 0.9300 |
| F1 (Macro) | 0.9274 |
| F1 (Weighted) | 0.9269 |
| Training Loss | 0.1181 |
| Validation Loss | 0.2070 |
pip install transformers torch1from transformers import pipeline
2
3classifier = pipeline(
4 task="text-classification",
5 model="nahiar/hatespeech-abusive-xlm-roberta-v1",
6 return_all_scores=True
7)
8
9result = classifier("Dasar bodoh, otak udang!")
10print(result)1[
2 {'label': 'HATESPEECH', 'score': 0.9123},
3 {'label': 'ABUSIVE', 'score': 0.9841}
4]Because this is a multilabel model, more than one label can be active for a single input.
1HATESPEECH → Content that attacks or demeans a group based on identity
2ABUSIVE → Insulting, offensive, or aggressive language without protected targets1texts = [
2 "Dasar kaum ini selalu bikin rusuh",
3 "Kamu memang bodoh dan tidak berguna",
4 "Saya tidak setuju dengan pendapat kamu"
5]
6
7results = classifier(texts)
8
9for text, preds in zip(texts, results):
10 labels = [(p["label"], round(p["score"], 4)) for p in preds]
11 print(text, "→", labels)| Parameter | Value |
|---|---|
| Base Model | xlm-roberta-base |
| Task Type | Multilabel Classification |
| Training Strategy | Fine-tuning |
| Epochs | Multiple |
| Learning Rate | 2e-5 |
| Batch Size | 16 |
| Training Date | 2025-12-18 |
1@misc{djunaedi2025hatespeech_multilabel,
2 author = {Raihan Hidayatulloh Djunaedi},
3 title = {Multilabel Hate Speech and Abusive Language Detection for Social Media Text},
4 year = {2025},
5 publisher = {Hugging Face},
6 url = {https://huggingface.co/nahiar/hatespeech-xlmr-v4}
7}