This study aims to analyze public sentiment towards the 2024 North Sumatra gubernatorial election by leveraging social media data, specifically TikTok, which has become a major platform for political discourse in Indonesia. The two competing candidate pairs, Bobby Nasution–Surya and Edy Rahmayadi–Hasan Basri, have sparked widespread online discussions that range from enthusiastic support to harsh criticism. These interactions have a significant impact on public opinion formation and may influence electoral outcomes. To address this phenomenon, this research implements a sentiment classification model using the Support Vector Machine (SVM) algorithm with a polynomial kernel, known for its effectiveness in handling high-dimensional textual data. A total of 2,100 TikTok comments were collected using scraping techniques via Python. The data then underwent several preprocessing stages, including case folding, cleaning, normalization, tokenizing, slangword removal, stopword removal, and stemming. Feature extraction was conducted using the TF-IDF method, followed by lexicon-based sentiment labeling into positive and negative classes. The classification model achieved an accuracy of 82%, with a positive sentiment precision of 0.81, recall of 0.96, and F1-score of 0.88. For negative sentiment, the precision was 0.86, recall 0.51, and F1-score 0.64. These findings indicate that the model performs well in identifying explicit positive sentiments but faces challenges in recognizing complex negative expressions such as sarcasm or implicit criticism. The results provide valuable insights into digital political behavior and demonstrate the potential of machine learning-based sentiment analysis as a tool for monitoring public perception in real time during elections.
Copyrights © 2025