Sentiment Analysis of Public Opinion on RUU KUHAP 2025 Using Multinomial Naïve Bayes and Random Oversampling - Muhammad Aqshal Anindya Tratama; Fadli Santoso Murmita; Dimas Arsya Maulana; Cindy Renata; Raras Ailsa (Journal of Artificial Intelligence and Engineering Applications (JAIEA), 2026)
The ratification of the Draft Criminal Procedure Code (RUU KUHAP) in 2025 has triggered a significant wave of public reaction on social media, particularly on YouTube. Understanding these public sentiments is crucial for evaluating the legislative performance of the House of Representatives (DPR). This study aims to classify public opinion into positive and negative sentiments using the Multinomial Naïve Bayes algorithm. The dataset consists of 2,370 user comments collected from YouTube. To address the chal lenge of unstructured text, a comprehensive pre - processing pipeline was implemented, including cleaning, normalization, and stemming. Furthermore, this research addresses the issue of class imbalance , where negative comments dominated (73.9%) by applying the Random Oversampling (ROS) technique to the training data. The feature extraction was performed using TF - IDF. The experimental results demonstrate that the proposed model achieved an overall Accuracy of 87.22%. Detailed evaluation shows a Pr ecision of 0.9 1 and Recall of 0.93 for the negative class, confirming the model's robustness. These findings indicate that the majority of public sentiment is critical of the RUU KUHAP , focusing on issues of corruption and trust. This research contributes to the field of text mining by demonstrating the effectiveness of oversampling in improving Naïve Bayes performance on imbalanced social media data.