Public Sentiment Analysis Toward Indonesian House of Representatives Member Allowances using Naïve Bayes
DOI:
https://doi.org/10.59934/jaiea.v6i1.2817Keywords:
TF IDF, Naive Bayes, Streamlit, Analysis Sentiment, Public PolicyAbstract
This study analyzes public sentiment toward allowances for members of the Indonesian House of Representatives using a Multinomial Naïve Bayes classifier. The initial dataset contained 14,000 public posts and comments collected from X and YouTube between July 2022 and February 2026. After validation and preprocessing, 12,869 records were retained. Sentiment labels were generated through an Indonesian lexicon-based procedure with two-token negation handling, while textual features were represented using augmented TF-IDF. The dataset was divided into 10,295 training records and 2,574 testing records. The resulting labels comprised 10,675 negative, 1,912 positive, and 282 neutral records. Testing produced an accuracy of 84.50%, macro precision of 0.5410, macro recall of 0.3767, and macro F1-score of 0.3819. The negative class achieved the strongest performance, whereas the neutral class was not successfully recognized because of severe class imbalance. The classification results were deployed through a Streamlit application that presents sentiment distribution, class-specific word clouds, temporal and source distributions, evaluation metrics, and new-text prediction. The findings show that Naïve Bayes can provide a useful overall classification result, but balanced class representation remains essential for reliable performance across all sentiment categories.
Downloads
References
I. Permana and K. D. Maani, “Publication trend of public sentiment towards Indonesia government policies,” Sinkron, vol. 8, no. 3, pp. 2061–2069, 2024, doi: 10.33395/sinkron.v8i3.13843.
D. D. Putri, G. F. Nama, and W. E. Sulistiono, “Analisis sentimen kinerja Dewan Perwakilan Rakyat (DPR) pada Twitter menggunakan metode Naive Bayes Classifier,” Jurnal Informatika dan Teknik Elektro Terapan, vol. 10, no. 1, 2022, doi: 10.23960/jitet.v10i1.2262.
N. W. A. S. Aprilia and A. R. Isnain, “Analisis sentimen terhadap media sosial Twitter dengan kasus kampanye anti-korupsi di Indonesia menggunakan Naive Bayes,” Jurnal Media Informatika Budidarma, vol. 8, no. 2, p. 695, 2024, doi: 10.30865/mib.v8i2.7582.
M. Fadli, A. Triayudi, and E. T. E. Handayani, “Sentiment analysis on Twitter social media application on fuel oil price hike using Naïve Bayes and decision tree algorithms,” SANA: Journal of Blockchain, NFTs and Metaverse Technology, vol. 2, no. 2, pp. 114–122, 2024, doi: 10.58905/sana.v2i2.271.
J. Rama Dani, “Analisis sentimen komentar YouTube terhadap kenaikan tunjangan DPR RI menggunakan Naïve Bayes, SVM, dan Random Forest,” Building of Informatics, Technology and Science (BITS), vol. 7, no. 3, 2025, doi: 10.47065/bits.v7i3.8513.
T. Ismardani and Z. Fatah, “Sentiment analysis of YouTube user comments on government policies using the Naïve Bayes method,” Journal of Data Insights, vol. 3, no. 2, pp. 113–123, 2025.
Z. R. Pratama et al., “Analisis sentimen publik terhadap isu tunjangan DPR menggunakan Brand24: Studi kasus strategi komunikasi publik dalam menghadapi konflik di media sosial,” Jurnal Multidisiplin Ilmu Akademik, vol. 2, no. 2, 2025, doi: 10.61722/jmia.v2i6.7382.
I. Hulu and H. Budiati, “Implementasi text mining pada pengukuran sentimen opini masyarakat terhadap Universitas Kristen Immanuel,” Jurnal Sains dan Komputer, vol. 7, no. 2, pp. 1–7, 2023, doi: 10.61179/jurnalinfact.v7i02.445.
W. Trisnawati and A. Wibowo, “Sentiment analysis of ICT service user using Naive Bayes Classifier and SVM methods with TF-IDF text weighting,” Jurnal Teknik Informatika (JUTIF), vol. 5, no. 3, pp. 709–719, 2024, doi: 10.52436/1.jutif.2024.5.3.1784.
S. A. Nugraha, “Penerapan lexicon based untuk analisis sentimen masyarakat Indonesia terhadap Danantara,” Jurnal Mahasiswa Teknik Informatika, vol. 9, no. 3, 2025.
Y. I. Kurniawan et al., “Naive Bayes Classifier with SMOTE for sentiment analysis of Blibli app reviews on the Google Play Store,” Jurnal Penelitian Inovatif, vol. 5, no. 3, pp. 2675–2688, 2025, doi: 10.54082/jupin.1842.
S. Raschka, Y. H. Liu, and V. Mirjalili, Machine Learning with PyTorch and Scikit-Learn: Develop Machine Learning and Deep Learning Models with Python. Birmingham, U.K.: Packt Publishing, 2022.
Y. William and R. Loisa, “Peran media sosial dalam membangun opini publik: Studi kasus akun media sosial DPR RI,” Kiwari, vol. 4, no. 3, pp. 426–434, 2025.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Journal of Artificial Intelligence and Engineering Applications (JAIEA)

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.








