zakerytclarke
commited on
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Mini Squad
|
2 |
+
A simple transformation on the SQuAD dataset for training tiny language models.
|
3 |
+
|
4 |
+
## Overview
|
5 |
+
The Mini Squad dataset is a modified version of the Stanford Question Answering Dataset (SQuAD). It focuses on extracting concise context sentences around each answer, making it suitable for training small-scale language models or fine-tuning lightweight architectures.
|
6 |
+
|
7 |
+
### Key Features
|
8 |
+
- **Reduced Context**: Extracts only the sentence containing the answer, bounded by sentence-ending punctuation (period, question mark, exclamation point, or semicolon).
|
9 |
+
- **Simplified Format**: Each entry includes `context`, `question`, and `answer`, providing a clean and easy-to-use structure.
|
10 |
+
- **Preprocessed for Lightweight Models**: Designed to minimize memory and computational requirements for smaller models.
|
11 |
+
|
12 |
+
## Dataset Structure
|
13 |
+
The dataset consists of two splits:
|
14 |
+
- `train.json`: Training set.
|
15 |
+
- `validation.json`: Validation set.
|
16 |
+
|
17 |
+
Each file is a JSON Lines file, where each line is a dictionary with the following fields:
|
18 |
+
- `context`: The extracted sentence containing the answer.
|
19 |
+
- `question`: The question from the original dataset.
|
20 |
+
- `answer`: The corresponding answer.
|
21 |
+
|
22 |
+
### Example Entry
|
23 |
+
```json
|
24 |
+
{
|
25 |
+
"context": "France where the Virgin Mary reputedly appeared to Saint Bernadette Soubirous in 1858.",
|
26 |
+
"question": "To whom did the Virgin Mary allegedly appear in 1858 in Lourdes France?",
|
27 |
+
"answer": "Saint Bernadette Soubirous"
|
28 |
+
}
|
29 |
+
```
|
30 |
+
|
31 |
+
## Usage
|
32 |
+
|
33 |
+
### Loading the Dataset
|
34 |
+
You can load the dataset using the Hugging Face `datasets` library:
|
35 |
+
|
36 |
+
```python
|
37 |
+
from datasets import load_dataset
|
38 |
+
|
39 |
+
# Load the dataset
|
40 |
+
dataset = load_dataset("zakerytclarke/mini_squad")
|
41 |
+
|
42 |
+
# Access the splits
|
43 |
+
train_df = dataset["train"].to_pandas()
|
44 |
+
validation_df = dataset["validation"].to_pandas()
|
45 |
+
|
46 |
+
print(train_df.head())
|
47 |
+
```
|
48 |
+
|
49 |
+
### Applications
|
50 |
+
- Fine-tuning small language models.
|
51 |
+
- Training efficient QA systems.
|
52 |
+
- Use as a benchmark for lightweight NLP architectures.
|
53 |
+
|
54 |
+
## File Structure
|
55 |
+
```
|
56 |
+
mini-squad/
|
57 |
+
|— train.json
|
58 |
+
|— validation.json
|
59 |
+
```
|
60 |
+
|
61 |
+
## Citation
|
62 |
+
If you use Mini Squad in your research or applications, please cite the original SQuAD dataset:
|
63 |
+
```
|
64 |
+
@article{rajpurkar2016squad,
|
65 |
+
title={SQuAD: 100,000+ Questions for Machine Comprehension of Text},
|
66 |
+
author={Rajpurkar, Pranav and Zhang, Jian and Lopyrev, Konstantin and Liang, Percy},
|
67 |
+
journal={arXiv preprint arXiv:1606.05250},
|
68 |
+
year={2016}
|
69 |
+
}
|
70 |
+
```
|
71 |
+
|
72 |
+
## License
|
73 |
+
The Mini Squad dataset inherits the license of the original SQuAD dataset. Please refer to the [SQuAD license](https://github.com/rajpurkar/SQuAD-explorer/blob/master/LICENSE) for details.
|
74 |
+
|