File size: 5,479 Bytes
9e9d40b
ae21d2d
 
 
 
 
 
 
 
 
 
 
 
 
 
9e9d40b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ae21d2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: mit
language:
  - en
task_categories:
  - question-answering
  - table-question-answering
tags:
  - financial
  - numerical-reasoning
  - multi-table
  - hierarchical-tables
  - earnings-reports
size_categories:
  - 1K<n<10K
dataset_info:
  features:
  - name: uid
    dtype: string
  - name: paragraphs
    list: string
  - name: tables
    list: string
  - name: table_description
    dtype: string
  - name: question
    dtype: string
  - name: answer
    dtype: string
  - name: program
    dtype: string
  - name: text_evidence
    list: int32
  - name: table_evidence
    list: string
  splits:
  - name: train
    num_bytes: 238214466
    num_examples: 7830
  - name: validation
    num_bytes: 32862217
    num_examples: 1044
  download_size: 172903720
  dataset_size: 271076683
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
  - split: validation
    path: data/validation-*
---

# MultiHiertt

A repackaging of the [MultiHiertt dataset](https://github.com/psunlpgroup/MultiHiertt) (Zhao et al., ACL 2022) for numerical reasoning over documents containing multiple hierarchical financial tables.

MultiHiertt is built on [FinTabNet](https://developer.ibm.com/exchanges/data/all/fintabnet/) (CDLA-Permissive-1.0), extracting 4,791 multi-page documents from S&P 500 annual reports (1999-2019). Each document contains 2-6 hierarchical HTML tables and surrounding text. Questions require reasoning across multiple tables and/or text passages, with answers derived via arithmetic programs or direct span selection.

## Why this version

The existing HuggingFace repository ([yilunzhao/MultiHiertt](https://huggingface.co/datasets/yilunzhao/MultiHiertt)) bundles model checkpoints alongside the dataset files, totalling 7.66 GB, and the dataset viewer is broken due to an Arrow conversion error on the HTML table fields. This version packages only the annotation data (172 MB) in a clean parquet format with a documented schema.

## Splits

| Split | Examples |
|---|---|
| train | 7,830 |
| validation | 1,044 |

The reference-free leaderboard test set (1,566 examples, `question` only) is intentionally excluded.

## Schema

| Field | Type | Description |
|---|---|---|
| `uid` | string | Unique example ID (MD5 hash) |
| `paragraphs` | list[string] | Sentences from the document; table positions marked with `## Table N ##` placeholders |
| `tables` | list[string] | Raw HTML string for each table in the document |
| `table_description` | string | JSON-serialized dict mapping `"{table}-{row}-{col}"` keys to natural-language cell descriptions (e.g. `"Table 0 shows Revenue is $446."`) |
| `question` | string | The financial question |
| `answer` | string | Numeric answer (e.g. `"9805"`) or text span; coerced to string |
| `program` | string | Flat DSL reasoning program (e.g. `add(10881,8729), divide(#0,const_2)`); empty string for span-selection questions (~19% of train) |
| `text_evidence` | list[int] | Zero-indexed paragraph indices used as gold evidence |
| `table_evidence` | list[string] | Gold cell references in `"{table}-{row}-{col}"` format, matching `table_description` keys |

### `table_description` format

Keys follow the pattern `"{table_idx}-{row}-{col}"` (zero-indexed table, one-indexed row and column). Values are auto-generated natural-language descriptions of the cell in context, produced by the authors' preprocessing script:

```python
import json
td = json.loads(row["table_description"])
# {"0-2-1": "Table 0 shows Revenue of 2007 is $446.", "0-2-2": ...}
```

### Program format

Programs use the same DSL as [FinQA](https://huggingface.co/datasets/rootsautomation/FinQA): flat token sequences with `#N` back-references to prior step results and `const_*` predefined constants. Unlike FinQA, MultiHiertt does not include a `steps` decomposition or `program_re` nested form.

## Usage

```python
from datasets import load_dataset
import json

ds = load_dataset("rootsautomation/MultiHiertt")
ex = ds["train"][0]

print(ex["question"])
print(ex["answer"])
print(ex["program"])       # empty string if span-selection

# Reconstruct document with tables in position
for para in ex["paragraphs"]:
    if para.startswith("## Table"):
        idx = int(para.split()[2])
        print(f"[TABLE {idx}]: {ex['tables'][idx][:80]}...")
    else:
        print(para)

# Access cell-level evidence
td = json.loads(ex["table_description"])
for cell_ref in ex["table_evidence"]:
    print(f"  {cell_ref}: {td.get(cell_ref, '(no description)')}")
```

## License

QA annotations and preprocessing code: [MIT](https://github.com/psunlpgroup/MultiHiertt/blob/main/LICENSE).

Underlying table data is sourced from FinTabNet, released under [CDLA-Permissive-1.0](https://cdla.dev/permissive-1-0/). The original annual reports are publicly available SEC filings from S&P 500 companies.

## Citation

```bibtex
@inproceedings{zhao-etal-2022-multihiertt,
    title     = "{M}ulti{H}iertt: Numerical Reasoning over Multi Hierarchical Tabular and Textual Data",
    author    = "Zhao, Yilun and Li, Yunxiang and Li, Chenying and Zhang, Rui",
    booktitle = "Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
    month     = may,
    year      = "2022",
    address   = "Dublin, Ireland",
    publisher = "Association for Computational Linguistics",
    url       = "https://aclanthology.org/2022.acl-long.454",
    pages     = "6588--6600",
}
```