Add PDF loading support and update dependencies#1565
Open
iam-tsr wants to merge 2 commits intomofa-org:mainfrom
Open
Add PDF loading support and update dependencies#1565iam-tsr wants to merge 2 commits intomofa-org:mainfrom
iam-tsr wants to merge 2 commits intomofa-org:mainfrom
Conversation
- Introduced PdfLoader for loading and processing PDF documents. - Added optional PDF support in mofa-foundation and rag_pipeline. - Updated Cargo.lock with new dependencies: pdf-extract, adobe-cmap-parser, and others. - Enhanced README and example files to demonstrate PDF functionality.
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.
🧠 Context
This pull request adds support for PDF document loading to the
mofa-foundationRAG pipeline, enabling users to extract and process text from PDF files as part of their retrieval-augmented generation workflows. The implementation introduces a newPdfLoader(behind thepdffeature flag), integrates it into the pipeline and documentation, and provides tests and usage examples. Additionally, a small bug fix is included in the Python example.PDF Document Loading Support
PdfLoaderstruct implementing theDocumentLoadertrait, allowing extraction of text from PDF files using thepdf-extractcrate. The loader handles file extension checks, error handling, and metadata population.LoaderError::PdfParseErrorvariant for robust error reporting when PDF parsing fails.pdffeature inmofa-foundationandrag_pipelineexamples, updatingCargo.tomlfiles and documentation to describe PDF support and usage.Examples and Tests
PdfLoadercovering extension checks and metadata, and included a demonstration of PDF loading and chunking in therag_pipelineexample.Bug Fix
analyze.pyscript where"analyses.append("sentiment")"was missing a closing quote and bracket, correcting it toresult["analyses"].append("sentiment").