Social media has become a major platform for the public to express opinions regarding political issues and government policies. This study aims to analyze Indonesian public sentiment toward the government policies of President Prabowo Subianto on Platform X and compare the performance of the Naïve Bayes and Support Vector Machine (SVM) algorithms for sentiment classification. Data were collected through a web crawling process using relevant keywords and subsequently underwent several preprocessing stages, including text cleaning, case folding, slang normalization, tokenization, stopword removal, and stemming. Sentiment labeling was performed automatically using a lexicon-based approach with a specially compiled Indonesian sentiment dictionary, with weighting referring to the VADER method. Text features were extracted using the Term Frequency–Inverse Document Frequency (TF-IDF) method, and the dataset was divided into training and testing sets using an 80:20 ratio. Model performance was evaluated using accuracy, precision, recall, and F1-score. The labeling results show a sentiment distribution of 42.3% positive, 33.7% negative, and 24.1% neutral. The experimental results indicate that the SVM algorithm outperformed Naïve Bayes in classifying public sentiment toward government policies, achieving an accuracy of 89% compared to 70% for Naïve Bayes. Furthermore, the specially compiled lexicon-based labeling approach proved effective in producing a large-scale training dataset without requiring manual annotation.
Copyrights © 2026