feat: add public layout-base extraction support on PDFToTextConverter#3137
Merged
masci merged 7 commits intodeepset-ai:mainfrom Sep 13, 2022
Merged
Conversation
agnieszka-m
approved these changes
Sep 5, 2022
masci
approved these changes
Sep 5, 2022
Contributor
masci
left a comment
There was a problem hiding this comment.
LGTM, thanks for the additional cleaning :)
Contributor
Author
|
The new documentation has been generated. CI is now green again. |
Contributor
Author
|
@masci Sorry to bother you, but I think this PR got lost in the Forgotten Lands. 😃 |
Contributor
|
@danielbichuetti 🙈 apologies, merging now! |
brandenchan
pushed a commit
that referenced
this pull request
Sep 21, 2022
…#3137) * feat(PDFToTextConverter): add option to get text in physical layout order * test: add physical layout extraction test to PDFToTextConverter * refactor: change layout parameter attribution places * docs: manually trigger pre-commits * docs: generate new docs to comply with pydoc-markdown style
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.
Related Issues
Proposed Changes:
Today, PDFToTextConverter has a private method which support turning on layout-based text extraction. The default option is stream ordered text extraction. Usually, this isn't an issue. However, some PDFs have a quite unfamiliar stream ordering, which is different from the physical layout.
This change implements a public parameter that makes possible to the user to choose between default stream-based extraction, or the layout-based extraction.
How did you test it?
Already existing PDFToTextConverter tests have been run again.
One specific scenario PDF file where the stream content is not the same as physical layout order has been added, and the test using the new parameter also has been included.
Notes for the reviewer
I have removed ancient comments, one doubled super().init (it happens at the start, and then it was being again called at the end, with useless effect)
Checklist