Comparative Sentiment Analysis of Indonesian Leadership Transitions on Platform X Using LSTM and Naïve Bayes: A Dual-Label Evaluation Using Lexicon-Based and Manual Annotation - Alief Ramadhan Dwi Putra Alief Rama; Afiyati Afiyati (Universitas Islam Kuantan Singingi, 2025)
This study compares Long Short-Term Memory (LSTM) and Naïve Bayes algorithms for sentiment analysis focused on leadership transitions within Indonesian social media. A dataset of 5,942 Indonesian-language tweets from platform X (formerly Twitter) was collected and labeled using both lexicon-based and manual annotation methods. Manual labeling was crucial to capture the nuanced and context-dependent sentiment often missed by lexicon-based techniques, especially during periods of heightened political discourse. The LSTM model was implemented for its ability to capture sequential dependencies in text, while Naïve Bayes was used as a computationally efficient baseline. Both models were rigorously evaluated using standard classification metrics, including accuracy, precision, recall, and F1-score. Experimental results show that LSTM achieved 71.6% accuracy with lexicon-based labels and 77.9% with manual labels. In comparison, Naïve Bayes achieved 61.5% and 78.2%, respectively. LSTM demonstrated better generalization across sentiment categories, particularly for neutral sentiments, while Naïve Bayes proved more effective on highly polarized datasets. These findings underscore the importance of strategic model selection based on data quality and labeling methods. The results offer valuable insights for political sentiment analysis and the development of data-driven decision-making tools in the digital political landscape.