Kandil7 commited on
Commit
6f92ee9
ยท
verified ยท
1 Parent(s): 103a705

Update README with accurate collection stats (18.7M passages, 40GB)

Browse files
Files changed (1) hide show
  1. README.md +177 -286
README.md CHANGED
@@ -52,15 +52,14 @@ dataset_info:
52
  dtype: int64
53
  splits:
54
  - name: train
55
- num_bytes: 42600000000
56
- num_examples: 5700000
57
- download_size: 4300000000
58
- dataset_size: 42600000000
59
  ---
60
 
61
  # ๐Ÿ•Œ Athar Islamic QA Datasets
62
 
63
- > **15.7M passages from 8,425 classical Islamic books spanning 1,400 years of scholarship**
64
 
65
  A comprehensive collection of Islamic texts covering Quran, Hadith, Fiqh, Tafsir, Aqeedah, Seerah, and more โ€” sourced from the Shamela library and enriched with scholarly metadata for RAG-based Islamic QA systems.
66
 
@@ -72,394 +71,269 @@ A comprehensive collection of Islamic texts covering Quran, Hadith, Fiqh, Tafsir
72
 
73
  | Metric | Value |
74
  |--------|-------|
75
- | **Total Passages** | 15,700,000+ |
76
- | **Total Source Books** | 8,425 |
77
- | **Total Scholars** | 3,146 |
78
- | **Time Span** | 0-1400 AH (7th-21st century CE) |
79
- | **Original Size** | 42.6 GB |
80
- | **Compressed Size** | ~4.3 GB |
81
  | **Collections** | 10 |
 
82
  | **Languages** | Arabic (primary), English (metadata) |
 
83
 
84
  ---
85
 
86
  ## ๐Ÿ“š Collections
87
 
88
- ### 1. `hadith_passages` (2M passages, 11 GB)
 
 
 
 
 
 
 
 
 
 
 
89
 
90
- Prophetic traditions from the six canonical hadith collections (Kutub al-Sittah) plus Musnad collections.
91
 
92
- | Feature | Details |
93
- |---------|---------|
94
- | Source Books | Sahih Bukhari, Sahih Muslim, Sunan Abu Dawud, Jami' al-Tirmidhi, Sunan al-Nasa'i, Sunan Ibn Majah |
95
- | Includes | Sanad (chain of narrators) and Matn (text) |
96
- | Authenticity Data | โœ… Esnad chain data available |
97
- | Time Period | 0-300 AH |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
 
99
- **Schema:**
100
  ```json
101
  {
102
- "content": "ุญุฏูŠุซ: ุนู† ุฃุจูŠ ู‡ุฑูŠุฑุฉ ุฑุถูŠ ุงู„ู„ู‡ ุนู†ู‡ ู‚ุงู„...",
103
- "book_id": 627,
104
- "title": "ุตุญูŠุญ ุงู„ุจุฎุงุฑูŠ",
105
- "author": "Imam Bukhari",
106
- "author_death": 256,
107
- "page": 45,
108
- "chapter": "ูƒุชุงุจ ุงู„ุตู„ุงุฉ",
109
- "section": "ุจุงุจ ุงู„ุฃุฐุงู†",
110
- "category": "ุตุญูŠุญ",
111
- "collection": "hadith_passages"
 
 
 
 
112
  }
113
  ```
114
 
115
  ---
116
 
117
- ### 2. `fiqh_passages` (1.2M passages, 7 GB)
118
-
119
- Islamic jurisprudence from all four major Sunni schools (Hanafi, Maliki, Shafi'i, Hanbali).
120
-
121
- | Feature | Details |
122
- |---------|---------|
123
- | Schools Covered | Hanafi, Maliki, Shafi'i, Hanbali |
124
- | Topics | Worship, Transactions, Family Law, Criminal Law |
125
- | Time Period | 150-1300 AH |
126
- | Source Books | 2,000+ fiqh texts |
127
-
128
- ---
129
-
130
- ### 3. `general_islamic` (1M passages, 6.5 GB)
131
-
132
- General Islamic knowledge including spirituality, ethics, dua, and daily life guidance.
133
-
134
- | Feature | Details |
135
- |---------|---------|
136
- | Topics | Spirituality, Ethics, Dua, Adab, Daily Life |
137
- | Time Period | 0-1400 AH |
138
- | Source Books | 1,500+ texts |
139
-
140
- ---
141
-
142
- ### 4. `islamic_history_passages` (900K passages, 6 GB)
143
 
144
- Islamic history from the Prophetic era through the Ottoman period.
145
 
146
- | Feature | Details |
147
- |---------|---------|
148
- | Periods | Prophetic, Rashidun, Umayyad, Abbasid, Ottoman |
149
- | Topics | Battles, Biographies, Dynasties, Events |
150
- | Time Period | 0-1400 AH |
151
-
152
- ---
153
-
154
- ### 5. `quran_tafsir` (800K passages, 5.2 GB)
155
-
156
- Quranic exegesis from classical tafsir works.
157
-
158
- | Feature | Details |
159
- |---------|---------|
160
- | Tafsir Works | Tabari, Qurtubi, Ibn Kathir, Jalalayn, etc. |
161
- | Coverage | All 114 surahs, 6,236 verses |
162
- | Languages | Classical Arabic |
163
- | Time Period | 200-900 AH |
164
-
165
- ---
166
-
167
- ### 6. `arabic_language_passages` (400K passages, 2.3 GB)
168
-
169
- Arabic grammar, linguistics, rhetoric, and language sciences.
170
-
171
- | Feature | Details |
172
- |---------|---------|
173
- | Topics | Nahw, Sarf, Balaghah, Arabic Lexicons |
174
- | Time Period | 150-1300 AH |
175
-
176
- ---
177
-
178
- ### 7. `aqeedah_passages` (300K passages, 1.8 GB)
179
-
180
- Islamic creed and theology from various theological schools.
181
-
182
- | Feature | Details |
183
- |---------|---------|
184
- | Schools | Ash'ari, Maturidi, Athari |
185
- | Topics | Tawhid, Attributes of Allah, Prophethood, Afterlife |
186
- | Time Period | 200-1300 AH |
187
-
188
- ---
189
-
190
- ### 8. `spirituality_passages` (200K passages, 1.1 GB)
191
-
192
- Islamic spirituality, purification of the heart, and Sufi works.
193
-
194
- | Feature | Details |
195
- |---------|---------|
196
- | Topics | Tasawwuf, Tazkiyah, Adab, Dhikr |
197
- | Time Period | 200-1300 AH |
198
-
199
- ---
200
-
201
- ### 9. `usul_fiqh` (150K passages, 0.9 GB)
202
-
203
- Principles of Islamic jurisprudence and legal theory.
204
-
205
- | Feature | Details |
206
- |---------|---------|
207
- | Topics | Usul al-Fiqh, Qawa'id Fiqhiyyah, Maqasid al-Shari'ah |
208
- | Time Period | 200-1200 AH |
209
 
210
  ---
211
 
212
- ### 10. `seerah_passages` (100K passages, 0.8 GB)
213
 
214
- Prophet Muhammad's ๏ทบ biography and related studies.
215
 
216
- | Feature | Details |
217
- |---------|---------|
218
- | Sources | Ibn Hisham, Ibn Kathir, Al-Rahiq al-Makhtum |
219
- | Topics | Birth, Prophethood, Migration, Battles, Death ๏ทบ |
220
- | Time Period | 200-1400 AH |
221
 
222
- ---
 
223
 
224
- ## ๐Ÿ“ File Structure
 
 
 
 
225
 
 
 
226
  ```
227
- Athar-Datasets/
228
- โ”œโ”€โ”€ collections/
229
- โ”‚ โ”œโ”€โ”€ fiqh_passages.jsonl.gz # 7.0 GB compressed
230
- โ”‚ โ”œโ”€โ”€ hadith_passages.jsonl.gz # 11.0 GB compressed
231
- โ”‚ โ”œโ”€โ”€ quran_tafsir.jsonl.gz # 5.2 GB compressed
232
- โ”‚ โ”œโ”€โ”€ aqeedah_passages.jsonl.gz # 1.8 GB compressed
233
- โ”‚ โ”œโ”€โ”€ seerah_passages.jsonl.gz # 0.8 GB compressed
234
- โ”‚ โ”œโ”€โ”€ islamic_history_passages.jsonl.gz # 6.0 GB compressed
235
- โ”‚ โ”œโ”€โ”€ arabic_language_passages.jsonl.gz # 2.3 GB compressed
236
- โ”‚ โ”œโ”€โ”€ spirituality_passages.jsonl.gz # 1.1 GB compressed
237
- โ”‚ โ”œโ”€โ”€ general_islamic.jsonl.gz # 6.5 GB compressed
238
- โ”‚ โ””โ”€โ”€ usul_fiqh.jsonl.gz # 0.9 GB compressed
239
- โ”‚
240
- โ””โ”€โ”€ metadata/
241
- โ”œโ”€โ”€ master_catalog.json # 8,425 books catalog
242
- โ”œโ”€โ”€ category_mapping.json # 41โ†’10 category mapping
243
- โ””โ”€โ”€ author_catalog.json # 3,146 scholars
244
- ```
245
-
246
- ---
247
-
248
- ## ๐Ÿ” How to Load
249
 
250
- ### Python (using huggingface_hub)
251
 
252
  ```python
253
- from huggingface_hub import hf_hub_download
254
- import json
255
 
256
- # Download a collection
257
- filepath = hf_hub_download(
258
- repo_id="Kandil7/Athar-Datasets",
259
- filename="collections/fiqh_passages.jsonl.gz",
260
- repo_type="dataset"
261
- )
262
-
263
- # Load passages
264
- import gzip
265
- passages = []
266
- with gzip.open(filepath, 'rt', encoding='utf-8') as f:
267
- for line in f:
268
- passages.append(json.loads(line))
269
 
270
- print(f"Loaded {len(passages):,} passages")
 
 
 
271
  ```
272
 
273
- ### Load with metadata
274
 
275
  ```python
276
- # Load metadata
277
- master_catalog = hf_hub_download(
278
- repo_id="Kandil7/Athar-Datasets",
279
- filename="metadata/master_catalog.json",
280
- repo_type="dataset"
281
- )
282
 
283
- author_catalog = hf_hub_download(
284
- repo_id="Kandil7/Athar-Datasets",
285
- filename="metadata/author_catalog.json",
286
- repo_type="dataset"
287
- )
288
 
289
- # Enrich passages with additional metadata
290
- with open(author_catalog, 'r') as f:
291
- authors = json.load(f)
292
  ```
293
 
294
  ---
295
 
296
  ## ๐Ÿ’ก Usage Examples
297
 
298
- ### Example 1: Semantic Search
299
 
300
  ```python
301
  from sentence_transformers import SentenceTransformer
 
 
302
 
303
- # Load model
304
  model = SentenceTransformer('BAAI/bge-m3')
305
 
306
- # Embed query
 
 
 
 
 
 
 
 
307
  query = "ู…ุง ุญูƒู… ุตู„ุงุฉ ุงู„ุฌู…ุงุนุฉุŸ"
308
- query_embedding = model.encode(query)
309
 
310
- # Search in collection (requires vector DB like Qdrant)
311
- # See: https://github.com/Kandil7/Athar
 
 
 
 
 
 
312
  ```
313
 
314
- ### Example 2: Faceted Search
315
 
316
  ```python
317
- # Filter by era and collection
318
  classical_passages = [
319
  p for p in passages
320
- if 200 <= p.get('author_death', 0) <= 500 # Classical era
321
- and p.get('collection') == 'fiqh_passages'
322
  ]
323
 
324
  # Filter by author
325
- bukhari_hadith = [
326
  p for p in hadith_passages
327
  if 'Bukhari' in p.get('author', '')
328
  ]
329
  ```
330
 
331
- ### Example 3: Citation-Enhanced QA
332
 
333
  ```python
334
- # Build a RAG pipeline
 
 
335
  from Athar import FiqhAgent
336
 
337
  agent = FiqhAgent()
338
  result = await agent.execute(
339
  query="ู…ุง ุญูƒู… ุตู„ุงุฉ ุงู„ุฌู…ุงุนุฉุŸ",
340
- filters={"era": "classical"},
341
- hierarchical=True
342
  )
343
 
344
- # Result includes rich citations:
345
- print(result.citations[0].source)
346
- # "Imam Bukhari - Sahih al-Bukhari, Chapter of Prayer"
347
- print(result.citations[0].metadata['hadith_grade'])
348
- # "sahih"
349
  ```
350
 
351
  ---
352
 
353
- ## ๐Ÿ—๏ธ Scholarly Eras
354
-
355
- | Era | Range (AH) | Range (CE) | Description |
356
- |-----|-----------|-----------|-------------|
357
- | **Prophetic** | 0-100 | 622-718 | Companions of Prophet ๏ทบ |
358
- | **Tabi'un** | 100-200 | 718-815 | Successors |
359
- | **Classical** | 200-500 | 815-1106 | Golden age of Islamic scholarship |
360
- | **Medieval** | 500-900 | 1106-1496 | Post-classical period |
361
- | **Ottoman** | 900-1300 | 1496-1883 | Ottoman era |
362
- | **Modern** | 1300+ | 1883+ | Modern period |
363
-
364
- ---
365
-
366
  ## ๐Ÿ“– Source: ElShamela Library (ุงู„ู…ูƒุชุจุฉ ุงู„ุดุงู…ู„ุฉ)
367
 
368
- This dataset is derived from **ElShamela Library** (ุงู„ู…ูƒุชุจุฉ ุงู„ุดุงู…ู„ุฉ) โ€” the largest comprehensive digital library of Islamic texts, containing **8,425 books** across **41 categories** spanning **1,400 years of Islamic scholarship**.
369
 
370
- ### About ElShamela Library
371
 
372
- **ElShamela** (ุงู„ู…ูƒุชุจุฉ ุงู„ุดุงู…ู„ุฉ) is a free, open-access digital library that has been digitizing and preserving classical Islamic texts for over two decades. It is widely considered the most comprehensive collection of Islamic heritage works, including:
373
-
374
- - **Quran and Tafsir** โ€” Complete Quran text with major classical commentaries
375
- - **Hadith Collections** โ€” Six canonical hadith books (Kutub al-Sittah) plus Musnad works
376
- - **Fiqh** โ€” Jurisprudence from all four major Sunni schools (Hanafi, Maliki, Shafi'i, Hanbali)
377
- - **Aqeedah** โ€” Islamic theology and creed from various schools
378
- - **Seerah** โ€” Prophet Muhammad's ๏ทบ biography
379
- - **Arabic Language** โ€” Grammar, linguistics, rhetoric, and lexicons
380
- - **Islamic History** โ€” Historical accounts from the Prophetic era through the Ottoman period
381
- - **Spirituality** โ€” Tasawwuf, ethics, and purification of the heart
382
- - **Usul Fiqh** โ€” Principles of Islamic jurisprudence and legal theory
383
 
384
  **Website:** https://shamela.ws/
385
 
386
  ### Processing Pipeline
387
 
388
- 1. **Extracted** 8,425 books from ElShamela Library format
389
  2. **Converted** from proprietary Shamela format to plain text
390
  3. **Split** into pages and passages for granular retrieval
391
  4. **Enriched** with metadata:
392
- - Author names and death years (Hijri calendar)
393
  - Book titles and categories
394
  - Chapter and section headings
395
  - Page numbers
396
- 5. **Organized** into 10 scholarly collections based on subject matter
397
- 6. **Added** hadith chain (esnad) data where available
398
- 7. **Compressed** with gzip for efficient storage and transfer
399
-
400
- ### ElShamela Statistics
401
-
402
- | Metric | Value |
403
- |--------|-------|
404
- | Total Books | 8,425 |
405
- | Total Categories | 41 |
406
- | Total Authors | 3,146 |
407
- | Time Span | 0-1400+ AH (7th-21st century CE) |
408
- | Original Size | 17.16 GB (extracted text) |
409
- | Languages | Classical Arabic (primary) |
410
 
411
  ---
412
 
413
- ## ๐Ÿ“Š Statistics
414
-
415
- ### Passages per Collection
416
-
417
- | Collection | Passages | Size (GB) | % of Total |
418
- |------------|----------|-----------|------------|
419
- | hadith_passages | ~2,000,000 | 11.0 | 35% |
420
- | fiqh_passages | ~1,200,000 | 7.0 | 21% |
421
- | general_islamic | ~1,000,000 | 6.5 | 18% |
422
- | islamic_history_passages | ~900,000 | 6.0 | 16% |
423
- | quran_tafsir | ~800,000 | 5.2 | 14% |
424
- | arabic_language_passages | ~400,000 | 2.3 | 7% |
425
- | aqeedah_passages | ~300,000 | 1.8 | 5% |
426
- | spirituality_passages | ~200,000 | 1.1 | 4% |
427
- | usul_fiqh | ~150,000 | 0.9 | 3% |
428
- | seerah_passages | ~100,000 | 0.8 | 2% |
429
-
430
- ### Scholar Distribution
431
-
432
- | Era | Scholars | Books | Passages |
433
- |-----|----------|-------|----------|
434
- | Prophetic | 150 | 12 | 50,000 |
435
- | Tabi'un | 280 | 85 | 200,000 |
436
- | Classical | 1,200 | 2,800 | 2,500,000 |
437
- | Medieval | 800 | 3,200 | 1,800,000 |
438
- | Ottoman | 500 | 1,800 | 900,000 |
439
- | Modern | 216 | 528 | 250,000 |
440
 
441
  ---
442
 
443
  ## ๐Ÿค Related Projects
444
 
445
- - **[Athar](https://github.com/Kandil7/Athar)** โ€” The parent project: A production-ready Islamic QA system using these datasets
446
- - **[Fanar-Sadiq Architecture](docs/Fanar-Sadiq%20A%20Multi-Agent%20Architecture%20for%20Grounded%20Islamic%20QA.pdf)** โ€” Research paper that inspired this system
447
- - **[Quran.com](https://quran.com)** โ€” Quran text reference
448
- - **[Sunnah.com](https://sunnah.com)** โ€” Hadith collections reference
449
 
450
  ---
451
 
452
  ## ๐Ÿ“ Citation
453
 
454
- If you use this dataset in your research, please cite:
455
-
456
  ```bibtex
457
  @misc{athar-datasets-2026,
458
- title={Athar: A Multi-Agent Architecture for Grounded Islamic QA},
459
- author={Kandil, [Author Name]},
460
  year={2026},
461
  url={https://huggingface.co/datasets/Kandil7/Athar-Datasets},
462
- note={Based on the Fanar-Sadiq architecture}
463
  }
464
  ```
465
 
@@ -469,20 +343,37 @@ If you use this dataset in your research, please cite:
469
 
470
  1. **Scholarly Context:** These texts represent classical Islamic scholarship. Always consult qualified scholars for religious rulings.
471
 
472
- 2. **Hadith Authenticity:** Hadith collections include chains of narration (esnad). Use the authenticity grading system to evaluate reliability.
473
 
474
- 3. **Fiqh Diversity:** The fiqh collection represents multiple schools of thought. Present all views when answering questions.
475
 
476
  4. **Language:** Primary content is in Classical Arabic. Metadata includes English translations.
477
 
478
- 5. **Licensing:** MIT License โ€” free for research and commercial use. Please attribute appropriately.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
479
 
480
  ---
481
 
482
  ## ๐Ÿ“ž Contact & Support
483
 
484
  - **GitHub:** https://github.com/Kandil7/Athar
485
- - **Issues:** https://github.com/Kandil7/Athar/issues
486
  - **HuggingFace:** https://huggingface.co/Kandil7
487
 
488
  ---
@@ -491,6 +382,6 @@ If you use this dataset in your research, please cite:
491
 
492
  **Built with โค๏ธ for the Muslim community**
493
 
494
- ๐Ÿ•Œ Athar Islamic QA Datasets โ€ข 5.7M passages โ€ข 8,425 books โ€ข 1,400 years of scholarship
495
 
496
  </div>
 
52
  dtype: int64
53
  splits:
54
  - name: train
55
+ num_examples: 18701966
56
+ download_size: 40000000000
57
+ dataset_size: 40000000000
 
58
  ---
59
 
60
  # ๐Ÿ•Œ Athar Islamic QA Datasets
61
 
62
+ > **18.7M passages from classical Islamic books spanning 1,400 years of scholarship**
63
 
64
  A comprehensive collection of Islamic texts covering Quran, Hadith, Fiqh, Tafsir, Aqeedah, Seerah, and more โ€” sourced from the Shamela library and enriched with scholarly metadata for RAG-based Islamic QA systems.
65
 
 
71
 
72
  | Metric | Value |
73
  |--------|-------|
74
+ | **Total Passages** | 18,701,966 |
75
+ | **Total Size** | ~40 GB |
 
 
 
 
76
  | **Collections** | 10 |
77
+ | **Source** | ElShamela Library (ุงู„ู…ูƒุชุจุฉ ุงู„ุดุงู…ู„ุฉ) |
78
  | **Languages** | Arabic (primary), English (metadata) |
79
+ | **Time Span** | 0-1400 AH (7th-21st century CE) |
80
 
81
  ---
82
 
83
  ## ๐Ÿ“š Collections
84
 
85
+ | # | Collection | Passages | Size | Description |
86
+ |---|------------|----------|------|-------------|
87
+ | 1 | `hadith_passages` | 5,059,547 | 11 GB | Prophetic traditions (Sahih Bukhari, Muslim, etc.) |
88
+ | 2 | `general_islamic` | 3,410,436 | 6.1 GB | General Islamic knowledge, spirituality, ethics |
89
+ | 3 | `fiqh_passages` | 2,397,988 | 6.6 GB | Islamic jurisprudence (Hanafi, Maliki, Shafi'i, Hanbali) |
90
+ | 4 | `islamic_history_passages` | 2,850,288 | 5.6 GB | Islamic history (Prophetic to Ottoman era) |
91
+ | 5 | `quran_tafsir` | 2,128,606 | 4.9 GB | Quranic exegesis (Tabari, Qurtubi, Ibn Kathir, etc.) |
92
+ | 6 | `arabic_language_passages` | 1,015,311 | 2.2 GB | Arabic grammar, linguistics, rhetoric |
93
+ | 7 | `aqeedah_passages` | 738,003 | 1.7 GB | Islamic creed and theology |
94
+ | 8 | `spirituality_passages` | 438,776 | 1.1 GB | Sufism, tasawwuf, purification of the heart |
95
+ | 9 | `usul_fiqh` | 368,388 | 874 MB | Principles of Islamic jurisprudence |
96
+ | 10 | `seerah_passages` | 294,623 | 755 MB | Prophet Muhammad's biography |
97
 
98
+ ---
99
 
100
+ ## ๐Ÿ“‹ Schema
101
+
102
+ Each passage contains the following fields:
103
+
104
+ | Field | Type | Description |
105
+ |-------|------|-------------|
106
+ | `content` | string | Main passage text (Arabic) |
107
+ | `content_type` | string | Type of content |
108
+ | `book_id` | int64 | Unique book identifier |
109
+ | `book_title` | string | Title of the source book |
110
+ | `category` | string | Category (e.g., "ุงู„ุนู‚ูŠุฏุฉ", "ุงู„ูู‚ู‡") |
111
+ | `author` | string | Author name |
112
+ | `author_death` | int64 | Author's death year (Hijri) |
113
+ | `collection` | string | Collection name |
114
+ | `page_number` | int64 | Page number in source |
115
+ | `section_title` | string | Section heading |
116
+ | `hierarchy` | list | Hierarchical path [book, chapter, section] |
117
+ | `title` | string | Passage title |
118
+ | `chapter` | string | Chapter name |
119
+ | `section` | string | Section name |
120
+ | `page` | int64 | Page number |
121
+
122
+ ### Example Entry
123
 
 
124
  ```json
125
  {
126
+ "content": "ุงู„ุญู…ุฏ ู„ู„ู‡ ู†ุญู…ุฏู‡ ูˆู†ุณุชุนูŠู†ู‡ ูˆู†ุณุชุบูุฑู‡ุŒ ูˆู†ุนูˆุฐ ุจุงู„ู„ู‡ ู…ู† ุดุฑูˆุฑ ุฃู†ูุณู†ุง...",
127
+ "book_id": 1234,
128
+ "book_title": "ุงู„ููˆุงุฆุฏ ุงู„ุนุฐุงุจ ููŠ ุงู„ุฑุฏ ุนู„ู‰ ู…ู† ู„ู… ูŠุญูƒู… ุงู„ุณู†ุฉ ูˆุงู„ูƒุชุงุจ",
129
+ "category": "ุงู„ุนู‚ูŠุฏุฉ",
130
+ "author": "ุญู…ุฏ ุจู† ู†ุงุตุฑ ุขู„ ู…ุนู…ุฑ",
131
+ "author_death": 1225,
132
+ "collection": "aqeedah_passages",
133
+ "page_number": 1,
134
+ "section_title": "ู…ู‚ุฏู…ุฉ ุงู„ู…ุญู‚ู‚",
135
+ "hierarchy": ["ุงู„ููˆุงุฆุฏ ุงู„ุนุฐุงุจ", "ู…ู‚ุฏู…ุฉ ุงู„ู…ุญู‚ู‚"],
136
+ "title": "ู…ู‚ุฏู…ุฉ ุงู„ู…ุญู‚ู‚",
137
+ "chapter": null,
138
+ "section": null,
139
+ "page": 1
140
  }
141
  ```
142
 
143
  ---
144
 
145
+ ## ๐Ÿ“Š Collection Breakdown
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
 
147
+ ### Passages Distribution
148
 
149
+ ```
150
+ hadith_passages โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 5,059,547 (27%)
151
+ general_islamic โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 3,410,436 (18%)
152
+ fiqh_passages โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 2,397,988 (13%)
153
+ islamic_history_passages โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 2,850,288 (15%)
154
+ quran_tafsir โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 2,128,606 (11%)
155
+ arabic_language_passages โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ 1,015,311 (5%)
156
+ aqeedah_passages โ–ˆโ–ˆโ–ˆโ–ˆ 738,003 (4%)
157
+ spirituality_passages โ–ˆโ–ˆ 438,776 (2%)
158
+ usul_fiqh โ–ˆ 368,388 (2%)
159
+ seerah_passages โ–ˆ 294,623 (2%)
160
+ ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
 
162
  ---
163
 
164
+ ## ๐Ÿ”ง How to Load
165
 
166
+ ### Using HuggingFace Datasets
167
 
168
+ ```python
169
+ from datasets import load_dataset
 
 
 
170
 
171
+ # Load full dataset
172
+ ds = load_dataset("Kandil7/Athar-Datasets")
173
 
174
+ # Access specific collection
175
+ for row in ds['train']:
176
+ if row['collection'] == 'fiqh_passages':
177
+ print(row['content'][:200])
178
+ break
179
 
180
+ # Filter by collection
181
+ hadith_ds = ds['train'].filter(lambda x: x['collection'] == 'hadith_passages')
182
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
 
184
+ ### Streaming Mode (Memory Efficient)
185
 
186
  ```python
187
+ from datasets import load_dataset
 
188
 
189
+ # Stream without downloading
190
+ ds = load_dataset("Kandil7/Athar-Datasets", split="train", streaming=True)
 
 
 
 
 
 
 
 
 
 
 
191
 
192
+ for i, passage in enumerate(ds):
193
+ if i >= 5:
194
+ break
195
+ print(f"{passage['collection']}: {passage['title']}")
196
  ```
197
 
198
+ ### Direct JSONL Access
199
 
200
  ```python
201
+ import json
 
 
 
 
 
202
 
203
+ # Load specific collection
204
+ with open('hadith_passages.jsonl', 'r', encoding='utf-8') as f:
205
+ passages = [json.loads(line) for line in f]
 
 
206
 
207
+ print(f"Loaded {len(passages):,} hadith passages")
 
 
208
  ```
209
 
210
  ---
211
 
212
  ## ๐Ÿ’ก Usage Examples
213
 
214
+ ### Example 1: Semantic Search with RAG
215
 
216
  ```python
217
  from sentence_transformers import SentenceTransformer
218
+ import numpy as np
219
+ import json
220
 
221
+ # Load embedding model
222
  model = SentenceTransformer('BAAI/bge-m3')
223
 
224
+ # Load a sample collection
225
+ with open('fiqh_passages.jsonl', 'r', encoding='utf-8') as f:
226
+ passages = [json.loads(line) for line in f][:1000]
227
+
228
+ # Create embeddings
229
+ texts = [p['content'] for p in passages]
230
+ embeddings = model.encode(texts)
231
+
232
+ # Search
233
  query = "ู…ุง ุญูƒู… ุตู„ุงุฉ ุงู„ุฌู…ุงุนุฉุŸ"
234
+ query_embedding = model.encode([query])[0]
235
 
236
+ # Find most similar
237
+ scores = np.dot(embeddings, query_embedding)
238
+ top_idx = np.argsort(scores)[-5:][::-1]
239
+
240
+ for idx in top_idx:
241
+ print(f"Score: {scores[idx]:.3f}")
242
+ print(passages[idx]['content'][:200])
243
+ print("---")
244
  ```
245
 
246
+ ### Example 2: Filter by Era
247
 
248
  ```python
249
+ # Filter classical era scholars (200-500 AH)
250
  classical_passages = [
251
  p for p in passages
252
+ if 200 <= p.get('author_death', 0) <= 500
 
253
  ]
254
 
255
  # Filter by author
256
+ imam_bukhari = [
257
  p for p in hadith_passages
258
  if 'Bukhari' in p.get('author', '')
259
  ]
260
  ```
261
 
262
+ ### Example 3: Citation-Enhanced QA with Athar
263
 
264
  ```python
265
+ # Use the Athar system for grounded answers
266
+ # See: https://github.com/Kandil7/Athar
267
+
268
  from Athar import FiqhAgent
269
 
270
  agent = FiqhAgent()
271
  result = await agent.execute(
272
  query="ู…ุง ุญูƒู… ุตู„ุงุฉ ุงู„ุฌู…ุงุนุฉุŸ",
273
+ filters={"era": "classical"}
 
274
  )
275
 
276
+ # Result includes citations
277
+ for citation in result.citations:
278
+ print(citation.source)
279
+ print(citation.text)
 
280
  ```
281
 
282
  ---
283
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  ## ๐Ÿ“– Source: ElShamela Library (ุงู„ู…ูƒุชุจุฉ ุงู„ุดุงู…ู„ุฉ)
285
 
286
+ This dataset is derived from **ElShamela Library** (ุงู„ู…ูƒุชุจุฉ ุงู„ุดุงู…ู„ุฉ) โ€” the largest comprehensive digital library of Islamic texts.
287
 
288
+ ### About ElShamela
289
 
290
+ **ElShamela** (ุงู„ู…ูƒุชุจุฉ ุงู„ุดุงู…ู„ุฉ) is a free, open-access digital library that has been digitizing and preserving classical Islamic texts for over two decades.
 
 
 
 
 
 
 
 
 
 
291
 
292
  **Website:** https://shamela.ws/
293
 
294
  ### Processing Pipeline
295
 
296
+ 1. **Extracted** books from ElShamela Library format
297
  2. **Converted** from proprietary Shamela format to plain text
298
  3. **Split** into pages and passages for granular retrieval
299
  4. **Enriched** with metadata:
300
+ - Author names and death years (Hijri)
301
  - Book titles and categories
302
  - Chapter and section headings
303
  - Page numbers
304
+ 5. **Organized** into 10 scholarly collections
 
 
 
 
 
 
 
 
 
 
 
 
 
305
 
306
  ---
307
 
308
+ ## ๐Ÿ—๏ธ Scholarly Eras
309
+
310
+ | Era | Range (AH) | Range (CE) | Description |
311
+ |-----|-----------|-----------|-------------|
312
+ | **Prophetic** | 0-100 | 622-718 | Companions of Prophet ๏ทบ |
313
+ | **Tabi'un** | 100-200 | 718-815 | Successors |
314
+ | **Classical** | 200-500 | 815-1106 | Golden age of Islamic scholarship |
315
+ | **Medieval** | 500-900 | 1106-1496 | Post-classical period |
316
+ | **Ottoman** | 900-1300 | 1496-1883 | Ottoman era |
317
+ | **Modern** | 1300+ | 1883+ | Modern period |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
318
 
319
  ---
320
 
321
  ## ๐Ÿค Related Projects
322
 
323
+ - **[Athar](https://github.com/Kandil7/Athar)** โ€” Production-ready Islamic QA system using this dataset
324
+ - **[Fanar-Sadiq Architecture](docs/Fanar-Sadiq%20A%20Multi-Agent%20Architecture%20for%20Grounded%20Islamic%20QA.pdf)** โ€” Research paper
 
 
325
 
326
  ---
327
 
328
  ## ๐Ÿ“ Citation
329
 
 
 
330
  ```bibtex
331
  @misc{athar-datasets-2026,
332
+ title={Athar Islamic QA Datasets},
333
+ author={Kandil, Ahmed},
334
  year={2026},
335
  url={https://huggingface.co/datasets/Kandil7/Athar-Datasets},
336
+ note={18.7M passages from 10 Islamic collections}
337
  }
338
  ```
339
 
 
343
 
344
  1. **Scholarly Context:** These texts represent classical Islamic scholarship. Always consult qualified scholars for religious rulings.
345
 
346
+ 2. **Hadith Authenticity:** Hadith passages include chains of narration (esnad). Use authenticity grading to evaluate reliability.
347
 
348
+ 3. **Fiqh Diversity:** The fiqh collection represents multiple schools of thought (Hanafi, Maliki, Shafi'i, Hanbali).
349
 
350
  4. **Language:** Primary content is in Classical Arabic. Metadata includes English translations.
351
 
352
+ 5. **Licensing:** MIT License โ€” free for research and commercial use.
353
+
354
+ ---
355
+
356
+ ## ๐Ÿ“ File Structure
357
+
358
+ ```
359
+ Athar-Datasets/
360
+ โ”œโ”€โ”€ hadith_passages.jsonl # 5,059,547 passages (11 GB)
361
+ โ”œโ”€โ”€ general_islamic.jsonl # 3,410,436 passages (6.1 GB)
362
+ โ”œโ”€โ”€ fiqh_passages.jsonl # 2,397,988 passages (6.6 GB)
363
+ โ”œโ”€โ”€ islamic_history_passages.jsonl # 2,850,288 passages (5.6 GB)
364
+ โ”œโ”€โ”€ quran_tafsir.jsonl # 2,128,606 passages (4.9 GB)
365
+ โ”œโ”€โ”€ arabic_language_passages.jsonl # 1,015,311 passages (2.2 GB)
366
+ โ”œโ”€โ”€ aqeedah_passages.jsonl # 738,003 passages (1.7 GB)
367
+ โ”œโ”€โ”€ spirituality_passages.jsonl # 438,776 passages (1.1 GB)
368
+ โ”œโ”€โ”€ usul_fiqh.jsonl # 368,388 passages (874 MB)
369
+ โ””โ”€โ”€ seerah_passages.jsonl # 294,623 passages (755 MB)
370
+ ```
371
 
372
  ---
373
 
374
  ## ๐Ÿ“ž Contact & Support
375
 
376
  - **GitHub:** https://github.com/Kandil7/Athar
 
377
  - **HuggingFace:** https://huggingface.co/Kandil7
378
 
379
  ---
 
382
 
383
  **Built with โค๏ธ for the Muslim community**
384
 
385
+ ๐Ÿ•Œ Athar Islamic QA โ€ข 18.7M passages โ€ข 10 collections โ€ข 1,400 years of scholarship
386
 
387
  </div>