• Regina Anatasya Rudiyanto (1*) Telkom University
  • Erwin Budi Setiawan (2) Telkom University

  • (*) Corresponding Author
Keywords: CNN, Particle Swarm Optimization, sentiment, TF-IDF, Word2vec


Over time, social media has always changed quickly. People can voice their ideas on various topics and communicate with each other through social media. One social media platform that allows users to express their ideas through tweets is Twitter. Sentiment is the route via which each person can express their ideas on a variety of subjects. The sentiment can be positive or negative. Sentiment analysis can be used to determine how Twitter users feel about particular subjects. Sentiment analysis on popular subjects in 2023, specifically the 2024 presidential contenders, will be done in this research. The dataset used in this research consists of 37,391 entries with 5 keywords. The research aims to understand how Twitter users respond and express their sentiments towards the presidential candidate through the use of deep learning classification techniques with Convolutional Neural Network (CNN), feature extraction using Term Frequency-Inverse Document Frequency (TF-IDF) method, and feature expansion with Word2Vec. Furthermore, this study employs Particle Swarm Optimization as an optimization technique to enhance the sentiment analysis model's performance. The test's results demonstrate a high degree of accuracy, offering a comprehensive picture of Twitter users' sentiments and perspectives toward the 2024 presidential contenders. This research helps to understand the dynamics of public opinion in the political context. Based on the evaluation results of the research, it yielded an accuracy of 78.2%, showcasing an improvement of 10.07% compared to the baseline.


Download data is not yet available.


K. Sailunaz and R. Alhajj, “Emotion and sentiment analysis from Twitter text,” J Comput Sci, vol. 36, p. 101003, 2019, doi: 10.1016/j.jocs.2019.05.009.

N. L. P. C. Savitri, R. A. Rahman, R. Venyutzky, and N. A. Rakhmawati, “Analisis Klasifikasi Sentimen Terhadap Sekolah Daring pada Twitter Menggunakan Supervised Machine Learning,” Jurnal Teknik Informatika dan Sistem Informasi, vol. 7, no. 1, pp. 47–58, 2021, doi: 10.28932/jutisi.v7i1.3216.

O. Edo-Osagie, B. De La Iglesia, I. Lake, and O. Edeghere, “A scoping review of the use of Twitter for public health research,” Comput Biol Med, vol. 122, no. April, p. 103770, 2020, doi: 10.1016/j.compbiomed.2020.103770.

W. G. Angelina Puput Giovani, Ardiansyah, Tuti Haryanti, Laela Kurniawati, “Analisis Sentimen Aplikasi Ruang Guru di Twitter Menggunakan Algoritma Klasifikasi,” TEKNOINFO, vol. 14, no. 2, pp. 116–124, 2020, doi:

R. Kumar and S. Garg, “Aspect-Based Sentiment Analysis Using Deep Learning Convolutional Neural Network,” Advances in Intelligent Systems and Computing, vol. 933, pp. 43–52, 2020, doi: 10.1007/978-981-13-7166-0_5.

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, 2021, doi: 10.1016/j.future.2020.08.005.

M. R. Haque, S. Akter Lima, and S. Z. Mishu, “Performance Analysis of Different Neural Networks for Sentiment Analysis on IMDb Movie Reviews,” 3rd International Conference on Electrical, Computer and Telecommunication Engineering, ICECTE 2019, pp. 161–164, 2019, doi: 10.1109/ICECTE48615.2019.9303573.

M. Wongkar and A. Angdresey, “Sentiment Analysis Using Naive Bayes Algorithm Of The Data Crawler: Twitter,” Proceedings of 2019 4th International Conference on Informatics and Computing, ICIC 2019, pp. 1–5, 2019, doi: 10.1109/ICIC47613.2019.8985884.

V. K. S. Que, A. Iriani, and H. D. Purnomo, “Analisis Sentimen Transportasi Online Menggunakan Support Vector Machine Berbasis Particle Swarm Optimization,” Jurnal Nasional Teknik Elektro dan Teknologi Informasi, vol. 9, no. 2, pp. 162–170, 2020, doi: 10.22146/jnteti.v9i2.102.

A. Pambudi and S. Suprapto, “Effect of Sentence Length in Sentiment Analysis Using Support Vector Machine and Convolutional Neural Network Method,” IJCCS (Indonesian Journal of Computing and Cybernetics Systems), vol. 15, no. 1, p. 21, 2021, doi: 10.22146/ijccs.61627.

G. A. M. Kukuh Jaluwana, Gusti Made Arya Sasmita, and I Made Agus Dwi Suarjaya, “Analysis of Public Sentiment Towards Goverment Efforts to Break the Chain of Covid-19 Transmission in Indonesia Using CNN and Bidirectional LSTM,” Jurnal RESTI (Rekayasa Sistem dan Teknologi Informasi), vol. 6, no. 4, pp. 511–520, 2022, doi: 10.29207/resti.v6i4.4055.

A. Z. R. Adam and E. B. Setiawan, “Social Media Sentiment Analysis using Convolutional Neural Network (CNN) dan Gated Recurrent Unit (GRU),” Jurnal Ilmiah Teknik Elektro Komputer dan Informatika (JITEKI), vol. 9, no. 1, pp. 119–131, 2023, doi: 10.26555/jiteki.v9i1.25813.

F. Alfariqi, W. Maharani, and J. H. Husen, “Klasifikasi Sentimen pada Twitter dalam Membantu Pemilihan Kandidat Karyawan dengan Menggunakan Convolutional Neural Network dan Fasttext Embeddings,” e-Proceeding of Engineering, vol. 7, no. 2, pp. 8052–8062, 2020, [Online]. Available:

W. A. Prabowo and F. Azizah, “Sentiment Analysis for Detecting Cyberbullying Using TF-IDF and SVM,” Jurnal RESTI (Rekayasa Sistem dan Teknologi Informasi), vol. 4, no. 6, pp. 11–12, 2020, doi: 10.29207/resti.v4i6.2753.

H. Utama and A. Masruro, “Analisis Sentimen pada Twitter menggunakan Word Embedding dengan Pendekatan Word2Vec,” Jurnal Sistem Cerdas, vol. 5, no. 2, pp. 128–134, 2022, doi: 10.37396/jsc.v5i2.242.

D. E. Cahyani and I. Patasik, “Performance comparison of tf-idf and word2vec models for emotion text classification,” Bulletin of Electrical Engineering and Informatics, vol. 10, no. 5, pp. 2780–2788, 2021, doi: 10.11591/eei.v10i5.3157.

G. G. S. Putra, W. Swastika, and P. L. T. Irawan, “Perbandingan Particle Swarm Optimization dengan Genetic Algorithm dalam Feature Selection untuk Analisis Sentimen pada Permendikbudristek PPKS-LPT,” JEPIN (Jurnal Edukasi dan Penelitian Informatika), vol. 8, no. 3, pp. 412–421, 2022,

How to Cite
Article Metrics

Abstract viewed = 68 times
PDF downloaded = 27 times