Skip to content

Conversation

@Bobholamovic
Copy link

Related Issues

Proposed Changes:

This is a new feature that adds the official PaddleOCR integration for Haystack, providing a PaddleOCR-VL document converter component. The component leverages PaddleOCR's API for document parsing and supports text extraction from both PDF and image files.

How did you test it?

This PR includes a complete unit test suite including initialization tests, parameter validation, file type inference, API call tests, etc. Tests cover PDF and image file processing.

Notes for the reviewer

Checklist

@Bobholamovic Bobholamovic requested a review from a team as a code owner November 26, 2025 12:33
@Bobholamovic Bobholamovic requested review from mpangrazzi and removed request for a team November 26, 2025 12:33
@CLAassistant
Copy link

CLAassistant commented Nov 26, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the type:documentation Improvements or additions to documentation label Nov 26, 2025
@anakin87 anakin87 self-requested a review November 26, 2025 13:43
@anakin87 anakin87 mentioned this pull request Nov 26, 2025
9 tasks
Copy link
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

Hey... thanks for the implementation!

I created #2569 to track the work to be done.

I don't think that I will be able to review this PR in detail soon, but in the meantime, please add a CI workflow similar to https://github.com/deepset-ai/haystack-core-integrations/blob/main/.github/workflows/anthropic.yml to make sure that tests run in the CI.

@Bobholamovic
Copy link
Author

Hey... thanks for the implementation!

I created #2569 to track the work to be done.

I don't think that I will be able to review this PR in detail soon, but in the meantime, please add a CI workflow similar to https://github.com/deepset-ai/haystack-core-integrations/blob/main/.github/workflows/anthropic.yml to make sure that tests run in the CI.

Thanks. The CI workflow has been added.

Copy link
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

Thanks for the implementation.

I did a first pass and found some opportunities for improvement...



@component
class PaddleOCRVLDocumentConverter:
Copy link
Member

Choose a reason for hiding this comment

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

Could you explain why PaddleOCRVLDocumentConverter instead of a more generic PaddleOCRDocumentConverter? Is this component tied to a specific model? It might be used with other models?

Copy link
Author

@Bobholamovic Bobholamovic Dec 3, 2025

Choose a reason for hiding this comment

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

PaddleOCR offers two document-parsing solutions: PP-StructureV3 and PaddleOCR-VL, and the interfaces are slightly different. The PaddleOCRVLDocumentConverter uses the PaddleOCR-VL algorithm internally, which is why it is named this way. We planned to add a PPStructureV3DocumentConverter in a future PR. Would you recommend using a single all-in-one class that supports the different PaddleOCR algorithms as backends, or separate classes as we originally planned?

Copy link
Member

Choose a reason for hiding this comment

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

I don't know the differences in terms of interface. I just would not like to have almost identical components but I trust you on this aspect. Please provide more information if possible.

Copy link
Author

Choose a reason for hiding this comment

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

If we define two separate converters, I expect the following differences between them:

  1. The optional parameters accepted by their __init__ methods differ significantly. You can see the differences in the supported arguments for the two algorithms here and here.
  2. Although the run method of each converter outputs raw_paddleocr_responses with a broadly similar structure, the exact fields are not identical, and there are notable differences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic:CI type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants