-
feat(hybrid): support DLA figure subdivision and English captions
发布于
2026-08-21 10:20:59 +00:00 The DLA model split its "figure" class into Figure(10)/Chart(18)/Image(19).
The transformer only knew labels 0-17, so charts and photos fell through to
a branch that drops objects with no OCR text — they vanished from output
entirely. A 200-document corpus scan puts that at 58% of visual objects.- Map labels 18/19 through label 10's existing picture route
- Switch captioning to IMAGE_CAPTIONING_EN; both engines write the same
response field, so the module name alone decides the language - Caption all three visual classes rather than gating on the class: a
rectangular photo was observed classified Figure(10) at confidence 0.900,
so gating drops alt text for real photos with nothing to show it happened - Add FORMULA_RECOGNITION; equations carry LaTeX instead of OCR text, with
the crop rectangle so evidence tooling can point at the region. Blank or
whitespace output falls back to the OCR text rather than replacing it - Drop duplicate visual detections (IoU >= 0.8, keep the confident one).
Measured: 3 duplicate pairs, all IoU 0.964-0.989, weaker always wrong.
Identity is the object's array position, not object_id — DLA omits that
field on some objects and repeats it across others on one page. Survivors
are walked confidence-first and compared only against those already kept,
so the cost stays linear in the detections a response claims - Run formulas before captioning so a page with both is rendered once
- Ignore a page the server marked IS_SUCCESS:false, and detect "not existed
engine": an unknown module returns HTTP 200 with SUCCESS:true, so a
module-name typo would otherwise be silent - Keep per-conversion state local; a cached client serves many documents and
convertAsync lets calls overlap - Add scripts/dla-corpus-scan/ to measure label distribution against a real
corpus, since the published spec does not match what the model emits
Verified end to end against the backend: English alt text reaches the JSON
and the PDF struct tree, 35 equations emit LaTeX, and the overlap cases
collapse to one picture each. 769 core tests pass.Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
下载附件