Spaces:
Sleeping
Sleeping
Commit History
-
rename package doc_agent -> docfield, distribution -> docfield-extract
The last identifier still carrying the old framing. The project is not an agent and the README says so; the import path said otherwise on every line of every module. Moved with git mv so history follows all 26 files, and kept as a package directory rather than flattened -- removing it would break the src layout the Space entry point depends on. pyproject needs [tool.uv.build-backend] module-name = "docfield". The uv build backend derives the module name from the project name, so a distribution called docfield-extract would otherwise look for src/docfield_extract/ and fail to find the package. Distribution name and import name differ on purpose: docfield-extract matches the repo, docfield is what you type. DB_PATH default moves from ./data/agent.db to ./data/docfield.db. This orphans any existing local database -- a watcher run against the new default starts an empty store and the old file is simply ignored, not migrated. There was no .db file in this working tree, so nothing was act…b6beb2d
-
eval: add --retry-errors to re-predict only the entries that failed
A quota outage left 44 of 361 cached SROIE documents with no extraction. Recovering them with --overwrite would have re-run all 361 and replaced the 317 successful predictions with fresh model output, invalidating every before/after rule comparison built on them -- S2 and the monetary tolerance change both depend on the predictions being frozen while only the rules vary. --retry-errors selects exactly the entries whose error field is set and skips every other cached id, so a successful prediction is never re-run, re-billed, or rewritten. Two guards, because both failure modes here spend quota silently: combining it with --overwrite raises rather than letting one win, and using it against an empty cache raises rather than falling through to a full predict. Note this leaves a cache that is mixed by construction: the backfilled 44 carry confidence and validation computed under current rules, the original 317 under the rules in force when they ran. That is only a disk-level inconsistency…fa6cf50
-
phase 5: evaluation harness (SROIE)
Two-phase harness so inference runs exactly once and tuning is free: - predict phase (eval/predict.py): runs process_document over a dataset slice, saves PIL images to temp files, caches gold + predicted Document + confidence + validation report to eval/cache/ keyed by id. The only phase that hits the model; idempotent (cached ids skipped) so re-runs never re-bill. - score phase (eval/score.py + eval/metrics.py): loads the cache and computes per-field and per-critical-field precision/recall/F1, the auto-accept critical precision, and a threshold sweep (0.50-0.99) that replays the real route() over cached (confidence, report), honoring the hard-failure override. Fully offline. Datasets: SROIE (jsdnrs/ICDAR2019-SROIE test) wired end-to-end; CORD and an invoice-JSON set scaffolded as adapters but not wired (load() raises, absent from WIRED_DATASETS). Only dataset-labeled fields are scored. Comparison (eval/normalize.py) reuses the schema's number/date coercion, then compares…d2a6765