boyang-runllama commited on
Commit
16f6672
·
verified ·
1 Parent(s): 05450eb

Match usage to ExtractBench

Browse files
Files changed (1) hide show
  1. README.md +19 -5
README.md CHANGED
@@ -102,21 +102,35 @@ Seven of the eight short documents are single plotter sheets 13 to 17 feet long
102
 
103
  ## Usage
104
 
105
- Download the dataset and run a system with the [ExtractBench evaluation framework](https://github.com/run-llama/ExtractBench#extractbench-pro):
 
 
 
 
 
 
 
 
 
 
 
 
106
 
107
  ```bash
108
- uv run extract-bench download --dataset pro
109
- uv run extract-bench run llamaextract_agentic --dataset pro
110
  ```
111
 
112
- Scoring follows ExtractBench and is fully deterministic:
113
 
114
  - **Unified value F1:** whether the extracted values match the expected output, under one definition for scalar fields and arrays of records.
115
  - **Perfect documents:** the share of documents with a unified value F1 of 100%.
116
  - **Word-level grounding F1:** a field counts as grounded only when its value is correct and its predicted box overlaps an accepted box for that field at IoU 0.5.
117
  - **Page-level grounding F1:** requires the correct source page rather than a box.
118
 
119
- The evaluation dataset files are:
 
 
120
 
121
  - [document_conventions.jsonl](document_conventions.jsonl): 22 test cases across 875 pages
122
  - [house_vocabulary.jsonl](house_vocabulary.jsonl): 14 test cases across 606 pages
 
102
 
103
  ## Usage
104
 
105
+ Load a split with `datasets`:
106
+
107
+ ```python
108
+ from datasets import load_dataset
109
+ import json
110
+
111
+ ds = load_dataset("llamaindex/ExtractBenchPro", split="charts_inside_documents")
112
+ case = ds[0]
113
+ schema = json.loads(case["data_schema"])
114
+ expected = json.loads(case["expected_output"])
115
+ ```
116
+
117
+ To run an extraction system, download the files in the layout expected by the [evaluation framework](https://github.com/run-llama/ExtractBench), then run a pipeline:
118
 
119
  ```bash
120
+ uv run extract-bench download --dataset pro # data-pro/<split>/<doc>.pdf + <doc>.test.json
121
+ uv run extract-bench run llamaextract_agentic --dataset pro # inference -> evaluation -> reports
122
  ```
123
 
124
+ ExtractBench Pro is scored the same way as ExtractBench. Value accuracy asks whether a system returned the right values, and is scored with unified value F1 on every document. Grounding asks whether the system can show where each value came from, and is scored only on the 81 documents with box ground truth.
125
 
126
  - **Unified value F1:** whether the extracted values match the expected output, under one definition for scalar fields and arrays of records.
127
  - **Perfect documents:** the share of documents with a unified value F1 of 100%.
128
  - **Word-level grounding F1:** a field counts as grounded only when its value is correct and its predicted box overlaps an accepted box for that field at IoU 0.5.
129
  - **Page-level grounding F1:** requires the correct source page rather than a box.
130
 
131
+ Scoring is fully deterministic: the same predictions and ground truth always produce the same score, with no model in the loop. The [code repository](https://github.com/run-llama/ExtractBench) contains the full metric definitions.
132
+
133
+ The evaluation dataset files include:
134
 
135
  - [document_conventions.jsonl](document_conventions.jsonl): 22 test cases across 875 pages
136
  - [house_vocabulary.jsonl](house_vocabulary.jsonl): 14 test cases across 606 pages