File size: 5,014 Bytes
1a09b95 | 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 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | ---
pretty_name: Natively Extended FinQA
license: cc-by-4.0
language:
- en
task_categories:
- question-answering
tags:
- finance
- finqa
- financial-question-answering
- numerical-reasoning
- long-context
- rag
configs:
- config_name: default
data_files:
- split: train
path: data/long_train.json
- split: validation
path: data/long_dev.json
- split: test
path: data/long_test.json
- split: private_test
path: data/long_private_test.json
---
# Natively Extended FinQA
Natively Extended FinQA is a long-context derivative of FinQA for numerical reasoning over financial data.
It preserves the FinQA task while increasing the amount of financial context surrounding each question.
Average context increased from approximately:
`611 words per question`
to:
`5,629 words per question`
## Splits
| Hugging Face Split | File | Records |
|---|---|---:|
| `train` | `long_train.json` | 6,251 |
| `validation` | `long_dev.json` | 883 |
| `test` | `long_test.json` | 1,147 |
| `private_test` | `long_private_test.json` | 919 |
## Load with Hugging Face Datasets
```python
from datasets import load_dataset
dataset = load_dataset(
"Mr-Rosen/Accuracy-Is-Not-Enough-FinQA-Dataset"
)
print(dataset)
print(dataset["train"][0]["qa"]["question"])
````
To load only one split:
```python
test = load_dataset(
"Mr-Rosen/Accuracy-Is-Not-Enough-FinQA-Dataset",
split="test",
)
```
## Load as Standard JSON
```python
import json
with open("data/long_test.json", "r", encoding="utf-8") as f:
test = json.load(f)
```
## Dataset Structure
Important top-level fields include:
```text
id
pre_text
table
post_text
qa
```
Important `qa` fields include:
```text
question
program
exe_ans
gold_inds
```
Additional FinQA fields may also be present.
## Field Usage
### Model-Visible Full-Context Input
```text
qa.question
pre_text
table
post_text
```
### Supervised Training Target
```text
qa.program
```
### Evaluation-Only / Gold Information
Do not expose these fields to a model during normal validation or test inference:
```text
qa.program
qa.answer
qa.exe_ans
qa.gold_inds
```
Example:
```python
def extract_model_input(example):
return {
"question": example["qa"]["question"],
"pre_text": example.get("pre_text", []),
"table": example.get("table", []),
"post_text": example.get("post_text", []),
}
```
## FinQA Program Format
The associated experiments generate structured FinQA programs.
Example:
```json
["subtract(", "5829", "5735", ")", "EOF"]
```
Multi-step programs can reference previous operations:
```json
[
"subtract(",
"5829",
"5735",
")",
"divide(",
"#0",
"5735",
")",
"EOF"
]
```
These programs should be evaluated with the FinQA evaluator.
## Dataset Construction
The expanded version adds additional native financial context around FinQA examples.
The goal is to increase context noise while retaining the original question, financial table data, program targets, execution answers, and supporting-evidence information.
Context blocks were varied so relevant evidence would not always occupy a predictable position.
Ordering within individual source blocks was preserved.
## Recommended Usage
```text
train -> adapter training
validation -> prompt/checkpoint/config selection
test -> final evaluation
private_test -> private-test-style use
```
If reproducing the accompanying study, do not use the test split for tuning.
## Associated Research
The dataset supports a six-method comparison using:
`Qwen/Qwen2.5-7B-Instruct`
Methods:
* Baseline
* RAG
* LoRA
* QLoRA
* RAG + LoRA
* RAG + QLoRA
Research repository:
`MarkPaulRosenthal/Accuracy-Is-Not-Enough-Practical-Financial-QA`
GitHub dataset repository:
[MarkPaulRosenthal/Accuracy-Is-Not-Enough-FinQA-Dataset](https://github.com/MarkPaulRosenthal/Accuracy-Is-Not-Enough-FinQA-Dataset)
## Retrieval Data
The fixed practical retrieval artifacts used by the RAG-family methods are published in the companion research repository rather than this dataset repository.
They are derived model inputs, not primary benchmark splits.
## Intended Uses
Appropriate uses include:
* long-context financial QA
* numerical reasoning
* structured program generation
* retrieval evaluation
* RAG
* LoRA/QLoRA
* context-noise analysis
* full-context versus retrieved-context comparisons
## Limitations
This is a controlled FinQA-derived benchmark rather than a random sample of complete production financial documents.
Results should not automatically be generalized to arbitrary financial reports or other financial domains without external evaluation.
## License
**CC BY 4.0**
This dataset remains a derivative of FinQA and should be attributed accordingly.
## Attribution
Natively Extended FinQA builds on:
**FinQA: A Dataset of Numerical Reasoning over Financial Data**
Users should cite the original FinQA work when using this derivative dataset.
|