Skip to content
Open access

A Hybrid System with Automatic Classification and RAG for Moroccan Court Rulings

2026 · International Journal of Advanced Computer Science and Applications · 0 citations · 25 references

Abstract

The Accessibility of Moroccan court judgments and decisions is significantly limited due to the lack of a specialized Arabic Judicial information retrieval architecture. Current NLP technologies focus on Modern Standard Arabic and fail to capture the specialized procedural language of judicial rulings from the courts, resulting in inadequate search and query answering assistance for legal professionals. This study introduces AraLex-RAG, a system that combines document extraction, automated categorization, and Retrieval-Augmented Generation (RAG) for Moroccan Arabic court texts. Neither the retrieval nor the classification components need a GPU; however, the RAG module has the possibility to use an external LLM API for generation. This study presents AraLex-RAG, a benchmark dataset of 2855 unstructured Moroccan judicial judgments in 26 different legal classes. It has been created using an automated workflow that combines specific Arabic text normalization, optical character recognition, and balanced class sampling. The information retrieval system is a combination of similarity-based semantic search and keyword-based search, and then uses Reciprocal Rank Fusion to fuse their results. The document categorization is based on a character-level text analysis approach mixed with a linear classifier, while the question-answering feature creates Arabic replies based on retrieved court rulings using a broad language structure. An accuracy of 92.87 percent is achieved (std 1.33 percent) and 76.15 percent macro F1 across 26 categories using five-fold stratified cross-validation on 2853 documents, outperforming the previous best on Moroccan court judgments (80.51 percent on a six-class subset) on a challenge 4 times tougher. Using 3,936 document query pairings, dense semantic retrieval performs better than the search-based keyword in all four assessment measures. On 45 stratified pairs of questions and answers, the query-answering component obtains a cosine similarity value of 0.845, which is similar to the most advanced Arabic query-answering systems on structured fields.

Read PDF

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.