Application of Sentiment Analysis to Crime News using Tf-Idf and K-Nearest Neighbor to Assess Public Perception
DOI:
https://doi.org/10.59934/jaiea.v5i1.1643Keywords:
Sentiment analysis, TF-IDF, K-Nearest Neighbor, criminal news, public opinionAbstract
The development of information technology and social media has changed the way people access news, including criminal news that is often in the public spotlight. Criminal news not only presents facts, but can also shape public opinion quickly and widely so that it has the potential to cause disinformation. For this reason, sentiment analysis is needed that is able to provide an objective picture of public perception of criminal news.This study uses a quantitative approach with stages: collection of crime news data and public comments from online media, text preprocessing (cleansing, case folding, tokenizing, stopword removal, normalization, and stemming), feature extraction using Term Frequency-Inverse Document Frequency (TF-IDF), sentiment classification with the K-Nearest Neighbor algorithm (K-NN), as well as model evaluation through accuracy, precision, recall, and F1-score metrics. The results showed that the combination of TF-IDF and K-NN was able to classify public comments on criminal news into three sentiment classes (positive, negative, neutral) with an accuracy rate of 82%. Further evaluation showed an average precision value of 0.86, a recall of 0.82, and an F1-score of 0.82. These findings prove that the TF-IDF and K-NN methods are effective in understanding public perception of online media-based crime reporting.
Downloads
References
A. P. Saputra and D. Lestari, “Klasifikasi teks komentar berita menggunakan metode TF-IDF dan K-NN,” J. Inform. dan Komput., vol. 7, no. 1, pp. 45–51, 2021.
R. Septian, H. Nugroho, and S. Lestari, “Penerapan Analisis Sentimen pada Media Sosial Menggunakan Algoritma Naïve Bayes,” J. Tek. Inform. dan Sist. Inf., vol. 5, no. 2, pp. 134–142, 2019.
T. Tengku Ridwansyah, “Evaluasi Model Analisis Sentimen Menggunakan Akurasi, Presisi, Recall, dan F1-Score,” J. Teknol. dan Sist. Inf., vol. 8, no. 4, pp. 215–222, 2022.
A. Apri Wenando, D. Rahmawati, and R. Putra, “Analisis Sentimen di Media Sosial Twitter Menggunakan Metode Naïve Bayes,” J. Teknol. dan Sist. Inf., vol. 9, no. 2, pp. 101–110, 2023.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2025 Journal of Artificial Intelligence and Engineering Applications (JAIEA)

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.







