-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update: change pdf text parser to pymupdf4llm #139
base: main
Are you sure you want to change the base?
Conversation
@tungsten106 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
maybe this can patch #142 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to let the user choose the engine rather than replacing it
I agree. There are pros and cons to each. The main thing is to allow a common interface. Can you propose an interface for this? One option is to just call register_page_converter externally, and the precedence logic would give precedence to whichever converter is registered later. (see here for example: https://github.com/microsoft/markitdown/blob/925c4499f72757abcf6cb521ee10e4844967af3d/src/markitdown/_markitdown.py#L1269C1-L1287C1) Another option would be to see which dependencies are installed (though this is more opaque) |
Using
pymupdf4llm
instead ofpdfminer
to parse pdf contents into markdown formats, as suggested by #131.Pros and Cons:
pdfminer
extract texts only, generated files have no heading, titles, etc.pymupdf4llm
, however, could perform a nice markdown featrues including different levels of heading, code blocks and images (could be saved to specific path, but not included in this commit)pymupdf4llm
may easily create lines of digits which belongs to plots, and create non-existing tables. This is a common problem to most PDF parsers, except those using ocr models (such as markers, MinerU).