Skip to content

Batch flat record comparisons in ordered sequence alignment - #170

Merged
xujustinj merged 1 commit into
mainfrom
xujustinj/batch-ordered-pair-scoring
Nov 21, 2026
Merged

xujustinj merged 1 commit into
mainfrom
xujustinj/batch-ordered-pair-scoring

Conversation

@xujustinj

Copy link
Copy Markdown

Summary

Speed up scoring for ordered arrays of flat records. The scorer batches exact field comparisons and computes one alignment row at a time in NumPy. Each row still considers every candidate pairing, and ties retain the same priority. This matters when two predictions have the same value but cite different locations.

For example, given expected rows A B C D E and predicted rows A B D E C, the alignment still credits A, B, D, and E. Fuzzy fields, distinct accepted alternatives, and custom normalizers use the existing field matcher.

Benchmark

Local scoring times on saved Datalab Oklahoma outputs with ordered matching enabled for the owners array.

Tier Previous Batched
Fast 20.42 s 1.16 s
Balanced — 5.77 s
Accurate — 5.72 s

Fast was 17.6× faster. The full Balanced and Accurate baseline comparisons were stopped before completion.

Test plan

  • Compared every Fast row pairing, 80,177 value verdicts, 236 grounding records, and nine metrics. All matched exactly.
  • Compared tracebacks on 21,279 small score matrices and scorer outputs on 500 randomized documents.
  • Added regression tests for absent fields competing with a normalized match and for tied predictions selecting the same field path.
  • Ran the evaluation suite (643 passed, 14 skipped), Ruff, and mypy on the changed scorer modules.

@xujustinj

xujustinj commented Nov 21, 2026 •

Copy link
Copy Markdown
Author

for the record we don't have arrays in ExtractBench's main data that would need this kind of evaluation -- Datalab + Oklahoma is a hypothetical, if we turn on structural: "ordered" for the Oklahoma array -- but if folks want to use ExtractBench to measure their own data, this is a good speedup to have

@xujustinj
xujustinj merged commit 9fce6ab into main Nov 21, 2026
3 checks passed
@xujustinj
xujustinj deleted the xujustinj/batch-ordered-pair-scoring branch November 23, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant