Sentiment Analysis Before Presidential Election 2024 Using Naïve Bayes Classifier Based On Public Opinion In Twitter

  • Prasetyo H
  • Fitrani A
N/ACitations
Citations of this article
16Readers
Mendeley users who have this article in their library.

Abstract

This study aims to determine the performance of the Naïve Bayes Classifier algorithm and sentiment analysis tested on a dataset obtained from Twitter social media scrapping with the topic of 2024 presidential candidates. Three candidates frequently discussed in public spaces were used as keyword parameters in data mining: #anis, #ganjar, and #pilpres2024, resulting in 3021 tweets extracted from 12/1/2022 to 31/1/2023, which were successfully converted to ".csv" format documents. Public opinions extracted from the dataset were then pre-processed using the Python programming language, resulting in 2157 cleaned tweets. The data that passed the pre-processing stage was then labeled as positive or negative sentiment. Sentiment analysis was performed using the Naïve Bayes Classifier algorithm with three testing experiments using different training and testing data compositions in each experiment. The results of the study showed that the best Naïve Bayes model was obtained in the first experiment with a 10% testing data and 90% training data composition, resulting in 71% accuracy, 93% precision, 66% recall, and an f-measure score of 77%. The conclusion of the study is that the electability of the 2024 presidential candidates shapes public opinion and generates public sentiment in the form of positive and negative tweets. Positive tweets had a higher percentage of 71.5% (1543), while negative sentiment tweets accounted for 28.5% (614). Further research is expected to produce different information by using different classification algorithms and larger data sets.

Cite

CITATION STYLE

APA

Prasetyo, H., & Fitrani, A. S. (2023). Sentiment Analysis Before Presidential Election 2024 Using Naïve Bayes Classifier Based On Public Opinion In Twitter. Procedia of Engineering and Life Science, 4. https://doi.org/10.21070/pels.v4i0.1395

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free