Layout(mapping=None, *, ignore_unknown_fields=False, **kwargs)
Describes the layout information of a text_segment in the document.
Attributes
Name | Description |
text_segment |
google.cloud.automl_v1.types.TextSegment
Text Segment that represents a segment in document_text. |
page_number |
int
Page number of the text_segment in the original document, starts from 1. |
bounding_poly |
google.cloud.automl_v1.types.BoundingPoly
The position of the text_segment in the page. Contains exactly 4 normalized_vertices and they are connected by edges in the order provided, which will represent a rectangle parallel to the frame. The NormalizedVertex-s are relative to the page. Coordinates are based on top-left as point (0,0). |
text_segment_type |
google.cloud.automl_v1.types.Document.Layout.TextSegmentType
The type of the text_segment in document. |
Classes
TextSegmentType
TextSegmentType(value)
The type of TextSegment in the context of the original document.
Values: TEXT_SEGMENT_TYPE_UNSPECIFIED (0): Should not be used. TOKEN (1): The text segment is a token. e.g. word. PARAGRAPH (2): The text segment is a paragraph. FORM_FIELD (3): The text segment is a form field. FORM_FIELD_NAME (4): The text segment is the name part of a form field. It will be treated as child of another FORM_FIELD TextSegment if its span is subspan of another TextSegment with type FORM_FIELD. FORM_FIELD_CONTENTS (5): The text segment is the text content part of a form field. It will be treated as child of another FORM_FIELD TextSegment if its span is subspan of another TextSegment with type FORM_FIELD. TABLE (6): The text segment is a whole table, including headers, and all rows. TABLE_HEADER (7): The text segment is a table's headers. It will be treated as child of another TABLE TextSegment if its span is subspan of another TextSegment with type TABLE. TABLE_ROW (8): The text segment is a row in table. It will be treated as child of another TABLE TextSegment if its span is subspan of another TextSegment with type TABLE. TABLE_CELL (9): The text segment is a cell in table. It will be treated as child of another TABLE_ROW TextSegment if its span is subspan of another TextSegment with type TABLE_ROW.