This research focuses on sentiment analysis of news articles about general elections, especially the president and vice president by comparing the performance of classification algorithms, especially Decision Tree and K-Nearest Neighbors (KNN), and evaluating the effectiveness of the SMOTE (Synthetic Minority Over-sampling Technique) technique in overcoming the problem of data imbalance or the dataset shows that the amount of data that has positive sentiment is more than negative sentiment. The main objective of this research is to determine which algorithm is superior in sentiment classification and see how SMOTE can improve the performance of the model. The dataset was scraped and subjected to text normalization, stop words removal, and feature extraction. SMOTE was applied to balance the classes in the dataset, thus overcoming the imbalance that often occurs in sentiment data. Decision Tree and KNN algorithms were used. The results showed that Decision Tree consistently performed better than KNN in terms of 85% accuracy, 44% precision, 47% recall, and 45% F1 score. The application of SMOTE is proven to improve the performance of both algorithms, but the effect is more significant on Decision Tree. Thus, this study concludes that Decision Tree, combined with SMOTE, is a more effective and reliable approach for sentiment analysis of election articles than KNN. These results make an important contribution to the development of sentiment analysis methods that can be applied to understand the dynamics of public opinion in a political context.
                        
                        
                        
                        
                            
                                Copyrights © 2024