Datasets:

Modalities:
Text
Formats:
json
License:
Fanar-Sadiq-Bench / README.md
Firoj's picture
Update README.md
eb7f03b verified
---
license: apache-2.0
configs:
- config_name: intent classifier
data_files:
- split: test
path: majority_agreement_set.jsonl
- config_name: prompt classifier
data_files:
- split: test
path: dataset.jsonl
language:
- ar
- en
size_categories:
- 1K<n<10K
---
# Fanar-Sadiq Classifier Datasets
**Fanar-Sadiq Classifier Datasets** is a bilingual Arabic/English collection of query-classification datasets released with the paper **“Fanar-Sadiq: A Multi-Agent Architecture for Grounded Islamic QA.”**
The datasets support the routing components of **Fanar-Sadiq**, a multi-agent Islamic question-answering system that routes user queries to specialized modules such as retrieval-grounded Islamic QA, Quran retrieval, du'a lookup, prayer-time computation, Islamic calendar tools, zakat calculators, and inheritance calculators.
This repository contains two classifier datasets:
1. **Prompt classifier**: a binary dataset for deciding whether a user query is Islamic or non-Islamic.
2. **Intent classifier**: a fine-grained Islamic intent dataset for routing Islamic queries to the appropriate specialized component.
## Dataset Summary
| Subset | Rows | Task | Labels |
|---|---:|---|---|
| `prompt classifier` | ~1.72k | Binary Islamic query detection | `islamic`, `non_islamic` |
| `intent classifier` | 700 | Fine-grained Islamic intent classification | 9 Islamic intent labels |
The data includes both **Arabic** and **English** queries, including naturally phrased, code-switched, short, long, factual, jurisprudential, conversational, and tool-oriented user requests.
## Intended Use
This dataset is intended for research and development on:
- Islamic query classification
- Arabic/English text classification
- Query routing for multi-agent or tool-augmented QA systems
- Intent classification for religious-domain assistants
- Evaluation of bilingual Islamic QA routing pipelines
Typical use cases include training or evaluating models that decide:
- whether an incoming query should be handled by an Islamic QA system;
- which specialized Islamic QA module should answer the query;
- whether a query requires retrieval, deterministic computation, or structured tool use.
## Dataset Subsets
### 1. Prompt Classifier
The `prompt classifier` subset is a binary classification dataset used to determine whether a query is related to Islamic content.
#### Schema
| Field | Type | Description |
|---|---|---|
| `id` | string | Unique example identifier |
| `query` | string | User query in Arabic or English |
| `label` | string | Binary label: `islamic` or `non_islamic` |
#### Labels
| Label | Description |
|---|---|
| `islamic` | Query is related to Islam, Islamic knowledge, Quran, Hadith, fiqh, Islamic history, worship, religious practice, or Islamic-domain reasoning |
| `non_islamic` | Query is general-purpose, unrelated to Islamic QA, or should be routed to a general assistant |
#### Example
```json
{
"id": "268fe685",
"query": "قارن بين تنظيم الحياة العامة وفق الشريعة الإسلامية والثقافة الغربية .",
"label": "islamic"
}
````
```json
{
"id": "9c5eae33",
"query": "لدي بنطالاً أبيض، ما لون القميص الذي يليق عليه؟",
"label": "non_islamic"
}
```
### 2. Intent Classifier
The `intent classifier` subset is a fine-grained Islamic intent classification dataset used to route Islamic queries to specialized components in Fanar-Sadiq.
The dataset was created from real user queries, anonymized and filtered to remove personally identifying information. Each query was annotated by three independent annotators, and the final label was determined by majority vote.
#### Schema
| Field | Type | Description |
| ------------------ | ------------ | -------------------------------------------- |
| `id` | string | Unique example identifier |
| `query` | string | User query in Arabic or English |
| `task_id` | integer | Internal task/example identifier |
| `majority_label` | string | Final intent label selected by majority vote |
| `annotator_labels` | list[string] | Individual labels assigned by annotators |
| `unanimous` | bool | Whether all annotators agreed |
| `agreement_ratio` | string | Agreement ratio, such as `3/3` or `2/3` |
#### Intent Labels
| Label | Description |
| ------------------------- | ------------------------------------------------------------------------------------------------- |
| `fiqh_ruling` | Questions about Islamic legal rulings, permissibility, obligations, halal/haram, or jurisprudence |
| `quran_retrieval` | Requests for Quranic verses, ayahs, surahs, Quran text, or Quran-related retrieval |
| `general_islamic` | General Islamic knowledge, history, concepts, beliefs, personalities, events, or explanations |
| `greeting` | Greetings, pleasantries, and short conversational openings |
| `zakat_calculation` | Questions requiring zakat computation or zakat-related financial reasoning |
| `inheritance_calculation` | Islamic inheritance/faraid questions requiring structured calculation |
| `dua_lookup` | Requests for supplications, adhkar, or du'a for specific occasions |
| `islamic_calendar` | Hijri/Gregorian conversion, Islamic dates, Ramadan/Eid dates, or Islamic events |
| `prayer_times` | Prayer times, Qibla direction, sunrise/sunset, or location/time-based worship queries |
#### Example
```json
{
"id": "2772",
"query": "Jazakallah khair for the help!",
"task_id": 812471,
"majority_label": "greeting",
"annotator_labels": ["greeting", "dua_lookup", "greeting"],
"unanimous": false,
"agreement_ratio": "2/3"
}
```
```json
{
"id": "83123",
"query": "ما هو نصيب الأخت الشقيقة مع وجود ابنتين للمتوفى؟ هل تعتبر عصبة؟",
"task_id": 812483,
"majority_label": "inheritance_calculation",
"annotator_labels": ["inheritance_calculation", "inheritance_calculation", "inheritance_calculation"],
"unanimous": true,
"agreement_ratio": "3/3"
}
```
## Loading the Dataset
You can load the dataset with the Hugging Face `datasets` library.
```python
from datasets import load_dataset
# List available configurations
# from datasets import get_dataset_config_names
# print(get_dataset_config_names("QCRI/Fanar-Sadiq-Classifier-Datasets"))
intent_ds = load_dataset(
"QCRI/Fanar-Sadiq-Classifier-Datasets",
name="intent classifier"
)
prompt_ds = load_dataset(
"QCRI/Fanar-Sadiq-Classifier-Datasets",
name="prompt classifier"
)
print(intent_ds)
print(prompt_ds)
```
Each subset currently contains a `test` split.
```python
print(intent_ds["test"][0])
print(prompt_ds["test"][0])
```
## Baseline Task Formulations
### Binary Classification
For the `prompt classifier` subset:
```text
Input: query
Output: islamic | non_islamic
```
Example:
```text
Query: ما حكم الزكاة في الإسلام؟
Label: islamic
```
### Multi-Class Intent Classification
For the `intent classifier` subset:
```text
Input: query
Output: one of the 9 Islamic intent labels
```
Example:
```text
Query: متى أذان الفجر في مكة المكرمة غداً؟
Label: prayer_times
```
## Relationship to Fanar-Sadiq
Fanar-Sadiq is a bilingual Arabic/English multi-agent Islamic QA architecture. Instead of sending every query through a single retrieve-then-generate pipeline, Fanar-Sadiq first classifies the query and routes it to specialized components.
Examples of routes include:
* retrieval-grounded fiqh and Islamic knowledge QA;
* exact Quran verse lookup and Quran-related routing;
* deterministic zakat and inheritance calculators;
* prayer-time and Qibla tools;
* Islamic calendar conversion and event lookup;
* du'a lookup and greeting handling.
These datasets are designed to evaluate and support the routing layer of that architecture.
## Annotation
### Intent Classifier
The intent-classification dataset was developed from anonymized real user queries. Each query was labeled by three independent annotators into one of nine intent categories. The final label was selected by majority vote, and examples without majority agreement were discarded.
The released intent subset includes 700 examples with majority labels.
### Prompt Classifier
The binary prompt-classifier dataset supports the orchestrator that decides whether a query should be routed to Fanar-Sadiq or to a general-purpose assistant. Queries labeled as Islamic are routed to the Islamic QA system; other queries are handled by a general assistant.
## Ethical Considerations and Limitations
This dataset is intended for classifier training and evaluation, not for issuing religious rulings.
Important limitations:
* The dataset contains user-style queries and may include sensitive religious, legal, social, or ethical topics.
* Labels reflect the routing schema used by Fanar-Sadiq and should not be interpreted as religious judgments.
* A query labeled `fiqh_ruling` means that the query asks about jurisprudence; it does not imply any answer or ruling.
* Models trained on this dataset may make routing errors, especially for ambiguous, multi-intent, or code-switched queries.
* Islamic legal questions may involve scholarly disagreement, madhhab-specific assumptions, local practice, and contextual details not present in the query.
* This dataset should not be used as a replacement for qualified scholarly expertise.
## Citation
If you use this dataset, please cite the Fanar-Sadiq paper:
```bibtex
@inproceedings{abbas2026fanarsadiq,
title = {{Fanar-Sadiq}: A Multi-Agent Architecture for Grounded Islamic QA},
author = {Abbas, Ummar and Ouzzani, Mourad and Eltabakh, Mohamed Y. and Sinan, Omar and Bhatia, Gagan and Mubarak, Hamdy and Hawasly, Majd and Hashim, Mohammed Qusay and Darwish, Kareem and Alam, Firoj},
booktitle = {Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics},
month = jul,
year = {2026},
address = {San Diego, California, United States},
publisher = {Association for Computational Linguistics},
note = {Accepted to ACL 2026}
}
```
## License
This dataset is released under the **Apache License 2.0**.