Focusing on legal cases: Automatic classification of legal documents with sentence embeddings and deep learning models - Fawaz Khaled Alarfaj (PLoS ONE, 2026)
The justice system is indispensable to any society as it enforces the rule of law, safeguards fundamental rights, and ensures the equitable resolution of disputes through structured legal frameworks. Artificial Intelligence (AI) has significantly advanced the legal and justice system by automating time-intensive tasks such as document review and contract analysis, thereby enhancing efficiency and reducing human error. Additionally, AI-powered predictive analytics and decision support systems have improved access to justice by providing data-driven insights, enabling faster case resolution, and ensuring more consistent application of the law. Legal document classification using AI techniques is imperative as it enables efficient organization, retrieval, and analysis of vast volumes of legal texts, enhancing accuracy, reducing manual effort, and facilitating faster decision-making in legal processes. In this research study, the main aim is to classify legal text documents using Machine Learning (ML) and state-of-the-art Deep Learning (DL) algorithms. Using a real-world dataset that consists of thousands of legal documents having complex language related to legal cases poses a challenging natural language understanding task by applying various textual features, deep features, and advanced sentence embeddings. The results reveal that the ensemble learning model of Extremely Randomized Trees shows better results with 89% accuracy, as it aggregates the results of multiple decorrelated decision trees to enhance predictive accuracy and control over-fitting. However, the best results of 96% are achieved with sentence embeddings. Sentence embeddings with Long Short-Term Memory (LSTM) networks are highly effective in Natural Language Processing (NLP) due to their ability to capture complex semantic and syntactic information within text.