Building of Informatics, Technology and Science
Vol 8 No 1 (2026): June 2026

Klasifikasi Pesan Penipuan pada Platform WhatsApp Menggunakan Metode Naïve Bayes Berbasis TF-IDF, N-Gram, dan Chi-Square

Hardika Nur Saputra (Universitas Dian Nuswantoro, Semarang)
Ardytha Luthfiarta (Universitas Dian Nuswantoro, Semarang)



Article Info

Publish Date
23 Jun 2026

Abstract

The rapid development of digital communication has led to an increase in message exchanges across various platforms, accompanied by the widespread spread of fraudulent messages (scams). This situation demands an automated system capable of identifying and classifying messages quickly and accurately. This study aims to develop a text-based message classification system on the WhatsApp platform using the Naïve Bayes algorithm. The research stages include text preprocessing consisting of case folding, cleaning, normalization, stopword removal, and stemming to improve data quality. Next, feature extraction is carried out using Term Frequency-Inverse Document Frequency (TF-IDF) combined with the N-Gram (unigram) approach to represent each word in the text, and Chi-Square feature selection is applied to obtain the most relevant features in the classification process. The dataset used consists of three categories of WhatsApp messages: normal, promotional, and fraudulent. In addition, this study also applies a data balancing method using Random Oversampling to increase the number of minority class samples in the training data for optimal model performance. The main contribution of this research is the application of a combination of TF-IDF unigram, Chi-Square feature selection, and Random Oversampling in the Naïve Bayes algorithm to improve the classification performance of Indonesian WhatsApp messages, especially in conditions of unbalanced class distribution. Model evaluation is carried out using a Confusion Matrix with accuracy, precision, recall, and F1-score metrics. The test results show that the model built is able to achieve an accuracy level of 95.63%, so the method used is proven to be effective in classifying WhatsApp messages accurately and consistently.

Copyrights © 2026






Journal Info

Abbrev

bits

Publisher

Subject

Computer Science & IT

Description

Building of Informatics, Technology and Science (BITS) is an open access media in publishing scientific articles that contain the results of research in information technology and computers. Paper that enters this journal will be checked for plagiarism and peer-rewiew first to maintain its quality. ...