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.
Hey y'all sorry looks like some bugs introduced when migrating from our internal repo to the public one. This should resolve a lot of issues with Figures. Basically, certain entities like Figures don't have any spans associated; it's just boxes:
because they come from vision models.
In this case, the ability to intersect cross layer via operations like
.
(seeEntity.__getattr__()
) is messed up because previously, it relied on being able to hitintersect_by_span
. I've added a deprecation warning to any uses of.getattr
since it's ambiguous; recommend all users to useintersect_by_span
orintersect_by_boxes
in the future, which is more clear.I've then added Figure detection into the CoreRecipe properly, as derived from
doc.blocks
Here's a minimal test to validate:
Here's example of the figure visualization:
![image](https://private-user-images.githubusercontent.com/13603748/312743339-394b0a3a-2120-44cc-b423-f16b627784f3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQwMzc4OTUsIm5iZiI6MTcyNDAzNzU5NSwicGF0aCI6Ii8xMzYwMzc0OC8zMTI3NDMzMzktMzk0YjBhM2EtMjEyMC00NGNjLWI0MjMtZjE2YjYyNzc4NGYzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE5VDAzMTk1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIyZDE1NzEyYmE2ZWE0NGI3NGZiOTY5NjhmZWJjZjk0NjBkZmI2YmM5NmExOTc5MWNkYWUyOThhOTA4NjFkZjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.UrpV-b5Bu5aakrdCrDaqvw-SJrrTor30PcHABbmffxo)
Thanks @aakanksha19 for catching!