Comparative Sentiment Analysis of Indonesian Leadership Transitions on Platform X Using LSTM and Naïve Bayes
A Dual-Label Evaluation Using Lexicon-Based and Manual Annotation
Abstract
This study compares Long Short-Term Memory (LSTM) and Naïve Bayes algorithms for sentiment analysis focused on leadership transitions within Indonesian social media. A dataset of 5,942 Indonesian-language tweets from platform X (formerly Twitter) was collected and labeled using both lexicon-based and manual annotation methods. Manual labeling was crucial to capture the nuanced and context-dependent sentiment often missed by lexicon-based techniques, especially during periods of heightened political discourse. The LSTM model was implemented for its ability to capture sequential dependencies in text, while Naïve Bayes was used as a computationally efficient baseline. Both models were rigorously evaluated using standard classification metrics, including accuracy, precision, recall, and F1-score. Experimental results show that LSTM achieved 71.6% accuracy with lexicon-based labels and 77.9% with manual labels. In comparison, Naïve Bayes achieved 61.5% and 78.2%, respectively. LSTM demonstrated better generalization across sentiment categories, particularly for neutral sentiments, while Naïve Bayes proved more effective on highly polarized datasets. These findings underscore the importance of strategic model selection based on data quality and labeling methods. The results offer valuable insights for political sentiment analysis and the development of data-driven decision-making tools in the digital political landscape.
Downloads
References
. D. Eryanto, I. van Eeden Jones, and K. Lasthuizen, “The troubling impact of political interference in Indonesian public sector institutions on ethical leadership credibility,” International Journal of Public Leadership, vol. 18, no. 4, pp. 319–336, Sep. 2022, doi: 10.1108/IJPL-10-2021-0056.
. M. Murni, J. J. Ma’ruf, S. Utami, and S. Chan, “ANALYSIS OF POLITICAL COMMUNICATION, POLITICAL LEADERSHIP IN POLITICAL PARTIES, POLITICAL COSTS, GOVERNMENT SUPPORT FOR PUBLIC TRUST IN ACEH PROVINCE,” Journal of Law and Sustainable Development, vol. 12, no. 3, p. e1569, Mar. 2024, doi: 10.55908/sdgs.v12i3.1569.
. A. N. Ma’aly, D. Pramesti, A. D. Fathurahman, and H. Fakhrurroja, “Exploring Sentiment Analysis for the Indonesian Presidential Election Through Online Reviews Using Multi-Label Classification with a Deep Learning Algorithm,” Information (Switzerland), vol. 15, no. 11, Nov. 2024, doi: 10.3390/info15110705.
. L. Damayanti and K. M. Lhaksmana, “Sentiment Analysis of the 2024 Indonesia Presidential Election on Twitter,” Jurnal dan Penelitian Teknik Informatika, vol. 8, no. 2, 2024, doi: 10.33395/v8i2.13379.
. A. S. Wisnubroto, A. Saifunas, A. B. Santoso, P. K. Putra, and I. Budi, “Opinion-based sentiment analysis related to 2024 Indonesian Presidential Election on YouTube,” in 2022 5th International Seminar on Research of Information Technology and Intelligent Systems (ISRITI), 2022, pp. 318–323. doi: 10.1109/ISRITI56927.2022.10052848.
. K. Shanmugavadivel, M. Subramanian, and M. B. Sameer, “Beyond_Tech@DravidianLangTech 2025: Political Multiclass Sentiment Analysis using Machine Learning and Neural Network,” pp. 234–238, 2025.
. M. David Angelo, R. Widyatna Harwenda, I. Budi, A. Budi Santoso, and P. Kresna Putra, “Sentiment Analysis and Topic Modeling of Public Opinion on Indonesia New Capital City Development Policies,” Journal Eduvest, vol. 5, no. 5, p. 2025, 2025, [Online]. Available: http://eduvest.greenvest.co.id
. M. R. Ramadhan and K. Budiman, “Sentiment Analysis of Presidential Candidates in 2024: A Comparison of the Performance of Support Vector Machine and Random Forest with N-Gram Method,” Recursive Journal of Informatics, vol. 3, no. 1, pp. 34–42, Mar. 2025, doi: 10.15294/rji.v3i1.8385.
. H. Ma’, A. Yudo Husodo, and B. Irmawati, “PERFORMANCE COMPARISON OF NAIVE BAYES AND BIDIRECTIONAL LSTM ALGORITHMS IN BSI MOBILE REVIEW SENTIMENT ANALYSIS,” Jurnal Teknik Informatika (JUTIF), vol. 6, no. 1, pp. 159–172, 2025, doi: 10.52436/1.jutif.2025.6.1.4178.
. M. Samantri and Afiyati, “Perbandingan Algoritma Support Vector Machine dan Random Forest untuk Analisis Sentimen Terhadap Kebijakan Pemerintah Indonesia Terkait Kenaikan Harga BBM Tahun 2022,” Jurnal Teknologi Informasi dan Komunikasi), vol. 8, no. 1, p. 2024, 2024, doi: 10.35870/jti.
. L. Aina, N. Voskarides, and R. Blanco, “Performance-Efficiency Trade-Offs in Adapting Language Models to Text Classification Tasks.” [Online]. Available: https://github.com/
. A. R. Sembiring and C. K. Dewa, “Sentiment Analysis On Indonesian Tweets about the 2024 Election,” Sinkron : Jurnal dan Penelitian Teknik Informatika, vol. 9, no. 1, pp. 413–422, Jan. 2025, doi: 10.33395/sinkron.v9i1.14481.
. P. Nandwani and R. Verma, “A review on sentiment analysis and emotion detection from text,” Soc Netw Anal Min, vol. 11, no. 1, p. 81, 2021, doi: 10.1007/s13278-021-00776-6.
. Y. Romadhoni, K. Fahmi, and H. Holle, “Analisis Sentimen Terhadap PERMENDIKBUD No.30 pada Media Sosial Twitter Menggunakan Metode Naive Bayes dan LSTM,” Jurnal Informatika: Jurnal pengembangan IT, vol. 7, no. 2, 2022.
. W. Yudha Patria, P. Harry Gunawan, and N. Aquarini, “Public Political Sentiment Post 2024 Presidential Election: Comparison of Naïve Bayes and Support Vector Machine,” Technology and Science (BITS), vol. 6, no. 4, 2025, doi: 10.47065/bits.v6i4.6734.
. C. Suhaeni, H. Wijayanto, and A. Kurnia, “Sentiment Classification on the 2024 Indonesian Presidential Candidate Dataset Using Deep Learning Approaches,” Indonesian Journal of Statistics and Its Applications, vol. 8, no. 2, pp. 83–94, Dec. 2024, doi: 10.29244/ijsa.v8i2p83-94.
. A. Putra Prasetyo, C. S. Kusuma, and D. Rizki, “Analisis Sentimen Twitter terhadap Isu Penundaan Pemilu 2024 Menggunakan Metode Long Short-Term Memory (LSTM),” JURNAL REPOSITOR, vol. 6, no. 3, pp. 293–304, 2024.
. A. Abdullah and E. B. Setiawan, “Performance of Deep Feed-Forward Neural Network Algorithm Based on Content-Based Filtering Approach,” INTENSIF: Jurnal Ilmiah Penelitian dan Penerapan Teknologi Sistem Informasi, vol. 8, no. 2, pp. 278–294, Feb. 2024, doi: 10.29407/intensif.v9i1.22999.
. A. Alamsyah and F. Saviera, “A Comparison of Indonesia’s E-Commerce Sentiment Analysis for Marketing Intelligence Effort (case study of Bukalapak, Tokopedia and Elevenia),” ArXiv, 2021.
. [20] V. R. Prasetyo, M. F. Naufal, and K. Wijaya, “Sentiment Analysis of ChatGPT on Indonesian Text using Hybrid CNN and Bi-LSTM,” Jurnal RESTI, vol. 9, no. 2, pp. 327–333, Apr. 2025, doi: 10.29207/resti.v9i2.6334.
. A. Rahman et al., “Analisis Perbandingan Algoritma LSTM dan Naive Bayes untuk Analisis Sentimen,” JEPIN (Jurnal Edukasi dan Penelitian Informatika), 2022.
. J. Ncib, Comparative Insights from 12 Machine Learning Models in Extracting Economic Ideology from Political Text. 2025. [Online]. Available: http://arxiv.org/abs/2501.09719
. N. Pohan, P. A. Widya Purnama, and H. Kurnia AR, “Pengenalan Aplikasi Teknologi Komputer untuk Edukasi Islami bagi Anak-anak TPQ Nurul Huda Gunung Pangilun, Kota Padang”, MB, vol. 1, no. 3, pp. 99–109, Sep. 2025, Accessed: Oct. 07, 2025. [Online]. Available: https://yasiinpublisher.org/index.php/mandalabakti/article/view/56
. W. Akbar, “Sinergi Mahasiswa Prodi Ilmu Hukum Universitas Islam Kuantan Singingi dan Aparatur Penegak Hukum dalam Mendukung Efektivitas Pelayanan Publik pada Bagian Pemulihan Aset dan Barang Bukti (PAPBB)Kejaksaan Negeri Kuantan Singingi””, MB, vol. 1, no. 3, pp. 110–118, Sep. 2025, Accessed: Oct. 07, 2025. [Online]. Available: https://yasiinpublisher.org/index.php/mandalabakti/article/view/69
. Febri Haswan, Nofri Wandi Al-Hafiz, A. Mualif, Afrinald Rizhan, Yudio Prastio, and Paris Paizal, “Pelatihan Optimalisasi Layanan Berbasis Teknologi: Aplikasi Antrian PTSP dan Sidang di Pengadilan Agama Teluk Kuantan”, MB, vol. 1, no. 3, pp. 119–125, Sep. 2025, Accessed: Oct. 07, 2025. [Online]. Available: https://yasiinpublisher.org/index.php/mandalabakti/article/view/57
Copyright (c) 2025 Alief Ramadhan Dwi Putra Alief Rama, Afiyati Afiyati

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
This is an open-access article distributed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International License which permits unrestricted use, distribution, and reproduction in any medium. Users are allowed to read, download, copy, distribute, search, or link to full-text articles in this journal without asking by giving appropriate credit, provide a link to the license, and indicate if changes were made. All of the remix, transform, or build upon the material must distribute the contributions under the same license as the original.












