Skip to content
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

Fix issue #556 #582

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
Open

Fix issue #556 #582

wants to merge 10 commits into from

Conversation

conjuncts
Copy link
Collaborator

Fix issue #556 by assigning text to figures in 2nd pass. Also, enhance tests.

tests/utils.py Outdated



def convert_to_pdftext(word_bboxes: list[tuple[float, float, float, float, str]], page_bbox: tuple, page_number: int):
Copy link
Owner

Choose a reason for hiding this comment

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

A lot of space at the top

get_counter=None):
"""Converts word bboxes (xmin, ymin, xmax, ymax, text) and text into a marker.providers.ProviderOutput object"""

if get_counter is None:
Copy link
Owner

Choose a reason for hiding this comment

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

I don't see a case where this would be triggered

Copy link
Owner

Choose a reason for hiding this comment

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

Formatting of the arguments could be better (break into separate lines for readability)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed!

tests/utils.py Outdated
from marker.providers.pdf import PdfProvider
from marker.schema.polygon import PolygonBox
from marker.schema.text.span import Span as MarkerSpan
from marker.schema.text.line import Line as MarkerLine
Copy link
Owner

Choose a reason for hiding this comment

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

Why do these need to be renamed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My original intent was to distinguish between the pdftext and marker schemas

tests/utils.py Outdated
polygon=PolygonBox.from_bbox([min_x, min_y, max_x, max_y]),
page_id=page_number,
block_id=get_counter(),
# rotation=0
Copy link
Owner

Choose a reason for hiding this comment

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

Should remove commented out code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants