Skip to content

fix(extraction): enable infographic extraction by default - #2863

Open
jioffe502 wants to merge 4 commits into
mainfrom
devin/1794923180-default-extract-infographics
Open

jioffe502 wants to merge 4 commits into
mainfrom
devin/1794923180-default-extract-infographics

Conversation

@jioffe502

@jioffe502 jioffe502 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Page elements labels infographic regions on many pages. With extract_infographics=False (the default), the OCR pass never reads those crops, so text drawn inside the infographic image is not indexed. This PR changes the ExtractParams.extract_infographics default to True. It also adds --no-extract-infographics to the CLI, so the flag can still be turned off.

Measured on current main (ebc87c9, which includes #2839), bo10k (10,000 PDFs, 213,538 pages), pdfium_hybrid, page-level text embeddings, dense top-10, no rerank, 2× RTX PRO 6000:

Recall@5 Recall@10 nDCG@10 pages/s
extract_infographics=False (current default) 0.7127 0.7610 0.6180 55.7
extract_infographics=True 0.8285 0.8760 0.7294 50.5

Recall@10 goes up 11.5 points for about 9% fewer pages/s. Almost all of the gain is on infographic queries (356 of 1,347). On an earlier commit without #2839, those went from 0.334 to 0.792, and the other query types moved by at most 1.2 points (chart 0.884 → 0.896, table 0.919 → 0.919, text 0.898 → 0.902). On current main with the flag off, infographic Recall@10 is 0.371, so #2839 recovers only a small part of the gap. ViDoRe v3 (all 8 subsets, text_image, unweighted mean) moves from 0.6360 to 0.6370. The infographic OCR path is untuned, so tuning should win back the pages/s cost.

  • Scope: the ExtractParams default, the CLI flag pair, caption coverage for infographics that replace deduplicated image crops, the tests that asserted the old default, and the multimodal extraction docs.
  • Unchanged:
    • Explicit extract_infographics=False keeps today's behavior.
    • Table and chart extraction are not affected.
  • Behavior change on method="nemotron_parse": regions Parse classifies as infographic now go to the infographic channel instead of page text. Not measured in this PR.
  • Captioning with image dedup (automatic when captioning is enabled): image crops that overlap an infographic region are deduplicated against it. Dedup now marks that infographic replaces_image=True, and captioning captions marked infographics even with caption_infographics=False, writing the VLM text to their caption field. The region keeps a visual description, and unmarked infographics behave as before.
  • Tests: pytest on every test file that references infographic or ExtractParams: 1,649 passed. New tests in test_dedup.py and test_caption.py cover the caption path. pre-commit on the changed files passed.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Link to Devin session: https://nvidia-cloud.devinenterprise.com/sessions/f1b18f26cd8b480b883b4fdd5fabab63
Open in Devin Desktop: https://nvidia-cloud.devinenterprise.com/desktop/session/f1b18f26cd8b480b883b4fdd5fabab63?variant=devin
Requested by: @jioffe502


🟢 Devin fixed all 3 findings · Follow Devin's work

Devin Review

Infographic regions found by page elements were not OCR'd unless
extract_infographics was set, so their text never reached the index.
Default it to True and add --no-extract-infographics to the CLI.
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; both previous findings are addressed, and no new actionable issue was found.

Summary

Enables infographic extraction by default while preserving an explicit opt-out.

  • PDF ingestion reads text from infographic regions by default.
  • Infographics that replace dropped image crops can still receive visual captions.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Extract images and infographics] --> B[Remove overlapping image crops]
    B --> C[Mark infographic replacements]
    C --> D[Caption marked infographics]
    D --> E[Keep OCR text and caption]
Loading

Reviews (3) · Last reviewed commit: "List replacing infographics among Omni c..." · Reviewed by Greptile

@jperez999 jperez999 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed correctness, design/reuse, minimality, scope, tests, and relevant PR dependencies. No additional inline finding, but the existing caption-loss concern remains valid and unresolved: #2863 (comment) . With captioning enabled, automatic dedup can remove an image overlapping an infographic, while caption_infographics=False prevents a replacement caption; an infographic with no OCR text can then contribute no text-search content. The PR description now discloses this behavior, so it is not an undisclosed scope expansion, but the regression still needs an explicit decision before merge. I have not duplicated that inline thread. The default/CLI flag diff is otherwise small and reuses existing routing. Validation: 150 selected planning/CLI tests passed; eight cases were excluded for local help-format and unchanged Ray schema-test failures. Land #2864 first as requested. GPU quality/performance was not rerun.

Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Nov 20, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

…aption mock

Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 findings. Devin automatically fixed all 3 findings.

Fixed by Devin (3)
  • Conflicting infographic caption requirements — The Omni caption targets sentence now includes infographics that replace a deduplicated image crop.
  • Caption test lacks a model spec — The replacement-caption tests now use MagicMock(spec_set=["caption_batch"]).
  • Batch captioning skips replacement infographics — The caption loop now accepts NumPy-array infographic cells and checks bbox with is None, so Arrow-backed batches caption replacing infographics. A new Arrow-backed test covers this.

View findings in Devin Review · Follow Devin's work

Devin Review

This branch has not been deployed

No deployments
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.

2 participants