Facebook pixel tracking

The Science and Information (SAI) Organization publishes open-access peer-reviewed journals in computer science and artificial intelligence.

Contact Info
Website thesai.org
Follow Us
Contact Info
Follow Us
Research Article | Open Access |

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

Author 1: Sara IBRIHICH Author 2: Ahmed OUSSOUS Author 3: Ouafaa IBRIHICH Author 4: Mustapha ESGHIR
International Journal of Advanced Computer Science and Applications (IJACSA) · Vol. 17, No. 9 · Published 2026

DOI: 10.14569/IJACSA.2026.0170920

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.

Keywords

How to Cite this Article

IBRIHICH, S., OUSSOUS, A., IBRIHICH, O., & ESGHIR, M. (2026). A Hybrid System with Automatic Classification and RAG for Moroccan Court Rulings. International Journal of Advanced Computer Science and Applications, 17(9). https://doi.org/10.14569/IJACSA.2026.0170920

IBRIHICH, Sara, et al.. "A Hybrid System with Automatic Classification and RAG for Moroccan Court Rulings." International Journal of Advanced Computer Science and Applications, vol. 17, no. 9, 2026, https://doi.org/10.14569/IJACSA.2026.0170920.

@article{IBRIHICH2026,
  title     = {A Hybrid System with Automatic Classification and RAG for Moroccan Court Rulings},
  journal   = {International Journal of Advanced Computer Science and Applications},
  volume    = {17},
  number    = {9},
  year      = {2026},
  publisher = {The Science and Information Organization},
  author    = {Sara IBRIHICH and Ahmed OUSSOUS and Ouafaa IBRIHICH and Mustapha ESGHIR},
  doi       = {10.14569/IJACSA.2026.0170920},
  url       = {https://doi.org/10.14569/IJACSA.2026.0170920}
}

Open Access — licensed under a Creative Commons Attribution 4.0 International License. Unrestricted use, distribution, and reproduction in any medium, even commercially, as long as the original work is properly cited.

Call for Papers - Important Dates

Volume 17 No. 11, November 2026
Paper Submission Due October 25, 2026
Review Notification November 15, 2026
Publication Date November 30, 2026