Sentiment Analysis of Hate Speech against DPR-RI on Twitter Using Naive Bayes and KNN Algorithms - Munthe, Joy Lousia Brigitha; Sinaga, Kristin; Santi Prayudani (Electronic Integrated Computer Algorithm Journal, 2024)
According to surveys, the rise in social media users has resulted in an increase of hate speech, and Twitter is one of the most popular platforms for this type of speech. The tweet feature on Twitter enables users to make repeated instances of hate speech, making Twitter data very intriguing to analyze. This study aims to investigate whether a tweet contains hate speech towards the Indonesian House of Representatives (DPR-RI). The research employed crawling techniques to gather data from Twitter using the Twitter API feature. The Naïve Bayes algorithm was applied, and the results were compared with the accuracy of the K-Nearest Neighbor. After preprocessing, the total data obtained was 1,494, with 956 test data and 538 training data. The study revealed that Twitter users' sentiment towards DPR-RI was 49.2% positive and 50.8% negative sentiment when tested using Naïve Bayes. Meanwhile, KNN showed 23.4% positive and 76.6% negative sentiment. The high negative sentiment in both classifiers suggests that Twitter users frequently express hate speech towards DPR-RI. Naïve Bayes algorithm showed the highest prediction accuracy at 98.32%, while the K-Nearest Neighbor algorithm had an accuracy of only 62.84%.