-
Notifications
You must be signed in to change notification settings - Fork 68
Vb/document entity annotation al 5106 #987
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6b6b1cb
Add DocumentEntity class
53381d0
Add NDDocumentEntity class
d53098b
Update tests
9d1138c
Refactor ner classes each in a separate file
1ed861c
Formatting
cde2f2a
PR refactor test
0c7be25
PR Get rid of camelcase
0b4590f
PR: add ndson test
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| from .text_entity import TextEntity | ||
| from .document_entity import DocumentEntity, DocumentTextSelection |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| from typing import List | ||
|
|
||
| from pydantic import BaseModel, validator | ||
|
|
||
| from labelbox.utils import _CamelCaseMixin | ||
|
|
||
|
|
||
| class DocumentTextSelection(_CamelCaseMixin, BaseModel): | ||
| token_ids: List[str] | ||
| group_id: str | ||
| page: int | ||
|
|
||
| @validator("page") | ||
| def validate_page(cls, v): | ||
| if v < 1: | ||
| raise ValueError("Page must be greater than 1") | ||
vbrodsky marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return v | ||
|
|
||
|
|
||
| class DocumentEntity(_CamelCaseMixin, BaseModel): | ||
| """ Represents a text entity """ | ||
| name: str | ||
| text_selections: List[DocumentTextSelection] | ||
File renamed without changes.
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
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
1 change: 1 addition & 0 deletions
1
tests/assets/arxiv-pdf_data_99-word-token-pdfs_0801.3483-lb-textlayer.json
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| [ | ||
| { | ||
| "uuid": "f6879f59-d2b5-49c2-aceb-d9e8dc478673", | ||
| "dataRow": { | ||
| "id": "ckrb1sf1i1g7i0ybcdc6oc8ct" | ||
| }, | ||
| "name": "named_entity", | ||
| "classifications": [], | ||
| "textSelections": [ | ||
| { | ||
| "groupId": "2f4336f4-a07e-4e0a-a9e1-5629b03b719b", | ||
| "tokenIds": [ | ||
| "3f984bf3-1d61-44f5-b59a-9658a2e3440f", | ||
| "3bf00b56-ff12-4e52-8cc1-08dbddb3c3b8", | ||
| "6e1c3420-d4b7-4c5a-8fd6-ead43bf73d80", | ||
| "87a43d32-af76-4a1d-b262-5c5f4d5ace3a", | ||
| "e8606e8a-dfd9-4c49-a635-ad5c879c75d0", | ||
| "67c7c19e-4654-425d-bf17-2adb8cf02c30", | ||
| "149c5e80-3e07-49a7-ab2d-29ddfe6a38fa", | ||
| "b0e94071-2187-461e-8e76-96c58738a52c" | ||
| ], | ||
| "page": 1 } | ||
| ] | ||
| } | ||
| ] |
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
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.