|
Download README.md from Alkanani/dalil: direct link, hf CLI and curl.
- Browser
- Download file 7.34 kB
-
https://huggingface.co/datasets/Alkanani/dalil/resolve/main/README.md
- Command line
-
hf download hf://datasets/Alkanani/dalil/README.md
-
curl -L -o README.md https://huggingface.co/datasets/Alkanani/dalil/resolve/main/README.md
7.34 kB
| language: | |
| - ar | |
| pretty_name: dalil | |
| license: other | |
| configs: | |
| - config_name: passages | |
| data_files: passages/*.parquet | |
| default: true | |
| - config_name: books | |
| data_files: catalog/library/books.parquet | |
| task_categories: | |
| - text-retrieval | |
| - question-answering | |
| size_categories: | |
| - 100K<n<1M | |
| tags: | |
| - islamic | |
| - islamic-rag | |
| - rag | |
| - quran | |
| - hadith | |
| - sunnah | |
| - tafsir | |
| - tafseer | |
| - fiqh | |
| - aqeedah | |
| - seerah | |
| - arabic | |
| - islamic-texts | |
| - retrieval | |
| - semantic-search | |
| - embeddings | |
| - faiss | |
| - bm25 | |
| # dalil data | |
| The books and search databases of **dalil** (دليل, "evidence"), a search system | |
| over classical Islamic texts in Arabic: the Quran, hadith collections, tafsir, | |
| fiqh, aqeedah and seerah. The code that reads this data is on GitHub: | |
| [abdallah-alkanani/dalil](https://github.com/abdallah-alkanani/dalil). | |
| ## What it holds | |
| - 542 books by 37 authors, plus the Quran and al-Ahadith al-Qudsiyya | |
| - 349,633 parents (the passages that are shown and cited) | |
| - 927,744 retrieval views (the chunks that are embedded and searched) | |
| - Vectors from Qwen3-Embedding-8B, 4,096 dimensions, in an exact FAISS | |
| `IndexFlatIP` | |
| | category | books | views | | |
| |---|---:|---:| | |
| | hadith | 100 | 461,950 | | |
| | fiqh | 168 | 256,556 | | |
| | aqeedah | 183 | 108,019 | | |
| | tafsir | 58 | 70,487 | | |
| | seerah | 12 | 22,213 | | |
| | quran | 1 | 6,236 | | |
| | fiqh_usul | 20 | 2,283 | | |
| ## How it was built | |
| - **Cut where the book divides.** DeepSeek read each book and chose how it is | |
| cut: by heading, by fatwa or mas'ala, by question and answer, and others. | |
| Nothing is cut at a fixed word count. Parents that were still too long were | |
| cut where DeepSeek named, in the text's own words, a change of subject; an | |
| anchor not found exactly once in the text was dropped. In this database, 146 | |
| parents in 51 books (the longest 555,464 words) were cut at 6,502 such places, | |
| all recorded in `recipe/decisions/semantic_boundaries.jsonl`. | |
| - **Search small, return whole.** Each chunk is embedded with a header naming its | |
| book, category, place in the book and kind of text, and a search returns the | |
| whole parent, with the parents before and after it on request. | |
| - **Hadith three ways.** The full text, the isnad and the matn are separate | |
| chunks. In the four Sunan, 19,291 hadith carry al-Albani's grade. | |
| - **Cleaned text.** Symbol-font characters are restored, text lost by the | |
| sources is recovered, and 49,710 Shamela footnotes are placed with their | |
| passages. | |
| The details, with a worked example, are in the | |
| [README](https://github.com/abdallah-alkanani/dalil#how-it-works). | |
| ## The books | |
| - **ابن تيمية** (119 books): مجموع الفتاوى، جامع المسائل - المجموعة الرابعة، منهاج السنة النبوية، مجموعة الرسائل والمسائل - ط وهبة، and 115 more | |
| - **ابن عثيمين** (108 books): فتاوى نور على الدرب للعثيمين، مجموع فتاوى ورسائل العثيمين، لقاء الباب المفتوح، اللقاء الشهري، and 104 more | |
| - **الألباني** (107 books): صحيح وضعيف الجامع الصغير، تفريغ «سلسلة الهدى والنور» للشيخ الألباني - الإصدار 4، صحيح الجامع الصغير وزيادته، التعليقات الحسان على صحيح ابن حبان، and 103 more | |
| - **ابن القيم** (61 books): إعلام الموقعين عن رب العالمين ت مشهور، التبيان في أيمان القرآن ط عالم الفوائد، الطرق الحكمية في السياسة الشرعية ط عالم الفوائد، التفسير القيم لابن القيم، and 57 more | |
| - **ابن باز** (60 books): فتاوى نور على الدرب لابن باز، فتاوى الدروس لابن باز، مجموع فتاوى ومقالات متنوعة - ابن باز، فتاوى نور على الدرب لابن باز - بعناية الشويعر، and 56 more | |
| - **وليد السعيدان** (50 books): تلخيص مسائل الحج على القول الراجح، تمام المنة ببعض ما اتفق عليه أهل السنة، إتحاف أهل الألباب بمعرفة التوحيد والعقيدة في سؤال وجواب، الشرح المبدي جمال منظومة الشيخ ابن سعدي، and 46 more | |
| - **The Quran and the hadith collections:** القرآن الكريم، صحيح البخاري، صحيح مسلم، سنن أبي داود، جامع الترمذي، سنن النسائي، سنن ابن ماجه، موطأ مالك، مسند أحمد، الأربعون النووية، الأحاديث القدسية | |
| - **Tafsir:** تفسير ابن كثير، جامع البيان (الطبري)، الجامع لأحكام القرآن (القرطبي)، التحرير والتنوير (ابن عاشور) | |
| - and 22 more books by other scholars | |
| The full list, scholar by scholar, is in [docs/books.md](https://github.com/abdallah-alkanani/dalil/blob/main/docs/books.md). | |
| ## Layout | |
| | path | size | what it is | | |
| |---|---:|---| | |
| | `db/dense_faiss_ar.index` | 15.2 GB | FAISS index; row *n* is the view in row *n* of `child_metadata` | | |
| | `db/faiss_metadata.sqlite` | 5.9 GB | table `child_metadata`: one row per view (view id, parent id, book, section, text, embedding text) | | |
| | `db/parents.sqlite` | 5.5 GB | table `parents`: one row per parent (citation, section path, references, original text, page number where the source has one) | | |
| | `db/bm25.sqlite` | 3.2 GB | FTS5 keyword index over the views (`child_fts`) | | |
| | `db/BUILD_REPORT.json` | | counts and checks from the build | | |
| | `passages/` | 472 MB | every parent as Parquet, for the viewer and for `datasets`: citation, book, scholar, category, place in the book, page, text | | |
| | `books/original/` | 1.0 GB | every book in its original form, one folder per author and per book (Arabic names) | | |
| | `books/cleaned/` | 886 MB | every book's full cleaned text, one `.txt` per book, in the same folders as `books/original/` | | |
| | `catalog/` | 66 MB | `library/<scholar>/<book>/<book>.json`: one card per book (title, scholar, category, source, its folder in `books/original/`, its file in `books/cleaned/`, passage and chunk counts), and `library/books.parquet` with all the cards in one table; `hadith/`: the al-Albani grade tables of the four Sunan | | |
| | `recipe/` | 9 MB | what a rebuild needs besides the books: which books to use, how each is cut, the al-Albani grades of the four Sunan | | |
| ## Reading the passages | |
| The viewer above shows every passage (`passages`) and every book (`books`). To load | |
| them in Python without the search databases: | |
| ```python | |
| from datasets import load_dataset | |
| passages = load_dataset("Alkanani/dalil", "passages", split="train") | |
| books = load_dataset("Alkanani/dalil", "books", split="train") | |
| ``` | |
| `text_original` is the passage as it is in the book; `text_for_synthesis` adds its | |
| footnotes and, for the four Sunan, al-Albani's grade. | |
| ## Using it with the dalil code | |
| Clone the code, then download everything except `recipe/` into the code's `data/` folder, and | |
| `recipe/` into the code's root folder: | |
| ```bash | |
| hf download Alkanani/dalil --repo-type dataset --exclude "recipe/*" --local-dir data | |
| hf download Alkanani/dalil --repo-type dataset --include "recipe/*" --local-dir . | |
| ``` | |
| Then search with `python -m dalil.s8_search "<question>"`. | |