Metrics are reported as mean ± sample standard deviation over the available completed seeds.
1{
2 "0": "CLEAN",
3 "1": "OFFENSIVE",
4 "2": "HATE"
5}
1import torch
2from transformers import AutoModelForSequenceClassification, AutoTokenizer
3
4model_id = "BaoNhan/bn-newsbert-ViHSD"
5tokenizer = AutoTokenizer.from_pretrained(model_id, use_fast=False)
6model = AutoModelForSequenceClassification.from_pretrained(model_id)
7
8# PhoBERT-style checkpoint: segment raw Vietnamese with VnCoreNLP first.
9text = "Đây là văn_bản tiếng_Việt đã được chuẩn_hóa ."
10
11inputs = tokenizer(
12 text,
13 return_tensors="pt",
14 truncation=True,
15 max_length=256,
16)
17
18with torch.no_grad():
19 probabilities = model(**inputs).logits.softmax(dim=-1)[0]
20
21predicted_id = int(probabilities.argmax())
22print(model.config.id2label[predicted_id], probabilities.tolist())
ViHSD is class-imbalanced and reflects Vietnamese social-media language from a
particular collection period. Performance may not transfer directly to new
platforms, dialects, code-switching patterns, irony, or emerging slang.
Predictions should not be the sole basis for moderation or punitive decisions.
1@InProceedings{10.1007/978-3-030-79457-6_35,
2 author={Luu, Son T. and Nguyen, Kiet Van and Nguyen, Ngan Luu-Thuy},
3 title={A Large-Scale Dataset for Hate Speech Detection on Vietnamese Social Media Texts},
4 booktitle={Advances and Trends in Artificial Intelligence. Artificial Intelligence Practices},
5 year={2021},
6 publisher={Springer International Publishing},
7 pages={415--426},
8 doi={10.1007/978-3-030-79457-6_35}
9}