Text Classification on Social Media X Using Support Vector Machine (SVM) for Public Opinion on the Pertamina Corruption Case
Abstract
Social media X (Twitter) is one of the platforms used by the public to express opinions on various public issues, including the Pertamina corruption case. The large amount of unstructured text-based opinions makes manual analysis difficult. This study aims to analyze public sentiment regarding the Pertamina corruption case on social media X using the Support Vector Machine (SVM) algorithm with Term Frequency–Inverse Document Frequency (TF-IDF) weighting. The study applies the CRISP-DM method, which includes business understanding, data understanding, data preparation, modeling, evaluation, and deployment. Data were obtained through crawling on social media X using several keywords related to the Pertamina corruption case during the period from 2018 to 2026, resulting in 3,671 tweets. The preprocessing stage included case folding, cleaning, tokenizing, stopword removal, and stemming. The data were then labeled as positive, negative, and neutral using a lexicon-based method. TF-IDF was used for word weighting, after which the data were divided into 80% training data and 20% testing data for classification using SVM with a linear kernel. The results show that the SVM model achieved good classification performance, with an accuracy of 87.76%, precision of 88.07%, recall of 87.76%, and F1-score of 87.18%. Positive sentiment was the most dominant category. The model was also implemented in a Streamlit application to display preprocessing, data visualization, sentiment prediction, and model evaluation interactively.