AnoraLee/vietnamese-hsd-visobert-combined is a fine-tuned uitnlp/visobert model for 3-class Vietnamese Hate Speech Detection (CLEAN, OFFENSIVE, HATE) on social media text.
This checkpoint is trained on the combined augmented dataset (merging original training data with Back-Translation, EDA, and LLM synthetic augmentations from Gemma & Qwen, deduplicated and conflict-filtered), achieving the highest HATE F1 (58.7%) across all 7 experiments in the benchmark.
| ID | Label | Description |
|---|---|---|
0 |
CLEAN |
Normal, non-toxic Vietnamese text |
1 |
OFFENSIVE |
Profanity, vulgarity, or rude language without targeted hate |
2 |
HATE |
Hate speech, harassment, dehumanization, or targeted attacks |
Evaluated on the frozen tdtu_test set (6,576 samples; validation set: 2,650 samples):
| Model | Strategy | Accuracy | Macro F1 | Weighted F1 | HATE F1 |
|---|---|---|---|---|---|
phobert_baseline |
Original unaugmented | 84.4% | 60.2% | 84.7% | 53.8% |
phobert_combined |
Combined augmentation | 78.0% | 57.3% | 80.7% | 58.0% |
visobert_baseline |
Original unaugmented | 84.5% | 61.5% | 85.1% | 55.5% |
visobert_combined |
Combined augmentation | 77.9% | 57.0% | 80.5% | 58.7% |
0.5407CLEAN comments, combining augmentation strategies intentionally trades off a small drop in overall accuracy to maximize recall and F1 on the minority HATE class (+4.9% HATE F1 over PhoBERT baseline, +3.2% over ViSoBERT baseline).Important: Unlike PhoBERT, ViSoBERT uses raw natural Vietnamese text without word segmentation (
_). Do not applyundertheseaorvncorenlpword joining before passing text to this model.
transformers pipelinefrom transformers import pipeline
classifier = pipeline(
"text-classification",
model="AnoraLee/vietnamese-hsd-visobert-combined",
tokenizer="AnoraLee/vietnamese-hsd-visobert-combined",
max_length=128,
truncation=True,
)
texts = [
"Bài viết chia sẻ rất hữu ích, cảm ơn tác giả!",
"Thứ rác rưởi, cút khỏi mạng xã hội đi.",
]
print(classifier(texts))
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
model_id = "AnoraLee/vietnamese-hsd-visobert-combined"
tokenizer = AutoTokenizer.from_pretrained(model_id, use_fast=True)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
model.eval()
text = "Nói chuyện kiểu gì mà vô duyên thế không biết."
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
with torch.no_grad():
logits = model(**inputs).logits
probs = torch.softmax(logits, dim=-1).squeeze()
pred_id = torch.argmax(probs).item()
print(f"Label: {model.config.id2label[pred_id]} ({probs[pred_id]:.4f})")
uitnlp/visobert (XLM-RoBERTa based, pre-trained on Vietnamese social media)combined_bt_eda_llm (140,914 samples from ViHSD, VOZ, YouTube, Back-Translation, EDA, and LLM synthesis)128learning_rate: 2e-5per_device_train_batch_size: 16weight_decay: 0.01fp16: Trueseed: 42EarlyStoppingCallback(patience=2) with load_best_model_at_end=True (metric_for_best_model="macro_f1"), selecting the Epoch 1 checkpoint.HATE speech, which can slightly increase false positives on borderline CLEAN / sarcastic sentences.Developed by researchers at the Faculty of Information Technology, Ton Duc Thang University (TDTU).
Distributed under the Apache License 2.0.
uitnlp/visobert