Repository navigation
Extract figure and table captions with a clean final image layout - #10
Merged
Merged
Conversation
Retain caption/page metadata and render caption-inclusive PDF crops. Stage extraction artifacts in intermediate storage and publish flat PNGs. Preserve old assets and repair metadata and Markdown links during migration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Figure/table crops omitted their captions and discarded caption/page metadata. Add a capped pilot and a full-corpus extraction command that retain metadata and render the original caption pixels into each image.
Publication validates source checksums and images, archives old assets, and updates index paths/counts and Markdown image links. Migration journals support retries; index promotion rolls back on failure. Text refreshes and the existing asset stage preserve the new layout. Continuation recovery uses conservative matching of adjacent ruled tables and retains review flags; rotated single-page crops and small source-caption clipping are covered.
Generated corpus files remain ignored and are not included in this PR. The README documents local execution without Docker.
Evidence
After: final figures/tables folders contain flat PNGs; metadata and preserved originals live in intermediate.
cd inlg27/agent-in-the-loop/corpus-creation && PYENV_VERSION=uniagent pyenv exec python -m pytest -q: 270 passed, with five existing PyMuPDF/SWIG deprecation warnings.git diff --checkpasses.Merge Danger
Door: two-way
Extraction and layout migration are explicit commands; merging does not run them. Original assets, metadata and changed Markdown are backed up in intermediate. Consumers must resolve current asset-metadata paths relative to the corpus-builder root.
Blast Radius: corpus
Image counts and metadata locations change when publication/migration runs. Automated extraction still requires review: 48 caption strings are unavailable, 1,839 captions lack extracted regions, and one source caption is clipped at the PDF boundary. Another 164 Markdown image links were already broken before this migration and remain unresolved.