Issue

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Sentiment Analysis on Social Media Using CNN-RNN Hybrid: A Case Study of Indonesian Presidential Candidate
Corresponding Author(s) : Slamet Riyadi
Kinetik: Game Technology, Information System, Computer Network, Computing, Electronics, and Control,
Vol. 10, No. 2, May 2025
Abstract
Research on sentiment analysis for Presidential Candidate 01 on social media cannot be ignored because there is no in-depth understanding of public perceptions and opinions circulating online. The CNN model is quite commonly used for sentiment analysis; however, this model still has quite low accuracy so modifications need to be made. This research aims to increase the accuracy of sentiment analysis through the application of a modified Convolutional Neural Network (CNN) method. The research process includes collecting tweet data related to Presidential Candidate 01 using crawling techniques, data preprocessing, sentiment labeling, data balancing, as well as dividing the dataset into training, validation and test data. The CNN model is modified with additional layers to improve the performance. The model is evaluated by measuring its accuracy, precision, recall, and F1 Score. The research results show that the modified CNN-RNN Hybrid model with the Upsampling method achieves an accuracy of 94% and F1 Score of 0.95, while the CNN-RNN Hybrid model has an accuracy of 86% and F1 Score of 0.82, the CNN Model has an accuracy of 90% and F1 Score of 0.88, and the RNN model has an accuracy of 88% and F1 Score of 0.84, which are higher compared to the Naïve Bayes and LSTM methods used in the previous research. Modifying the CNN method can significantly increase the accuracy of sentiment analysis for Presidential Candidate 01, so that it can become a more effective tool for understanding public perceptions and improving political campaign strategies.
Keywords
Download Citation
Endnote/Zotero/Mendeley (RIS)BibTeX
- F. Aftab et al., “A Comprehensive Survey on Sentiment Analysis Techniques,” International Journal of Technology, vol. 14, no. 6, pp. 1288–1298, 2023. https://doi.org/10.14716/ijtech.v14i6.6632
- M. R. Fais Sya’ bani, U. Enri, and T. N. Padilah, “Analisis Sentimen Terhadap Bakal Calon Presiden 2024 Dengan Algoritme Naïve Bayes,” JURIKOM (Jurnal Riset Komputer), vol. 9, no. 2, p. 265, Apr. 2022. https://doi.org/10.30865/jurikom.v9i2.3989
- M. E. Basiri, S. Nemati, M. Abdar, E. Cambria, and U. R. Acharya, “ABCDM: An Attention-based Bidirectional CNN-RNN Deep Model for sentiment analysis,” Future Generation Computer Systems, vol. 115, pp. 279–294, Feb. 2021. https://doi.org/10.1016/j.future.2020.08.005
- C. N. Dang, M. N. Moreno-García, and F. De La Prieta, “Hybrid Deep Learning Models for Sentiment Analysis,” Complexity, vol. 2021, 2021. https://doi.org/10.1155/2021/9986920
- S. Sachin, A. Tripathi, N. Mahajan, S. Aggarwal, and P. Nagrath, “Sentiment Analysis Using Gated Recurrent Neural Networks,” Mar. 01, 2020, Springer. https://doi.org/10.1007/s42979-020-0076-y
- M. Z. Rahman, Y. A. Sari, and N. Yudistira, “Analisis Sentimen Tweet COVID-19 menggunakan Word Embedding dan Metode Long Short-Term Memory (LSTM),” 2021.
- Ridho Darman, “Analisis Sentimen Respons Twitter Terhadap Persyaratan Badan Penyelenggara Jaminan Sosial Kantor Pertanahan” Kantor Pertanahan Kabupaten Agam, K. Agraria dan Tata Ruang, B. Lubuk Basung, K. Agam, and P. Sumatera Barat, “Jurnal Widya Bhumi,” 2023. https://doi.org/10.31292/wb.v3i2.61
- M. Li and Y. Shi, “Sentiment analysis and prediction model based on Chinese government affairs microblogs,” Heliyon, vol. 9, no. 8, Aug. 2023. https://doi.org/10.1016/j.heliyon.2023.e19091
- M. Işik and H. Dağ, “The impact of text preprocessing on the prediction of review ratings,” 2020, Turkiye Klinikleri. https://doi.org/10.3906/elk-1907-46
- J. Khatib Sulaiman, D. Setiyawati, N. Cahyono, and U. Amikom Yogyakarta, “Analisa Sentimen Pengguna Sosial Media Twitter Terhadap Perokok di Indonesia,” Indonesian Journal of Computer Science Attribution, vol. 12, no. 1, pp. 2023–262, 2023. https://doi.org/10.33022/ijcs.v12i1.3154
- S. Dewi and D. B. Arianto, “Twitter Sentiment Analysis Towards Qatar as Host of The 2022 World Cup Using Textblob”. https://doi.org/10.55324/josr.v2i2.615
- H. Dia, “Evaluating the Accuracy of Sentiment Analysis Models when Applied to Social Media Texts; Evaluating the Accuracy of Sentiment Analysis Models when Applied to Social Media Texts; Utvärdering av noggrannheten hos sentimentanalysmodeller när de tillämpas på texter från sociala medier.”
- C. Magnolia, A. Nurhopipah, D. Bagus, and A. Kusuma, “Edu Komputika Journal Penanganan Imbalanced Dataset untuk Klasifikasi Komentar Program Kampus Merdeka Pada Aplikasi Twitter,” 2022. https://doi.org/10.15294/edukomputika.v9i2.61854
- J. Prasetya, “Leibniz : Jurnal Matematika Penerapan Klasifikasi Naive Bayes Dengan Algoritma Random Oversampling dan Random Undersampling Pada Data Tidak Seimbang Cervical Cancer Risk Factors,” vol. 2, no. 2. https://doi.org/10.59632/leibniz.v2i2.173
- A. Q. Md, S. Kulkarni, C. J. Joshua, T. Vaichole, S. Mohan, and C. Iwendi, “Enhanced Preprocessing Approach Using Ensemble Machine Learning Algorithms for Detecting Liver Disease,” Biomedicines, vol. 11, no. 2, Feb. 2023. https://doi.org/10.3390/biomedicines11020581
- L. Geni, E. Yulianti, and D. I. Sensuse, “Sentiment Analysis of Tweets Before the 2024 Elections in Indonesia Using IndoBERT Language Models,” Jurnal Ilmiah Teknik Elektro Komputer dan Informatika (JITEKI), vol. 9, no. 3, pp. 746–757, 2023. https://doi.org/10.26555/jiteki.v9i3.26490
- M. M. A. Monshi, J. Poon, V. Chung, and F. M. Monshi, “CovidXrayNet: Optimizing data augmentation and CNN hyperparameters for improved COVID-19 detection from CXR,” Comput Biol Med, vol. 133, Jun. 2021. https://doi.org/10.1016/j.compbiomed.2021.104375
- L. Zhao and Z. Zhang, “A improved pooling method for convolutional neural networks,” Sci Rep, vol. 14, no. 1, Dec. 2024. https://doi.org/10.1038/s41598-024-51258-6
- H. Asrawi, E. Utami, and A. Yaqin, “LSTM and Bidirectional GRU Comparison for Text Classification,” sinkron, vol. 8, no. 4, pp. 2264–2274, Oct. 2023. https://doi.org/10.33395/sinkron.v8i4.12899
- M. A. Nurrohmat and A. SN, “Sentiment Analysis of Novel Review Using Long Short-Term Memory Method,” IJCCS (Indonesian Journal of Computing and Cybernetics Systems), vol. 13, no. 3, p. 209, Jul. 2019. https://doi.org/10.22146/ijccs.41236
- F. A. Irawan and D. A. Rochmah, “Penerapan Algoritma CNN Untuk Mengetahui Sentimen Masyarakat Terhadap Kebijakan Vaksin Covid-19,” JURNAL INFORMATIKA, vol. 9, no. 2, 2022. https://doi.org/10.31294/inf.v9i2.13257
- R. Yacouby Amazon Alexa and D. Axman Amazon Alexa, “Probabilistic Extension of Precision, Recall, and F1 Score for More Thorough Evaluation of Classification Models.” https://doi.org/10.18653/v1/2020.eval4nlp-1.9
- D. Hidayatul Qudsi, J. Hakim Lubis, K. Umam Syaliman, and N. Fadilah Najwa, “Analisis Sentimen Pada Data Saran Mahasiswa Terhadap Kinerja Departemen Di Perguruan Tinggi Menggunakan Convolutional Neural Network,” 2021. https://doi.org/10.25126/jtiik.202184842
- S. Pavlitskaya, J. Oswald, and J. M. Zöllner, “Measuring Overfitting in Convolutional Neural Networks using Adversarial Perturbations and Label Noise,” Sep. 2022. https://doi.org/10.48550/arXiv.2209.13382
- M. Ainur Rohman and T. Chamidy, “Bidirectional GRU dengan Attention Mechanism pada Analisis Sentimen PLN Mobile Bidirectional GRU with Attention Mechanism on Sentiment Analysis of PLN Mobile.” https://doi.org/10.33633/tc.v22i2.7876
References
F. Aftab et al., “A Comprehensive Survey on Sentiment Analysis Techniques,” International Journal of Technology, vol. 14, no. 6, pp. 1288–1298, 2023. https://doi.org/10.14716/ijtech.v14i6.6632
M. R. Fais Sya’ bani, U. Enri, and T. N. Padilah, “Analisis Sentimen Terhadap Bakal Calon Presiden 2024 Dengan Algoritme Naïve Bayes,” JURIKOM (Jurnal Riset Komputer), vol. 9, no. 2, p. 265, Apr. 2022. https://doi.org/10.30865/jurikom.v9i2.3989
M. E. Basiri, S. Nemati, M. Abdar, E. Cambria, and U. R. Acharya, “ABCDM: An Attention-based Bidirectional CNN-RNN Deep Model for sentiment analysis,” Future Generation Computer Systems, vol. 115, pp. 279–294, Feb. 2021. https://doi.org/10.1016/j.future.2020.08.005
C. N. Dang, M. N. Moreno-García, and F. De La Prieta, “Hybrid Deep Learning Models for Sentiment Analysis,” Complexity, vol. 2021, 2021. https://doi.org/10.1155/2021/9986920
S. Sachin, A. Tripathi, N. Mahajan, S. Aggarwal, and P. Nagrath, “Sentiment Analysis Using Gated Recurrent Neural Networks,” Mar. 01, 2020, Springer. https://doi.org/10.1007/s42979-020-0076-y
M. Z. Rahman, Y. A. Sari, and N. Yudistira, “Analisis Sentimen Tweet COVID-19 menggunakan Word Embedding dan Metode Long Short-Term Memory (LSTM),” 2021.
Ridho Darman, “Analisis Sentimen Respons Twitter Terhadap Persyaratan Badan Penyelenggara Jaminan Sosial Kantor Pertanahan” Kantor Pertanahan Kabupaten Agam, K. Agraria dan Tata Ruang, B. Lubuk Basung, K. Agam, and P. Sumatera Barat, “Jurnal Widya Bhumi,” 2023. https://doi.org/10.31292/wb.v3i2.61
M. Li and Y. Shi, “Sentiment analysis and prediction model based on Chinese government affairs microblogs,” Heliyon, vol. 9, no. 8, Aug. 2023. https://doi.org/10.1016/j.heliyon.2023.e19091
M. Işik and H. Dağ, “The impact of text preprocessing on the prediction of review ratings,” 2020, Turkiye Klinikleri. https://doi.org/10.3906/elk-1907-46
J. Khatib Sulaiman, D. Setiyawati, N. Cahyono, and U. Amikom Yogyakarta, “Analisa Sentimen Pengguna Sosial Media Twitter Terhadap Perokok di Indonesia,” Indonesian Journal of Computer Science Attribution, vol. 12, no. 1, pp. 2023–262, 2023. https://doi.org/10.33022/ijcs.v12i1.3154
S. Dewi and D. B. Arianto, “Twitter Sentiment Analysis Towards Qatar as Host of The 2022 World Cup Using Textblob”. https://doi.org/10.55324/josr.v2i2.615
H. Dia, “Evaluating the Accuracy of Sentiment Analysis Models when Applied to Social Media Texts; Evaluating the Accuracy of Sentiment Analysis Models when Applied to Social Media Texts; Utvärdering av noggrannheten hos sentimentanalysmodeller när de tillämpas på texter från sociala medier.”
C. Magnolia, A. Nurhopipah, D. Bagus, and A. Kusuma, “Edu Komputika Journal Penanganan Imbalanced Dataset untuk Klasifikasi Komentar Program Kampus Merdeka Pada Aplikasi Twitter,” 2022. https://doi.org/10.15294/edukomputika.v9i2.61854
J. Prasetya, “Leibniz : Jurnal Matematika Penerapan Klasifikasi Naive Bayes Dengan Algoritma Random Oversampling dan Random Undersampling Pada Data Tidak Seimbang Cervical Cancer Risk Factors,” vol. 2, no. 2. https://doi.org/10.59632/leibniz.v2i2.173
A. Q. Md, S. Kulkarni, C. J. Joshua, T. Vaichole, S. Mohan, and C. Iwendi, “Enhanced Preprocessing Approach Using Ensemble Machine Learning Algorithms for Detecting Liver Disease,” Biomedicines, vol. 11, no. 2, Feb. 2023. https://doi.org/10.3390/biomedicines11020581
L. Geni, E. Yulianti, and D. I. Sensuse, “Sentiment Analysis of Tweets Before the 2024 Elections in Indonesia Using IndoBERT Language Models,” Jurnal Ilmiah Teknik Elektro Komputer dan Informatika (JITEKI), vol. 9, no. 3, pp. 746–757, 2023. https://doi.org/10.26555/jiteki.v9i3.26490
M. M. A. Monshi, J. Poon, V. Chung, and F. M. Monshi, “CovidXrayNet: Optimizing data augmentation and CNN hyperparameters for improved COVID-19 detection from CXR,” Comput Biol Med, vol. 133, Jun. 2021. https://doi.org/10.1016/j.compbiomed.2021.104375
L. Zhao and Z. Zhang, “A improved pooling method for convolutional neural networks,” Sci Rep, vol. 14, no. 1, Dec. 2024. https://doi.org/10.1038/s41598-024-51258-6
H. Asrawi, E. Utami, and A. Yaqin, “LSTM and Bidirectional GRU Comparison for Text Classification,” sinkron, vol. 8, no. 4, pp. 2264–2274, Oct. 2023. https://doi.org/10.33395/sinkron.v8i4.12899
M. A. Nurrohmat and A. SN, “Sentiment Analysis of Novel Review Using Long Short-Term Memory Method,” IJCCS (Indonesian Journal of Computing and Cybernetics Systems), vol. 13, no. 3, p. 209, Jul. 2019. https://doi.org/10.22146/ijccs.41236
F. A. Irawan and D. A. Rochmah, “Penerapan Algoritma CNN Untuk Mengetahui Sentimen Masyarakat Terhadap Kebijakan Vaksin Covid-19,” JURNAL INFORMATIKA, vol. 9, no. 2, 2022. https://doi.org/10.31294/inf.v9i2.13257
R. Yacouby Amazon Alexa and D. Axman Amazon Alexa, “Probabilistic Extension of Precision, Recall, and F1 Score for More Thorough Evaluation of Classification Models.” https://doi.org/10.18653/v1/2020.eval4nlp-1.9
D. Hidayatul Qudsi, J. Hakim Lubis, K. Umam Syaliman, and N. Fadilah Najwa, “Analisis Sentimen Pada Data Saran Mahasiswa Terhadap Kinerja Departemen Di Perguruan Tinggi Menggunakan Convolutional Neural Network,” 2021. https://doi.org/10.25126/jtiik.202184842
S. Pavlitskaya, J. Oswald, and J. M. Zöllner, “Measuring Overfitting in Convolutional Neural Networks using Adversarial Perturbations and Label Noise,” Sep. 2022. https://doi.org/10.48550/arXiv.2209.13382
M. Ainur Rohman and T. Chamidy, “Bidirectional GRU dengan Attention Mechanism pada Analisis Sentimen PLN Mobile Bidirectional GRU with Attention Mechanism on Sentiment Analysis of PLN Mobile.” https://doi.org/10.33633/tc.v22i2.7876