During the pandemic, the Indonesian government issued a Distance Learning (PJJ) policy to reduce the spread of COVID-19. Many people expressed opinions about the pros and cons of the implementation of distance learning policies through social media, one of which is Twitter. These opinions can then be processed by conducting sentiment analysis. In this study, researcher will implement the K-Nearest Neighbor method to conduct sentiment analysis on Twitter regarding distance learning. The initial stage of the research is collecting tweets from Twitter as many as 1014 data. The next stage is labeling the dataset manually, which is then followed by the preprocessing stage which consists of data cleaning, case folding, tokenization, normalization, stopword removal and stemming. The dataset is further divided into two, namely train data and test data using an 8:2 ratio, where 80% is used as train data and 20% is used as test data. The K-Nearest Neighbor model is then built with several different hyperparameters. The KNN model evaluated using test data. The calculation of the accuracy value between the prediction sentiment and the actual sentiment of the test data is done using confusion matrix. The results of data classification using the K-Nearest Neighbor method with the most optimal hyperparameter resulted in an accuracy of 74.38%. The results of the study are expected to be able to classify positive and negative sentiment within sentences with the best accuracy so that the results of this study can help the government regarding distance learning policies during the pandemic.
Copyrights © 2026