File size: 5,277 Bytes
5f63cc1
1b835ac
 
a9a8118
 
1b835ac
a9a8118
1b835ac
a9a8118
 
 
 
1b835ac
a9a8118
5f63cc1
a9a8118
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5f63cc1
1b835ac
 
 
 
 
 
 
 
 
 
 
 
 
de1d61d
 
1b835ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
de1d61d
1b835ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
de1d61d
 
 
 
 
 
 
 
 
 
 
 
1b835ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
---
license: cc-by-4.0
task_categories:
- question-answering
- text-retrieval
language:
- en
tags:
- rag
- qasper
- scientific-qa
- retrieval
size_categories:
- 10K<n<100K
configs:
- config_name: answers
  data_files:
  - split: train
    path: answers/train*
  - split: dev
    path: answers/dev*
  - split: test
    path: answers/test*
- config_name: corpus
  data_files:
  - split: train
    path: corpus/*
- config_name: qrels
  data_files:
  - split: train
    path: qrels/train*
  - split: dev
    path: qrels/dev*
  - split: test
    path: qrels/test*
- config_name: queries
  data_files:
  - split: train
    path: queries/train*
  - split: dev
    path: queries/dev*
  - split: test
    path: queries/test*
- config_name: retrieved_docs
  data_files:
  - split: train
    path: retrieved_docs/train-*
  - split: dev
    path: retrieved_docs/dev-*
  - split: test
    path: retrieved_docs/test-*
- config_name: top_ranked
  data_files:
  - split: train
    path: top_ranked/train*
  - split: dev
    path: top_ranked/dev*
  - split: test
    path: top_ranked/test*
dataset_info:
  config_name: retrieved_docs
  features:
  - name: query_id
    dtype: string
  - name: corpus_id
    dtype: string
  - name: rank
    dtype: int64
  - name: retrieval_score
    dtype: float64
  - name: is_relevant
    dtype: bool
  splits:
  - name: train
    num_bytes: 1681424
    num_examples: 20985
  - name: dev
    num_bytes: 712632
    num_examples: 8894
  - name: test
    num_bytes: 1048757
    num_examples: 13089
  download_size: 758823
  dataset_size: 3442813
---

# QASPER RAG

Dataset for Retrieval-Augmented Generation (RAG) based on [QASPER](https://huggingface.co/datasets/allenai/qasper).

## Structure

| Subset | Splits | Description |
|--------|--------|-------------|
| `corpus` | train (default) | Paper chunks (abstract + full-text paragraphs) shared across all query splits |
| `queries` | train, dev, test | Information-seeking questions over scientific papers |
| `qrels` | train, dev, test | Relevance judgments (query ↔ paragraph chunk) |
| `answers` | train, dev, test | Reference answers (longest valid free-form answer) |
| `top_ranked` | train, dev, test | Paper-scoped candidate pool (all chunks of the query paper) |
| `retrieved_docs` | train, dev, test | Top-k retrieval results with relevance labels |

## Dataset statistics

| Split | Queries | Corpus |
|-------|--------:|-------:|
| train | 2101 | 81550 |
| dev   | 890 | 81550 |
| test  | 1310 | 81550 |

The corpus is shared across all splits and contains paragraph-level chunks from the abstract and full text of each paper.

- **Dev split:** mapped from the original `validation` split
- **Corpus source:** unique papers from train, validation and test splits
- **Chunking:** one chunk for the abstract (`section_name: abstract`) and one chunk per paragraph in `full_text`

## Source

| Component | QASPER resource |
|-----------|-----------------|
| Train | `train` split from [allenai/qasper](https://huggingface.co/datasets/allenai/qasper) |
| Dev | `validation` split |
| Test | `test` split |
| Corpus | `abstract` + `full_text.paragraphs` |
| Queries | `qas.question` |
| Qrels | `qas.answers[*].answer[*].evidence` matched to corpus chunks |
| Top ranked | All paragraph chunks from the query paper (paper-scoped retrieval pool) |
| Answers | Longest valid answer per question (`free_form_answer`, joined `extractive_spans`, or `Yes`/`No`) |

## Filtering

Questions are kept only when at least one answer satisfies all of the following:

- `unanswerable` is `false`
- the answer has `free_form_answer`, non-empty `extractive_spans`, or `yes_no`
- after removing evidence items containing `FLOAT SELECTED`, at least one answer still has evidence that matches the corpus

Evidence items containing `FLOAT SELECTED` are removed individually. Questions are omitted only when no valid answer has remaining evidence.

## Schema

### corpus
```json
{"id": "...", "title": "...", "section_name": "...", "text": "..."}
```

### queries
```json
{"id": "...", "text": "..."}
```

### qrels
```json
{"query_id": "...", "corpus_id": "...", "score": 1}
```

### answers
```json
{"query_id": "...", "answer": "..."}
```

### top_ranked
```json
{"query-id": "...", "corpus-ids": ["paper_00000", "paper_00001"]}
```

### retrieved_docs
```json
{"query_id": "...", "corpus_id": "...", "rank": 1, "retrieval_score": 0.92, "is_relevant": true}
```

Top-k documents retrieved from the indexed corpus (`is_relevant` is derived from `qrels`).

## Usage

```python
from datasets import load_dataset

corpus = load_dataset("DinoStackAI/qasper-rag", "corpus")["train"]
queries = load_dataset("DinoStackAI/qasper-rag", "queries")
qrels = load_dataset("DinoStackAI/qasper-rag", "qrels")
answers = load_dataset("DinoStackAI/qasper-rag", "answers")

train_queries = queries["train"]
dev_qrels = qrels["dev"]
test_answers = answers["test"]
```

## Citation

QASPER is released under the [CC BY 4.0 License](https://creativecommons.org/licenses/by/4.0/).

```bibtex
@inproceedings{Dasigi2021ADO,
  title={A Dataset of Information-Seeking Questions and Answers Anchored in Research Papers},
  author={Pradeep Dasigi and Kyle Lo and Iz Beltagy and Arman Cohan and Noah A. Smith and Matt Gardner},
  year={2021}
}
```