Downloads · 30 days
9
6% of all-time downloads
nahiar/hatespeech-xlmr-v4
hatespeech-xlmr-v4 is a text classification model from nahiar. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
Multilingual Indonesian & English — XLM-RoBERTa
Downloads · 30 days
9
6% of all-time downloads
All-time downloads
163
Public
Parameters
278M
3.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt2.2 GB · 66%
From the Hugging Face model README
Multilingual Indonesian & English — XLM-RoBERTa
This repository provides a fine-tuned XLM-RoBERTa model for Hate Speech detection in social media text.
The model is designed to identify hate speech vs non-hate speech across Indonesian, regional Indonesian languages, and English, particularly in noisy and informal online conversations.
pipelinePerformance metrics are reported on a held-out validation set.
| Metric | Score |
|---|---|
| Accuracy | 0.9180 |
| F1 (Macro) | 0.9179 |
| F1 (Weighted) | 0.9200 |
| Training Loss | 0.9200 |
| Validation Loss | 0.9200 |
(Exact scores may vary depending on evaluation split and threshold.)
pip install transformers torch
from transformers import pipeline
classifier = pipeline(
"text-classification",
model="nahiar/hatespeech-xlmr-v4"
)
result = classifier("Dasar bodoh, otak udang!")
print(result)
Output
[{'label': 'LABEL_1', 'score': 0.9821}]
LABEL_0 → NON_HATE
LABEL_1 → HATE_SPEECH
texts = [
"Kamu itu memang tidak berguna",
"Saya tidak setuju dengan pendapat kamu",
"Dasar kaum ini selalu bikin rusuh"
]
results = classifier(texts)
for text, result in zip(texts, results):
print(f"{result['label']} ({result['score']:.4f}) → {text}")
| Parameter | Value |
|---|---|
| Base Model | xlm-roberta-base |
| Training Strategy | Fine-tuning |
| Epochs | Multiple |
| Learning Rate | 2e-5 |
| Batch Size | 16 |
| Training Date | 2025-12-03 |
This model is released under the Apache License 2.0 Free for research and commercial use.
@misc{djunaedi2025hatespeech,
author = {Raihan Hidayatulloh Djunaedi},
title = {Hate Speech Detection for Social Media Text},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/nahiar/hatespeech-xlmr-v4}
}