OPTIMASI KNN DENGAN PSO UNTUK KLASIFIKASI KASUS HUKUM DI AUSTRALIA MENGGUNAKAN N-GRAM
DOI:
https://doi.org/10.37859/seis.v5i1.8644
Abstract
This study aims to improve the accuracy of legal case classification in Australia by integrating the K-Nearest Neighbors (KNN) algorithm optimized using Particle Swarm Optimization (PSO) and N-Gram-based text representation. The dataset consists of 15,263 legal documents collected from the Federal Court of Australia (FCA) with an 80:20 data split for training and testing. The classification process is carried out by applying TF-IDF weighting and a combination of N-Gram (unigrams, bigrams, trigrams) to enrich the data representation. The PSO optimization results show an optimal K value of 9, with a testing accuracy reaching 96%. The evaluation of the model performance shows a precision value of 0.95, a recall of 0.96, and an F1-Score of 0.94. These results indicate that the combination of KNN, PSO, and N-Gram is able to significantly improve the performance of legal document classification, especially in the Cited case category. However, the weakness of the model in the Not Cited category indicates the need to develop a method to handle data imbalance in order to improve model generalization.
Downloads
References
A. K. Jailani Tanjung, H. Purwadi, and , Hartiwiningsih, “Paradigma Hakim Dalam Memutuskan Perkara Pidana Di Indonesia,” J. Huk. dan Pembang. Ekon., vol. 7, no. 1, p. 39, 2019, doi: 10.20961/hpe.v7i1.29178.
G. Dlamini, Z. Kholmatova, A. Kruglov, G. Succi, H. Tarasau, and A. Valeev, “Meta-analytical Comparison Of SVM and KNN for Text Classification,” Int. Conf. "Nonlinearity, Inf. Robot. NIR, 2021, doi: 10.1109/NIR52917.2021.9666133.
J. González-González, F. de Arriba-Pérez, S. García-Méndez, A. Busto-Castiñeira, and F. J. González-Castaño, “Automatic explanation of the classification of Spanish legal judgments in jurisdiction-dependent law categories with tree estimators,” J. King Saud Univ. - Comput. Inf. Sci., vol. 35, no. 7, 2023, doi: 10.1016/j.jksuci.2023.101634.
R. K. Halder, M. N. Uddin, M. A. Uddin, S. Aryal, and A. Khraisat, “Enhancing K-nearest neighbor algorithm: a comprehensive review and performance analysis of modifications,” J. Big Data, vol. 11, no. 1, 2024, doi: 10.1186/s40537-024-00973-y.
A. K. Iman, E. Iman, H. Ujianto, F. Sains, and U. T. Yogyakarta, “Analisis Sentimen Pemindahan Ibu Kota Indonesia Menggunakan K-Nearest Neighbor Sentiment Analysis of the Relocation of Indonesia ’ s Capital Using K-Nearest Neighbor,” J. Pendidik. dan Teknol. Indones., vol. 4, no. 12, pp. 759–768, 2024.
M. Rizki, A. Hermawan, and D. Avianto, “Optimization of Hyperparameter K in K-Nearest Neighbor Using Particle Swarm Optimization,” JUITA J. Inform., vol. 12, no. 1, p. 71, 2024, doi: 10.30595/juita.v12i1.20688.
S. Bansal, “Klasifikasi Teks Kutipan Hukum,” p. 2021, 2021, [Online]. Available: https://www.kaggle.com/datasets/shivamb/legal-citation-text-classification/data
M. Muharrom, “Komparasi Algoritma Klasifikasi Naive Bayes Dan K-Nearest Neighbors Dalam Analisis Sentimen Terhadap Opini Film Pada Twitter,” J. Inform. Dan Tekonologi Komput., vol. 3, no. 1, pp. 43–50, 2023, doi: 10.55606/jitek.v3i1.1147.
A. Firdaus, “Aplikasi Algoritma K-Nearest Neighbor pada Analisis Sentimen Omicron Covid-19,” J. Ris. Stat., pp. 85–92, 2022, doi: 10.29313/jrs.v2i2.1148.
G. Putra, A. Brahmantha, E. Utami, and A. Yaqin, “Klasifikasi Genre Anime Berdasarkan Sinopsis Menggunakan Algoritma K-Nearest Neighbors,” J. Manaj. Inform. Sist. Inf. , vol. 7, no. 1, pp. 15–24, 2024.
S. N. Yanti, Yuhandri, and Sumijan, “Jurnal KomtekInfo Implementasi K-Nearest Neighbor Berbasis Particle Swarm,” J. KomtekInfo, vol. 11, no. 4, pp. 371–379, 2024, doi: 10.35134/komtekinfo.v11i4.586.
M. A. Satriawan and W. Widhiarso, “Klasifikasi Pengenalan Wajah Untuk Mengetahui Jenis Kelamin Menggunakan Metode Convolutional Neural Network,” J. Algoritm., vol. 4, no. 1, pp. 43–52, 2023, doi: 10.35957/algoritme.xxxx.
R. Riskawati, F. Fatihanursari, I. Iin, and A. Rizki Rinaldi, “Penerapan Metode Naïve Bayes Classifier Pada Analisis Sentimen Aplikasi Gopay,” JATI (Jurnal Mhs. Tek. Inform., vol. 8, no. 1, pp. 346–353, 2024, doi: 10.36040/jati.v8i1.8699.
S. Agustian et al., “Jurnal Computer Science and Information Technology ( CoSciTech ) Pengaruh Agregasi Data pada Klasifikasi Sentimen untuk Dataset Terbatas Menggunakan SGD Effect of Data Aggregation on Sentiment Classification for Limited Datasets Using SGD Classifier,” J. Comput. Sci. Inf. Technol., vol. 5, no. 3, pp. 626–634, 2024.
N. Knn, “Analisa Sentimen Pada Media Sosial ‘ X ’ Pencarian Keyword ChatGPT Menggunakan Algoritma K-Nearest Abstrak,” vol. 5, no. 3, pp. 3291–3305, 2024.
I. Moeslem et al., “Deep Learning Dengan Teknik Early Stopping Untuk Mendeteksi Deep Learning With Early Stopping Technique For Malware Detection On Iot Devices,” J. Teknol. Inf. dan Ilmu Komput., vol. 12, no. 1, pp. 21–30, 2025, doi: 10.25126/jtiik.2025128267.
Downloads
Published
How to Cite
Issue
Section
License
Copyright Notice
An author who publishes in the Journal of Software Engineering and Information System (SEIS) agrees to the following terms:
- Author retains the copyright and grants the journal the right of first publication of the work simultaneously licensed under the Creative Commons Attribution-ShareAlike 4.0 License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal
- Author is able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book) with the acknowledgement of its initial publication in this journal.
- Author is permitted and encouraged to post his/her work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of the published work (See The Effect of Open Access).
Read more about the Creative Commons Attribution-ShareAlike 4.0 Licence here: https://creativecommons.org/licenses/by-sa/4.0/.






