Quranic Conversations: Developing a Semantic Search tool for the Quran using Arabic NLP Techniques
Summary
The authors address a practical retrieval problem: people who want to know what the Qur'an teaches on some topic struggle to collect all relevant verses. Keyword lookup misses verses that never name the topic, no canonical topic index exists, related ideas are spread across distinct vocabulary, and scholars disagree on readings. The authors propose a semantic search tool. Instead of embedding the short verses directly, they embed exegetical commentary, i.e. tafsirs. They used thirty Arabic tafsirs and two English commentaries, aligned to the Hafs text. A user's prompt is embedded with a sentence model, compared by cosine similarity against every tafsir vector, and the best-matching commentary points back to its ayah. Several encoders were compared: SNxLM, MPNet, MiniLM, DistilBERT and MultiFiT. SNxLM gave the most accurate hits, notably with the Altasheel tafsir. The peak similarity was 0.97 for the "abdu" tafsir on a finance-related verse. The work matters because it shows commentary can act as a semantic bridge between modern questions and terse classical text.
Key points
- Source text: the Hafs reading in plain text from the King Fahd Glorious Qur'an Complex (6,236 ayahs). The topic index merges SearchTruth and the Quranic Corpus, since no canonical index exists.
- Commentary data:
- 30 Arabic tafsirs plus 2 English commentaries, all from the Qortoba Foundation.
- They cover Sunni, Shia and Sufi schools and span the 10th to 21st centuries.
- They include both transmitted (bi'l-Ma'thur) and reasoned (bi'r-Ra'y) methods.
- Alignment: verse-by-verse tafsirs such as Al-Jalalayn map directly. Passage-level ones such as Al Tafsir Al Kabir or Al-Kashshaaf are copied onto every verse in the span they cover.
- Models compared: SNxLM, MPNet, MiniLM, DistilBERT and MultiFiT. Retrieval uses cosine similarity between the prompt vector and each tafsir vector. SNxLM performed best, with a top score of 0.97.
- Retrieved verses were manually graded High or Medium for relevance on topics such as "Women", "Good Behaviors" and "The Role of Knowledge". Planned future work covers other similarity measures, GloVe, FastText, LLaMa and LaMDA.
Interesting ideas
- I1. Searching through commentary rather than the source text means a dense, archaic verse is matched via its richer explanatory gloss, which surfaces relevance that the verse wording alone hides. — For Mova (world): Mova could attach curated glosses or definitions (e.g. WordNet/FrameNet descriptions) to entities and events in the text world, letting questions match a concept even when the surface word never appears.
- I2. When one commentary covers a multi-verse passage, it is duplicated onto each verse, which is a simple way to reconcile span-level annotations with unit-level indexing. — For Mova (learn): when silver annotations or teacher outputs come at paragraph level, projecting them onto each sentence they cover gives a cheap alignment baseline, which can be checked against finer evidence.
- I3. The study draws on many independent commentaries from different schools and eras, giving several "views" of the same verse rather than one authoritative reading. — For Mova (learn): this mirrors the witness-parser idea; disagreement among diverse sources can flag contested readings instead of forcing a single label.
- I4. The similarity score and human relevance were reported side by side, and they diverged: a 0.30 hit was judged High while a 0.49 hit was only Medium. — For Mova (answer): Mova's evaluation should always pair internal confidence with an external judgment, treating the mismatch as a diagnostic signal rather than trusting scores alone.
- I5. The paper highlights near-synonym pairs that carry distinct meanings (nabi vs rasūl, zakāh vs sadaqah), showing that topic search must respect fine sense boundaries. — For Mova (frames): role and frame assignment should keep such distinctions (obligatory vs voluntary giving) as separate frame types or attributes, not collapse them into one generic sense.
Cite
@misc{shohoud2023quranic,
title = {{Quranic Conversations: Developing a Semantic Search tool for the Quran using Arabic NLP Techniques}},
author = {Shohoud, Yasser and Shoman, Maged and Abdelazim, Sarah},
year = {2023},
doi = {10.48550/arxiv.2311.05120},
eprint = {2311.05120},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2311.05120}
}References
- “The Future of the Global Muslim Population,” Pew Research Center’s Religion & Public Life Project (blog), January 27, 2011, https://www.pewresearch.org/religion/2011/01/27/the-future-ofthe-global-muslim-population/. ↗
- Ingrid Mattson, The Story of the Qur’an: Its History and Place in Muslimlife, 2nd ed (Chichester, West Sussex ; Malden, MA: Wiley-Blackwell, 2013), 146. find
- Jerald Dirks, The Cross & The Crescent, 1st ed (Beltsville, Md: Amana Publications, 2001), 45. find
- M. A. S. Abdel Haleem, trans., The Qur’an: English Translation and Parallel Arabic Text, Bilingual, Revised edition (Oxford ; New York: Oxford University Press, 2010), 7. find
- “Lanes Lexicon,” accessed May 20, 2023, http://lexicon.quranic-research.net/data/06_H/123_HTb.html. ↗
- “Hafs Narration,” King Fahd Glorious Qur’an Complex, September 29, 2019, https://qurancomplex.gov.sa/en/riwaiat-hafs/. ↗
- SearchTruth, “Complete Indexing of Quran Topics from A to Z | SearchTruth,” SearchTruth.com, accessed May 21, 2023, https://www.searchtruth.com/quran/topics/. ↗
- “The Quranic Arabic Corpus - Topic Index,” accessed May 21, 2023, https://corpus.quran.com/topics.jsp. ↗
- Qortoba Foundation, “Quran Tafsirs,” HTML, March 15, 2022, https://github.com/qortoba/tafsirs. ↗
- “Tafsir Al Jalalayn Details Page,” accessed May 21, 2023, https://www.quran.link/books/details/70/. ↗
- “Al Tafsir Al Kabir Details Page,” accessed May 21, 2023, https://www.quran.link/books/details/69/. ↗
- M. A. S. Abdel Haleem, trans., The Qur’an: English Translation and Parallel Arabic Text, Bilingual, Revised edition (Oxford ; New York: Oxford University Press, 2010), 601. find
- https://chat.openai.com/, accessed August, 2023. ↗
This page in Markdown → https://md.research.elamur.ai/free/en/papers/shohoud-2023-quranic-conversations-developing-semantic-search/