Skip to content

fix(extraction): keep text inside infographic boxes when infographic extraction is off - #2839

Merged
devin-ai-integration[bot] merged 5 commits into
mainfrom
jioffe/keep-text-in-infographics-when-off
Nov 17, 2026
Merged

devin-ai-integration[bot] merged 5 commits into
mainfrom
jioffe/keep-text-in-infographics-when-off

Conversation

@jioffe502

@jioffe502 jioffe502 commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Keeps title, paragraph, and header/footer boxes that lie inside infographic boxes when extract_infographics=False, so pages whose text sits in an infographic still produce rows.
Since #2815, Page Elements v3 postprocessing removes text boxes contained in table, chart, or infographic boxes, and #2816 labels more regions as infographics. With infographic extraction off, no OCR pass reads infographic crops, so that text was dropped and the page produced no row.

cc @jiaruic09 (author of #2815 and #2816)

Workload (8 GPUs) main pps PR pps² Recall@10
bo10k (PDF/text) 331.1¹ 328.0¹ 0.7484 → 0.7513
ViDoRe v3 English, all (image-heavy) 31.6¹ 31.4 0.6802 → 0.6801

¹ Mean of 2 runs.
² Evals ran on 00ff799. The later commit (92e8e98) only changes docs.

The PR recovers rows: bo10k 9,940 → 9,981 docs (full table below); ViDoRe keeps the same 12,973 rows.

What changed

  • postprocess_page_elements_v3(..., suppress_text_in_infographics=True) passes the flag through postprocess_included_texts to postprocess_included. When it is False, only table and chart count as text containers.
  • detect_page_elements_v3(..., extract_infographics=True) passes suppress_text_in_infographics=extract_infographics on the local and remote postprocessing paths.
  • build_graph and _MultiTypeExtractBase add extract_infographics to the Page Elements kwargs, the same way the OCR stage already gets it.

Why it's safe

  • Defaults keep the current behavior, so with extract_infographics=True the result is unchanged and text inside infographics is still removed, because infographic OCR re-reads it.
  • Table and chart containment is unchanged with either setting.
  • Tests: tests/test_page_elements_infographic_text.py uses raw detections from a real scanned page whose text lies inside one infographic box. Text survives with the flag off and is removed with it on, and table-contained paragraphs are removed either way. The existing Page Elements, YOLOX, and graph-builder tests also pass.

Not tested: remote Page Elements NIM end to end (the same postprocess function is unit-tested); Nemotron Parse is unaffected.

Details
Workload GPUs main This PR Docs Index rows Recall@10 nDCG@10
bo10k (PDF/text) 8 645.0 s 651.3 s (+1.0%) 9,940 → 9,981 ~305.1k → ~306.1k 0.7484 → 0.7513 0.6162 → 0.6183
bo767 (PDF/text) 8 254.4 s 254.9 s (+0.2%) 764 → 767 81,716 → 81,888 0.9183 → 0.9183 0.7752 → 0.7742

Setup: 8x NVIDIA RTX PRO 6000 Blackwell Server Edition, Nemotron 3.5 Embed BF16, default settings with infographic extraction off, main = b1c42db. bo10k is the mean of two runs per arm (run-to-run spread ±0.3%); bo767 is one run per arm. The bo10k +1.0% is most likely the recovered rows going through OCR and embedding.

  • Scope: Page Elements v3 postprocessing only. Unchanged: OCR, table/chart extraction, and behavior with infographic extraction on.
  • A 166-page CPU replay of affected pages goes from 143 pages with no extracted text to 12.
  • Limitation: those remaining 12 pages come from fix(extraction): preserve OCR crop geometry and page reading order #2816's detector-input change alone. No text box is detected on them at all, so this PR cannot recover them.

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


👀 1 finding for you to triage · Follow Devin's work

Devin Review

…extraction is off

Since #2815, Page Elements v3 postprocessing removes title, paragraph, and header/footer boxes contained in table, chart, or infographic boxes. With extract_infographics=False the OCR stage never reads infographic crops, so on scanned pages whose text lies inside an infographic box all text was dropped and the page produced no rows.

Thread extract_infographics into the page-elements stage the same way the OCR stage receives it, and only treat infographic boxes as text containers when infographic content is extracted. Table and chart containment is unchanged.

Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
@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

… on and off

Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
devin-ai-integration[bot]

This comment was marked as resolved.

Keep current Parse guidance and correct the infographic extraction default while resolving the documentation conflict.
Skip infographic title matching alongside contained-text suppression so title-only pages keep an OCR target.
@devin-ai-integration

Copy link
Copy Markdown
Contributor

Superseded by #2861, which batches the release fixes into one PR, one commit per original PR. This change is commit-for-commit identical there.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Reopened: keeping the release fixes as individual PRs for review. #2861 is closed.

@jioffe502
jioffe502 marked this pull request as ready for review November 16, 2026 22:08
@jioffe502
jioffe502 requested review from a team as code owners November 16, 2026 22:08
@jioffe502
jioffe502 requested a review from drobison00 November 16, 2026 22:08
@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change reaches document extraction workflows that use Page Elements v3.

The missing type annotations must be addressed before merging.

Findings

  1. P1 New flags lack types. ▶
Fix with agent prompt
### Issue 1
nemo_retriever/src/nemo_retriever/models/nim/primitives/model_interface/yolox.py:undefined-1592
The new `suppress_text_in_infographics` parameter has no type annotation. The same applies to `match_infographics` in `match_structured_boxes_with_title` and `suppress_text_in_infographics` in `postprocess_included_texts`.

The repository requires type annotations on every public function parameter. Add `: bool` to these three new parameters; the older untyped parameters are outside this finding.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Preserves detected page text inside infographic regions when infographic extraction is off.

  • Page text keeps detected words inside infographics when infographic extraction is off.

Reviews (2) · Last reviewed commit: "Merge main into infographic text preserv..." · Reviewed by Greptile

confs,
class_="title",
classes=["table", "chart", "title", "infographic"],
suppress_text_in_infographics=True,

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.

P1 New flags lack types. The new suppress_text_in_infographics parameter has no type annotation. The same applies to match_infographics in match_structured_boxes_with_title and suppress_text_in_infographics in postprocess_included_texts.

The repository requires type annotations on every public function parameter. Add : bool to these three new parameters; the older untyped parameters are outside this finding.

Rule Used: All public functions, methods, and class attributes must have type annotations. This includes parameter types, return types, and class-level attributes. Private/internal helpers (prefixed with _) are encouraged but not required. (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: nemo_retriever/src/nemo_retriever/models/nim/primitives/model_interface/yolox.py
Line: 1592

Comment:
**New flags lack types.** The new `suppress_text_in_infographics` parameter has no type annotation. The same applies to `match_infographics` in `match_structured_boxes_with_title` and `suppress_text_in_infographics` in `postprocess_included_texts`.

The repository requires type annotations on every public function parameter. Add `: bool` to these three new parameters; the older untyped parameters are outside this finding.

**Rule Used:** All public functions, methods, and class attributes must have type annotations. This includes parameter types, return types, and class-level attributes. Private/internal helpers (prefixed with _) are encouraged but not required. ([source](https://github.com/nvidia/nemo-retriever/blob/dc3ffe92e7efe27648079031ee5f3b0abc386815/.greptile/config.json))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Retain current extraction documentation and clarify that detected text and title boxes inside infographic regions remain when infographic extraction is disabled.

Signed-off-by: Jacob Ioffe <jioffe@nvidia.com>
@devin-ai-integration
devin-ai-integration Bot merged commit ebc87c9 into main Nov 17, 2026
11 checks passed

@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

@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 1 finding. It is left for you to triage below.

View findings in Devin Review · Follow Devin's work

Devin Review



def postprocess_included_texts(boxes, confs, labels, classes):
def postprocess_included_texts(boxes, confs, labels, classes, suppress_text_in_infographics=True):

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.

🟡 Missing types on new public options

New suppress_text_in_infographics and match_infographics parameters lack type annotations across three public helpers. The repository's Type Safety rules require complete annotations on public interfaces.

Devin left this for you to triage: Real repo-rule gap (new bool params lack annotations), but #2839 is already merged. Recommend a tiny follow-up PR off main adding : bool to the three helpers; no behaviour change.

Learn more

The new options on postprocess_included, match_structured_boxes_with_title, and postprocess_included_texts have boolean defaults but no parameter annotations. The package's Type Safety rules apply to all public interfaces, including these helpers.

Example: match_structured_boxes_with_title(..., match_infographics=True) introduces an unannotated public option, while postprocess_page_elements_v3 annotates its corresponding option as bool.

Recommended fix: Annotate the newly added parameters as suppress_text_in_infographics: bool = True and match_infographics: bool = True in all three helpers.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

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