Malcom: Indonesian Journal of Machine Learning and Computer Science
Vol. 6 No. 1 (2026): MALCOM January 2026

Comparative Analysis of Naive Bayes and Support Vector Machine for Hate Speech Classification

Rolanda Difandana (Universitas Budi Luhur)
Ian Imaduddin (Universitas Budi Luhur)
Indra Indra (Universitas Budi Luhur)



Article Info

Publish Date
02 Feb 2026

Abstract

This study addresses the increasing need for automated hate speech detection in Indonesia due to the rapid growth of social media and the rise of abusive online content. It compares the performance of Naive Bayes (NB) and Support Vector Machine (SVM) algorithms in classifying Indonesian-language tweets into three categories: hate speech (27.52%), abusive language (34.25%), and neutral content (38.23%). The dataset consists of 13,169 manually annotated tweets collected from Twitter (now X), with moderate class imbalance handled using stratified sampling. Text preprocessing included tokenization, case folding, stopword removal, and stemming using the Nazief–Adriani algorithm, followed by TF-IDF feature extraction with a unigram configuration (min_df=3, max_df=0.95). Both algorithms were evaluated using 10-fold stratified cross-validation with accuracy, precision, recall, and F1-score as performance metrics. Experimental results show that SVM with a linear kernel outperformed NB, achieving an accuracy of 93.28%, precision of 92.45%, and F1-score of 92.89%, compared to NB’s accuracy of 84.71%, precision of 83.56%, and F1-score of 84.12%. Although effective, this study is limited to classical machine learning approaches with TF-IDF features and does not incorporate deep learning or contextual embeddings, while still providing practical guidance for algorithm selection in Indonesian hate speech detection systems.

Copyrights © 2026






Journal Info

Abbrev

malcom

Publisher

Subject

Computer Science & IT

Description

MALCOM: Indonesian Journal of Machine Learning and Computer Science is a scientific journal published by the Institut Riset dan Publikasi Indonesia (IRPI) in collaboration with several Universities throughout Riau and Indonesia. MALCOM will be published 2 (two) times a year, April and October, each ...