File size: 4,121 Bytes
e67f889 1ede967 7e83d73 e67f889 1ede967 9a0da82 4c70816 1ede967 4c70816 1ede967 9a0da82 1ede967 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
---
license: apache-2.0
language:
- ar
tags:
- islamic-finance
- fatwa
- question-answering
- training
- instruction-tuning
- arabic
size_categories:
- 10K<n<100K
task_categories:
- question-answering
- text-generation
pretty_name: Fatwa Training Dataset (Standardized)
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
dataset_info:
features:
- name: id
dtype: string
- name: conversations
list:
- name: content
dtype: string
- name: role
dtype: string
- name: category
dtype: string
- name: is_referral
dtype: string
- name: question_length
dtype: int64
- name: answer_length
dtype: int64
splits:
- name: train
num_bytes: 15481402
num_examples: 9953
download_size: 6512899
dataset_size: 15481402
---
# Fatwa Training Dataset (Standardized)
## Dataset Description
This dataset contains Islamic finance and jurisprudence fatwa question-answer pairs in a **standardized conversation format** for training Arabic language models. Each original sample has been augmented with **3 different prompt templates** to increase training diversity.
## Dataset Statistics
- **Total Samples**: 9,953
- **Unique Fatwas**: 6,212
- **Prompt Variations**: 3 per fatwa
- **Average Question Length**: 230.0 characters
- **Average Answer Length**: 493.6 characters
## Dataset Structure
### Data Fields
- `id`: Unique identifier for each fatwa (format: `fatwa_XXXXX`)
- `conversations`: List of conversation turns in chat format
- `content`: The text content
- `role`: Either "human" (question) or "agent" (answer)
- `category`: Islamic finance category
- `is_referral`: Whether the fatwa is mainly a referral (YES/NO)
- `question_length`: Character count of the original question
- `answer_length`: Character count of the answer
### Categories
- **zakat**: 4096 samples
- **riba**: 2047 samples
- **murabaha**: 1155 samples
- **gharar**: 711 samples
- **waqf**: 606 samples
- **ijara**: 469 samples
- **maysir**: 308 samples
- **musharaka**: 198 samples
- **mudharaba**: 188 samples
- **takaful**: 149 samples
- **sukuk**: 26 samples
### Prompt Templates
Each fatwa appears 3 times with different prompt styles:
1. **Formal Style**: "بناءً على أحكام الشريعة الإسلامية والفقه الإسلامي، أجب على السؤال التالي..."
2. **Concise Style**: "أجب على السؤال التالي وفقاً لأحكام الشريعة الإسلامية..."
3. **Expert Persona**: "أنت عالم متخصص في الفقه الإسلامي والمعاملات المالية..."
## Usage
```python
from datasets import load_dataset
dataset = load_dataset("SahmBenchmark/fatwa-training_standardized_new")
# Access training data
for example in dataset['train']:
print(f"ID: {example['id']}")
print(f"Human: {example['conversations'][0]['content']}")
print(f"Agent: {example['conversations'][1]['content']}")
print(f"Category: {example['category']}")
```
### For Fine-tuning
```python
from datasets import load_dataset
dataset = load_dataset("SahmBenchmark/fatwa-training_standardized_new")
def format_for_training(example):
human_msg = example['conversations'][0]['content']
agent_msg = example['conversations'][1]['content']
return {"text": f"### Human: {human_msg}\n\n### Assistant: {agent_msg}"}
formatted_dataset = dataset.map(format_for_training)
```
## Categories
- **zakat**: Islamic almsgiving
- **riba**: Interest/usury-related rulings
- **murabaha**: Cost-plus financing
- **gharar**: Uncertainty in contracts
- **waqf**: Islamic endowment
- **ijara**: Islamic leasing
- **maysir**: Gambling-related rulings
- **musharaka**: Partnership financing
- **mudharaba**: Profit-sharing partnership
- **takaful**: Islamic insurance
- **sukuk**: Islamic bonds
## Citation
```bibtex
@dataset{fatwa_training_standardized,
title={Fatwa Training Dataset (Standardized)},
author={SahmBenchmark},
year={2025},
url={https://huggingface.co/datasets/SahmBenchmark/fatwa-training_standardized_new}
}
```
## License
Apache 2.0 License
|