JOURNAL OF APPLIED INFORMATICS AND COMPUTING
Vol. 9 No. 6 (2025): December 2025

Sentiment Analysis of the TPKS Law on Twitter: A Comparative Study of Classification Algorithm Performance

Mawar, Heni Sapta (Unknown)
Rahardi, Majid (Unknown)



Article Info

Publish Date
05 Dec 2025

Abstract

The enactment of Law Number 12 of 2022 concerning the Crime of Sexual Violence (UU TPKS) has sparked significant public discourse on social media, especially on Twitter. This study aims to identify the most effective classification algorithm for analyzing public sentiment regarding the UU TPKS. A total of 2,351 Indonesian-language tweets were collected, preprocessed, and manually labeled into positive and negative sentiments. The Term Frequency–Inverse Document Frequency (TF-IDF) method was used for feature extraction, followed by classification using six algorithms: Naive Bayes (NB), K-Nearest Neighbors (KNN), Logistic Regression (LR), Support Vector Machine (SVM), Random Forest (RF), and XGBoost. The evaluation results show that SVM and Random Forest achieved the highest accuracy of 85.35%, precision of 0.85, recall of 0.85, and F1-score of 0.83, outperforming other models in handling high-dimensional and imbalanced data. These results demonstrate that the combination of TF-IDF with SVM and Random Forest provides an effective and reliable approach for sentiment analysis of Indonesian-language social media data, particularly in evaluating public responses to socio-legal policies such as the UU TPKS.

Copyrights © 2025






Journal Info

Abbrev

JAIC

Publisher

Subject

Computer Science & IT

Description

Journal of Applied Informatics and Computing (JAIC) Volume 2, Nomor 1, Juli 2018. Berisi tulisan yang diangkat dari hasil penelitian di bidang Teknologi Informatika dan Komputer Terapan dengan e-ISSN: 2548-9828. Terdapat 3 artikel yang telah ditelaah secara substansial oleh tim editorial dan ...