christinamaria/cord-v2-ocr
CORD-v2 text-only — receipt OCR text → structured JSON A text-only derivative of CORD-v2 (Consolidated Receipt Dataset; Park et al., 2019), the standard benchmark for document information extraction used by Donut and similar models. The original dataset pairs 1,000 receipt photos with a rich ground-truth schema (~30 field types across 4 groups, including menu line items). This version drops the images and pairs the OCR text of each receipt with its target parse, so text-only… See the full description on the dataset page: https://huggingface.co/datasets/christinamaria/cord-v2-ocr.
CORD-v2 text-only — receipt OCR text → structured JSON
A text-only derivative of CORD-v2 (Consolidated Receipt Dataset; Park et al., 2019), the standard benchmark for document information extraction used by Donut and similar models. The original dataset pairs 1,000 receipt photos with a rich ground-truth schema (~30 field types across 4 groups, including menu line items). This version drops the images and pairs the OCR text of each receipt with its target parse, so text-only LLMs can be trained and evaluated on document extraction to JSON.
Format
Each line is a JSON object:
{
"system_prompt": "Extract the structured data from the following receipt OCR text. Respond with only a JSON object using these field groups:\n- menu: line items, each with nm (name), cnt (count), price, and where present num, unitprice, discountprice, itemsubtotal, vatyn, etc, sub (nested sub-items)\n- void_menu: cancelled items, each with nm, price\n- sub_total: subtotal_price, discount_price, service_price, othersvc_price, tax_price, etc\n- total: total_price, total_etc, cashprice, changeprice, creditcardprice, emoneyprice, menutype_cnt, menuqty_cnt\nAll values are strings. A group or field appears only if present on the receipt; groups with multiple entries are JSON arrays.\nOutput strict JSON exactly like this example — double-quoted keys and values, no single quotes, no code fences, no text before or after the JSON object:\n{\"menu\": [{\"nm\": \"ICE TEA\", \"cnt\": \"2\", \"price\": \"10,000\"}], \"sub_total\": {\"subtotal_price\": \"10,000\", \"tax_price\": \"1,000\"}, \"total\": {\"total_price\": \"11,000\", \"cashprice\": \"15,000\", \"changeprice\": \"4,000\"}}",
"text": "1 REAL GANACHE 16,500\n1 EGG TART 13,000\n1 PIZZA TOAST 16,000\nTOTAL 45,500\nCASH 50,000\nCHANGE 4,500",
"gt_parse": {
"menu": [
{"nm": "REAL GANACHE", "cnt": "1", "price": "16,500"},
{"nm": "EGG TART", "cnt": "1", "price": "13,000"},
{"nm": "PIZZA TOAST", "cnt": "1", "price": "16,000"}
],
"total": {"total_price": "45,500", "cashprice": "50,000", "changeprice": "4,500"}
}
}Splits
Splits are identical to the original CORD-v2 splits; no rows were added, removed, or moved.
How this was built
CORD has no plain-text field — its raw annotation is word-level: every word with its four-corner pixel coordinates (quad), grouped by semantic field (menu.nm, menu.cnt, menu.price, …) rather than by visual line.
- `text` was reconstructed from those word annotations to match what an OCR engine would output: words are clustered into visual rows by vertical center (tolerance = half the median word height per receipt) and sorted left-to-right within each row. The semantic-field grouping was deliberately ignored — serializing it directly would leak the answer's field boundaries into the input.
- `gt_parse` is the original target parse, verbatim.
- Dropped fields from the original
ground_truth:meta,roi,repeating_symbol,dontcare(image-specific geometry and annotation bookkeeping), plus theimagecolumn itself.
Annotations were read directly from the source dataset's parquet files (ground_truth column only); the images were never downloaded.
Caveats
- Models trained on this learn OCR text → JSON. At inference you must run OCR on new documents first; the vision step is not learned.
- Receipts are photographed, sometimes skewed or crumpled, so the coordinate-based line reconstruction can occasionally merge or split a visual row — noise comparable to what real OCR produces.
- Receipts are mostly from Indonesian shops and restaurants; item names mix Indonesian and English.
Citation
@article{park2019cord,
title = {CORD: A Consolidated Receipt Dataset for Post-OCR Parsing},
author = {Park, Seunghyun and Shin, Seung and Lee, Bado and Lee, Junyeop and Surh, Jaeheung and Seo, Minjoon and Lee, Hwalsuk},
journal = {Workshop on Document Intelligence at NeurIPS 2019},
year = {2019}
}License
Creative Commons Attribution 4.0 International (CC BY 4.0), matching the original CORD-v2 release.
