(retriever) add pdfium_hybrid/ocr extract methods for scanned pages#1521
Merged
jdye64 merged 10 commits intoNVIDIA:mainfrom Mar 10, 2026
Merged
(retriever) add pdfium_hybrid/ocr extract methods for scanned pages#1521jdye64 merged 10 commits intoNVIDIA:mainfrom
jdye64 merged 10 commits intoNVIDIA:mainfrom
Conversation
jdye64
reviewed
Mar 10, 2026
| help="LanceDB URI/path for this run.", | ||
| ), | ||
| method: str = typer.Option( | ||
| "pdfium", |
Collaborator
There was a problem hiding this comment.
should pdfium or pdfium_hybrid be the default? Asking because I really don't know?
Collaborator
Author
There was a problem hiding this comment.
I changed the default to pdfium_hybrid in 4c7e837.
It behaves identically to pdfium for text-based pages but for scanned pages it automatically switches to OCR instead of returning empty strings. There's no downside for non-scanned PDFs since the OCR path only activates when the page has zero native text.
This should gives us a 1% recall boost on bo767.
| help="Embedding model name passed to .embed().", | ||
| ), | ||
| method: str = typer.Option( | ||
| "pdfium", |
Collaborator
There was a problem hiding this comment.
same question about default
…t into edwardk/retriever-scanned
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.
Description
This PR adds
pdfium_hybridandocrtext extraction methods to the nemo_retriever library, matching the nv-ingest pipeline's existing support.--method pdfium(default): no behavioral change, native text extraction only--method pdfium_hybrid: scanned pages get OCR'd text, non-scanned pages keep native text--method ocr: all pages get OCR'd textChecklist