Sentiment Analysis of the Trending Topic #Indonesiagelap on X Using a Naive Bayes Algorithm Based on Particle Swarm Optimization
DOI:
https://doi.org/10.62951/ijamc.v2i2.127Keywords:
#IndonesiaGelap, Naive Bayes, Particle Swarm Optimization (PSO), Sentiment Analysis, Social Media XAbstract
The rise of social media has created a digital public sphere that enables users to express their opinions on social and political issues openly and in real-time. One of the most discussed topics on social media platform X is the trending hashtag #IndonesiaGelap, which reflects public concern and criticism regarding various governmental and societal conditions. This study aims to conduct sentiment analysis on tweets containing the hashtag to determine the overall sentiment trend among users. The method employed in this research is the Naive Bayes classification algorithm, known for its simplicity and effectiveness in text classification. To enhance the model’s performance, Particle Swarm Optimization (PSO) is applied to optimize feature selection and parameter tuning. The dataset consists of public tweets collected via the Twitter API, followed by preprocessing, feature extraction using TF-IDF, and sentiment classification into three categories: positive, negative, and neutral. The results indicate that the integration of PSO significantly improves the classification accuracy of the Naive Bayes model compared to the baseline. The majority of tweets related to #IndonesiaGelap exhibit a negative sentiment, indicating widespread public dissatisfaction and criticism. This research is expected to contribute to a better understanding of public perception and serve as valuable input for stakeholders in addressing social issues in the digital age.
References
M. Rezki, D. N. Kholifah, M. Faisal, P. Priyono, and R. Suryadithia, “Analisis Review Pengguna Google Meet dan Zoom Cloud Meeting Menggunakan Algoritma Naïve Bayes,” J. Infortech, vol. 2, no. 2, pp. 264–270, 2020, doi: 10.31294/infortech.v2i2.9286.
A. Faisal, Y. Alkhalifi, A. Rifai, and W. Gata, “Analisis Sentimen Dewan Perwakilan Rakyat Dengan Algoritma Klasifikasi Berbasis Particle Swarm Optimization,” JOINTECS (Journal Inf. Technol. Comput. Sci., vol. 5, no. 2, p. 61, 2020, doi: 10.31328/jointecs.v5i2.1362.
S. A. Dainamang, N. Hayatin, and D. R. Chandranegara, “Analisis Sentimen Media Sosial Twiiter terhadap RUU Omnibus Law dengan Metode Naive Bayes dan Particle Swarm Optimization,” Komputika J. Sist. Komput., vol. 11, no. 2, pp. 211– 218, 2022, doi: 10.34010/komputika.v11i2.6037.
M. Agus Arianto and A. Solichin, “Analisis Sentimen Motogp Mandalika Pada Twitter Menggunakan Metode Naïve Bayes,” J. TICOM Technol. Inf. Commun., vol. 11, no. 1, pp. 20–25, 2022, [Online]. Available: https://t.co/XyNW7StiWQ
F. A. Artanto, “Analisis Sentimen Opini Publik terhadap Fenomena Bunuh Diri Mahasiswa di Twitter Menggunakan Algoritma Naive Bayes,” J. Sains Teknol. dan Sist. Inf., vol. 4, no. 1, pp. 70–77, 2024, doi: 10.54259/satesi.v4i1.2908.
A. Halim and Andri Safuwan, “Analisis Sentimen Opini Warganet Twitter Terhadap Tes Screening Genose Pendeteksi Virus Covid-19 Menggunakan Metode Naïve Bayes Berbasis Particle Swarm Optimization,” J. Inform. Teknol. dan Sains, vol. 5, no. 1, pp. 170–178, 2023, doi: 10.51401/jinteks.v5i1.2229.
T. D. Putra, E. Utami, and M. P. Kurniawan, “Analisis Sentimen Pemilu 2024 dengan Naive Bayes Berbasis Particle Swarm Optimization (PSO),” Explore, vol. 13, no. 1, pp. 1–5, 2023, doi: 10.35200/ex.v11i2.13.
S. Andini, R. Kurniawan, S. Anwar, and K. Cirebon, “ANALISIS SENTIMEN PENGGUNA X MENGENAI OPINI,” vol. 13, no. 2, pp. 665–671, 2025.
M. Hanif Razka, T. Theresiawati, and N. Chamidah, “Analisis Sentimen terhadap Aplikasi PeduliLindungi pada Jejaring Sosial Twitter Menggunakan Algoritma Naïve Bayes dan Seleksi Fitur Particle Swarm Optimization,” Inform. J. Ilmu Komput., vol. 19, no. 1, pp. 68–80, 2023, doi: 10.52958/iftk.v19i1.4688.
J. Ilmiah, “Scientica Scientica,” vol. 3, pp. 387–392, 2025.
A. Herliana and S. S. Muawiyah, “Komparasi Optimasi Analisis Sentimen Cyberbullying Pada Instagram Berbasis Particle Swarm Optimization,” J. Responsif Ris. Sains dan Inform., vol. 6, no. 1, pp. 43–53, 2024, doi: 10.51977/jti.v6i1.1419.
H. Nurdin et al., “Naive Bayes and Particle Swarm Optimization in Early Detection Naive Bayes Dan Particle Swarm Optimization Dalam Deteksi,” vol. 5, no. 3, pp. 703–708, 2024.
K. S. Nugroho, I. Istiadi, and F. Marisa, “Naive Bayes classifier optimization for text classification on e-government using particle swarm optimization,” J. Teknol. dan Sist. Komput., vol. 8, no. 1, pp. 21–26, 2020, doi: 10.14710/jtsiskom.8.1.2020.21-26.
H. B. Jatmiko, N. Tedi Kurniadi, and D. Maulana, “Optimasi Naïve Bayes Dengan Particle Swarm Optimization Untuk Analisis Sentimen Formula E-Jakarta,” J. Autom. Comput. Inf. Syst., vol. 2, no. 1, pp. 22–30, 2022, doi: 10.47134/jacis.v2i1.35.
M. Y. Kurniawan, F. Hafidh, M. E. Rosadi, and R. I. Y. Anwar, “Penerapan Particle Swarm Optimization Pada Deteksi Ujaran Kebencian Dalam Platform Twitter,” J. Responsif Ris. Sains dan Inform., vol. 5, no. 2, pp. 434–443, 2023, doi: 10.51977/jti.v5i2.1340.
U. Dirgantara and M. Suryadarma, “Peningkatan Optimasi Sentimen Dalam Pelaksanaan Proses Pemilihan Presiden Berdasarkan Opini Publik Dengan Menggunakan Algoritma Naïve Bayes Dan Paricle Swarm Optimization,” J. Sist. Inf. Univ. Suryadarma, vol. 7, no. 2, 2014, doi: 10.35968/jsi.v7i2.452.
Y. Septiawan, A. Aglasia, and D. A. Muktiawan, “Peningkatan Performa Analisis Sentimen Ulasan Pelanggan terhadap Layanan Pengiriman Menggunakan Model Naïve Bayes yang Dioptimalkan dengan PSO Performance Improvement of Sentiment Analysis of Customer Reviews on Delivery Services Using a Naïve Bayes Model Optimised Naïve Bayes Model with PSO,” vol. 3, no. 1, pp. 10–19, 2025, doi: 10.25181/rt.v3i1.4001.
D. A. Classification, M. Using, and P. Swarm, “Perancangan Mesin Klasifikasi Menggunakan Particle Swarm Optimization,” vol. 8, no. 2, pp. 146–154, 2024.
W. Wiyanto and Z. Setyaningsih, “Sentiment Analysis Pemutusan Hubungan Kerja Akibat Pandemi Covid-19 Menggunakan Algoritma NaïveBayes Dan PSO,” J. Sisfokom (Sistem Inf. dan Komputer), vol. 10, no. 3, pp. 426–431, 2021, doi: 10.32736/sisfokom.v10i3.1299.
M. Minardi, R. Lasepa, S. Riyadi, S. Ramadhan, and D. D. Saputra, “Sentiment Analysis Terhadap Perspektif Warganet Atas Tragedi Kanjuruhan Malang di Twitter Menggunakan Naïve Bayes Classifier,” J. Inform., vol. 10, no. 1, pp. 45– 53, 2023, doi: 10.31294/inf.v10i1.14546.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 International Journal of Applied Mathematics and Computing

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


