-
Notifications
You must be signed in to change notification settings - Fork 185
Expand file tree
/
Copy pathlabels.py
More file actions
65 lines (51 loc) · 1.56 KB
/
Copy pathlabels.py
File metadata and controls
65 lines (51 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
"""Models for the labels types."""
from enum import Enum
class DocItemLabel(str, Enum):
"""DocItemLabel."""
# DocLayNet v2
CAPTION = "caption"
FOOTNOTE = "footnote"
FORMULA = "formula"
LIST_ITEM = "list_item"
PAGE_FOOTER = "page_footer"
PAGE_HEADER = "page_header"
PICTURE = "picture"
SECTION_HEADER = "section_header"
TABLE = "table"
TEXT = "text"
TITLE = "title"
DOCUMENT_INDEX = "document_index"
CODE = "code"
CHECKBOX_SELECTED = "checkbox_selected"
CHECKBOX_UNSELECTED = "checkbox_unselected"
FORM = "form"
KEY_VALUE_REGION = "key_value_region"
# Additional labels for markup-based formats (e.g. HTML, Word)
PARAGRAPH = "paragraph" # explicitly a paragraph and not arbitrary text
REFERENCE = "reference"
def __str__(self):
"""Get string value."""
return str(self.value)
class GroupLabel(str, Enum):
"""GroupLabel."""
UNSPECIFIED = "unspecified"
LIST = (
"list" # group label for list container (not the list-items) (e.g. HTML <ul/>)
)
ORDERED_LIST = "ordered_list" # List with enumeration (e.g. HTML <ol/>)
CHAPTER = "chapter"
SECTION = "section"
SHEET = "sheet"
SLIDE = "slide"
def __str__(self):
"""Get string value."""
return str(self.value)
class TableCellLabel(str, Enum):
"""TableCellLabel."""
COLUMN_HEADER = "col_header"
ROW_HEADER = "row_header"
ROW_SECTION = "row_section"
BODY = "body"
def __str__(self):
"""Get string value."""
return str(self.value)