Sentiment Analysis of Opinions on the Performance of the Governor of West Java in 2025 on Social Media X Using LSTM

Muhammad Apipudin Safaat, Nia Ekawati

Submitted : 2025-07-09, Published : 2025-11-30.

Abstract

The rise of political discourse on Indonesian social media platforms such as X (formerly Twitter) creates opportunities and challenges for policymakers. Existing sentiment analysis methods often fail to handle informal language, slang, and sarcasm, leading to frequent misclassification that may misguide governance decisions. This study aims to establish the first benchmark for three-class sentiment analysis (positive, neutral, negative) in Indonesian political discourse using a Long Short-Term Memory (LSTM) model with culture-specific preprocessing. A dataset of 1,002 tweets on the performance of the Governor of West Java (Feb–May 2025) was collected, normalized for slang and typos, and enriched with a political lexicon. Manual annotation achieved high agreement (κ = 0.82). An LSTM model with 128 units and 30% dropout was trained and evaluated. Results show 95.88% training accuracy but only 36.32% validation accuracy, indicating severe overfitting. Misclassifications (42%) mainly stemmed from sarcasm and contextual ambiguity, with the lowest precision in the positive class (31%). The study contributes by (1) providing the first benchmark for Indonesian political sentiment, (2) demonstrating the value of culture-specific preprocessing, and (3) offering policy insights into latent dissatisfaction hidden in neutral tweets. Limitations include small dataset size and lack of sarcasm-aware mechanisms, suggesting future exploration of hybrid and transformer-based models.

Keywords

Sentiment Analysis; LSTM; Indonesian NLP; Political Communication; Social Media Mining; Overfitting

References

P. Sunarko, A. Bijaksana Putra Negara, R. Septiriana, and J. H. Hadari Nawawi, “Perbandingan Klasifikasi Algoritma Support vector machine dan Naïve Bayes Menggunakan Labeling VADER dan Lexicon based pada Tweets Bahasa Indonesia dan Bahasa Inggris,” JUARA, J. Apl. dan Ris. Inform., vol. 3, no. 1, pp. 9–19, 2024, doi: 10.26418/juara.v3i1.86468.

B. M. A. AWAD, Z. NADIAH, and A. N. S. NASUTION, “Opini Publik Terhadap Penerapan New Normal Di Media Sosial Twitter,” Cover. J. Strateg. Commun., vol. 11, no. 1, pp. 19–26, 2020, doi: 10.35814/coverage.v11i1.1728.

J. Y. Hui, “Rsis commentaries,” Most, no. 67906982, pp. 4–6, 2009.

Fransiscus and A. S. Girsang, “Sentiment Analysis of COVID-19 Public Activity Restriction (PPKM) Impact using BERT Method,” Int. J. Eng. Trends Technol., vol. 70, no. 12, pp. 281–288, 2022, doi: 10.14445/22315381/IJETT-V70I12P226.

G. F. Nama, A. H. Shalihah, P. B. Wintoro, Y. Mulyani, and D. Despa, “Implementation of Naïve Bayes Classifier & Support Vector Machine Algorithm for Sentiment Classification using Twitter Data on Indonesian Presidential Candidates In 2024,” J. Inf. Syst. Eng. Manag., vol. 10, no. 20s, pp. 510–531, 2025, doi: 10.52783/jisem.v10i20s.3175.

Ahmed Derbala Yacoub, Salwa O. Slim, and Amal Elsayed Aboutabl, “A Survey of Sentiment Analysis and Sarcasm Detection: Challenges, Techniques, and Trends,” Int. J. Electr. Comput. Eng. Syst., vol. 15, pp. 69–78, 2024.

S. S. Almalki, “Sentiment Analysis and Emotion Detection Using Transformer Models in Multilingual Social Media Data,” Int. J. Adv. Comput. Sci. Appl., vol. 16, no. 3, pp. 324–333, 2025, doi: 10.14569/IJACSA.2025.0160332.

M. O. Ibrohim and I. Budi, “Hate speech and abusive language detection in Indonesian social media: Progress and challenges,” Heliyon, vol. 9, no. 8, p. e18647, 2023, doi: 10.1016/j.heliyon.2023.e18647.

H. Tang, N. Zhang, X. Yu, T. Mao, and L. Wang, “Enhancing Sentiment Analysis with Word2Vec and LSTM: A Comparative Study,” J. Basic Appl. Res. Int., vol. 29, no. 3, pp. 1–10, 2023, doi: 10.56557/jobari/2023/v29i38342.

M. Huang, Y. Cao, and C. Dong, “Modeling Rich Contexts for Sentiment Classification with LSTM,” 2016, [Online]. Available: http://arxiv.org/abs/1605.01478

H. Murfi, S. Theresia Gowandi, G. Ardaneswari, and S. Nurrohmah, “BERT-based combination of convolutional and recurrent neural network for indonesian sentiment analysis,” Appl. Soft Comput., vol. 151, pp. 1–15, 2024, doi: 10.1016/j.asoc.2023.111112.

H. Jayadianti, W. Kaswidjanti, A. T. Utomo, S. Saifullah, F. A. Dwiyanto, and R. Drezewski, “Sentiment analysis of Indonesian reviews using fine-tuning IndoBERT and R-CNN,” Ilk. J. Ilm., vol. 14, no. 3, pp. 348–354, 2022, doi: 10.33096/ilkom.v14i3.1505.348-354.

Y. Y. Tan, C. O. Chow, J. Kanesan, J. H. Chuah, and Y. L. Lim, “Sentiment Analysis and Sarcasm Detection using Deep Multi-Task Learning,” Wirel. Pers. Commun., vol. 129, no. 3, pp. 2213–2237, 2023, doi: 10.1007/s11277-023-10235-4.

A. A. Mudding and Arifin A Abd Karim, “Analisis Sentimen Menggunakan Algoritma Lstm Pada Media Sosial,” J. Publ. Ilmu Komput. dan Multimed., vol. 1, no. 3, pp. 181–187, 2022, doi: 10.55606/jupikom.v1i3.517.

T. Widyanto, I. Ristiana, and A. Wibowo, “Komparasi Naïve Bayes dan SVM Analisis Sentimen RUU Kesehatan di Twitter,” SINTECH (Science Inf. Technol. J., vol. 6, no. 3, pp. 147–161, 2023, doi: 10.31598/sintechjournal.v6i3.1433.

J. Devlin, M.-W. Chang, K. Lee, K. T. Google, and A. I. Language, “BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding,” Naacl-Hlt 2019, no. Mlm, pp. 4171–4186, 2018, [Online]. Available: https://aclanthology.org/N19-1423.pdf

R. Prabowo, H. Sujaini, and T. Rismawan, “Analisis Sentimen Pengguna Twitter Terhadap Kasus COVID-19 di Indonesia Menggunakan Metode Regresi Logistik Multinomial,” J. Sist. dan Teknol. Inf., vol. 11, no. 2, p. 366, 2023, doi: 10.26418/justin.v11i2.57449.

D. W. Wicaksono, B. Hartono, J. T. Lomba, and J. Semarang, “Analisis Sentimen Twitter Terhadap Kualitas Udara Jakarta Menggunakan Metode NBC,” vol. 17, no. 1, pp. 103–110, 2024, [Online]. Available: http://journal.stekom.ac.id/index.php/elkompage103

A. M. K. Mohammed, G. G. M. N. Ali, and S. S. Khairunnesa, “GSAF: An ML-Based Sentiment Analytics Framework for Understanding Contemporary Public Sentiment and Trends on Key Societal Issues,” Inf., vol. 16, no. 4, 2025, doi: 10.3390/info16040271.

E. Lunando and A. Purwarianti, “Indonesian social media sentiment analysis with sarcasm detection,” 2013 Int. Conf. Adv. Comput. Sci. Inf. Syst. ICACSIS 2013, pp. 195–198, 2013, doi: 10.1109/ICACSIS.2013.6761575.

A. Glenn, P. LaCasse, and B. Cox, “Emotion classification of Indonesian Tweets using Bidirectional LSTM,” Neural Comput. Appl., vol. 35, no. 13, pp. 9567–9578, 2023, doi: 10.1007/s00521-022-08186-1.

V. R. Prasetyo, M. F. Naufal, and K. Wijaya, “Sentiment Analysis of ChatGPT on Indonesian Text using Hybrid CNN and Bi-LSTM,” J. RESTI, vol. 9, no. 2, pp. 327–333, 2025, doi: 10.29207/resti.v9i2.6334.

V. B. Lestari, E. Utami, and Hanafi, “Combining Bi-LSTM And Word2vec Embedding For Sentiment Analysis Models Of Application User Reviews,” Indones. J. Comput. Sci., vol. 13, no. 1, pp. 312–326, 2024, doi: 10.33022/ijcs.v13i1.3647.

P. Sayarizki and H. Nurrahmi, “Implementation of IndoBERT for Sentiment Analysis of Indonesian Presidential Candidates,” J. Comput., vol. 9, no. 2, pp. 61–72, 2024, doi: 10.34818/indojc.2024.9.2.934.

O. Vitman, Y. Kostiuk, G. Sidorov, and A. Gelbukh, “Sarcasm detection framework using context, emotion and sentiment features,” Expert Syst. Appl., vol. 234, no. 559, 2023, doi: 10.1016/j.eswa.2023.121068.

Article Metrics

Abstract view: 46 times
Download     : 12   times Download     : 4   times

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

Refbacks

  • There are currently no refbacks.