Datasets:
Update README with accurate collection stats (18.7M passages, 40GB)
Browse files
README.md
CHANGED
|
@@ -52,15 +52,14 @@ dataset_info:
|
|
| 52 |
dtype: int64
|
| 53 |
splits:
|
| 54 |
- name: train
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
dataset_size: 42600000000
|
| 59 |
---
|
| 60 |
|
| 61 |
# ๐ Athar Islamic QA Datasets
|
| 62 |
|
| 63 |
-
> **
|
| 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** |
|
| 76 |
-
| **Total
|
| 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 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
|
| 90 |
-
|
| 91 |
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
-
**Schema:**
|
| 100 |
```json
|
| 101 |
{
|
| 102 |
-
"content": "ุญุฏ
|
| 103 |
-
"book_id":
|
| 104 |
-
"
|
| 105 |
-
"
|
| 106 |
-
"
|
| 107 |
-
"
|
| 108 |
-
"
|
| 109 |
-
"
|
| 110 |
-
"
|
| 111 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
}
|
| 113 |
```
|
| 114 |
|
| 115 |
---
|
| 116 |
|
| 117 |
-
##
|
| 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 |
-
|
| 145 |
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 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 |
-
##
|
| 213 |
|
| 214 |
-
|
| 215 |
|
| 216 |
-
|
| 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 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
-
###
|
| 251 |
|
| 252 |
```python
|
| 253 |
-
from
|
| 254 |
-
import json
|
| 255 |
|
| 256 |
-
#
|
| 257 |
-
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
| 271 |
```
|
| 272 |
|
| 273 |
-
###
|
| 274 |
|
| 275 |
```python
|
| 276 |
-
|
| 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 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
repo_type="dataset"
|
| 287 |
-
)
|
| 288 |
|
| 289 |
-
|
| 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 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 307 |
query = "ู
ุง ุญูู
ุตูุงุฉ ุงูุฌู
ุงุนุฉุ"
|
| 308 |
-
query_embedding = model.encode(query)
|
| 309 |
|
| 310 |
-
#
|
| 311 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 312 |
```
|
| 313 |
|
| 314 |
-
### Example 2:
|
| 315 |
|
| 316 |
```python
|
| 317 |
-
# Filter
|
| 318 |
classical_passages = [
|
| 319 |
p for p in passages
|
| 320 |
-
if 200 <= p.get('author_death', 0) <= 500
|
| 321 |
-
and p.get('collection') == 'fiqh_passages'
|
| 322 |
]
|
| 323 |
|
| 324 |
# Filter by author
|
| 325 |
-
|
| 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 |
-
#
|
|
|
|
|
|
|
| 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
|
| 345 |
-
|
| 346 |
-
|
| 347 |
-
print(
|
| 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
|
| 369 |
|
| 370 |
-
### About ElShamela
|
| 371 |
|
| 372 |
-
**ElShamela** (ุงูู
ูุชุจุฉ ุงูุดุงู
ูุฉ) is a free, open-access digital library that has been digitizing and preserving classical Islamic texts for over two decades.
|
| 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**
|
| 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
|
| 393 |
- Book titles and categories
|
| 394 |
- Chapter and section headings
|
| 395 |
- Page numbers
|
| 396 |
-
5. **Organized** into 10 scholarly collections
|
| 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 |
-
##
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
|
| 418 |
-
|
|
| 419 |
-
|
|
| 420 |
-
|
|
| 421 |
-
|
|
| 422 |
-
|
|
| 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)** โ
|
| 446 |
-
- **[Fanar-Sadiq Architecture](docs/Fanar-Sadiq%20A%20Multi-Agent%20Architecture%20for%20Grounded%20Islamic%20QA.pdf)** โ Research paper
|
| 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
|
| 459 |
-
author={Kandil,
|
| 460 |
year={2026},
|
| 461 |
url={https://huggingface.co/datasets/Kandil7/Athar-Datasets},
|
| 462 |
-
note={
|
| 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
|
| 473 |
|
| 474 |
-
3. **Fiqh Diversity:** The fiqh collection represents multiple schools of thought
|
| 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|
| 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>
|