Skip to content

Conversation

@benjats07
Copy link
Contributor

@benjats07 benjats07 commented Oct 17, 2023

This code can't be executed with the current version of unstructured-inference due a lack of coordinates on Picture elements produced by Chipper.
However, those elements shouldn't be ordered at all, so the fix is to skip ordering when Chipper is used.

After this PR is merged this code is correctly executed.

from unstructured_inference.inference import layout
from unstructured_inference.models.base import get_model

file = "sample-docs/recalibrating-risk-report.pdf"
model = get_model("chipperv1")
doc = layout.DocumentLayout.from_file(
    file,
    model,
)

print(doc)

@benjats07 benjats07 linked an issue Oct 17, 2023 that may be closed by this pull request
@benjats07 benjats07 requested review from ajjimeno and qued October 17, 2023 22:18
@benjats07 benjats07 marked this pull request as ready for review October 17, 2023 22:24
Copy link
Contributor

@ajjimeno ajjimeno left a comment

Choose a reason for hiding this comment

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

LGTM!

@ajjimeno ajjimeno merged commit 5624a69 into main Oct 17, 2023
@ajjimeno ajjimeno deleted the fix/no-order-chipper-elements branch October 17, 2023 22:25
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.

bug: Fix layout sorting when bbox is None (ChipperV1)

3 participants