Understanding Public Sentiments on the 2024 Presidential Election through BERT-Powered Analysis - Setiawan, Abiyyu Daffa Haidar; Maharani, Warih (Jurnal Pendidikan Informatika (EDUMATIC), 2025)
Social media platforms serve as dynamic communication across boundaries, with X serving as a platform for opinion exchange. This research examines public sentiment on the 2024 Indonesian Presidential Election to understand voter sentiments based on what happened during the pre-election. Using the Twitter API, 2,146 tweets were collected based on election-related keywords and hashtags, focusing on Indonesian-language tweets with direct opinions. The method that we use is data crawling using the Twitter API. Preprocessing steps included case folding (converting text to lowercase), cleansing (removing noise like URLs and emojis), tokenization, stemming (reducing words to base forms), and stop word removal (e.g., “yang,” “dan”). Slang was standardized with a custom dictionary to ensure consistency and accurate interpretation. Leveraging BERT for sentiment analysis, the model achieved 99% accuracy; results indicate that 93.1% of analyzed tweets expressed negative sentiment, highlighting public dissatisfaction about the 2024 presidential election. Hyperparameters are also tested to optimize model performances. With the best result accuracy in 99% using an 80:20 split ratio, with a batch size of 16 and a learning rate of 0.00001. This research underlines the importance of sentiment analysis in elections, demonstrating BERT’s capability to handle linguistic complexities and providing a methodological framework for analyzing social media data in political contexts.