Klasifikasi Opini Publik di Twitter Terhadap Bakal Calon Presiden Indonesia Tahun 2024 Menggunakan LSTM Secara Realtime Berbasis Website

  • Muhammad Rizki Politeknik Harapan Bersama
  • Muhammad Fikri Hidayattullah Politeknik Harapan Bersama
  • Dwi Intan Af'idah Politeknik Harapan Bersama
Abstract views: 55 , PDF downloads: 45
Keywords: public opinion, presidential election, LSTM, realtime, dashboard


The analysis of public opinions from Indonesian netizens regarding the potential presidential candidates for Indonesia in 2024 on Twitter is challenging. Human-based classification of the candidates on Twitter has limitations as it requires expertise and a considerable amount of time to process the data. Therefore, a system that provides realtime visualization of public opinion classification is necessary. Previous research only focused on model evaluation, while this study aims to implement the best model on a website. The objective of this research is to develop a system for monitoring the Twitter-based public opinion classification of the potential presidential candidates for Indonesia in 2024 within specific time frames. The training process utilizes the LSTM method, resulting in a model with an accuracy of 76%. Parameters such as batch size, dropout, and learning rate were tested. The data used in this study was obtained by crawling Twitter using the keywords Ganjar Pranowo, Anies Baswedan, and Prabowo Subianto. The LSTM model was then implemented in a website-based system that generates a dashboard with features such as a color-coded map displaying the highest levels of positive sentiment for each candidate in each province, the overall classification count for each candidate, and filters for sentiment classification based on province and specific time frames. 


Sekretariat Negara, Undang - Undang Republik Indonesia Nomor 42 Tahun 2008 Tentang Pemilihan Umum Presiden dan Wakil Presiden. 2008.

Y. Medistiara, “Survei PWS: Elektabilitas Prabowo 30,8%, Ganjar 18,8%, Anies 17,5%,” Jakarta, 2022.

N. Utami, “Survei Capres IPO: Prabowo 24,8%, Anies 22,5%, dan Ganjar 19,3%,” Jakarta, 2022.

M. O. Erwanti, “Survei Capres SMRC: Ganjar 32,1%, Prabowo 27,5%, Anies 26%,” Jakarta, 2022.

A. B. Ramadhan, “Survei Charta Politika: Prabowo Unggul di Jabar, Ganjar di Sumut dan Kaltim,” Jakarta, 2022.

D. Reportal, “Social media statistics for Indonesia in 2022,” 2022. https://datareportal.com/reports/digital-2022-indonesia (accessed Nov. 03, 2022).

N. I. Widiastuti, E. Rainarli, and K. E. Dewi, “Peringkasan dan Support Vector Machine pada Klasifikasi Dokumen,” J. Infotel, vol. 9, no. 4, p. 416, 2017, doi: 10.20895/infotel.v9i4.312.

D. C. Mutz, S. American, P. Science, and N. Oct, “The Consequences of Cross-Cutting Networks for Political Participation Author ( s ): Diana C . Mutz Reviewed work ( s ): Source : American Journal of Political Science , Vol . 46 , No . 4 ( Oct ., 2002 ), pp . 838-855 Published by : Midwest Political Scie,” vol. 46, no. 4, pp. 838–855, 2013.

B. Liu, Sentiment Analysis: A Fascinating Problem. 2012.

T. Iqbal and S. Qureshi, “The survey: Text generation models in deep learning,” J. King Saud Univ. - Comput. Inf. Sci., vol. 34, no. 6, pp. 2515–2528, 2022, doi: 10.1016/j.jksuci.2020.04.001.

A. Yenter and A. Verma, “Deep CNN-LSTM with combined kernels from multiple branches for IMDb review sentiment analysis,” 2017 IEEE 8th Annu. Ubiquitous Comput. Electron. Mob. Commun. Conf. UEMCON 2017, vol. 2018-Janua, pp. 540–546, 2017, doi: 10.1109/UEMCON.2017.8249013.

A. P. Nardilasari, A. L. Hananto, S. S. Hilabi, and B. Priyatna, “Analisis Sentimen Calon Presiden 2024 Menggunakan Algoritma SVM,” vol. 7, no. 1, pp. 11–18, 2024.

S. Wiyono, D. S. Wibowo, M. F. Hidayatullah, and D. Dairoh, “Comparative Study of KNN, SVM and Decision Tree Algorithm for Student’s Performance Prediction,” Int. J. Comput. Sci. Appl. Math., vol. 6, no. 2, p. 50, 2020, doi: 10.12962/j24775401.v6i2.4360.

H. Ghulam, F. Zeng, W. Li, and Y. Xiao, “Deep Learning-Based Sentiment Analysis for Roman Urdu Text,” Procedia Comput. Sci., vol. 147, pp. 131–135, 2019, doi: 10.1016/j.procs.2019.01.202.

R. P. Nawangsari, R. Kusumaningrum, and A. Wibowo, “Word2vec for Indonesian sentiment analysis towards hotel reviews: An evaluation study,” Procedia Comput. Sci., vol. 157, pp. 360–366, 2019, doi: 10.1016/j.procs.2019.08.178.

D. Jatnika, M. A. Bijaksana, and A. A. Suryani, “Word2vec model analysis for semantic similarities in English words,” Procedia Comput. Sci., vol. 157, pp. 160–167, 2019, doi: 10.1016/j.procs.2019.08.153.

C. Zhang, X. Wang, S. Yu, and Y. Wang, “Research on Keyword Extraction of Word2vec Model in Chinese Corpus,” Proc. - 17th IEEE/ACIS Int. Conf. Comput. Inf. Sci. ICIS 2018, pp. 339–343, 2018, doi: 10.1109/ICIS.2018.8466534.

E. Miranda, “Sentiment Analysis using Sentiwordnet and Machine Learning Approach ( Indonesia general election opinion from the twitter content ),” 2019 Int. Conf. Inf. Manag. Technol., vol. 1, no. August, pp. 62–67, 2019.

P. Singh, R. S. Sawhney, and K. S. Kahlon, “Forecasting the 2016 US Presidential Elections Using Sentiment Analysis,” vol. 1, pp. 276–288, 2017, doi: 10.1007/978-3-319-68557-1_36.

D. I. Af’idah, D. Dairoh, S. F. Handayani, R. W. Pratiwi, and S. I. Sari, “Sentimen Ulasan Destinasi Wisata Pulau Bali Menggunakan Bidirectional Long Short Term Memory,” MATRIK J. Manajemen, Tek. Inform. dan Rekayasa Komput., vol. 21, no. 3, pp. 607–618, 2022, doi: 10.30812/matrik.v21i3.1402.

I. M. Guyon, “A Scaling Law for the Validation-Set Training-Set Size Ratio,” 1997.

PlumX Metrics