← All case studies
RAGRetail & MediaOdyssey Analytics · 2023

Arabic Extractive Q&A

Retrieval-augmented Q&A over classical Arabic religious texts despite sparse Arabic NLP tooling.

~90%answer accuracy

Context

Users wanted precise answers from classical Arabic religious texts, quoting the source rather than paraphrasing it.

Challenge

Arabic NLP tooling is thin, classical Arabic is harder still, and answers had to come straight from the text.

My role

Built the system end to end.

Architecture

How the system fits together

Arabic Extractive Q&A architecture diagramClassical textsArabic corpusNormalisationdiacritics · segmentsVector indexpassage embeddingsQuestionin ArabicRetrieverLangChainExtractive readeropen-source LLMAnswer spanwith referencespans
External sourceServiceData storeUser / outputModel / AITelemetry / async

Simplified for public sharing; client-specific details are omitted.

Approach

Key engineering decisions

  1. 01

    Arabic-aware preprocessing

    Text is normalised (diacritics, letter variants) and segmented so retrieval works on classical spelling.

  2. 02

    Retrieval with LangChain

    Passages are embedded and retrieved with LangChain against the normalised corpus.

  3. 03

    Extractive answers

    Open-source LLMs pick the answer span from retrieved passages, so every answer is a quote with a reference.