Fix 14 malformed/corrupted LineItem date values in ground truth (3 docs)

#3

Fix 14 malformed/corrupted LineItem date values in ground truth (3 documents)

Summary

While using this dataset to benchmark key-information-extraction accuracy, we
found that LineItems scores were being capped by a small number of corrupted
date strings in the ground-truth labels
rather than by model behavior. This PR
corrects 14 malformed date values across 3 documents. Every correction is
verified against the source PDF image and preserves the original digit content.

No other values are changed. No document's set of rows is added to or removed
from. This is a surgical typo fix.

Documents & changes

Document Row Field Current Proposed Rationale
3b768c37cd4670c0f28b0e89d7507e05 12 EndDate 11/0316 11/03/16 Missing /; every row in this invoice has StartDate == EndDate, both 11/03/16
d1a83bbb1eeb256a325dab9e0ce6235b 206,219,220 StartDate 2.7.16 2-7-16 Invoice renders all dates as M-D-YY; . are stray separators
d1a83bbb1eeb256a325dab9e0ce6235b 211,239 StartDate 2.7-16 2-7-16 same
d1a83bbb1eeb256a325dab9e0ce6235b 244,245,250 StartDate 2.8.16 2-8-16 same
d1a83bbb1eeb256a325dab9e0ce6235b 251,256 StartDate 24-16 2-4-16 Month "24" is impossible; dropped hyphen — OCR/PDF show 2-4-16
d1a83bbb1eeb256a325dab9e0ce6235b 264 StartDate 2-846 2-8-16 Dropped hyphen; sits among 2-8-16 rows
d1a83bbb1eeb256a325dab9e0ce6235b 306 StartDate 2.9-16 2-9-16 Invoice canonical M-D-YY
ef3f9ec55c8438337f6f45d65b57ceef 5 EndDate 07/17/ 6 07/17/16 Stray space; End-Date column is uniformly 07/17/16

(Row indices are 0-based within each document's LineItems array.)

To make review easier, each correction includes a bounding-box-annotated page
image
(corrections/review_images/) showing where the value appears in the source document.
These were produced by OCR'ing the (scanned) pages with Amazon Textract and boxing
the corrected value using word geometry. Note: where a date repeats many times in a
spot table, the box marks a correct instance of the value rather than the exact
row — it is an orientation aid; the textual rationale in the table above is the
authoritative justification.

Methodology

  1. Extracted json_response (GT) and text (OCR) for all 75 documents from the
    published parquet.
  2. Programmatically flagged every LineItem*Date value that is non-null but
    either does not parse as a date or has an impossible month/day.
  3. For each flagged value, rendered the source PDF at 200 DPI and visually
    confirmed the correct value and the invoice's canonical date format.
  4. Applied minimal edits that preserve digit content and match the surrounding
    rows. An automated assertion verifies each "before" value matches the current
    GT exactly before writing the "after" value.

What this PR intentionally does NOT change

  • Date formats. The schema types dates as free strings, so the mix of
    M-D-YY, M/D/YY, M/D/YYYY, and bare M/D is not a labeling error. We leave
    well-formed dates untouched. (Happy to provide an optional, separate
    normalization patch if the maintainers want a single canonical format.)
  • Empty LineItems. The 4 documents with LineItems: [] are fee-summary
    invoices with no dated spot-detail table; [] is correct.
  • Row completeness. We did not attempt to add/remove rows; that would require
    a separate, manually-verified reconciliation pass.

Attribution / license

This is a corrections contribution to a CC-BY-NC-4.0 dataset, offered under the
same terms with attribution to amazon-agi/RealKIE-FCC-Verified and the original
RealKIE dataset (arXiv 2403.20101). Source documents remain FCC public files.

Note for reviewers — the change is one Parquet file, but it's fully auditable

The only data change in this PR is data/test-00000-of-00001.parquet (the
json_response column). Since Parquet is binary, GitHub/HF won't render a diff — so
I've added a corrections/ folder to this PR branch to make the change reviewable:

  • corrections/CORRECTIONS.md — the 14 edits as a table, with per-edit evidence
  • corrections/MANIFEST.json — machine-readable old→new list
  • corrections/gt_fixes.diff — unified diff of the affected records (pretty JSON)

Exactly 14 cells differ from main; nothing else (all values, row counts, other
columns, images, and PDFs are untouched). Every edit is a malformed/corrupted date
string corrected to the value shown in the source PDF, preserving digit content and
the document's own canonical date format.

Document Row Field Current Proposed
3b768c37cd46… 12 LineItemEndDate 11/0316 11/03/16
d1a83bbb1eeb… 206 LineItemStartDate 2.7.16 2-7-16
d1a83bbb1eeb… 211 LineItemStartDate 2.7-16 2-7-16
d1a83bbb1eeb… 219 LineItemStartDate 2.7.16 2-7-16
d1a83bbb1eeb… 220 LineItemStartDate 2.7.16 2-7-16
d1a83bbb1eeb… 239 LineItemStartDate 2.7-16 2-7-16
d1a83bbb1eeb… 244 LineItemStartDate 2.8.16 2-8-16
d1a83bbb1eeb… 245 LineItemStartDate 2.8.16 2-8-16
d1a83bbb1eeb… 250 LineItemStartDate 2.8.16 2-8-16
d1a83bbb1eeb… 251 LineItemStartDate 24-16 2-4-16
d1a83bbb1eeb… 256 LineItemStartDate 24-16 2-4-16
d1a83bbb1eeb… 264 LineItemStartDate 2-846 2-8-16
d1a83bbb1eeb… 306 LineItemStartDate 2.9-16 2-9-16
ef3f9ec55c84… 5 LineItemEndDate 07/17/ 6 07/17/16

Verify:

import pandas as pd, json
a = pd.read_parquet("hf://datasets/amazon-agi/RealKIE-FCC-Verified@main/data/test-00000-of-00001.parquet")
b = pd.read_parquet("hf://datasets/amazon-agi/RealKIE-FCC-Verified@refs/pr/3/data/test-00000-of-00001.parquet")
# diff json_response cell-by-cell -> exactly the 14 (id,row,field) in corrections/MANIFEST.json

Happy to reshape this (e.g. land the corrections as loose JSON instead of a Parquet
rewrite) if the maintainers prefer a different mechanism.

The bbox-annotated review images referenced in the PR description are now on this PR branch under corrections/review_images/ (14 PNGs, one per edit). corrections/CORRECTIONS.md links each one from its row in the corrections table. As noted there: where a date repeats in a spot table the box marks a correct instance of the value, not necessarily the exact GT row — the textual evidence column is the authoritative justification.

Cleanup: the Parquet was rewritten to preserve the original JSON key / Arrow struct-field ordering. An earlier revision of this PR had round-tripped the file through pandas, which alphabetically reordered keys in the (unchanged) json_schema column — harmless semantically, but it made the diff noisy. The PR branch now differs from main in exactly the 14 LineItems date cells listed in corrections/ and nothing else (verified cell-by-cell across all 75 rows; id, text, json_schema, and image_files are byte-identical to main).

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment