Machine Learning-Based Legal Text Classification Model Using Simple Contrastive Learning of Sentence Embeddings
Abstract
Investigative officers at the Thonglor Metropolitan Police Station record free-text criminal accusations in heterogeneous styles that include domain-specific, legal terminology. Thai further complicates natural language processing text classification due to the absence of explicit word delimiters and flexible orthography. This study proposed a framework to classify accusations into seven legal categories aligned with the Thai Penal Code. An 11-year dataset of raw narratives (2014-2024) was cleaned via data preprocessing then converted to sentence embeddings using the Simple Contrastive Learning of Sentence Embeddings (SimCSE) model, the Multilingual Bidirectional Encoder Representations from Transformers Thai Cased. This study's five benchmark models included a support vector machine, a k-nearest neighbors model, a random forest, the Extreme Gradient Boosting algorithm, and a neural network. Hyperparameters were selected by grid search with five-fold cross-validation, and the reported metrics included class-wise F1, F1-macro, F1-weighted, and accuracy. The neural network yielded the best overall performance with 0.6502, 0.6817, and 0.6897 for F1-macro, F1-weighted, and accuracy, respectively. The results highlighted challenges from heterogeneous “Others” categories and class imbalance.
Fields of Study & Subjects
Hate Speech and Cyberbullying Detection
Topic Modeling
Authorship Attribution and Profiling
Publication details
- Journal / source
- International Journal of Knowledge and Systems Science
- Publisher
- IGI Global Scientific Publishing
- Volume
- 16
- Issue
- 1
- Pages
- 1–19
- Publication date
- 7 January 2026
- Language
- NG