From 8dac05c6580cacaf0a3ccadc002c30186f428210 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Fri, 22 Oct 2021 18:10:11 -0700 Subject: [PATCH 01/27] initial get_children work --- .../azure/ai/formrecognizer/_models.py | 287 ++++++++++++++++-- 1 file changed, 260 insertions(+), 27 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index e593fe15c15a..1d06ead2d430 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -6,6 +6,7 @@ # pylint: disable=protected-access, too-many-lines +from typing import Union, Any from enum import Enum from collections import namedtuple from ._generated.v2021_09_30_preview.models import ModelInfo, Error @@ -96,7 +97,7 @@ def get_field_value( return None -def get_field_value_v3(value): # pylint: disable=too-many-return-statements +def get_field_value_v3(value, parent): # pylint: disable=too-many-return-statements if value is None: return value if value.type == "string": @@ -115,14 +116,14 @@ def get_field_value_v3(value): # pylint: disable=too-many-return-statements return value.value_signature if value.type == "array": return ( - [DocumentField._from_generated(value) for value in value.value_array] + [DocumentField._from_generated(value, parent) for value in value.value_array] if value.value_array else [] ) if value.type == "object": return ( { - key: DocumentField._from_generated(value) + key: DocumentField._from_generated(value, parent) for key, value in value.value_object.items() } if value.value_object @@ -2132,6 +2133,11 @@ class DocumentContentElement(object): :vartype content: str :ivar bounding_box: Bounding box of the word. :vartype bounding_box: list[Point] + :ivar span: Location of the element in the reading order concatenated + content. + :vartype span: ~azure.ai.formrecognizer.DocumentSpan + :ivar confidence: Confidence of correctly extracting the selection mark. + :vartype confidence: float :ivar str kind: The kind of document element. Possible kinds are "word" or "selectionMark" which correspond to a :class:`~azure.ai.formrecognizer.DocumentWord` or :class:`~azure.ai.formrecognizer.DocumentSelectionMark`, respectively. @@ -2140,11 +2146,13 @@ class DocumentContentElement(object): def __init__(self, **kwargs): self.content = kwargs.get("content", None) self.bounding_box = kwargs.get("bounding_box", None) + self.span = kwargs.get("span", None) + self.confidence = kwargs.get("confidence", None) self.kind = kwargs.get("kind", None) def __repr__(self): - return "DocumentContentElement(content={}, bounding_box={}, kind={})".format( - self.content, self.bounding_box, self.kind + return "DocumentContentElement(content={}, bounding_box={}, span={}, confidence={}, kind={})".format( + self.content, self.bounding_box, self.span, self.confidence, self.kind ) def to_dict(self): @@ -2159,6 +2167,8 @@ def to_dict(self): "bounding_box": [f.to_dict() for f in self.bounding_box] if self.bounding_box else [], + "span": self.span.to_dict() if self.span else None, + "confidence": self.confidence, "kind": self.kind, } @@ -2176,6 +2186,8 @@ def from_dict(cls, data): bounding_box=[Point.from_dict(v) for v in data.get("bounding_box")] # type: ignore if len(data.get("bounding_box", [])) > 0 else [], + span=DocumentSpan.from_dict(data.get("span")) if data.get("span") else None, + confidence=data.get("confidence", None), kind=data.get("kind", None), ) @@ -2196,6 +2208,7 @@ class AnalyzedDocument(object): """ def __init__(self, **kwargs): + self._parent = kwargs.get("_parent", None) self.doc_type = kwargs.get("doc_type", None) self.bounding_regions = kwargs.get("bounding_regions", None) self.spans = kwargs.get("spans", None) @@ -2203,13 +2216,14 @@ def __init__(self, **kwargs): self.confidence = kwargs.get("confidence", None) @classmethod - def _from_generated(cls, document): + def _from_generated(cls, document, parent): return cls( + _parent=parent, doc_type=document.doc_type, bounding_regions=prepare_bounding_regions(document.bounding_regions), spans=prepare_document_spans(document.spans), fields={ - key: DocumentField._from_generated(field) + key: DocumentField._from_generated(field, parent) for key, field in document.fields.items() } if document.fields @@ -2270,6 +2284,29 @@ def from_dict(cls, data): confidence=data.get("confidence", None), ) + def get_children( + self, element_types + ): # pylint: disable=unused-argument,no-self-use + # type: (list[str]) -> dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + """Get the child elements found in the span of this AnalyzedDocument. + :param list[str] element_types: Required. List of the child elements to retreive from the span of this item. + :return: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :rtype: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + """ + result = {} + for elem in element_types: + result[elem] = _find_elements( + self._parent, + elem, + self.spans, + allowed_elements=[ + "line", + "word", + "selection_mark", + ], + ) + return result + class DocumentEntity(object): """An object representing various categories of entities. @@ -2289,6 +2326,7 @@ class DocumentEntity(object): """ def __init__(self, **kwargs): + self._parent = kwargs.get("_parent", None) self.category = kwargs.get("category", None) self.sub_category = kwargs.get("sub_category", None) self.content = kwargs.get("content", None) @@ -2297,8 +2335,9 @@ def __init__(self, **kwargs): self.confidence = kwargs.get("confidence", None) @classmethod - def _from_generated(cls, entity): + def _from_generated(cls, entity, parent): return cls( + _parent=parent, category=entity.category, sub_category=entity.sub_category, content=entity.content, @@ -2378,6 +2417,29 @@ def from_dict(cls, data): confidence=data.get("confidence", None), ) + def get_children( + self, element_types + ): # pylint: disable=unused-argument,no-self-use + # type: (list[str]) -> dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + """Get the child elements found in the span of this DocumentEntity. + :param list[str] element_types: Required. List of the child elements to retreive from the span of this item. + :return: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :rtype: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + """ + result = {} + for elem in element_types: + result[elem] = _find_elements( + self._parent, + elem, + self.spans, + allowed_elements=[ + "line", + "word", + "selection_mark", + ], + ) + return result + class DocumentField(object): """An object representing the content and location of a document field value. @@ -2403,6 +2465,7 @@ class DocumentField(object): """ def __init__(self, **kwargs): + self._parent = kwargs.get("_parent", None) self.value_type = kwargs.get("value_type", None) self.value = kwargs.get("value", None) self.content = kwargs.get("content", None) @@ -2411,11 +2474,12 @@ def __init__(self, **kwargs): self.confidence = kwargs.get("confidence", None) @classmethod - def _from_generated(cls, field): + def _from_generated(cls, field, parent): if field is None: return None return cls( - value=get_field_value_v3(field), + _parent=parent, + value=get_field_value_v3(field, parent), value_type=adjust_value_type(field.type) if field.type else None, content=field.content if field.content else None, bounding_regions=[ @@ -2494,6 +2558,29 @@ def from_dict(cls, data): confidence=data.get("confidence", None), ) + def get_children( + self, element_types + ): # pylint: disable=unused-argument,no-self-use + # type: (list[str]) -> dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + """Get the child elements found in the span of this DocumentField. + :param list[str] element_types: Required. List of the child elements to retreive from the span of this item. + :return: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :rtype: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + """ + result = {} + for elem in element_types: + result[elem] = _find_elements( + self._parent, + elem, + self.spans, + allowed_elements=[ + "line", + "word", + "selection_mark", + ], + ) + return result + class DocumentKeyValueElement(object): """An object representing the field key or value in a key-value pair. @@ -2508,13 +2595,15 @@ class DocumentKeyValueElement(object): """ def __init__(self, **kwargs): + self._parent = kwargs.get("_parent", None) self.content = kwargs.get("content", None) self.bounding_regions = kwargs.get("bounding_regions", None) self.spans = kwargs.get("spans", None) @classmethod - def _from_generated(cls, element): + def _from_generated(cls, element, parent): return cls( + _parent=parent, content=element.content, bounding_regions=[ BoundingRegion._from_generated(region) @@ -2590,12 +2679,12 @@ def __init__(self, **kwargs): self.confidence = kwargs.get("confidence", None) @classmethod - def _from_generated(cls, key_value_pair): + def _from_generated(cls, key_value_pair, parent): return cls( - key=DocumentKeyValueElement._from_generated(key_value_pair.key) + key=DocumentKeyValueElement._from_generated(key_value_pair.key, parent) if key_value_pair.key else None, - value=DocumentKeyValueElement._from_generated(key_value_pair.value) + value=DocumentKeyValueElement._from_generated(key_value_pair.value, parent) if key_value_pair.value else None, confidence=key_value_pair.confidence, @@ -2640,6 +2729,29 @@ def from_dict(cls, data): confidence=data.get("confidence", None), ) + def get_children( + self, element_types + ): # pylint: disable=unused-argument,no-self-use + # type: (list[str]) -> dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + """Get the child elements found in the span of this DocumentKeyValueElement. + :param list[str] element_types: Required. List of the child elements to retreive from the span of this item. + :return: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :rtype: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + """ + result = {} + for elem in element_types: + result[elem] = _find_elements( + self._parent, + elem, + self.spans, + allowed_elements=[ + "line", + "word", + "selection_mark", + ], + ) + return result + class DocumentLine(object): """A content line object representing the content found on a single line of the document. @@ -2653,13 +2765,15 @@ class DocumentLine(object): """ def __init__(self, **kwargs): + self._parent = kwargs.get("_parent", None) self.content = kwargs.get("content", None) self.bounding_box = kwargs.get("bounding_box", None) self.spans = kwargs.get("spans", None) @classmethod - def _from_generated(cls, line): + def _from_generated(cls, line, parent): return cls( + _parent=parent, content=line.content, bounding_box=get_bounding_box(line), spans=prepare_document_spans(line.spans), @@ -2708,6 +2822,46 @@ def from_dict(cls, data): else [], ) + def get_words( + self, mode + ): # pylint: disable=unused-argument,no-self-use + # type: (str) -> list[DocumentWord] + """Get the child elements found in the span of this DocumentLine. + :param str mode: Required. Mode used to search for words. Can be either "overlap" (default) or "contains". + :return: list[DocumentWord] + :rtype: list[DocumentWord] + """ + return _find_elements( + self._parent, + "word", + self.spans, + allowed_elements=[ + "word", + ], + ) + + def get_children( + self, element_types + ): # pylint: disable=unused-argument,no-self-use + # type: (list[str]) -> dict[Union[DocumentContentElement, DocumentWord, DocumentSelectionMark]] + """Get the child elements found in the span of this DocumentLine. + :param list[str] element_types: Required. List of the child elements to retreive from the span of the line. + :return: dict[Union[DocumentContentElement, DocumentWord, DocumentSelectionMark]] + :rtype: dict[Union[DocumentContentElement, DocumentWord, DocumentSelectionMark]] + """ + result = {} + for elem in element_types: + result[elem] = _find_elements( + self._parent, + elem, + self.spans, + allowed_elements=[ + "word", + "selection_mark", + ], + ) + return result + class DocumentPage(object): """Content and layout elements extracted from a page of the input. @@ -2756,7 +2910,7 @@ def _from_generated(cls, page): width=page.width, height=page.height, unit=page.unit, - lines=[DocumentLine._from_generated(line) for line in page.lines] + lines=[DocumentLine._from_generated(line, page) for line in page.lines] if page.lines else [], words=[DocumentWord._from_generated(word) for word in page.words] @@ -2865,8 +3019,6 @@ class DocumentSelectionMark(DocumentContentElement): def __init__(self, **kwargs): super(DocumentSelectionMark, self).__init__(kind="selectionMark", **kwargs) self.state = kwargs.get("state", None) - self.span = kwargs.get("span", None) - self.confidence = kwargs.get("confidence", None) @classmethod def _from_generated(cls, mark): @@ -3010,6 +3162,7 @@ class DocumentTable(object): """ def __init__(self, **kwargs): + self._parent = kwargs.get("_parent", None) self.row_count = kwargs.get("row_count", None) self.column_count = kwargs.get("column_count", None) self.cells = kwargs.get("cells", None) @@ -3017,11 +3170,12 @@ def __init__(self, **kwargs): self.spans = kwargs.get("spans", None) @classmethod - def _from_generated(cls, table): + def _from_generated(cls, table, parent): return cls( + _parent=parent, row_count=table.row_count, column_count=table.column_count, - cells=[DocumentTableCell._from_generated(cell) for cell in table.cells] + cells=[DocumentTableCell._from_generated(cell, parent) for cell in table.cells] if table.cells else [], bounding_regions=prepare_bounding_regions(table.bounding_regions), @@ -3084,6 +3238,29 @@ def from_dict(cls, data): else [], ) + def get_children( + self, element_types + ): # pylint: disable=unused-argument,no-self-use + # type: (list[str]) -> dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + """Get the child elements found in the span of this DocumentTable. + :param list[str] element_types: Required. List of the child elements to retreive from the span of this item. + :return: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :rtype: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + """ + result = {} + for elem in element_types: + result[elem] = _find_elements( + self._parent, + elem, + self.spans, + allowed_elements=[ + "line", + "word", + "selection_mark", + ], + ) + return result + class DocumentTableCell(object): """An object representing the location and content of a table cell. @@ -3108,6 +3285,7 @@ class DocumentTableCell(object): """ def __init__(self, **kwargs): + self._parent = kwargs.get("_parent", None) self.kind = kwargs.get("kind", "content") self.row_index = kwargs.get("row_index", None) self.column_index = kwargs.get("column_index", None) @@ -3118,8 +3296,9 @@ def __init__(self, **kwargs): self.spans = kwargs.get("spans", None) @classmethod - def _from_generated(cls, cell): + def _from_generated(cls, cell, parent): return cls( + _parent=parent, kind=cell.kind if cell.kind else "content", row_index=cell.row_index, column_index=cell.column_index, @@ -3198,6 +3377,29 @@ def from_dict(cls, data): else [], ) + def get_children( + self, element_types + ): # pylint: disable=unused-argument,no-self-use + # type: (list[str]) -> dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + """Get the child elements found in the span of this DocumentTableCellElement. + :param list[str] element_types: Required. List of the child elements to retreive from the span of this item. + :return: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :rtype: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + """ + result = {} + for elem in element_types: + result[elem] = _find_elements( + self._parent, + elem, + self.spans, + allowed_elements=[ + "line", + "word", + "selection_mark", + ], + ) + return result + class ModelOperationInfo(object): """Model operation information, including the kind and status of the operation, when it was @@ -3425,8 +3627,6 @@ class DocumentWord(DocumentContentElement): def __init__(self, **kwargs): super(DocumentWord, self).__init__(kind="word", **kwargs) - self.span = kwargs.get("span", None) - self.confidence = kwargs.get("confidence", None) @classmethod def _from_generated(cls, word): @@ -3530,17 +3730,17 @@ def _from_generated(cls, response): pages=[DocumentPage._from_generated(page) for page in response.pages] if response.pages else [], - tables=[DocumentTable._from_generated(table) for table in response.tables] + tables=[DocumentTable._from_generated(table, response) for table in response.tables] if response.tables else [], key_value_pairs=[ - DocumentKeyValuePair._from_generated(kv) + DocumentKeyValuePair._from_generated(kv, response) for kv in response.key_value_pairs ] if response.key_value_pairs else [], entities=[ - DocumentEntity._from_generated(entity) for entity in response.entities + DocumentEntity._from_generated(entity, response) for entity in response.entities ] if response.entities else [], @@ -3548,7 +3748,7 @@ def _from_generated(cls, response): if response.styles else [], documents=[ - AnalyzedDocument._from_generated(document) + AnalyzedDocument._from_generated(document, response) for document in response.documents ] if response.documents @@ -4039,3 +4239,36 @@ def from_dict(cls, data): innererror=DocumentAnalysisInnerError.from_dict(data.get("innererror")) # type: ignore if data.get("innererror") else None ) + + +def _find_elements(parent, element, spans, **kwargs): + # type: (AnalyzeResult, str, list[DocumentSpan], Any) -> list[Any] + allowed = kwargs.get("allowed_elements", None) + if element not in allowed: + raise ValueError("received an unsupported child element") + result = [] + for elem in _get_element_list(parent, element): + if in_span(elem, spans): + result.append(elem) + return result + + +def _get_element_list(parent, element): + # type: (AnalyzeResult, str) -> list[Any] + if element == "word": + return parent.words + elif element == "selectionMark": + return parent.selection_marks + else: + raise ValueError("Unsupported element requested.") + + +def in_span(element, spans): + # type: (Any, list[Point]) -> bool + if hasattr(element, "span"): + for span in spans: + if element.span.offset >= span.offset and ( + element.span.offset + element.span.length + ) <= (span.offset + span.length): + return True + return False From e70a672841e68d5fbb6e395c68667206d7dab3fb Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Mon, 25 Oct 2021 10:42:08 -0700 Subject: [PATCH 02/27] add support for cross page elements, update return types --- .../azure/ai/formrecognizer/_models.py | 208 ++++++++++-------- 1 file changed, 118 insertions(+), 90 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index 1d06ead2d430..a98549588187 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -2285,26 +2285,27 @@ def from_dict(cls, data): ) def get_children( - self, element_types + self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (list[str]) -> dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] """Get the child elements found in the span of this AnalyzedDocument. - :param list[str] element_types: Required. List of the child elements to retreive from the span of this item. - :return: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] - :rtype: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :ivar str element_types: List of the child elements to retreive from the span of this item. + :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] """ - result = {} + element_types = kwargs.get("element_types", ["word", "line"]) + + result = [] for elem in element_types: - result[elem] = _find_elements( - self._parent, + result.extend(_find_cross_page_elements( + self, elem, - self.spans, allowed_elements=[ "line", "word", "selection_mark", ], - ) + )) return result @@ -2418,26 +2419,27 @@ def from_dict(cls, data): ) def get_children( - self, element_types + self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (list[str]) -> dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] """Get the child elements found in the span of this DocumentEntity. - :param list[str] element_types: Required. List of the child elements to retreive from the span of this item. - :return: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] - :rtype: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :ivar str element_types: List of the child elements to retreive from the span of this item. + :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] """ - result = {} + element_types = kwargs.get("element_types", ["word", "line"]) + + result = [] for elem in element_types: - result[elem] = _find_elements( - self._parent, + result.extend(_find_cross_page_elements( + self, elem, - self.spans, allowed_elements=[ "line", "word", "selection_mark", ], - ) + )) return result @@ -2559,26 +2561,27 @@ def from_dict(cls, data): ) def get_children( - self, element_types + self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (list[str]) -> dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] """Get the child elements found in the span of this DocumentField. - :param list[str] element_types: Required. List of the child elements to retreive from the span of this item. - :return: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] - :rtype: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :ivar str element_types: List of the child elements to retreive from the span of this item. + :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] """ - result = {} + element_types = kwargs.get("element_types", ["word", "line"]) + + result = [] for elem in element_types: - result[elem] = _find_elements( - self._parent, + result.extend(_find_cross_page_elements( + self, elem, - self.spans, allowed_elements=[ "line", "word", "selection_mark", ], - ) + )) return result @@ -2674,6 +2677,7 @@ class DocumentKeyValuePair(object): """ def __init__(self, **kwargs): + self._parent = kwargs.get("_parent", None) self.key = kwargs.get("key", None) self.value = kwargs.get("value", None) self.confidence = kwargs.get("confidence", None) @@ -2681,6 +2685,7 @@ def __init__(self, **kwargs): @classmethod def _from_generated(cls, key_value_pair, parent): return cls( + _parent=parent, key=DocumentKeyValueElement._from_generated(key_value_pair.key, parent) if key_value_pair.key else None, @@ -2730,26 +2735,36 @@ def from_dict(cls, data): ) def get_children( - self, element_types + self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (list[str]) -> dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] - """Get the child elements found in the span of this DocumentKeyValueElement. - :param list[str] element_types: Required. List of the child elements to retreive from the span of this item. - :return: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] - :rtype: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + """Get the child elements found in the span of this DocumentKeyValuePair. + :ivar str element_types: List of the child elements to retreive from the span of this item. + :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] """ - result = {} + element_types = kwargs.get("element_types", ["word", "line"]) + + result = [] for elem in element_types: - result[elem] = _find_elements( - self._parent, + result.extend(_find_cross_page_elements( + self.key, elem, - self.spans, allowed_elements=[ "line", "word", "selection_mark", ], - ) + )) + result.extend(_find_cross_page_elements( + self.key, + elem, + allowed_elements=[ + "line", + "word", + "selection_mark", + ], + )) return result @@ -2822,44 +2837,28 @@ def from_dict(cls, data): else [], ) - def get_words( - self, mode - ): # pylint: disable=unused-argument,no-self-use - # type: (str) -> list[DocumentWord] - """Get the child elements found in the span of this DocumentLine. - :param str mode: Required. Mode used to search for words. Can be either "overlap" (default) or "contains". - :return: list[DocumentWord] - :rtype: list[DocumentWord] - """ - return _find_elements( - self._parent, - "word", - self.spans, - allowed_elements=[ - "word", - ], - ) def get_children( - self, element_types + self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (list[str]) -> dict[Union[DocumentContentElement, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> list[Union[DocumentContentElement, DocumentWord, DocumentSelectionMark]] """Get the child elements found in the span of this DocumentLine. - :param list[str] element_types: Required. List of the child elements to retreive from the span of the line. - :return: dict[Union[DocumentContentElement, DocumentWord, DocumentSelectionMark]] - :rtype: dict[Union[DocumentContentElement, DocumentWord, DocumentSelectionMark]] + :ivar list[str] element_types: List of the child elements to retreive from the span of the line. + :return: list[Union[DocumentContentElement, DocumentWord, DocumentSelectionMark]] + :rtype: list[Union[DocumentContentElement, DocumentWord, DocumentSelectionMark]] """ - result = {} + element_types = kwargs.get("element_types", ["word"]) + + result = [] for elem in element_types: - result[elem] = _find_elements( + result.extend(_find_elements( self._parent, elem, self.spans, allowed_elements=[ - "word", - "selection_mark", + "word", # TODO add selection marks once they're ready. The spans on selection marks dont match up with the spans of the line ], - ) + )) return result @@ -3239,26 +3238,27 @@ def from_dict(cls, data): ) def get_children( - self, element_types + self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (list[str]) -> dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> list[Union[DocumentLine, DocumentContentElement, DocumentWord, DocumentSelectionMark]] """Get the child elements found in the span of this DocumentTable. - :param list[str] element_types: Required. List of the child elements to retreive from the span of this item. - :return: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] - :rtype: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :ivar str element_types: List of the child elements to retreive from the span of this item. + :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] """ - result = {} + element_types = kwargs.get("element_types", ["word", "line"]) + + result = [] for elem in element_types: - result[elem] = _find_elements( - self._parent, + result.extend(_find_cross_page_elements( + self, elem, - self.spans, allowed_elements=[ "line", "word", "selection_mark", ], - ) + )) return result @@ -3378,26 +3378,27 @@ def from_dict(cls, data): ) def get_children( - self, element_types + self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (list[str]) -> dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] """Get the child elements found in the span of this DocumentTableCellElement. - :param list[str] element_types: Required. List of the child elements to retreive from the span of this item. - :return: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] - :rtype: dict[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :ivar str element_types: List of the child elements to retreive from the span of this item. + :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] """ - result = {} + element_types = kwargs.get("element_types", ["word"]) + + result = [] for elem in element_types: - result[elem] = _find_elements( - self._parent, + result.extend(_find_cross_page_elements( + self, elem, - self.spans, allowed_elements=[ "line", "word", "selection_mark", ], - ) + )) return result @@ -4253,12 +4254,32 @@ def _find_elements(parent, element, spans, **kwargs): return result +def _find_cross_page_elements(source, element, **kwargs): + # type: (Union[DocumentTable, DocumentField], str, Any) -> list[Any] + allowed = kwargs.get("allowed_elements", None) + if element not in allowed: + raise ValueError("received an unsupported child element") + result = [] + for region in source.bounding_regions: + for elem in _get_element_list(_get_page(source._parent.pages, region.page_number), element): + if in_span(elem, source.spans): + result.append(elem) + return result + +def _get_page(pages, page_number): + for page in pages: + if page.page_number == page_number: + return page + raise "could not find page" + def _get_element_list(parent, element): - # type: (AnalyzeResult, str) -> list[Any] + # type: (DocumentPage, str) -> list[Any] if element == "word": return parent.words - elif element == "selectionMark": + elif element == "selection_mark": return parent.selection_marks + elif element == "line": + return parent.lines else: raise ValueError("Unsupported element requested.") @@ -4271,4 +4292,11 @@ def in_span(element, spans): element.span.offset + element.span.length ) <= (span.offset + span.length): return True + elif hasattr(element, "spans"): + for span in spans: + for element_span in element.spans: + if element_span.offset >= span.offset and ( + element_span.offset + element_span.length + ) <= (span.offset + span.length): + return True return False From c4900aa363aff19438879004d8335e102214b640 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Mon, 25 Oct 2021 10:42:21 -0700 Subject: [PATCH 03/27] add tests --- .../tests/test_get_children.py | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py new file mode 100644 index 000000000000..1e387461f3b2 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py @@ -0,0 +1,122 @@ +# coding=utf-8 +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ + +import functools +from azure.ai.formrecognizer._generated.models import AnalyzeResultOperation +from azure.ai.formrecognizer import DocumentAnalysisClient +from azure.ai.formrecognizer import AnalyzeResult +from preparers import FormRecognizerPreparer +from testcase import FormRecognizerTest +from preparers import GlobalClientPreparer as _GlobalClientPreparer + + +DocumentAnalysisClientPreparer = functools.partial(_GlobalClientPreparer, DocumentAnalysisClient) + + +class TestDocumentFromStream(FormRecognizerTest): + + @FormRecognizerPreparer() + @DocumentAnalysisClientPreparer() + def test_document_line_get_children(self, client): + with open(self.invoice_pdf, "rb") as fd: + document = fd.read() + + poller = client.begin_analyze_document("prebuilt-document", document) + result = poller.result() + + elements = result.pages[0].lines[0].get_children() + assert len(elements) == 1 + assert elements[0].content == "Contoso" + + + @FormRecognizerPreparer() + @DocumentAnalysisClientPreparer() + def test_document_table_get_children(self, client): + with open(self.form_jpg, "rb") as fd: + document = fd.read() + + poller = client.begin_analyze_document("prebuilt-layout", document) + result = poller.result() + + elements = result.tables[0].get_children() + assert len(elements) == 45 + + elements = result.tables[0].get_children(element_types=["word"]) + assert len(elements) == 25 + + + @FormRecognizerPreparer() + @DocumentAnalysisClientPreparer() + def test_document_table_cell_get_children(self, client): + with open(self.form_jpg, "rb") as fd: + document = fd.read() + + poller = client.begin_analyze_document("prebuilt-layout", document) + result = poller.result() + + elements = result.tables[0].cells[0].get_children() + assert len(elements) == 1 + + + @FormRecognizerPreparer() + @DocumentAnalysisClientPreparer() + def test_analyzed_document_get_children(self, client): + with open(self.form_jpg, "rb") as fd: + document = fd.read() + + poller = client.begin_analyze_document("prebuilt-invoice", document) + result = poller.result() + + elements = result.documents[0].get_children() + assert len(elements) == 186 + + + @FormRecognizerPreparer() + @DocumentAnalysisClientPreparer() + def test_document_field_get_children(self, client): + with open(self.form_jpg, "rb") as fd: + document = fd.read() + + poller = client.begin_analyze_document("prebuilt-invoice", document) + result = poller.result() + + elements = result.documents[0].fields.get("InvoiceTotal").get_children() + assert len(elements) == 2 + + elements = result.documents[0].fields.get("InvoiceTotal").get_children(element_types=["line"]) + assert len(elements) == 1 + + + @FormRecognizerPreparer() + @DocumentAnalysisClientPreparer() + def test_document_entity_get_children(self, client): + with open(self.form_jpg, "rb") as fd: + document = fd.read() + + poller = client.begin_analyze_document("prebuilt-document", document) + result = poller.result() + + elements = result.entities[0].get_children() + assert len(elements) == 2 + + elements = result.entities[0].get_children(element_types=["word"]) + assert len(elements) == 1 + + + @FormRecognizerPreparer() + @DocumentAnalysisClientPreparer() + def test_document_key_value_pair_get_children(self, client): + with open(self.form_jpg, "rb") as fd: + document = fd.read() + + poller = client.begin_analyze_document("prebuilt-document", document) + result = poller.result() + + elements = result.key_value_pairs[0].get_children() + assert len(elements) == 4 + + elements = result.key_value_pairs[0].get_children(element_types=["line"]) + assert len(elements) == 0 From e1dfd8aea21c6b79a705a4c8111ba1703dc151fb Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Mon, 25 Oct 2021 10:44:57 -0700 Subject: [PATCH 04/27] add recordings --- ...n.test_analyzed_document_get_children.yaml | 607 +++++++++++++++ ...ren.test_document_entity_get_children.yaml | 706 ++++++++++++++++++ ...dren.test_document_field_get_children.yaml | 607 +++++++++++++++ ..._document_key_value_pair_get_children.yaml | 703 +++++++++++++++++ ...ldren.test_document_line_get_children.yaml | 378 ++++++++++ ...test_document_table_cell_get_children.yaml | 514 +++++++++++++ ...dren.test_document_table_get_children.yaml | 514 +++++++++++++ 7 files changed, 4029 insertions(+) create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_analyzed_document_get_children.yaml create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_entity_get_children.yaml create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_field_get_children.yaml create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_key_value_pair_get_children.yaml create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_line_get_children.yaml create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_table_cell_get_children.yaml create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_table_get_children.yaml diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_analyzed_document_get_children.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_analyzed_document_get_children.yaml new file mode 100644 index 000000000000..914c5ec0c108 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_analyzed_document_get_children.yaml @@ -0,0 +1,607 @@ +interactions: +- request: + body: '!!! The request body has been omitted from the recording because its size + 479269 is larger than 128KB. !!!' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '479269' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-invoice:analyze?stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview + response: + body: + string: '' + headers: + apim-request-id: + - 834dac50-4a4f-4fad-b903-d09bf4a48a01 + content-length: + - '0' + date: + - Mon, 25 Oct 2021 17:42:59 GMT + operation-location: + - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-invoice/analyzeResults/834dac50-4a4f-4fad-b903-d09bf4a48a01?api-version=2021-09-30-preview + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '490' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-invoice/analyzeResults/834dac50-4a4f-4fad-b903-d09bf4a48a01?api-version=2021-09-30-preview + response: + body: + string: '{"status": "succeeded", "createdDateTime": "2021-10-25T17:42:59Z", + "lastUpdatedDateTime": "2021-10-25T17:43:02Z", "analyzeResult": {"apiVersion": + "2021-09-30-preview", "modelId": "prebuilt-invoice", "stringIndexType": "unicodeCodePoint", + "content": "Purchase Order\nHero Limited\nPurchase Order\nCompany Phone: 555-348-6512\nWebsite: + www.herolimited.com\nEmail:\nDated As: 12/20/2020\naccounts@herolimited.com\nPurchase + Order #: 948284\nShipped To\nVendor Name: Hillary Swank\nCompany Name: Higgly + Wiggly Books\nAddress: 938 NE Burner Road\nBoulder City, CO 92848\nPhone: + 938-294-2949\nShipped From\nName: Bernie Sanders\nCompany Name: Jupiter Book + Supply\nAddress: 383 N Kinnick Road\nSeattle, WA 38383\nPhone: 932-299-0292\nDetails\nQuantity\nUnit + Price\nTotal\nBindings\n20\n1.00\n20.00\nCovers Small\n20\n1.00\n20.00\nFeather + Bookmark\n20\n5.00\n100.00\nCopper Swirl Marker\n20\n5.00\n100.00\nSUBTOTAL\n$140.00\nTAX\n$4.00\nBernie + Sanders\nTOTAL\n$144.00\nBernie Sanders\nManager\nAdditional Notes:\nDo not + Jostle Box. Unpack carefully. Enjoy.\nJupiter Book Supply will refund you + 50% per book if returned within 60 days of reading and\noffer you 25% off + you next total purchase.", "pages": [{"pageNumber": 1, "angle": 0, "width": + 1700, "height": 2200, "unit": "pixel", "words": [{"content": "Purchase", "boundingBox": + [137, 140, 259, 139, 259, 167, 137, 167], "confidence": 0.997, "span": {"offset": + 0, "length": 8}}, {"content": "Order", "boundingBox": [264, 139, 350, 139, + 349, 167, 264, 167], "confidence": 0.995, "span": {"offset": 9, "length": + 5}}, {"content": "Hero", "boundingBox": [621, 208, 769, 206, 769, 266, 620, + 266], "confidence": 0.983, "span": {"offset": 15, "length": 4}}, {"content": + "Limited", "boundingBox": [793, 205, 1058, 204, 1057, 266, 793, 266], "confidence": + 0.997, "span": {"offset": 20, "length": 7}}, {"content": "Purchase", "boundingBox": + [1113, 322, 1365, 321, 1364, 370, 1113, 368], "confidence": 0.997, "span": + {"offset": 28, "length": 8}}, {"content": "Order", "boundingBox": [1381, 321, + 1549, 321, 1548, 370, 1380, 370], "confidence": 0.995, "span": {"offset": + 37, "length": 5}}, {"content": "Company", "boundingBox": [163, 353, 270, 351, + 270, 379, 164, 378], "confidence": 0.993, "span": {"offset": 43, "length": + 7}}, {"content": "Phone:", "boundingBox": [275, 351, 358, 351, 359, 378, 276, + 379], "confidence": 0.997, "span": {"offset": 51, "length": 6}}, {"content": + "555-348-6512", "boundingBox": [363, 351, 524, 351, 524, 374, 364, 378], "confidence": + 0.994, "span": {"offset": 58, "length": 12}}, {"content": "Website:", "boundingBox": + [167, 394, 265, 393, 265, 418, 167, 417], "confidence": 0.997, "span": {"offset": + 71, "length": 8}}, {"content": "www.herolimited.com", "boundingBox": [270, + 393, 522, 393, 522, 418, 270, 418], "confidence": 0.993, "span": {"offset": + 80, "length": 19}}, {"content": "Email:", "boundingBox": [165, 435, 237, 435, + 237, 460, 165, 460], "confidence": 0.995, "span": {"offset": 100, "length": + 6}}, {"content": "Dated", "boundingBox": [1025, 421, 1103, 420, 1103, 448, + 1025, 448], "confidence": 0.993, "span": {"offset": 107, "length": 5}}, {"content": + "As:", "boundingBox": [1110, 420, 1156, 420, 1156, 448, 1110, 448], "confidence": + 0.998, "span": {"offset": 113, "length": 3}}, {"content": "12/20/2020", "boundingBox": + [1162, 420, 1312, 421, 1312, 449, 1162, 448], "confidence": 0.992, "span": + {"offset": 117, "length": 10}}, {"content": "accounts@herolimited.com", "boundingBox": + [164, 481, 471, 479, 470, 503, 165, 503], "confidence": 0.959, "span": {"offset": + 128, "length": 24}}, {"content": "Purchase", "boundingBox": [1023, 461, 1146, + 461, 1147, 489, 1023, 488], "confidence": 0.997, "span": {"offset": 153, "length": + 8}}, {"content": "Order", "boundingBox": [1152, 461, 1237, 461, 1237, 489, + 1152, 489], "confidence": 0.995, "span": {"offset": 162, "length": 5}}, {"content": + "#:", "boundingBox": [1242, 461, 1270, 461, 1270, 489, 1243, 489], "confidence": + 0.997, "span": {"offset": 168, "length": 2}}, {"content": "948284", "boundingBox": + [1275, 461, 1373, 462, 1373, 489, 1275, 489], "confidence": 0.995, "span": + {"offset": 171, "length": 6}}, {"content": "Shipped", "boundingBox": [167, + 547, 328, 547, 327, 592, 168, 592], "confidence": 0.997, "span": {"offset": + 178, "length": 7}}, {"content": "To", "boundingBox": [337, 547, 392, 547, + 391, 591, 336, 592], "confidence": 0.963, "span": {"offset": 186, "length": + 2}}, {"content": "Vendor", "boundingBox": [160, 611, 250, 610, 250, 638, 160, + 637], "confidence": 0.997, "span": {"offset": 189, "length": 6}}, {"content": + "Name:", "boundingBox": [256, 610, 341, 609, 340, 639, 256, 638], "confidence": + 0.995, "span": {"offset": 196, "length": 5}}, {"content": "Hillary", "boundingBox": + [346, 609, 427, 609, 427, 639, 346, 639], "confidence": 0.997, "span": {"offset": + 202, "length": 7}}, {"content": "Swank", "boundingBox": [433, 609, 518, 610, + 517, 639, 433, 639], "confidence": 0.995, "span": {"offset": 210, "length": + 5}}, {"content": "Company", "boundingBox": [160, 649, 275, 647, 276, 678, + 161, 676], "confidence": 0.993, "span": {"offset": 216, "length": 7}}, {"content": + "Name:", "boundingBox": [281, 647, 366, 647, 366, 679, 282, 678], "confidence": + 0.995, "span": {"offset": 224, "length": 5}}, {"content": "Higgly", "boundingBox": + [372, 647, 449, 646, 449, 679, 372, 679], "confidence": 0.997, "span": {"offset": + 230, "length": 6}}, {"content": "Wiggly", "boundingBox": [455, 646, 541, 646, + 541, 678, 455, 679], "confidence": 0.997, "span": {"offset": 237, "length": + 6}}, {"content": "Books", "boundingBox": [547, 646, 628, 646, 628, 676, 547, + 678], "confidence": 0.995, "span": {"offset": 244, "length": 5}}, {"content": + "Address:", "boundingBox": [161, 685, 266, 685, 265, 712, 160, 711], "confidence": + 0.994, "span": {"offset": 250, "length": 8}}, {"content": "938", "boundingBox": + [271, 685, 319, 685, 318, 713, 271, 712], "confidence": 0.993, "span": {"offset": + 259, "length": 3}}, {"content": "NE", "boundingBox": [324, 685, 360, 685, + 359, 713, 323, 713], "confidence": 0.998, "span": {"offset": 263, "length": + 2}}, {"content": "Burner", "boundingBox": [366, 685, 452, 685, 452, 713, 365, + 713], "confidence": 0.997, "span": {"offset": 266, "length": 6}}, {"content": + "Road", "boundingBox": [458, 685, 521, 685, 521, 713, 457, 713], "confidence": + 0.992, "span": {"offset": 273, "length": 4}}, {"content": "Boulder", "boundingBox": + [279, 722, 369, 722, 370, 751, 280, 750], "confidence": 0.994, "span": {"offset": + 278, "length": 7}}, {"content": "City,", "boundingBox": [375, 722, 431, 722, + 432, 751, 376, 751], "confidence": 0.995, "span": {"offset": 286, "length": + 5}}, {"content": "CO", "boundingBox": [437, 722, 473, 722, 473, 751, 437, + 751], "confidence": 0.999, "span": {"offset": 292, "length": 2}}, {"content": + "92848", "boundingBox": [480, 722, 559, 722, 559, 749, 480, 751], "confidence": + 0.995, "span": {"offset": 295, "length": 5}}, {"content": "Phone:", "boundingBox": + [613, 722, 701, 722, 701, 749, 613, 749], "confidence": 0.997, "span": {"offset": + 301, "length": 6}}, {"content": "938-294-2949", "boundingBox": [706, 722, + 882, 722, 881, 748, 706, 749], "confidence": 0.983, "span": {"offset": 308, + "length": 12}}, {"content": "Shipped", "boundingBox": [167, 784, 324, 785, + 324, 830, 169, 830], "confidence": 0.997, "span": {"offset": 321, "length": + 7}}, {"content": "From", "boundingBox": [333, 785, 431, 785, 431, 827, 333, + 830], "confidence": 0.991, "span": {"offset": 329, "length": 4}}, {"content": + "Name:", "boundingBox": [166, 853, 246, 853, 245, 879, 166, 879], "confidence": + 0.994, "span": {"offset": 334, "length": 5}}, {"content": "Bernie", "boundingBox": + [251, 853, 333, 852, 332, 880, 251, 879], "confidence": 0.997, "span": {"offset": + 340, "length": 6}}, {"content": "Sanders", "boundingBox": [338, 852, 444, + 852, 444, 879, 338, 880], "confidence": 0.997, "span": {"offset": 347, "length": + 7}}, {"content": "Company", "boundingBox": [164, 890, 280, 890, 281, 919, + 165, 919], "confidence": 0.994, "span": {"offset": 355, "length": 7}}, {"content": + "Name:", "boundingBox": [285, 890, 372, 889, 372, 919, 286, 919], "confidence": + 0.995, "span": {"offset": 363, "length": 5}}, {"content": "Jupiter", "boundingBox": + [377, 889, 464, 889, 464, 919, 378, 919], "confidence": 0.997, "span": {"offset": + 369, "length": 7}}, {"content": "Book", "boundingBox": [469, 889, 532, 889, + 532, 920, 470, 919], "confidence": 0.992, "span": {"offset": 377, "length": + 4}}, {"content": "Supply", "boundingBox": [538, 889, 628, 890, 628, 920, 538, + 920], "confidence": 0.995, "span": {"offset": 382, "length": 6}}, {"content": + "Address:", "boundingBox": [166, 926, 271, 926, 271, 953, 166, 953], "confidence": + 0.994, "span": {"offset": 389, "length": 8}}, {"content": "383", "boundingBox": + [277, 925, 325, 925, 325, 953, 276, 953], "confidence": 0.997, "span": {"offset": + 398, "length": 3}}, {"content": "N", "boundingBox": [330, 925, 346, 926, 346, + 953, 330, 953], "confidence": 0.995, "span": {"offset": 402, "length": 1}}, + {"content": "Kinnick", "boundingBox": [355, 926, 444, 926, 444, 954, 355, + 953], "confidence": 0.997, "span": {"offset": 404, "length": 7}}, {"content": + "Road", "boundingBox": [450, 926, 516, 927, 515, 954, 449, 954], "confidence": + 0.983, "span": {"offset": 412, "length": 4}}, {"content": "Seattle,", "boundingBox": + [281, 965, 374, 964, 375, 991, 283, 991], "confidence": 0.996, "span": {"offset": + 417, "length": 8}}, {"content": "WA", "boundingBox": [380, 964, 424, 964, + 425, 991, 381, 991], "confidence": 0.998, "span": {"offset": 426, "length": + 2}}, {"content": "38383", "boundingBox": [432, 964, 510, 963, 511, 990, 432, + 991], "confidence": 0.995, "span": {"offset": 429, "length": 5}}, {"content": + "Phone:", "boundingBox": [760, 964, 847, 964, 846, 990, 760, 990], "confidence": + 0.997, "span": {"offset": 435, "length": 6}}, {"content": "932-299-0292", + "boundingBox": [852, 964, 1029, 963, 1028, 990, 851, 990], "confidence": 0.987, + "span": {"offset": 442, "length": 12}}, {"content": "Details", "boundingBox": + [447, 1048, 556, 1048, 555, 1078, 446, 1078], "confidence": 0.993, "span": + {"offset": 455, "length": 7}}, {"content": "Quantity", "boundingBox": [886, + 1048, 1030, 1047, 1029, 1084, 886, 1084], "confidence": 0.997, "span": {"offset": + 463, "length": 8}}, {"content": "Unit", "boundingBox": [1112, 1047, 1175, + 1047, 1175, 1078, 1111, 1078], "confidence": 0.992, "span": {"offset": 472, + "length": 4}}, {"content": "Price", "boundingBox": [1181, 1047, 1263, 1048, + 1262, 1078, 1181, 1078], "confidence": 0.995, "span": {"offset": 477, "length": + 5}}, {"content": "Total", "boundingBox": [1382, 1047, 1468, 1047, 1468, 1077, + 1382, 1077], "confidence": 0.995, "span": {"offset": 483, "length": 5}}, {"content": + "Bindings", "boundingBox": [172, 1094, 279, 1097, 279, 1123, 173, 1122], "confidence": + 0.993, "span": {"offset": 489, "length": 8}}, {"content": "20", "boundingBox": + [859, 1094, 887, 1094, 887, 1119, 859, 1119], "confidence": 0.997, "span": + {"offset": 498, "length": 2}}, {"content": "1.00", "boundingBox": [1240, 1095, + 1290, 1094, 1291, 1117, 1240, 1118], "confidence": 0.988, "span": {"offset": + 501, "length": 4}}, {"content": "20.00", "boundingBox": [1458, 1096, 1526, + 1095, 1525, 1120, 1459, 1119], "confidence": 0.995, "span": {"offset": 506, + "length": 5}}, {"content": "Covers", "boundingBox": [170, 1136, 251, 1136, + 251, 1161, 170, 1161], "confidence": 0.995, "span": {"offset": 512, "length": + 6}}, {"content": "Small", "boundingBox": [256, 1136, 332, 1135, 331, 1161, + 256, 1161], "confidence": 0.995, "span": {"offset": 519, "length": 5}}, {"content": + "20", "boundingBox": [859, 1135, 889, 1135, 889, 1160, 859, 1160], "confidence": + 0.997, "span": {"offset": 525, "length": 2}}, {"content": "1.00", "boundingBox": + [1239, 1135, 1290, 1135, 1291, 1160, 1239, 1160], "confidence": 0.984, "span": + {"offset": 528, "length": 4}}, {"content": "20.00", "boundingBox": [1458, + 1135, 1526, 1135, 1526, 1160, 1458, 1160], "confidence": 0.995, "span": {"offset": + 533, "length": 5}}, {"content": "Feather", "boundingBox": [173, 1180, 265, + 1179, 265, 1206, 174, 1206], "confidence": 0.997, "span": {"offset": 539, + "length": 7}}, {"content": "Bookmark", "boundingBox": [270, 1179, 399, 1178, + 400, 1206, 271, 1206], "confidence": 0.997, "span": {"offset": 547, "length": + 8}}, {"content": "20", "boundingBox": [860, 1179, 888, 1179, 888, 1204, 860, + 1203], "confidence": 0.995, "span": {"offset": 556, "length": 2}}, {"content": + "5.00", "boundingBox": [1239, 1179, 1290, 1178, 1291, 1203, 1239, 1204], "confidence": + 0.994, "span": {"offset": 559, "length": 4}}, {"content": "100.00", "boundingBox": + [1443, 1181, 1525, 1180, 1525, 1204, 1443, 1205], "confidence": 0.067, "span": + {"offset": 564, "length": 6}}, {"content": "Copper", "boundingBox": [170, + 1223, 257, 1222, 257, 1253, 170, 1253], "confidence": 0.995, "span": {"offset": + 571, "length": 6}}, {"content": "Swirl", "boundingBox": [263, 1222, 325, 1222, + 325, 1251, 262, 1252], "confidence": 0.995, "span": {"offset": 578, "length": + 5}}, {"content": "Marker", "boundingBox": [331, 1222, 429, 1223, 429, 1248, + 330, 1251], "confidence": 0.997, "span": {"offset": 584, "length": 6}}, {"content": + "20", "boundingBox": [860, 1223, 887, 1223, 887, 1247, 860, 1247], "confidence": + 0.997, "span": {"offset": 591, "length": 2}}, {"content": "5.00", "boundingBox": + [1239, 1221, 1291, 1221, 1291, 1247, 1239, 1247], "confidence": 0.988, "span": + {"offset": 594, "length": 4}}, {"content": "100.00", "boundingBox": [1444, + 1224, 1525, 1223, 1524, 1247, 1444, 1248], "confidence": 0.995, "span": {"offset": + 599, "length": 6}}, {"content": "SUBTOTAL", "boundingBox": [1147, 1575, 1293, + 1575, 1293, 1600, 1147, 1600], "confidence": 0.993, "span": {"offset": 606, + "length": 8}}, {"content": "$140.00", "boundingBox": [1426, 1572, 1526, 1572, + 1525, 1597, 1427, 1599], "confidence": 0.993, "span": {"offset": 615, "length": + 7}}, {"content": "TAX", "boundingBox": [1236, 1618, 1288, 1618, 1288, 1643, + 1236, 1643], "confidence": 0.994, "span": {"offset": 623, "length": 3}}, {"content": + "$4.00", "boundingBox": [1458, 1615, 1529, 1615, 1529, 1642, 1458, 1643], + "confidence": 0.988, "span": {"offset": 627, "length": 5}}, {"content": "Bernie", + "boundingBox": [484, 1671, 595, 1671, 595, 1706, 484, 1706], "confidence": + 0.997, "span": {"offset": 633, "length": 6}}, {"content": "Sanders", "boundingBox": + [602, 1671, 762, 1670, 763, 1708, 602, 1706], "confidence": 0.997, "span": + {"offset": 640, "length": 7}}, {"content": "TOTAL", "boundingBox": [1204, + 1674, 1292, 1674, 1292, 1699, 1205, 1699], "confidence": 0.994, "span": {"offset": + 648, "length": 5}}, {"content": "$144.00", "boundingBox": [1427, 1671, 1527, + 1669, 1527, 1697, 1429, 1698], "confidence": 0.983, "span": {"offset": 654, + "length": 7}}, {"content": "Bernie", "boundingBox": [542, 1719, 614, 1719, + 615, 1742, 544, 1742], "confidence": 0.995, "span": {"offset": 662, "length": + 6}}, {"content": "Sanders", "boundingBox": [618, 1719, 716, 1719, 716, 1743, + 619, 1742], "confidence": 0.997, "span": {"offset": 669, "length": 7}}, {"content": + "Manager", "boundingBox": [577, 1754, 681, 1756, 680, 1778, 578, 1776], "confidence": + 0.994, "span": {"offset": 677, "length": 7}}, {"content": "Additional", "boundingBox": + [173, 1796, 350, 1796, 349, 1832, 173, 1831], "confidence": 0.993, "span": + {"offset": 685, "length": 10}}, {"content": "Notes:", "boundingBox": [357, + 1796, 478, 1797, 477, 1833, 356, 1832], "confidence": 0.997, "span": {"offset": + 696, "length": 6}}, {"content": "Do", "boundingBox": [175, 1881, 201, 1881, + 202, 1907, 175, 1907], "confidence": 0.988, "span": {"offset": 703, "length": + 2}}, {"content": "not", "boundingBox": [207, 1881, 251, 1880, 252, 1908, 208, + 1907], "confidence": 0.998, "span": {"offset": 706, "length": 3}}, {"content": + "Jostle", "boundingBox": [257, 1880, 330, 1880, 330, 1909, 257, 1908], "confidence": + 0.997, "span": {"offset": 710, "length": 6}}, {"content": "Box.", "boundingBox": + [336, 1880, 397, 1880, 397, 1909, 336, 1909], "confidence": 0.991, "span": + {"offset": 717, "length": 4}}, {"content": "Unpack", "boundingBox": [403, + 1880, 497, 1880, 497, 1910, 403, 1909], "confidence": 0.997, "span": {"offset": + 722, "length": 6}}, {"content": "carefully.", "boundingBox": [503, 1880, 620, + 1880, 620, 1911, 503, 1910], "confidence": 0.996, "span": {"offset": 729, + "length": 10}}, {"content": "Enjoy.", "boundingBox": [626, 1880, 706, 1881, + 706, 1912, 626, 1911], "confidence": 0.995, "span": {"offset": 740, "length": + 6}}, {"content": "Jupiter", "boundingBox": [169, 1924, 265, 1924, 265, 1959, + 169, 1959], "confidence": 0.994, "span": {"offset": 747, "length": 7}}, {"content": + "Book", "boundingBox": [272, 1924, 350, 1924, 351, 1958, 272, 1959], "confidence": + 0.992, "span": {"offset": 755, "length": 4}}, {"content": "Supply", "boundingBox": + [357, 1924, 460, 1924, 460, 1958, 357, 1958], "confidence": 0.995, "span": + {"offset": 760, "length": 6}}, {"content": "will", "boundingBox": [467, 1924, + 516, 1924, 516, 1958, 467, 1958], "confidence": 0.991, "span": {"offset": + 767, "length": 4}}, {"content": "refund", "boundingBox": [523, 1924, 622, + 1924, 621, 1958, 523, 1958], "confidence": 0.997, "span": {"offset": 772, + "length": 6}}, {"content": "you", "boundingBox": [629, 1924, 685, 1924, 684, + 1958, 628, 1958], "confidence": 0.998, "span": {"offset": 779, "length": 3}}, + {"content": "50%", "boundingBox": [691, 1924, 761, 1924, 760, 1958, 691, 1958], + "confidence": 0.988, "span": {"offset": 783, "length": 3}}, {"content": "per", + "boundingBox": [768, 1924, 819, 1924, 819, 1958, 767, 1958], "confidence": + 0.998, "span": {"offset": 787, "length": 3}}, {"content": "book", "boundingBox": + [826, 1924, 900, 1924, 899, 1958, 825, 1958], "confidence": 0.992, "span": + {"offset": 791, "length": 4}}, {"content": "if", "boundingBox": [907, 1924, + 927, 1924, 926, 1958, 906, 1958], "confidence": 0.999, "span": {"offset": + 796, "length": 2}}, {"content": "returned", "boundingBox": [933, 1924, 1059, + 1924, 1058, 1958, 933, 1958], "confidence": 0.996, "span": {"offset": 799, + "length": 8}}, {"content": "within", "boundingBox": [1066, 1924, 1153, 1924, + 1152, 1958, 1065, 1958], "confidence": 0.997, "span": {"offset": 808, "length": + 6}}, {"content": "60", "boundingBox": [1160, 1924, 1200, 1924, 1199, 1958, + 1159, 1958], "confidence": 0.999, "span": {"offset": 815, "length": 2}}, {"content": + "days", "boundingBox": [1207, 1924, 1279, 1924, 1278, 1958, 1206, 1958], "confidence": + 0.992, "span": {"offset": 818, "length": 4}}, {"content": "of", "boundingBox": + [1286, 1924, 1317, 1924, 1316, 1958, 1284, 1958], "confidence": 0.997, "span": + {"offset": 823, "length": 2}}, {"content": "reading", "boundingBox": [1324, + 1924, 1438, 1924, 1437, 1958, 1322, 1958], "confidence": 0.997, "span": {"offset": + 826, "length": 7}}, {"content": "and", "boundingBox": [1445, 1924, 1505, 1924, + 1504, 1958, 1443, 1958], "confidence": 0.998, "span": {"offset": 834, "length": + 3}}, {"content": "offer", "boundingBox": [169, 1958, 231, 1958, 231, 1991, + 169, 1991], "confidence": 0.993, "span": {"offset": 838, "length": 5}}, {"content": + "you", "boundingBox": [237, 1958, 295, 1958, 295, 1992, 237, 1991], "confidence": + 0.989, "span": {"offset": 844, "length": 3}}, {"content": "25%", "boundingBox": + [303, 1958, 371, 1958, 372, 1992, 303, 1992], "confidence": 0.947, "span": + {"offset": 848, "length": 3}}, {"content": "off", "boundingBox": [378, 1958, + 420, 1958, 420, 1992, 378, 1992], "confidence": 0.998, "span": {"offset": + 852, "length": 3}}, {"content": "you", "boundingBox": [427, 1958, 482, 1958, + 482, 1992, 427, 1992], "confidence": 0.998, "span": {"offset": 856, "length": + 3}}, {"content": "next", "boundingBox": [488, 1958, 554, 1959, 555, 1992, + 489, 1992], "confidence": 0.992, "span": {"offset": 860, "length": 4}}, {"content": + "total", "boundingBox": [561, 1959, 627, 1959, 627, 1991, 561, 1992], "confidence": + 0.994, "span": {"offset": 865, "length": 5}}, {"content": "purchase.", "boundingBox": + [633, 1959, 786, 1961, 787, 1990, 633, 1991], "confidence": 0.996, "span": + {"offset": 871, "length": 9}}], "selectionMarks": [], "lines": [{"content": + "Purchase Order", "boundingBox": [136, 139, 351, 138, 351, 166, 136, 166], + "spans": [{"offset": 0, "length": 14}]}, {"content": "Hero Limited", "boundingBox": + [620, 205, 1074, 204, 1075, 265, 620, 266], "spans": [{"offset": 15, "length": + 12}]}, {"content": "Purchase Order", "boundingBox": [1112, 321, 1554, 321, + 1554, 369, 1112, 369], "spans": [{"offset": 28, "length": 14}]}, {"content": + "Company Phone: 555-348-6512", "boundingBox": [163, 352, 528, 350, 528, 376, + 163, 379], "spans": [{"offset": 43, "length": 27}]}, {"content": "Website: + www.herolimited.com", "boundingBox": [166, 393, 533, 393, 533, 418, 166, 418], + "spans": [{"offset": 71, "length": 28}]}, {"content": "Email:", "boundingBox": + [165, 435, 237, 435, 237, 460, 165, 460], "spans": [{"offset": 100, "length": + 6}]}, {"content": "Dated As: 12/20/2020", "boundingBox": [1024, 419, 1317, + 420, 1317, 448, 1024, 448], "spans": [{"offset": 107, "length": 20}]}, {"content": + "accounts@herolimited.com", "boundingBox": [164, 479, 482, 478, 483, 502, + 164, 503], "spans": [{"offset": 128, "length": 24}]}, {"content": "Purchase + Order #: 948284", "boundingBox": [1023, 461, 1376, 461, 1376, 489, 1023, 488], + "spans": [{"offset": 153, "length": 24}]}, {"content": "Shipped To", "boundingBox": + [167, 547, 397, 546, 397, 591, 167, 592], "spans": [{"offset": 178, "length": + 10}]}, {"content": "Vendor Name: Hillary Swank", "boundingBox": [159, 609, + 520, 609, 520, 638, 159, 638], "spans": [{"offset": 189, "length": 26}]}, + {"content": "Company Name: Higgly Wiggly Books", "boundingBox": [159, 647, + 629, 646, 629, 677, 160, 679], "spans": [{"offset": 216, "length": 33}]}, + {"content": "Address: 938 NE Burner Road", "boundingBox": [160, 684, 526, + 684, 526, 712, 160, 711], "spans": [{"offset": 250, "length": 27}]}, {"content": + "Boulder City, CO 92848", "boundingBox": [279, 722, 566, 721, 566, 750, 279, + 751], "spans": [{"offset": 278, "length": 22}]}, {"content": "Phone: 938-294-2949", + "boundingBox": [612, 721, 885, 721, 885, 747, 612, 748], "spans": [{"offset": + 301, "length": 19}]}, {"content": "Shipped From", "boundingBox": [167, 784, + 453, 784, 453, 829, 167, 830], "spans": [{"offset": 321, "length": 12}]}, + {"content": "Name: Bernie Sanders", "boundingBox": [165, 852, 445, 851, 445, + 878, 165, 879], "spans": [{"offset": 334, "length": 20}]}, {"content": "Company + Name: Jupiter Book Supply", "boundingBox": [164, 889, 629, 889, 629, 919, + 164, 919], "spans": [{"offset": 355, "length": 33}]}, {"content": "Address: + 383 N Kinnick Road", "boundingBox": [165, 925, 521, 926, 521, 953, 165, 952], + "spans": [{"offset": 389, "length": 27}]}, {"content": "Seattle, WA 38383", + "boundingBox": [280, 963, 514, 962, 514, 990, 281, 991], "spans": [{"offset": + 417, "length": 17}]}, {"content": "Phone: 932-299-0292", "boundingBox": [760, + 963, 1032, 963, 1032, 989, 760, 990], "spans": [{"offset": 435, "length": + 19}]}, {"content": "Details", "boundingBox": [446, 1047, 558, 1047, 558, 1077, + 446, 1077], "spans": [{"offset": 455, "length": 7}]}, {"content": "Quantity", + "boundingBox": [885, 1047, 1034, 1047, 1034, 1083, 886, 1083], "spans": [{"offset": + 463, "length": 8}]}, {"content": "Unit Price", "boundingBox": [1111, 1047, + 1270, 1047, 1269, 1078, 1111, 1077], "spans": [{"offset": 472, "length": 10}]}, + {"content": "Total", "boundingBox": [1382, 1047, 1468, 1047, 1467, 1077, 1382, + 1077], "spans": [{"offset": 483, "length": 5}]}, {"content": "Bindings", "boundingBox": + [172, 1093, 279, 1095, 279, 1123, 172, 1121], "spans": [{"offset": 489, "length": + 8}]}, {"content": "20", "boundingBox": [859, 1094, 893, 1094, 893, 1119, 859, + 1119], "spans": [{"offset": 498, "length": 2}]}, {"content": "1.00", "boundingBox": + [1240, 1096, 1295, 1094, 1294, 1118, 1241, 1118], "spans": [{"offset": 501, + "length": 4}]}, {"content": "20.00", "boundingBox": [1458, 1095, 1530, 1095, + 1530, 1119, 1458, 1119], "spans": [{"offset": 506, "length": 5}]}, {"content": + "Covers Small", "boundingBox": [169, 1135, 332, 1134, 333, 1160, 169, 1161], + "spans": [{"offset": 512, "length": 12}]}, {"content": "20", "boundingBox": + [859, 1135, 894, 1135, 891, 1160, 860, 1160], "spans": [{"offset": 525, "length": + 2}]}, {"content": "1.00", "boundingBox": [1239, 1135, 1295, 1135, 1294, 1159, + 1239, 1160], "spans": [{"offset": 528, "length": 4}]}, {"content": "20.00", + "boundingBox": [1458, 1135, 1530, 1135, 1530, 1159, 1459, 1160], "spans": + [{"offset": 533, "length": 5}]}, {"content": "Feather Bookmark", "boundingBox": + [173, 1178, 403, 1177, 403, 1205, 173, 1206], "spans": [{"offset": 539, "length": + 16}]}, {"content": "20", "boundingBox": [860, 1179, 892, 1179, 891, 1204, + 860, 1203], "spans": [{"offset": 556, "length": 2}]}, {"content": "5.00", + "boundingBox": [1239, 1179, 1295, 1178, 1295, 1203, 1239, 1204], "spans": + [{"offset": 559, "length": 4}]}, {"content": "100.00", "boundingBox": [1442, + 1180, 1530, 1180, 1530, 1203, 1443, 1204], "spans": [{"offset": 564, "length": + 6}]}, {"content": "Copper Swirl Marker", "boundingBox": [169, 1223, 429, 1222, + 430, 1249, 169, 1253], "spans": [{"offset": 571, "length": 19}]}, {"content": + "20", "boundingBox": [860, 1223, 893, 1223, 893, 1247, 860, 1247], "spans": + [{"offset": 591, "length": 2}]}, {"content": "5.00", "boundingBox": [1239, + 1221, 1294, 1222, 1294, 1246, 1239, 1247], "spans": [{"offset": 594, "length": + 4}]}, {"content": "100.00", "boundingBox": [1443, 1223, 1530, 1222, 1530, + 1246, 1444, 1247], "spans": [{"offset": 599, "length": 6}]}, {"content": "SUBTOTAL", + "boundingBox": [1146, 1573, 1296, 1573, 1296, 1600, 1146, 1600], "spans": + [{"offset": 606, "length": 8}]}, {"content": "$140.00", "boundingBox": [1426, + 1571, 1530, 1571, 1530, 1597, 1426, 1598], "spans": [{"offset": 615, "length": + 7}]}, {"content": "TAX", "boundingBox": [1236, 1618, 1296, 1618, 1295, 1643, + 1236, 1643], "spans": [{"offset": 623, "length": 3}]}, {"content": "$4.00", + "boundingBox": [1458, 1615, 1529, 1615, 1528, 1641, 1458, 1643], "spans": + [{"offset": 627, "length": 5}]}, {"content": "Bernie Sanders", "boundingBox": + [484, 1670, 764, 1670, 764, 1707, 484, 1706], "spans": [{"offset": 633, "length": + 14}]}, {"content": "TOTAL", "boundingBox": [1203, 1673, 1297, 1673, 1297, + 1698, 1204, 1699], "spans": [{"offset": 648, "length": 5}]}, {"content": "$144.00", + "boundingBox": [1427, 1670, 1529, 1669, 1530, 1696, 1427, 1697], "spans": + [{"offset": 654, "length": 7}]}, {"content": "Bernie Sanders", "boundingBox": + [542, 1718, 718, 1719, 718, 1742, 542, 1741], "spans": [{"offset": 662, "length": + 14}]}, {"content": "Manager", "boundingBox": [577, 1753, 681, 1755, 681, 1778, + 577, 1776], "spans": [{"offset": 677, "length": 7}]}, {"content": "Additional + Notes:", "boundingBox": [172, 1796, 478, 1796, 478, 1832, 172, 1831], "spans": + [{"offset": 685, "length": 17}]}, {"content": "Do not Jostle Box. Unpack carefully. + Enjoy.", "boundingBox": [174, 1879, 707, 1880, 707, 1911, 174, 1908], "spans": + [{"offset": 703, "length": 43}]}, {"content": "Jupiter Book Supply will refund + you 50% per book if returned within 60 days of reading and", "boundingBox": + [168, 1923, 1510, 1923, 1510, 1957, 168, 1958], "spans": [{"offset": 747, + "length": 90}]}, {"content": "offer you 25% off you next total purchase.", + "boundingBox": [168, 1957, 786, 1958, 786, 1991, 168, 1991], "spans": [{"offset": + 838, "length": 42}]}], "spans": [{"offset": 0, "length": 880}]}], "tables": + [{"rowCount": 5, "columnCount": 4, "cells": [{"kind": "columnHeader", "rowIndex": + 0, "columnIndex": 0, "rowSpan": 1, "columnSpan": 1, "content": "Details", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [157, 1037, 847, 1038, + 847, 1086, 155, 1086]}], "spans": [{"offset": 455, "length": 7}]}, {"kind": + "columnHeader", "rowIndex": 0, "columnIndex": 1, "rowSpan": 1, "columnSpan": + 1, "content": "Quantity", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [847, 1038, 1069, 1038, 1070, 1086, 847, 1086]}], "spans": [{"offset": 463, + "length": 8}]}, {"kind": "columnHeader", "rowIndex": 0, "columnIndex": 2, + "rowSpan": 1, "columnSpan": 1, "content": "Unit Price", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1069, 1038, 1309, 1038, 1309, 1086, 1070, + 1086]}], "spans": [{"offset": 472, "length": 10}]}, {"kind": "columnHeader", + "rowIndex": 0, "columnIndex": 3, "rowSpan": 1, "columnSpan": 1, "content": + "Total", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1309, 1038, + 1543, 1038, 1543, 1086, 1309, 1086]}], "spans": [{"offset": 483, "length": + 5}]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": 1, "columnSpan": 1, "content": + "Bindings", "boundingRegions": [{"pageNumber": 1, "boundingBox": [155, 1086, + 847, 1086, 847, 1127, 155, 1127]}], "spans": [{"offset": 489, "length": 8}]}, + {"rowIndex": 1, "columnIndex": 1, "rowSpan": 1, "columnSpan": 1, "content": + "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [847, 1086, 1070, + 1086, 1070, 1127, 847, 1127]}], "spans": [{"offset": 498, "length": 2}]}, + {"rowIndex": 1, "columnIndex": 2, "rowSpan": 1, "columnSpan": 1, "content": + "1.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1070, 1086, + 1309, 1086, 1309, 1127, 1070, 1127]}], "spans": [{"offset": 501, "length": + 4}]}, {"rowIndex": 1, "columnIndex": 3, "rowSpan": 1, "columnSpan": 1, "content": + "20.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1309, 1086, + 1543, 1086, 1543, 1127, 1309, 1127]}], "spans": [{"offset": 506, "length": + 5}]}, {"rowIndex": 2, "columnIndex": 0, "rowSpan": 1, "columnSpan": 1, "content": + "Covers Small", "boundingRegions": [{"pageNumber": 1, "boundingBox": [155, + 1127, 847, 1127, 847, 1171, 155, 1171]}], "spans": [{"offset": 512, "length": + 12}]}, {"rowIndex": 2, "columnIndex": 1, "rowSpan": 1, "columnSpan": 1, "content": + "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [847, 1127, 1070, + 1127, 1070, 1171, 847, 1171]}], "spans": [{"offset": 525, "length": 2}]}, + {"rowIndex": 2, "columnIndex": 2, "rowSpan": 1, "columnSpan": 1, "content": + "1.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1070, 1127, + 1309, 1127, 1309, 1171, 1070, 1171]}], "spans": [{"offset": 528, "length": + 4}]}, {"rowIndex": 2, "columnIndex": 3, "rowSpan": 1, "columnSpan": 1, "content": + "20.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1309, 1127, + 1543, 1127, 1543, 1171, 1309, 1171]}], "spans": [{"offset": 533, "length": + 5}]}, {"rowIndex": 3, "columnIndex": 0, "rowSpan": 1, "columnSpan": 1, "content": + "Feather Bookmark", "boundingRegions": [{"pageNumber": 1, "boundingBox": [155, + 1171, 847, 1171, 847, 1214, 155, 1214]}], "spans": [{"offset": 539, "length": + 16}]}, {"rowIndex": 3, "columnIndex": 1, "rowSpan": 1, "columnSpan": 1, "content": + "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [847, 1171, 1070, + 1171, 1070, 1214, 847, 1214]}], "spans": [{"offset": 556, "length": 2}]}, + {"rowIndex": 3, "columnIndex": 2, "rowSpan": 1, "columnSpan": 1, "content": + "5.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1070, 1171, + 1309, 1171, 1309, 1214, 1070, 1214]}], "spans": [{"offset": 559, "length": + 4}]}, {"rowIndex": 3, "columnIndex": 3, "rowSpan": 1, "columnSpan": 1, "content": + "100.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1309, 1171, + 1543, 1171, 1543, 1215, 1309, 1214]}], "spans": [{"offset": 564, "length": + 6}]}, {"rowIndex": 4, "columnIndex": 0, "rowSpan": 1, "columnSpan": 1, "content": + "Copper Swirl Marker", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [155, 1214, 847, 1214, 847, 1258, 155, 1258]}], "spans": [{"offset": 571, + "length": 19}]}, {"rowIndex": 4, "columnIndex": 1, "rowSpan": 1, "columnSpan": + 1, "content": "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [847, + 1214, 1070, 1214, 1070, 1258, 847, 1258]}], "spans": [{"offset": 591, "length": + 2}]}, {"rowIndex": 4, "columnIndex": 2, "rowSpan": 1, "columnSpan": 1, "content": + "5.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1070, 1214, + 1309, 1214, 1309, 1258, 1070, 1258]}], "spans": [{"offset": 594, "length": + 4}]}, {"rowIndex": 4, "columnIndex": 3, "rowSpan": 1, "columnSpan": 1, "content": + "100.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1309, 1214, + 1543, 1215, 1543, 1260, 1309, 1258]}], "spans": [{"offset": 599, "length": + 6}]}], "boundingRegions": [{"pageNumber": 1, "boundingBox": [153, 1036, 1548, + 1036, 1547, 1265, 153, 1265]}], "spans": [{"offset": 455, "length": 150}]}, + {"rowCount": 4, "columnCount": 2, "cells": [{"kind": "columnHeader", "rowIndex": + 0, "columnIndex": 0, "rowSpan": 1, "columnSpan": 1, "content": "SUBTOTAL", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [1070, 1565, 1309, 1565, + 1309, 1609, 1071, 1609]}], "spans": [{"offset": 606, "length": 8}]}, {"kind": + "columnHeader", "rowIndex": 0, "columnIndex": 1, "rowSpan": 1, "columnSpan": + 1, "content": "$140.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1309, 1565, 1544, 1564, 1544, 1609, 1309, 1609]}], "spans": [{"offset": 615, + "length": 7}]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": 1, "columnSpan": + 1, "content": "TAX", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1071, 1609, 1309, 1609, 1309, 1652, 1071, 1652]}], "spans": [{"offset": 623, + "length": 3}]}, {"rowIndex": 1, "columnIndex": 1, "rowSpan": 1, "columnSpan": + 1, "content": "$4.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1309, 1609, 1544, 1609, 1544, 1652, 1309, 1652]}], "spans": [{"offset": 627, + "length": 5}]}, {"rowIndex": 2, "columnIndex": 0, "rowSpan": 1, "columnSpan": + 1, "content": "", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1071, + 1652, 1309, 1652, 1309, 1664, 1071, 1664]}], "spans": []}, {"rowIndex": 2, + "columnIndex": 1, "rowSpan": 1, "columnSpan": 1, "content": "", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1309, 1652, 1544, 1652, 1544, 1664, 1309, + 1664]}], "spans": []}, {"rowIndex": 3, "columnIndex": 0, "rowSpan": 1, "columnSpan": + 1, "content": "TOTAL", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1071, 1664, 1309, 1664, 1309, 1707, 1071, 1706]}], "spans": [{"offset": 648, + "length": 5}]}, {"rowIndex": 3, "columnIndex": 1, "rowSpan": 1, "columnSpan": + 1, "content": "$144.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1309, 1664, 1544, 1664, 1544, 1707, 1309, 1707]}], "spans": [{"offset": 654, + "length": 7}]}], "boundingRegions": [{"pageNumber": 1, "boundingBox": [1062, + 1563, 1560, 1563, 1560, 1709, 1062, 1709]}], "spans": [{"offset": 606, "length": + 26}, {"offset": 648, "length": 13}]}], "styles": [{"isHandwritten": true, + "confidence": 0.9, "spans": [{"offset": 633, "length": 14}]}], "documents": + [{"docType": "prebuilt:invoice", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [0, 0, 1700, 0, 1700, 2200, 0, 2200]}], "fields": {"InvoiceDate": {"type": + "date", "valueDate": "2020-12-20", "content": "12/20/2020", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1162, 420, 1312, 421, 1312, 449, 1162, + 448]}], "confidence": 0.747, "spans": [{"offset": 117, "length": 10}]}, "InvoiceId": + {"type": "string", "valueString": "948284", "content": "948284", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1275, 461, 1373, 462, 1373, 489, 1275, + 489]}], "confidence": 0.367, "spans": [{"offset": 171, "length": 6}]}, "InvoiceTotal": + {"type": "number", "valueNumber": 144, "content": "$144.00", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1427, 1671, 1527, 1669, 1527, 1697, 1429, + 1698]}], "confidence": 0.989, "spans": [{"offset": 654, "length": 7}]}, "Items": + {"type": "array", "valueArray": [{"type": "object", "valueObject": {"Amount": + {"type": "number", "valueNumber": 20, "content": "20.00", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1458, 1096, 1526, 1095, 1525, 1120, 1459, + 1119]}], "confidence": 0.903, "spans": [{"offset": 506, "length": 5}]}, "Description": + {"type": "string", "valueString": "Bindings", "content": "Bindings", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [172, 1094, 279, 1097, 279, 1123, 173, 1122]}], + "confidence": 0.955, "spans": [{"offset": 489, "length": 8}]}, "Quantity": + {"type": "number", "valueNumber": 20, "content": "20", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [859, 1094, 887, 1094, 887, 1119, 859, 1119]}], + "confidence": 0.883, "spans": [{"offset": 498, "length": 2}]}, "UnitPrice": + {"type": "number", "valueNumber": 1, "content": "1.00", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1240, 1095, 1290, 1094, 1291, 1117, 1240, + 1118]}], "confidence": 0.864, "spans": [{"offset": 501, "length": 4}]}}, "content": + "Bindings 20 1.00 20.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [172, 1094, 1526, 1094, 1526, 1123, 172, 1123]}], "confidence": 0.88, "spans": + [{"offset": 489, "length": 22}]}, {"type": "object", "valueObject": {"Amount": + {"type": "number", "valueNumber": 20, "content": "20.00", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1458, 1135, 1526, 1135, 1526, 1160, 1458, + 1160]}], "confidence": 0.903, "spans": [{"offset": 533, "length": 5}]}, "Description": + {"type": "string", "valueString": "Covers Small", "content": "Covers Small", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [170, 1135, 332, 1135, + 332, 1161, 170, 1161]}], "confidence": 0.9, "spans": [{"offset": 512, "length": + 12}]}, "Quantity": {"type": "number", "valueNumber": 20, "content": "20", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [859, 1135, 889, 1135, + 889, 1160, 859, 1160]}], "confidence": 0.88, "spans": [{"offset": 525, "length": + 2}]}, "UnitPrice": {"type": "number", "valueNumber": 1, "content": "1.00", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [1239, 1135, 1290, 1135, + 1291, 1160, 1239, 1160]}], "confidence": 0.833, "spans": [{"offset": 528, + "length": 4}]}}, "content": "Covers Small 20 1.00 20.00", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [170, 1135, 1526, 1135, 1526, 1161, 170, + 1161]}], "confidence": 0.882, "spans": [{"offset": 512, "length": 26}]}, {"type": + "object", "valueObject": {"Amount": {"type": "number", "valueNumber": 100, + "content": "100.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1443, 1181, 1525, 1180, 1525, 1204, 1443, 1205]}], "confidence": 0.903, "spans": + [{"offset": 564, "length": 6}]}, "Description": {"type": "string", "valueString": + "Feather Bookmark", "content": "Feather Bookmark", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [173, 1179, 400, 1178, 400, 1206, 173, 1207]}], "confidence": + 0.9, "spans": [{"offset": 539, "length": 16}]}, "Quantity": {"type": "number", + "valueNumber": 20, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [860, 1179, 888, 1179, 888, 1204, 860, 1203]}], "confidence": + 0.898, "spans": [{"offset": 556, "length": 2}]}, "UnitPrice": {"type": "number", + "valueNumber": 5, "content": "5.00", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [1239, 1179, 1290, 1178, 1291, 1203, 1239, 1204]}], "confidence": + 0.873, "spans": [{"offset": 559, "length": 4}]}}, "content": "Feather Bookmark + 20 5.00 100.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [173, + 1179, 1525, 1172, 1525, 1205, 173, 1212]}], "confidence": 0.886, "spans": + [{"offset": 539, "length": 31}]}, {"type": "object", "valueObject": {"Amount": + {"type": "number", "valueNumber": 100, "content": "100.00", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1444, 1224, 1525, 1223, 1524, 1247, 1444, + 1248]}], "confidence": 0.961, "spans": [{"offset": 599, "length": 6}]}, "Description": + {"type": "string", "valueString": "Copper Swirl Marker", "content": "Copper + Swirl Marker", "boundingRegions": [{"pageNumber": 1, "boundingBox": [170, + 1223, 429, 1221, 429, 1252, 170, 1254]}], "confidence": 0.899, "spans": [{"offset": + 571, "length": 19}]}, "Quantity": {"type": "number", "valueNumber": 20, "content": + "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [860, 1223, 887, + 1223, 887, 1247, 860, 1247]}], "confidence": 0.899, "spans": [{"offset": 591, + "length": 2}]}, "UnitPrice": {"type": "number", "valueNumber": 5, "content": + "5.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1239, 1221, + 1291, 1221, 1291, 1247, 1239, 1247]}], "confidence": 0.888, "spans": [{"offset": + 594, "length": 4}]}}, "content": "Copper Swirl Marker 20 5.00 100.00", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [170, 1223, 1525, 1215, 1525, 1248, 170, + 1255]}], "confidence": 0.91, "spans": [{"offset": 571, "length": 34}]}]}, + "Locale": {"type": "string", "valueString": "en-US", "confidence": 1}, "SubTotal": + {"type": "number", "valueNumber": 140, "content": "$140.00", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1426, 1572, 1526, 1572, 1525, 1597, 1427, + 1599]}], "confidence": 0.989, "spans": [{"offset": 615, "length": 7}]}, "TotalTax": + {"type": "number", "valueNumber": 4, "content": "$4.00", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1458, 1615, 1529, 1615, 1529, 1642, 1458, + 1643]}], "confidence": 0.989, "spans": [{"offset": 627, "length": 5}]}, "VendorAddress": + {"type": "string", "valueString": "383 N Kinnick Road Seattle, WA 38383", + "content": "383 N Kinnick Road Seattle, WA 38383", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [276, 925, 516, 925, 516, 991, 276, 991]}], "confidence": + 0.946, "spans": [{"offset": 398, "length": 36}]}, "VendorAddressRecipient": + {"type": "string", "valueString": "Jupiter Book Supply", "content": "Jupiter + Book Supply", "boundingRegions": [{"pageNumber": 1, "boundingBox": [377, 888, + 628, 890, 628, 921, 377, 919]}], "confidence": 0.784, "spans": [{"offset": + 369, "length": 19}]}, "VendorName": {"type": "string", "valueString": "Hillary + Swank Higgly Wiggly Books", "content": "Hillary Swank Higgly Wiggly Books", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [346, 609, 628, 607, + 628, 678, 346, 680]}], "confidence": 0.747, "spans": [{"offset": 202, "length": + 13}, {"offset": 230, "length": 19}]}}, "confidence": 1, "spans": [{"offset": + 0, "length": 880}]}]}}' + headers: + apim-request-id: + - 5992e67f-24dc-4457-abf5-945fba50191a + content-type: + - application/json; charset=utf-8 + date: + - Mon, 25 Oct 2021 17:43:05 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '422' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_entity_get_children.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_entity_get_children.yaml new file mode 100644 index 000000000000..d6d84c284486 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_entity_get_children.yaml @@ -0,0 +1,706 @@ +interactions: +- request: + body: '!!! The request body has been omitted from the recording because its size + 479269 is larger than 128KB. !!!' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '479269' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document:analyze?stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview + response: + body: + string: '' + headers: + apim-request-id: + - 8092df0f-ab97-4787-947e-4a44fff39ab6 + content-length: + - '0' + date: + - Mon, 25 Oct 2021 17:44:14 GMT + operation-location: + - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/8092df0f-ab97-4787-947e-4a44fff39ab6?api-version=2021-09-30-preview + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '545' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/8092df0f-ab97-4787-947e-4a44fff39ab6?api-version=2021-09-30-preview + response: + body: + string: '{"status": "succeeded", "createdDateTime": "2021-10-25T17:44:15Z", + "lastUpdatedDateTime": "2021-10-25T17:44:20Z", "analyzeResult": {"apiVersion": + "2021-09-30-preview", "modelId": "prebuilt-document", "stringIndexType": "unicodeCodePoint", + "content": "Purchase Order\nHero Limited\nCompany Phone: 555-348-6512\nWebsite: + www.herolimited.com\nEmail:\nPurchase Order\nDated As: 12/20/2020\nPurchase + Order #: 948284\naccounts@herolimited.com\nShipped To\nVendor Name: Hillary + Swank\nCompany Name: Higgly Wiggly Books\nAddress: 938 NE Burner Road\nBoulder + City, CO 92848\nPhone: 938-294-2949\nShipped From\nName: Bernie Sanders\nCompany + Name: Jupiter Book Supply\nAddress: 383 N Kinnick Road\nSeattle, WA 38383\nPhone: + 932-299-0292\nDetails\nQuantity\nUnit Price\nTotal\nBindings\n20\n1.00\n20.00\nCovers + Small\n20\n1.00\n20.00\nFeather Bookmark\n20\n5.00\n100.00\nCopper Swirl Marker\n20\n5.00\n100.00\nBernie + Sanders\nBernie Sanders\nManager\nAdditional Notes:\nDo not Jostle Box. Unpack + carefully. Enjoy.\nSUBTOTAL\n$140.00\nTAX\n$4.00\nTOTAL\n$144.00\nJupiter + Book Supply will refund you 50% per book if returned within 60 days of reading + and\noffer you 25% off you next total purchase.", "pages": [{"pageNumber": + 1, "angle": 0, "width": 1700, "height": 2200, "unit": "pixel", "words": [{"content": + "Purchase", "boundingBox": [137, 140, 259, 139, 259, 167, 137, 167], "confidence": + 0.997, "span": {"offset": 0, "length": 8}}, {"content": "Order", "boundingBox": + [264, 139, 350, 139, 349, 167, 264, 167], "confidence": 0.995, "span": {"offset": + 9, "length": 5}}, {"content": "Hero", "boundingBox": [621, 208, 769, 206, + 769, 266, 620, 266], "confidence": 0.983, "span": {"offset": 15, "length": + 4}}, {"content": "Limited", "boundingBox": [793, 205, 1058, 204, 1057, 266, + 793, 266], "confidence": 0.997, "span": {"offset": 20, "length": 7}}, {"content": + "Company", "boundingBox": [163, 353, 270, 351, 270, 379, 164, 378], "confidence": + 0.993, "span": {"offset": 28, "length": 7}}, {"content": "Phone:", "boundingBox": + [275, 351, 358, 351, 359, 378, 276, 379], "confidence": 0.997, "span": {"offset": + 36, "length": 6}}, {"content": "555-348-6512", "boundingBox": [363, 351, 524, + 351, 524, 374, 364, 378], "confidence": 0.994, "span": {"offset": 43, "length": + 12}}, {"content": "Website:", "boundingBox": [167, 394, 265, 393, 265, 418, + 167, 417], "confidence": 0.997, "span": {"offset": 56, "length": 8}}, {"content": + "www.herolimited.com", "boundingBox": [270, 393, 522, 393, 522, 418, 270, + 418], "confidence": 0.993, "span": {"offset": 65, "length": 19}}, {"content": + "Email:", "boundingBox": [165, 435, 237, 435, 237, 460, 165, 460], "confidence": + 0.995, "span": {"offset": 85, "length": 6}}, {"content": "Purchase", "boundingBox": + [1113, 322, 1365, 321, 1364, 370, 1113, 368], "confidence": 0.997, "span": + {"offset": 92, "length": 8}}, {"content": "Order", "boundingBox": [1381, 321, + 1549, 321, 1548, 370, 1380, 370], "confidence": 0.995, "span": {"offset": + 101, "length": 5}}, {"content": "Dated", "boundingBox": [1025, 421, 1103, + 420, 1103, 448, 1025, 448], "confidence": 0.993, "span": {"offset": 107, "length": + 5}}, {"content": "As:", "boundingBox": [1110, 420, 1156, 420, 1156, 448, 1110, + 448], "confidence": 0.998, "span": {"offset": 113, "length": 3}}, {"content": + "12/20/2020", "boundingBox": [1162, 420, 1312, 421, 1312, 449, 1162, 448], + "confidence": 0.992, "span": {"offset": 117, "length": 10}}, {"content": "Purchase", + "boundingBox": [1023, 461, 1146, 461, 1147, 489, 1023, 488], "confidence": + 0.997, "span": {"offset": 128, "length": 8}}, {"content": "Order", "boundingBox": + [1152, 461, 1237, 461, 1237, 489, 1152, 489], "confidence": 0.995, "span": + {"offset": 137, "length": 5}}, {"content": "#:", "boundingBox": [1242, 461, + 1270, 461, 1270, 489, 1243, 489], "confidence": 0.997, "span": {"offset": + 143, "length": 2}}, {"content": "948284", "boundingBox": [1275, 461, 1373, + 462, 1373, 489, 1275, 489], "confidence": 0.995, "span": {"offset": 146, "length": + 6}}, {"content": "accounts@herolimited.com", "boundingBox": [164, 481, 471, + 479, 470, 503, 165, 503], "confidence": 0.959, "span": {"offset": 153, "length": + 24}}, {"content": "Shipped", "boundingBox": [167, 547, 328, 547, 327, 592, + 168, 592], "confidence": 0.997, "span": {"offset": 178, "length": 7}}, {"content": + "To", "boundingBox": [337, 547, 392, 547, 391, 591, 336, 592], "confidence": + 0.963, "span": {"offset": 186, "length": 2}}, {"content": "Vendor", "boundingBox": + [160, 611, 250, 610, 250, 638, 160, 637], "confidence": 0.997, "span": {"offset": + 189, "length": 6}}, {"content": "Name:", "boundingBox": [256, 610, 341, 609, + 340, 639, 256, 638], "confidence": 0.995, "span": {"offset": 196, "length": + 5}}, {"content": "Hillary", "boundingBox": [346, 609, 427, 609, 427, 639, + 346, 639], "confidence": 0.997, "span": {"offset": 202, "length": 7}}, {"content": + "Swank", "boundingBox": [433, 609, 518, 610, 517, 639, 433, 639], "confidence": + 0.995, "span": {"offset": 210, "length": 5}}, {"content": "Company", "boundingBox": + [160, 649, 275, 647, 276, 678, 161, 676], "confidence": 0.993, "span": {"offset": + 216, "length": 7}}, {"content": "Name:", "boundingBox": [281, 647, 366, 647, + 366, 679, 282, 678], "confidence": 0.995, "span": {"offset": 224, "length": + 5}}, {"content": "Higgly", "boundingBox": [372, 647, 449, 646, 449, 679, 372, + 679], "confidence": 0.997, "span": {"offset": 230, "length": 6}}, {"content": + "Wiggly", "boundingBox": [455, 646, 541, 646, 541, 678, 455, 679], "confidence": + 0.997, "span": {"offset": 237, "length": 6}}, {"content": "Books", "boundingBox": + [547, 646, 628, 646, 628, 676, 547, 678], "confidence": 0.995, "span": {"offset": + 244, "length": 5}}, {"content": "Address:", "boundingBox": [161, 685, 266, + 685, 265, 712, 160, 711], "confidence": 0.994, "span": {"offset": 250, "length": + 8}}, {"content": "938", "boundingBox": [271, 685, 319, 685, 318, 713, 271, + 712], "confidence": 0.993, "span": {"offset": 259, "length": 3}}, {"content": + "NE", "boundingBox": [324, 685, 360, 685, 359, 713, 323, 713], "confidence": + 0.998, "span": {"offset": 263, "length": 2}}, {"content": "Burner", "boundingBox": + [366, 685, 452, 685, 452, 713, 365, 713], "confidence": 0.997, "span": {"offset": + 266, "length": 6}}, {"content": "Road", "boundingBox": [458, 685, 521, 685, + 521, 713, 457, 713], "confidence": 0.992, "span": {"offset": 273, "length": + 4}}, {"content": "Boulder", "boundingBox": [279, 722, 369, 722, 370, 751, + 280, 750], "confidence": 0.994, "span": {"offset": 278, "length": 7}}, {"content": + "City,", "boundingBox": [375, 722, 431, 722, 432, 751, 376, 751], "confidence": + 0.995, "span": {"offset": 286, "length": 5}}, {"content": "CO", "boundingBox": + [437, 722, 473, 722, 473, 751, 437, 751], "confidence": 0.999, "span": {"offset": + 292, "length": 2}}, {"content": "92848", "boundingBox": [480, 722, 559, 722, + 559, 749, 480, 751], "confidence": 0.995, "span": {"offset": 295, "length": + 5}}, {"content": "Phone:", "boundingBox": [613, 722, 701, 722, 701, 749, 613, + 749], "confidence": 0.997, "span": {"offset": 301, "length": 6}}, {"content": + "938-294-2949", "boundingBox": [706, 722, 882, 722, 881, 748, 706, 749], "confidence": + 0.983, "span": {"offset": 308, "length": 12}}, {"content": "Shipped", "boundingBox": + [167, 784, 324, 785, 324, 830, 169, 830], "confidence": 0.997, "span": {"offset": + 321, "length": 7}}, {"content": "From", "boundingBox": [333, 785, 431, 785, + 431, 827, 333, 830], "confidence": 0.991, "span": {"offset": 329, "length": + 4}}, {"content": "Name:", "boundingBox": [166, 853, 246, 853, 245, 879, 166, + 879], "confidence": 0.994, "span": {"offset": 334, "length": 5}}, {"content": + "Bernie", "boundingBox": [251, 853, 333, 852, 332, 880, 251, 879], "confidence": + 0.997, "span": {"offset": 340, "length": 6}}, {"content": "Sanders", "boundingBox": + [338, 852, 444, 852, 444, 879, 338, 880], "confidence": 0.997, "span": {"offset": + 347, "length": 7}}, {"content": "Company", "boundingBox": [164, 890, 280, + 890, 281, 919, 165, 919], "confidence": 0.994, "span": {"offset": 355, "length": + 7}}, {"content": "Name:", "boundingBox": [285, 890, 372, 889, 372, 919, 286, + 919], "confidence": 0.995, "span": {"offset": 363, "length": 5}}, {"content": + "Jupiter", "boundingBox": [377, 889, 464, 889, 464, 919, 378, 919], "confidence": + 0.997, "span": {"offset": 369, "length": 7}}, {"content": "Book", "boundingBox": + [469, 889, 532, 889, 532, 920, 470, 919], "confidence": 0.992, "span": {"offset": + 377, "length": 4}}, {"content": "Supply", "boundingBox": [538, 889, 628, 890, + 628, 920, 538, 920], "confidence": 0.995, "span": {"offset": 382, "length": + 6}}, {"content": "Address:", "boundingBox": [166, 926, 271, 926, 271, 953, + 166, 953], "confidence": 0.994, "span": {"offset": 389, "length": 8}}, {"content": + "383", "boundingBox": [277, 925, 325, 925, 325, 953, 276, 953], "confidence": + 0.997, "span": {"offset": 398, "length": 3}}, {"content": "N", "boundingBox": + [330, 925, 346, 926, 346, 953, 330, 953], "confidence": 0.995, "span": {"offset": + 402, "length": 1}}, {"content": "Kinnick", "boundingBox": [355, 926, 444, + 926, 444, 954, 355, 953], "confidence": 0.997, "span": {"offset": 404, "length": + 7}}, {"content": "Road", "boundingBox": [450, 926, 516, 927, 515, 954, 449, + 954], "confidence": 0.983, "span": {"offset": 412, "length": 4}}, {"content": + "Seattle,", "boundingBox": [281, 965, 374, 964, 375, 991, 283, 991], "confidence": + 0.996, "span": {"offset": 417, "length": 8}}, {"content": "WA", "boundingBox": + [380, 964, 424, 964, 425, 991, 381, 991], "confidence": 0.998, "span": {"offset": + 426, "length": 2}}, {"content": "38383", "boundingBox": [432, 964, 510, 963, + 511, 990, 432, 991], "confidence": 0.995, "span": {"offset": 429, "length": + 5}}, {"content": "Phone:", "boundingBox": [760, 964, 847, 964, 846, 990, 760, + 990], "confidence": 0.997, "span": {"offset": 435, "length": 6}}, {"content": + "932-299-0292", "boundingBox": [852, 964, 1029, 963, 1028, 990, 851, 990], + "confidence": 0.987, "span": {"offset": 442, "length": 12}}, {"content": "Details", + "boundingBox": [447, 1048, 556, 1048, 555, 1078, 446, 1078], "confidence": + 0.993, "span": {"offset": 455, "length": 7}}, {"content": "Quantity", "boundingBox": + [886, 1048, 1030, 1047, 1029, 1084, 886, 1084], "confidence": 0.997, "span": + {"offset": 463, "length": 8}}, {"content": "Unit", "boundingBox": [1112, 1047, + 1175, 1047, 1175, 1078, 1111, 1078], "confidence": 0.992, "span": {"offset": + 472, "length": 4}}, {"content": "Price", "boundingBox": [1181, 1047, 1263, + 1048, 1262, 1078, 1181, 1078], "confidence": 0.995, "span": {"offset": 477, + "length": 5}}, {"content": "Total", "boundingBox": [1382, 1047, 1468, 1047, + 1468, 1077, 1382, 1077], "confidence": 0.995, "span": {"offset": 483, "length": + 5}}, {"content": "Bindings", "boundingBox": [172, 1094, 279, 1097, 279, 1123, + 173, 1122], "confidence": 0.993, "span": {"offset": 489, "length": 8}}, {"content": + "20", "boundingBox": [859, 1094, 887, 1094, 887, 1119, 859, 1119], "confidence": + 0.997, "span": {"offset": 498, "length": 2}}, {"content": "1.00", "boundingBox": + [1240, 1095, 1290, 1094, 1291, 1117, 1240, 1118], "confidence": 0.988, "span": + {"offset": 501, "length": 4}}, {"content": "20.00", "boundingBox": [1458, + 1096, 1526, 1095, 1525, 1120, 1459, 1119], "confidence": 0.995, "span": {"offset": + 506, "length": 5}}, {"content": "Covers", "boundingBox": [170, 1136, 251, + 1136, 251, 1161, 170, 1161], "confidence": 0.995, "span": {"offset": 512, + "length": 6}}, {"content": "Small", "boundingBox": [256, 1136, 332, 1135, + 331, 1161, 256, 1161], "confidence": 0.995, "span": {"offset": 519, "length": + 5}}, {"content": "20", "boundingBox": [859, 1135, 889, 1135, 889, 1160, 859, + 1160], "confidence": 0.997, "span": {"offset": 525, "length": 2}}, {"content": + "1.00", "boundingBox": [1239, 1135, 1290, 1135, 1291, 1160, 1239, 1160], "confidence": + 0.984, "span": {"offset": 528, "length": 4}}, {"content": "20.00", "boundingBox": + [1458, 1135, 1526, 1135, 1526, 1160, 1458, 1160], "confidence": 0.995, "span": + {"offset": 533, "length": 5}}, {"content": "Feather", "boundingBox": [173, + 1180, 265, 1179, 265, 1206, 174, 1206], "confidence": 0.997, "span": {"offset": + 539, "length": 7}}, {"content": "Bookmark", "boundingBox": [270, 1179, 399, + 1178, 400, 1206, 271, 1206], "confidence": 0.997, "span": {"offset": 547, + "length": 8}}, {"content": "20", "boundingBox": [860, 1179, 888, 1179, 888, + 1204, 860, 1203], "confidence": 0.995, "span": {"offset": 556, "length": 2}}, + {"content": "5.00", "boundingBox": [1239, 1179, 1290, 1178, 1291, 1203, 1239, + 1204], "confidence": 0.994, "span": {"offset": 559, "length": 4}}, {"content": + "100.00", "boundingBox": [1443, 1181, 1525, 1180, 1525, 1204, 1443, 1205], + "confidence": 0.067, "span": {"offset": 564, "length": 6}}, {"content": "Copper", + "boundingBox": [170, 1223, 257, 1222, 257, 1253, 170, 1253], "confidence": + 0.995, "span": {"offset": 571, "length": 6}}, {"content": "Swirl", "boundingBox": + [263, 1222, 325, 1222, 325, 1251, 262, 1252], "confidence": 0.995, "span": + {"offset": 578, "length": 5}}, {"content": "Marker", "boundingBox": [331, + 1222, 429, 1223, 429, 1248, 330, 1251], "confidence": 0.997, "span": {"offset": + 584, "length": 6}}, {"content": "20", "boundingBox": [860, 1223, 887, 1223, + 887, 1247, 860, 1247], "confidence": 0.997, "span": {"offset": 591, "length": + 2}}, {"content": "5.00", "boundingBox": [1239, 1221, 1291, 1221, 1291, 1247, + 1239, 1247], "confidence": 0.988, "span": {"offset": 594, "length": 4}}, {"content": + "100.00", "boundingBox": [1444, 1224, 1525, 1223, 1524, 1247, 1444, 1248], + "confidence": 0.995, "span": {"offset": 599, "length": 6}}, {"content": "Bernie", + "boundingBox": [484, 1671, 595, 1671, 595, 1706, 484, 1706], "confidence": + 0.997, "span": {"offset": 606, "length": 6}}, {"content": "Sanders", "boundingBox": + [602, 1671, 762, 1670, 763, 1708, 602, 1706], "confidence": 0.997, "span": + {"offset": 613, "length": 7}}, {"content": "Bernie", "boundingBox": [542, + 1719, 614, 1719, 615, 1742, 544, 1742], "confidence": 0.995, "span": {"offset": + 621, "length": 6}}, {"content": "Sanders", "boundingBox": [618, 1719, 716, + 1719, 716, 1743, 619, 1742], "confidence": 0.997, "span": {"offset": 628, + "length": 7}}, {"content": "Manager", "boundingBox": [577, 1754, 681, 1756, + 680, 1778, 578, 1776], "confidence": 0.994, "span": {"offset": 636, "length": + 7}}, {"content": "Additional", "boundingBox": [173, 1796, 350, 1796, 349, + 1832, 173, 1831], "confidence": 0.993, "span": {"offset": 644, "length": 10}}, + {"content": "Notes:", "boundingBox": [357, 1796, 478, 1797, 477, 1833, 356, + 1832], "confidence": 0.997, "span": {"offset": 655, "length": 6}}, {"content": + "Do", "boundingBox": [175, 1881, 201, 1881, 202, 1907, 175, 1907], "confidence": + 0.988, "span": {"offset": 662, "length": 2}}, {"content": "not", "boundingBox": + [207, 1881, 251, 1880, 252, 1908, 208, 1907], "confidence": 0.998, "span": + {"offset": 665, "length": 3}}, {"content": "Jostle", "boundingBox": [257, + 1880, 330, 1880, 330, 1909, 257, 1908], "confidence": 0.997, "span": {"offset": + 669, "length": 6}}, {"content": "Box.", "boundingBox": [336, 1880, 397, 1880, + 397, 1909, 336, 1909], "confidence": 0.991, "span": {"offset": 676, "length": + 4}}, {"content": "Unpack", "boundingBox": [403, 1880, 497, 1880, 497, 1910, + 403, 1909], "confidence": 0.997, "span": {"offset": 681, "length": 6}}, {"content": + "carefully.", "boundingBox": [503, 1880, 620, 1880, 620, 1911, 503, 1910], + "confidence": 0.996, "span": {"offset": 688, "length": 10}}, {"content": "Enjoy.", + "boundingBox": [626, 1880, 706, 1881, 706, 1912, 626, 1911], "confidence": + 0.995, "span": {"offset": 699, "length": 6}}, {"content": "SUBTOTAL", "boundingBox": + [1147, 1575, 1293, 1575, 1293, 1600, 1147, 1600], "confidence": 0.993, "span": + {"offset": 706, "length": 8}}, {"content": "$140.00", "boundingBox": [1426, + 1572, 1526, 1572, 1525, 1597, 1427, 1599], "confidence": 0.993, "span": {"offset": + 715, "length": 7}}, {"content": "TAX", "boundingBox": [1236, 1618, 1288, 1618, + 1288, 1643, 1236, 1643], "confidence": 0.994, "span": {"offset": 723, "length": + 3}}, {"content": "$4.00", "boundingBox": [1458, 1615, 1529, 1615, 1529, 1642, + 1458, 1643], "confidence": 0.988, "span": {"offset": 727, "length": 5}}, {"content": + "TOTAL", "boundingBox": [1204, 1674, 1292, 1674, 1292, 1699, 1205, 1699], + "confidence": 0.994, "span": {"offset": 733, "length": 5}}, {"content": "$144.00", + "boundingBox": [1427, 1671, 1527, 1669, 1527, 1697, 1429, 1698], "confidence": + 0.983, "span": {"offset": 739, "length": 7}}, {"content": "Jupiter", "boundingBox": + [169, 1924, 265, 1924, 265, 1959, 169, 1959], "confidence": 0.994, "span": + {"offset": 747, "length": 7}}, {"content": "Book", "boundingBox": [272, 1924, + 350, 1924, 351, 1958, 272, 1959], "confidence": 0.992, "span": {"offset": + 755, "length": 4}}, {"content": "Supply", "boundingBox": [357, 1924, 460, + 1924, 460, 1958, 357, 1958], "confidence": 0.995, "span": {"offset": 760, + "length": 6}}, {"content": "will", "boundingBox": [467, 1924, 516, 1924, 516, + 1958, 467, 1958], "confidence": 0.991, "span": {"offset": 767, "length": 4}}, + {"content": "refund", "boundingBox": [523, 1924, 622, 1924, 621, 1958, 523, + 1958], "confidence": 0.997, "span": {"offset": 772, "length": 6}}, {"content": + "you", "boundingBox": [629, 1924, 685, 1924, 684, 1958, 628, 1958], "confidence": + 0.998, "span": {"offset": 779, "length": 3}}, {"content": "50%", "boundingBox": + [691, 1924, 761, 1924, 760, 1958, 691, 1958], "confidence": 0.988, "span": + {"offset": 783, "length": 3}}, {"content": "per", "boundingBox": [768, 1924, + 819, 1924, 819, 1958, 767, 1958], "confidence": 0.998, "span": {"offset": + 787, "length": 3}}, {"content": "book", "boundingBox": [826, 1924, 900, 1924, + 899, 1958, 825, 1958], "confidence": 0.992, "span": {"offset": 791, "length": + 4}}, {"content": "if", "boundingBox": [907, 1924, 927, 1924, 926, 1958, 906, + 1958], "confidence": 0.999, "span": {"offset": 796, "length": 2}}, {"content": + "returned", "boundingBox": [933, 1924, 1059, 1924, 1058, 1958, 933, 1958], + "confidence": 0.996, "span": {"offset": 799, "length": 8}}, {"content": "within", + "boundingBox": [1066, 1924, 1153, 1924, 1152, 1958, 1065, 1958], "confidence": + 0.997, "span": {"offset": 808, "length": 6}}, {"content": "60", "boundingBox": + [1160, 1924, 1200, 1924, 1199, 1958, 1159, 1958], "confidence": 0.999, "span": + {"offset": 815, "length": 2}}, {"content": "days", "boundingBox": [1207, 1924, + 1279, 1924, 1278, 1958, 1206, 1958], "confidence": 0.992, "span": {"offset": + 818, "length": 4}}, {"content": "of", "boundingBox": [1286, 1924, 1317, 1924, + 1316, 1958, 1284, 1958], "confidence": 0.997, "span": {"offset": 823, "length": + 2}}, {"content": "reading", "boundingBox": [1324, 1924, 1438, 1924, 1437, + 1958, 1322, 1958], "confidence": 0.997, "span": {"offset": 826, "length": + 7}}, {"content": "and", "boundingBox": [1445, 1924, 1505, 1924, 1504, 1958, + 1443, 1958], "confidence": 0.998, "span": {"offset": 834, "length": 3}}, {"content": + "offer", "boundingBox": [169, 1958, 231, 1958, 231, 1991, 169, 1991], "confidence": + 0.993, "span": {"offset": 838, "length": 5}}, {"content": "you", "boundingBox": + [237, 1958, 295, 1958, 295, 1992, 237, 1991], "confidence": 0.989, "span": + {"offset": 844, "length": 3}}, {"content": "25%", "boundingBox": [303, 1958, + 371, 1958, 372, 1992, 303, 1992], "confidence": 0.947, "span": {"offset": + 848, "length": 3}}, {"content": "off", "boundingBox": [378, 1958, 420, 1958, + 420, 1992, 378, 1992], "confidence": 0.998, "span": {"offset": 852, "length": + 3}}, {"content": "you", "boundingBox": [427, 1958, 482, 1958, 482, 1992, 427, + 1992], "confidence": 0.998, "span": {"offset": 856, "length": 3}}, {"content": + "next", "boundingBox": [488, 1958, 554, 1959, 555, 1992, 489, 1992], "confidence": + 0.992, "span": {"offset": 860, "length": 4}}, {"content": "total", "boundingBox": + [561, 1959, 627, 1959, 627, 1991, 561, 1992], "confidence": 0.994, "span": + {"offset": 865, "length": 5}}, {"content": "purchase.", "boundingBox": [633, + 1959, 786, 1961, 787, 1990, 633, 1991], "confidence": 0.996, "span": {"offset": + 871, "length": 9}}], "selectionMarks": [], "lines": [{"content": "Purchase + Order", "boundingBox": [136, 139, 351, 138, 351, 166, 136, 166], "spans": + [{"offset": 0, "length": 14}]}, {"content": "Hero Limited", "boundingBox": + [620, 205, 1074, 204, 1075, 265, 620, 266], "spans": [{"offset": 15, "length": + 12}]}, {"content": "Company Phone: 555-348-6512", "boundingBox": [163, 352, + 528, 350, 528, 376, 163, 379], "spans": [{"offset": 28, "length": 27}]}, {"content": + "Website: www.herolimited.com", "boundingBox": [166, 393, 533, 393, 533, 418, + 166, 418], "spans": [{"offset": 56, "length": 28}]}, {"content": "Email:", + "boundingBox": [165, 435, 237, 435, 237, 460, 165, 460], "spans": [{"offset": + 85, "length": 6}]}, {"content": "Purchase Order", "boundingBox": [1112, 321, + 1554, 321, 1554, 369, 1112, 369], "spans": [{"offset": 92, "length": 14}]}, + {"content": "Dated As: 12/20/2020", "boundingBox": [1024, 419, 1317, 420, + 1317, 448, 1024, 448], "spans": [{"offset": 107, "length": 20}]}, {"content": + "Purchase Order #: 948284", "boundingBox": [1023, 461, 1376, 461, 1376, 489, + 1023, 488], "spans": [{"offset": 128, "length": 24}]}, {"content": "accounts@herolimited.com", + "boundingBox": [164, 479, 482, 478, 483, 502, 164, 503], "spans": [{"offset": + 153, "length": 24}]}, {"content": "Shipped To", "boundingBox": [167, 547, + 397, 546, 397, 591, 167, 592], "spans": [{"offset": 178, "length": 10}]}, + {"content": "Vendor Name: Hillary Swank", "boundingBox": [159, 609, 520, 609, + 520, 638, 159, 638], "spans": [{"offset": 189, "length": 26}]}, {"content": + "Company Name: Higgly Wiggly Books", "boundingBox": [159, 647, 629, 646, 629, + 677, 160, 679], "spans": [{"offset": 216, "length": 33}]}, {"content": "Address: + 938 NE Burner Road", "boundingBox": [160, 684, 526, 684, 526, 712, 160, 711], + "spans": [{"offset": 250, "length": 27}]}, {"content": "Boulder City, CO 92848", + "boundingBox": [279, 722, 566, 721, 566, 750, 279, 751], "spans": [{"offset": + 278, "length": 22}]}, {"content": "Phone: 938-294-2949", "boundingBox": [612, + 721, 885, 721, 885, 747, 612, 748], "spans": [{"offset": 301, "length": 19}]}, + {"content": "Shipped From", "boundingBox": [167, 784, 453, 784, 453, 829, + 167, 830], "spans": [{"offset": 321, "length": 12}]}, {"content": "Name: Bernie + Sanders", "boundingBox": [165, 852, 445, 851, 445, 878, 165, 879], "spans": + [{"offset": 334, "length": 20}]}, {"content": "Company Name: Jupiter Book + Supply", "boundingBox": [164, 889, 629, 889, 629, 919, 164, 919], "spans": + [{"offset": 355, "length": 33}]}, {"content": "Address: 383 N Kinnick Road", + "boundingBox": [165, 925, 521, 926, 521, 953, 165, 952], "spans": [{"offset": + 389, "length": 27}]}, {"content": "Seattle, WA 38383", "boundingBox": [280, + 963, 514, 962, 514, 990, 281, 991], "spans": [{"offset": 417, "length": 17}]}, + {"content": "Phone: 932-299-0292", "boundingBox": [760, 963, 1032, 963, 1032, + 989, 760, 990], "spans": [{"offset": 435, "length": 19}]}, {"content": "Details", + "boundingBox": [446, 1047, 558, 1047, 558, 1077, 446, 1077], "spans": [{"offset": + 455, "length": 7}]}, {"content": "Quantity", "boundingBox": [885, 1047, 1034, + 1047, 1034, 1083, 886, 1083], "spans": [{"offset": 463, "length": 8}]}, {"content": + "Unit Price", "boundingBox": [1111, 1047, 1270, 1047, 1269, 1078, 1111, 1077], + "spans": [{"offset": 472, "length": 10}]}, {"content": "Total", "boundingBox": + [1382, 1047, 1468, 1047, 1467, 1077, 1382, 1077], "spans": [{"offset": 483, + "length": 5}]}, {"content": "Bindings", "boundingBox": [172, 1093, 279, 1095, + 279, 1123, 172, 1121], "spans": [{"offset": 489, "length": 8}]}, {"content": + "20", "boundingBox": [859, 1094, 893, 1094, 893, 1119, 859, 1119], "spans": + [{"offset": 498, "length": 2}]}, {"content": "1.00", "boundingBox": [1240, + 1096, 1295, 1094, 1294, 1118, 1241, 1118], "spans": [{"offset": 501, "length": + 4}]}, {"content": "20.00", "boundingBox": [1458, 1095, 1530, 1095, 1530, 1119, + 1458, 1119], "spans": [{"offset": 506, "length": 5}]}, {"content": "Covers + Small", "boundingBox": [169, 1135, 332, 1134, 333, 1160, 169, 1161], "spans": + [{"offset": 512, "length": 12}]}, {"content": "20", "boundingBox": [859, 1135, + 894, 1135, 891, 1160, 860, 1160], "spans": [{"offset": 525, "length": 2}]}, + {"content": "1.00", "boundingBox": [1239, 1135, 1295, 1135, 1294, 1159, 1239, + 1160], "spans": [{"offset": 528, "length": 4}]}, {"content": "20.00", "boundingBox": + [1458, 1135, 1530, 1135, 1530, 1159, 1459, 1160], "spans": [{"offset": 533, + "length": 5}]}, {"content": "Feather Bookmark", "boundingBox": [173, 1178, + 403, 1177, 403, 1205, 173, 1206], "spans": [{"offset": 539, "length": 16}]}, + {"content": "20", "boundingBox": [860, 1179, 892, 1179, 891, 1204, 860, 1203], + "spans": [{"offset": 556, "length": 2}]}, {"content": "5.00", "boundingBox": + [1239, 1179, 1295, 1178, 1295, 1203, 1239, 1204], "spans": [{"offset": 559, + "length": 4}]}, {"content": "100.00", "boundingBox": [1442, 1180, 1530, 1180, + 1530, 1203, 1443, 1204], "spans": [{"offset": 564, "length": 6}]}, {"content": + "Copper Swirl Marker", "boundingBox": [169, 1223, 429, 1222, 430, 1249, 169, + 1253], "spans": [{"offset": 571, "length": 19}]}, {"content": "20", "boundingBox": + [860, 1223, 893, 1223, 893, 1247, 860, 1247], "spans": [{"offset": 591, "length": + 2}]}, {"content": "5.00", "boundingBox": [1239, 1221, 1294, 1222, 1294, 1246, + 1239, 1247], "spans": [{"offset": 594, "length": 4}]}, {"content": "100.00", + "boundingBox": [1443, 1223, 1530, 1222, 1530, 1246, 1444, 1247], "spans": + [{"offset": 599, "length": 6}]}, {"content": "Bernie Sanders", "boundingBox": + [484, 1670, 764, 1670, 764, 1707, 484, 1706], "spans": [{"offset": 606, "length": + 14}]}, {"content": "Bernie Sanders", "boundingBox": [542, 1718, 718, 1719, + 718, 1742, 542, 1741], "spans": [{"offset": 621, "length": 14}]}, {"content": + "Manager", "boundingBox": [577, 1753, 681, 1755, 681, 1778, 577, 1776], "spans": + [{"offset": 636, "length": 7}]}, {"content": "Additional Notes:", "boundingBox": + [172, 1796, 478, 1796, 478, 1832, 172, 1831], "spans": [{"offset": 644, "length": + 17}]}, {"content": "Do not Jostle Box. Unpack carefully. Enjoy.", "boundingBox": + [174, 1879, 707, 1880, 707, 1911, 174, 1908], "spans": [{"offset": 662, "length": + 43}]}, {"content": "SUBTOTAL", "boundingBox": [1146, 1573, 1296, 1573, 1296, + 1600, 1146, 1600], "spans": [{"offset": 706, "length": 8}]}, {"content": "$140.00", + "boundingBox": [1426, 1571, 1530, 1571, 1530, 1597, 1426, 1598], "spans": + [{"offset": 715, "length": 7}]}, {"content": "TAX", "boundingBox": [1236, + 1618, 1296, 1618, 1295, 1643, 1236, 1643], "spans": [{"offset": 723, "length": + 3}]}, {"content": "$4.00", "boundingBox": [1458, 1615, 1529, 1615, 1528, 1641, + 1458, 1643], "spans": [{"offset": 727, "length": 5}]}, {"content": "TOTAL", + "boundingBox": [1203, 1673, 1297, 1673, 1297, 1698, 1204, 1699], "spans": + [{"offset": 733, "length": 5}]}, {"content": "$144.00", "boundingBox": [1427, + 1670, 1529, 1669, 1530, 1696, 1427, 1697], "spans": [{"offset": 739, "length": + 7}]}, {"content": "Jupiter Book Supply will refund you 50% per book if returned + within 60 days of reading and", "boundingBox": [168, 1923, 1510, 1923, 1510, + 1957, 168, 1958], "spans": [{"offset": 747, "length": 90}]}, {"content": "offer + you 25% off you next total purchase.", "boundingBox": [168, 1957, 786, 1958, + 786, 1991, 168, 1991], "spans": [{"offset": 838, "length": 42}]}], "spans": + [{"offset": 0, "length": 880}]}], "tables": [{"rowCount": 5, "columnCount": + 4, "cells": [{"kind": "columnHeader", "rowIndex": 0, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Details", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [157, 1037, 847, 1038, 847, 1086, 155, 1086]}], "spans": + [{"offset": 455, "length": 7}]}, {"kind": "columnHeader", "rowIndex": 0, "columnIndex": + 1, "rowSpan": 1, "columnSpan": 1, "content": "Quantity", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [847, 1038, 1069, 1038, 1070, 1086, 847, + 1086]}], "spans": [{"offset": 463, "length": 8}]}, {"kind": "columnHeader", + "rowIndex": 0, "columnIndex": 2, "rowSpan": 1, "columnSpan": 1, "content": + "Unit Price", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1069, + 1038, 1309, 1038, 1309, 1086, 1070, 1086]}], "spans": [{"offset": 472, "length": + 10}]}, {"kind": "columnHeader", "rowIndex": 0, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "Total", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1038, 1543, 1038, 1543, 1086, 1309, 1086]}], "spans": + [{"offset": 483, "length": 5}]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Bindings", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1086, 847, 1086, 847, 1127, 155, 1127]}], "spans": + [{"offset": 489, "length": 8}]}, {"rowIndex": 1, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1086, 1070, 1086, 1070, 1127, 847, 1127]}], "spans": + [{"offset": 498, "length": 2}]}, {"rowIndex": 1, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "1.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1086, 1309, 1086, 1309, 1127, 1070, 1127]}], "spans": + [{"offset": 501, "length": 4}]}, {"rowIndex": 1, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "20.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1086, 1543, 1086, 1543, 1127, 1309, 1127]}], "spans": + [{"offset": 506, "length": 5}]}, {"rowIndex": 2, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Covers Small", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1127, 847, 1127, 847, 1171, 155, 1171]}], "spans": + [{"offset": 512, "length": 12}]}, {"rowIndex": 2, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1127, 1070, 1127, 1070, 1171, 847, 1171]}], "spans": + [{"offset": 525, "length": 2}]}, {"rowIndex": 2, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "1.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1127, 1309, 1127, 1309, 1171, 1070, 1171]}], "spans": + [{"offset": 528, "length": 4}]}, {"rowIndex": 2, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "20.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1127, 1543, 1127, 1543, 1171, 1309, 1171]}], "spans": + [{"offset": 533, "length": 5}]}, {"rowIndex": 3, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Feather Bookmark", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1171, 847, 1171, 847, 1214, 155, 1214]}], "spans": + [{"offset": 539, "length": 16}]}, {"rowIndex": 3, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1171, 1070, 1171, 1070, 1214, 847, 1214]}], "spans": + [{"offset": 556, "length": 2}]}, {"rowIndex": 3, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "5.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1171, 1309, 1171, 1309, 1214, 1070, 1214]}], "spans": + [{"offset": 559, "length": 4}]}, {"rowIndex": 3, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "100.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1171, 1543, 1171, 1543, 1215, 1309, 1214]}], "spans": + [{"offset": 564, "length": 6}]}, {"rowIndex": 4, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Copper Swirl Marker", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1214, 847, 1214, 847, 1258, 155, 1258]}], "spans": + [{"offset": 571, "length": 19}]}, {"rowIndex": 4, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1214, 1070, 1214, 1070, 1258, 847, 1258]}], "spans": + [{"offset": 591, "length": 2}]}, {"rowIndex": 4, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "5.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1214, 1309, 1214, 1309, 1258, 1070, 1258]}], "spans": + [{"offset": 594, "length": 4}]}, {"rowIndex": 4, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "100.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1214, 1543, 1215, 1543, 1260, 1309, 1258]}], "spans": + [{"offset": 599, "length": 6}]}], "boundingRegions": [{"pageNumber": 1, "boundingBox": + [153, 1036, 1548, 1036, 1547, 1265, 153, 1265]}], "spans": [{"offset": 455, + "length": 150}]}, {"rowCount": 4, "columnCount": 2, "cells": [{"kind": "columnHeader", + "rowIndex": 0, "columnIndex": 0, "rowSpan": 1, "columnSpan": 1, "content": + "SUBTOTAL", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1070, 1565, + 1309, 1565, 1309, 1609, 1071, 1609]}], "spans": [{"offset": 706, "length": + 8}]}, {"kind": "columnHeader", "rowIndex": 0, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "$140.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1565, 1544, 1564, 1544, 1609, 1309, 1609]}], "spans": + [{"offset": 715, "length": 7}]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "TAX", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [1071, 1609, 1309, 1609, 1309, 1652, 1071, 1652]}], "spans": + [{"offset": 723, "length": 3}]}, {"rowIndex": 1, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "$4.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1609, 1544, 1609, 1544, 1652, 1309, 1652]}], "spans": + [{"offset": 727, "length": 5}]}, {"rowIndex": 2, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1071, 1652, 1309, 1652, 1309, 1664, 1071, 1664]}], "spans": []}, {"rowIndex": + 2, "columnIndex": 1, "rowSpan": 1, "columnSpan": 1, "content": "", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1309, 1652, 1544, 1652, 1544, 1664, 1309, + 1664]}], "spans": []}, {"rowIndex": 3, "columnIndex": 0, "rowSpan": 1, "columnSpan": + 1, "content": "TOTAL", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1071, 1664, 1309, 1664, 1309, 1707, 1071, 1706]}], "spans": [{"offset": 733, + "length": 5}]}, {"rowIndex": 3, "columnIndex": 1, "rowSpan": 1, "columnSpan": + 1, "content": "$144.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1309, 1664, 1544, 1664, 1544, 1707, 1309, 1707]}], "spans": [{"offset": 739, + "length": 7}]}], "boundingRegions": [{"pageNumber": 1, "boundingBox": [1062, + 1563, 1560, 1563, 1560, 1709, 1062, 1709]}], "spans": [{"offset": 706, "length": + 40}]}], "keyValuePairs": [{"key": {"content": "Company Phone:", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [163, 352, 359, 351, 359, 379, 163, 380]}], + "spans": [{"offset": 28, "length": 14}]}, "value": {"content": "555-348-6512", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [363, 351, 524, 351, + 524, 374, 364, 378]}], "spans": [{"offset": 43, "length": 12}]}, "confidence": + 0.932}, {"key": {"content": "Website:", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [167, 394, 265, 393, 265, 418, 167, 417]}], "spans": [{"offset": + 56, "length": 8}]}, "value": {"content": "www.herolimited.com", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [270, 393, 522, 393, 522, 418, 270, 418]}], + "spans": [{"offset": 65, "length": 19}]}, "confidence": 0.943}, {"key": {"content": + "Dated As:", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1025, 420, + 1156, 420, 1156, 448, 1025, 448]}], "spans": [{"offset": 107, "length": 9}]}, + "value": {"content": "12/20/2020", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1162, 420, 1312, 421, 1312, 449, 1162, 448]}], "spans": [{"offset": 117, + "length": 10}]}, "confidence": 0.932}, {"key": {"content": "Email:", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [165, 435, 237, 435, 237, 460, 165, 460]}], + "spans": [{"offset": 85, "length": 6}]}, "value": {"content": "accounts@herolimited.com", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [164, 481, 471, 479, + 470, 503, 165, 503]}], "spans": [{"offset": 153, "length": 24}]}, "confidence": + 0.938}, {"key": {"content": "Purchase Order #:", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1023, 461, 1270, 461, 1270, 489, 1023, 489]}], "spans": + [{"offset": 128, "length": 17}]}, "value": {"content": "948284", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1275, 461, 1373, 462, 1373, 489, 1275, + 489]}], "spans": [{"offset": 146, "length": 6}]}, "confidence": 0.923}, {"key": + {"content": "Vendor Name:", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [160, 609, 341, 609, 341, 639, 160, 639]}], "spans": [{"offset": 189, "length": + 12}]}, "value": {"content": "Hillary Swank", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [346, 608, 518, 610, 518, 640, 346, 639]}], "spans": [{"offset": + 202, "length": 13}]}, "confidence": 0.905}, {"key": {"content": "Company Name:", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [160, 646, 366, 647, + 366, 679, 160, 678]}], "spans": [{"offset": 216, "length": 13}]}, "value": + {"content": "Higgly Wiggly Books", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [372, 647, 628, 645, 628, 678, 372, 680]}], "spans": [{"offset": 230, "length": + 19}]}, "confidence": 0.871}, {"key": {"content": "Address:", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [161, 685, 266, 685, 265, 712, 160, 711]}], + "spans": [{"offset": 250, "length": 8}]}, "value": {"content": "938 NE Burner + Road Boulder City, CO 92848", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [271, 685, 559, 685, 559, 751, 271, 751]}], "spans": [{"offset": 259, "length": + 41}]}, "confidence": 0.796}, {"key": {"content": "Phone:", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [613, 722, 701, 722, 701, 749, 613, 749]}], + "spans": [{"offset": 301, "length": 6}]}, "value": {"content": "938-294-2949", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [706, 722, 882, 722, + 881, 748, 706, 749]}], "spans": [{"offset": 308, "length": 12}]}, "confidence": + 0.943}, {"key": {"content": "Name:", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [166, 853, 246, 853, 245, 879, 166, 879]}], "spans": [{"offset": + 334, "length": 5}]}, "value": {"content": "Bernie Sanders", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [251, 852, 444, 852, 444, 880, 251, 880]}], + "spans": [{"offset": 340, "length": 14}]}, "confidence": 0.917}, {"key": {"content": + "Company Name:", "boundingRegions": [{"pageNumber": 1, "boundingBox": [164, + 889, 372, 889, 372, 919, 164, 919]}], "spans": [{"offset": 355, "length": + 13}]}, "value": {"content": "Jupiter Book Supply", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [377, 888, 628, 890, 628, 921, 377, 919]}], "spans": [{"offset": + 369, "length": 19}]}, "confidence": 0.871}, {"key": {"content": "Address:", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [166, 926, 271, 926, + 271, 953, 166, 953]}], "spans": [{"offset": 389, "length": 8}]}, "value": + {"content": "383 N Kinnick Road Seattle, WA 38383", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [276, 925, 516, 925, 516, 991, 276, 991]}], "spans": [{"offset": + 398, "length": 36}]}, "confidence": 0.803}, {"key": {"content": "Phone:", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [760, 964, 847, 964, + 846, 990, 760, 990]}], "spans": [{"offset": 435, "length": 6}]}, "value": + {"content": "932-299-0292", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [852, 964, 1029, 963, 1028, 990, 851, 990]}], "spans": [{"offset": 442, "length": + 12}]}, "confidence": 0.943}, {"key": {"content": "SUBTOTAL", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1147, 1575, 1293, 1575, 1293, 1600, 1147, + 1600]}], "spans": [{"offset": 706, "length": 8}]}, "value": {"content": "$140.00", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [1426, 1572, 1526, 1572, + 1525, 1597, 1427, 1599]}], "spans": [{"offset": 715, "length": 7}]}, "confidence": + 0.943}, {"key": {"content": "TAX", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1236, 1618, 1288, 1618, 1288, 1643, 1236, 1643]}], "spans": [{"offset": 723, + "length": 3}]}, "value": {"content": "$4.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1458, 1615, 1529, 1615, 1529, 1642, 1458, 1643]}], "spans": + [{"offset": 727, "length": 5}]}, "confidence": 0.943}, {"key": {"content": + "TOTAL", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1204, 1674, + 1292, 1674, 1292, 1699, 1205, 1699]}], "spans": [{"offset": 733, "length": + 5}]}, "value": {"content": "$144.00", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [1427, 1671, 1527, 1669, 1527, 1697, 1429, 1698]}], "spans": + [{"offset": 739, "length": 7}]}, "confidence": 0.943}], "entities": [{"category": + "Quantity", "subCategory": "Number", "content": "20", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [859, 1094, 887, 1094, 887, 1119, 859, 1119]}], "confidence": + 0.8, "spans": [{"offset": 498, "length": 2}]}, {"category": "Quantity", "subCategory": + "Number", "content": "1.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1240, 1095, 1291, 1094, 1291, 1117, 1240, 1118]}], "confidence": 0.8, "spans": + [{"offset": 501, "length": 4}]}, {"category": "Quantity", "subCategory": "Number", + "content": "20.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1458, + 1095, 1526, 1095, 1526, 1120, 1458, 1120]}], "confidence": 0.8, "spans": [{"offset": + 506, "length": 5}]}, {"category": "Quantity", "subCategory": "Number", "content": + "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [859, 1135, 889, + 1135, 889, 1160, 859, 1160]}], "confidence": 0.8, "spans": [{"offset": 525, + "length": 2}]}, {"category": "Quantity", "subCategory": "Number", "content": + "1.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1239, 1135, + 1291, 1135, 1291, 1160, 1239, 1160]}], "confidence": 0.8, "spans": [{"offset": + 528, "length": 4}]}, {"category": "Quantity", "subCategory": "Number", "content": + "20.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1458, 1135, + 1526, 1135, 1526, 1160, 1458, 1160]}], "confidence": 0.8, "spans": [{"offset": + 533, "length": 5}]}, {"category": "Quantity", "subCategory": "Number", "content": + "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [860, 1179, 888, + 1179, 888, 1204, 860, 1203]}], "confidence": 0.8, "spans": [{"offset": 556, + "length": 2}]}, {"category": "Quantity", "subCategory": "Number", "content": + "5.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1239, 1179, + 1291, 1178, 1291, 1203, 1239, 1204]}], "confidence": 0.8, "spans": [{"offset": + 559, "length": 4}]}, {"category": "Quantity", "subCategory": "Number", "content": + "100.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1443, 1181, + 1525, 1180, 1525, 1204, 1443, 1205]}], "confidence": 0.8, "spans": [{"offset": + 564, "length": 6}]}, {"category": "Quantity", "subCategory": "Number", "content": + "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [860, 1223, 887, + 1223, 887, 1247, 860, 1247]}], "confidence": 0.8, "spans": [{"offset": 591, + "length": 2}]}, {"category": "Quantity", "subCategory": "Number", "content": + "5.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1239, 1221, + 1291, 1221, 1291, 1247, 1239, 1247]}], "confidence": 0.8, "spans": [{"offset": + 594, "length": 4}]}, {"category": "Quantity", "subCategory": "Number", "content": + "100.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1444, 1224, + 1525, 1223, 1525, 1247, 1444, 1248]}], "confidence": 0.8, "spans": [{"offset": + 599, "length": 6}]}, {"category": "Quantity", "subCategory": "Currency", "content": + "$140.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1426, 1572, + 1526, 1571, 1526, 1598, 1426, 1599]}], "confidence": 0.8, "spans": [{"offset": + 715, "length": 7}]}, {"category": "Quantity", "subCategory": "Currency", "content": + "$4.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1458, 1615, + 1529, 1615, 1529, 1642, 1458, 1643]}], "confidence": 0.8, "spans": [{"offset": + 727, "length": 5}]}, {"category": "Quantity", "subCategory": "Currency", "content": + "$144.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1427, 1671, + 1527, 1669, 1527, 1697, 1427, 1699]}], "confidence": 0.8, "spans": [{"offset": + 739, "length": 7}]}, {"category": "Organization", "content": "Hero Limited + Company", "boundingRegions": [{"pageNumber": 1, "boundingBox": [620, 205, + 1058, 204, 1058, 266, 620, 267]}, {"pageNumber": 1, "boundingBox": [163, 352, + 270, 351, 270, 379, 163, 380]}], "confidence": 0.82, "spans": [{"offset": + 15, "length": 20}]}, {"category": "URL", "content": "www.herolimited.com", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [270, 393, 522, 393, + 522, 418, 270, 418]}], "confidence": 0.8, "spans": [{"offset": 65, "length": + 19}]}, {"category": "DateTime", "subCategory": "Date", "content": "12/20/2020", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [1162, 420, 1312, 421, + 1312, 449, 1162, 448]}], "confidence": 0.8, "spans": [{"offset": 117, "length": + 10}]}, {"category": "Quantity", "subCategory": "Number", "content": "948284", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [1275, 461, 1373, 462, + 1373, 489, 1275, 489]}], "confidence": 0.8, "spans": [{"offset": 146, "length": + 6}]}, {"category": "Email", "content": "accounts@herolimited.com", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [164, 480, 471, 479, 471, 503, 164, 504]}], + "confidence": 0.8, "spans": [{"offset": 153, "length": 24}]}, {"category": + "Person", "content": "Hillary Swank", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [346, 608, 518, 610, 518, 640, 346, 639]}], "confidence": 0.89, + "spans": [{"offset": 202, "length": 13}]}, {"category": "Person", "content": + "Higgly", "boundingRegions": [{"pageNumber": 1, "boundingBox": [372, 647, + 449, 646, 449, 679, 372, 679]}], "confidence": 0.46, "spans": [{"offset": + 230, "length": 6}]}, {"category": "Organization", "content": "Wiggly", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [455, 646, 541, 646, 541, 678, 455, 679]}], + "confidence": 0.43, "spans": [{"offset": 237, "length": 6}]}, {"category": + "Address", "content": "938 NE Burner Road Boulder City, CO", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [271, 685, 521, 685, 521, 713, 271, 713]}, + {"pageNumber": 1, "boundingBox": [279, 722, 473, 722, 473, 751, 279, 751]}], + "confidence": 0.79, "spans": [{"offset": 259, "length": 35}]}, {"category": + "Quantity", "subCategory": "Number", "content": "938", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [271, 684, 319, 685, 319, 713, 271, 713]}], + "confidence": 0.8, "spans": [{"offset": 259, "length": 3}]}, {"category": + "Quantity", "subCategory": "Number", "content": "92848", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [480, 722, 559, 721, 559, 750, 480, 751]}], + "confidence": 0.8, "spans": [{"offset": 295, "length": 5}]}, {"category": + "Person", "content": "Bernie Sanders", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [251, 852, 444, 852, 444, 880, 251, 880]}], "confidence": + 0.8, "spans": [{"offset": 340, "length": 14}]}, {"category": "Organization", + "subCategory": "Sports", "content": "Jupiter", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [377, 889, 464, 889, 464, 919, 377, 919]}], "confidence": + 0.76, "spans": [{"offset": 369, "length": 7}]}, {"category": "Address", "content": + "383 N Kinnick Road", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [276, 925, 516, 926, 516, 955, 276, 953]}], "confidence": 0.96, "spans": [{"offset": + 398, "length": 18}]}, {"category": "Quantity", "subCategory": "Number", "content": + "383", "boundingRegions": [{"pageNumber": 1, "boundingBox": [276, 925, 325, + 925, 325, 953, 276, 953]}], "confidence": 0.8, "spans": [{"offset": 398, "length": + 3}]}, {"category": "Location", "subCategory": "GPE", "content": "Seattle", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [281, 965, 375, 964, + 375, 991, 281, 992]}], "confidence": 0.77, "spans": [{"offset": 417, "length": + 7}]}, {"category": "Location", "subCategory": "GPE", "content": "WA", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [380, 964, 425, 964, 425, 991, 380, 991]}], + "confidence": 0.42, "spans": [{"offset": 426, "length": 2}]}, {"category": + "Quantity", "subCategory": "Number", "content": "38383", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [432, 964, 511, 963, 511, 990, 432, 991]}], + "confidence": 0.8, "spans": [{"offset": 429, "length": 5}]}, {"category": + "Person", "content": "Bernie Sanders", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [484, 1669, 763, 1670, 763, 1708, 484, 1707]}], "confidence": + 0.8, "spans": [{"offset": 606, "length": 14}]}, {"category": "Person", "content": + "Bernie Sanders", "boundingRegions": [{"pageNumber": 1, "boundingBox": [542, + 1718, 716, 1719, 716, 1743, 542, 1742]}], "confidence": 0.41, "spans": [{"offset": + 621, "length": 14}]}, {"category": "Organization", "content": "Jupiter Book + Supply", "boundingRegions": [{"pageNumber": 1, "boundingBox": [169, 1924, + 460, 1924, 460, 1959, 169, 1959]}], "confidence": 0.99, "spans": [{"offset": + 747, "length": 19}]}, {"category": "Quantity", "subCategory": "Percentage", + "content": "50%", "boundingRegions": [{"pageNumber": 1, "boundingBox": [691, + 1924, 761, 1924, 761, 1958, 691, 1958]}], "confidence": 0.8, "spans": [{"offset": + 783, "length": 3}]}, {"category": "DateTime", "subCategory": "DateRange", + "content": "within 60 days", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1065, 1924, 1279, 1924, 1279, 1958, 1065, 1958]}], "confidence": 0.8, "spans": + [{"offset": 808, "length": 14}]}, {"category": "Quantity", "subCategory": + "Percentage", "content": "25%", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [303, 1958, 372, 1958, 372, 1992, 303, 1992]}], "confidence": 0.8, "spans": + [{"offset": 848, "length": 3}]}], "styles": [{"isHandwritten": true, "confidence": + 0.9, "spans": [{"offset": 606, "length": 14}]}]}}' + headers: + apim-request-id: + - ca342753-4dfd-486b-a1cb-8157e251b2d5 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 25 Oct 2021 17:44:21 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '197' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_field_get_children.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_field_get_children.yaml new file mode 100644 index 000000000000..90e8b24310dc --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_field_get_children.yaml @@ -0,0 +1,607 @@ +interactions: +- request: + body: '!!! The request body has been omitted from the recording because its size + 479269 is larger than 128KB. !!!' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '479269' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-invoice:analyze?stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview + response: + body: + string: '' + headers: + apim-request-id: + - e5241645-09db-4160-9810-71c3eaa0c5dc + content-length: + - '0' + date: + - Mon, 25 Oct 2021 17:43:07 GMT + operation-location: + - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-invoice/analyzeResults/e5241645-09db-4160-9810-71c3eaa0c5dc?api-version=2021-09-30-preview + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '480' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-invoice/analyzeResults/e5241645-09db-4160-9810-71c3eaa0c5dc?api-version=2021-09-30-preview + response: + body: + string: '{"status": "succeeded", "createdDateTime": "2021-10-25T17:43:07Z", + "lastUpdatedDateTime": "2021-10-25T17:43:10Z", "analyzeResult": {"apiVersion": + "2021-09-30-preview", "modelId": "prebuilt-invoice", "stringIndexType": "unicodeCodePoint", + "content": "Purchase Order\nHero Limited\nPurchase Order\nCompany Phone: 555-348-6512\nWebsite: + www.herolimited.com\nEmail:\nDated As: 12/20/2020\naccounts@herolimited.com\nPurchase + Order #: 948284\nShipped To\nVendor Name: Hillary Swank\nCompany Name: Higgly + Wiggly Books\nAddress: 938 NE Burner Road\nBoulder City, CO 92848\nPhone: + 938-294-2949\nShipped From\nName: Bernie Sanders\nCompany Name: Jupiter Book + Supply\nAddress: 383 N Kinnick Road\nSeattle, WA 38383\nPhone: 932-299-0292\nDetails\nQuantity\nUnit + Price\nTotal\nBindings\n20\n1.00\n20.00\nCovers Small\n20\n1.00\n20.00\nFeather + Bookmark\n20\n5.00\n100.00\nCopper Swirl Marker\n20\n5.00\n100.00\nSUBTOTAL\n$140.00\nTAX\n$4.00\nBernie + Sanders\nTOTAL\n$144.00\nBernie Sanders\nManager\nAdditional Notes:\nDo not + Jostle Box. Unpack carefully. Enjoy.\nJupiter Book Supply will refund you + 50% per book if returned within 60 days of reading and\noffer you 25% off + you next total purchase.", "pages": [{"pageNumber": 1, "angle": 0, "width": + 1700, "height": 2200, "unit": "pixel", "words": [{"content": "Purchase", "boundingBox": + [137, 140, 259, 139, 259, 167, 137, 167], "confidence": 0.997, "span": {"offset": + 0, "length": 8}}, {"content": "Order", "boundingBox": [264, 139, 350, 139, + 349, 167, 264, 167], "confidence": 0.995, "span": {"offset": 9, "length": + 5}}, {"content": "Hero", "boundingBox": [621, 208, 769, 206, 769, 266, 620, + 266], "confidence": 0.983, "span": {"offset": 15, "length": 4}}, {"content": + "Limited", "boundingBox": [793, 205, 1058, 204, 1057, 266, 793, 266], "confidence": + 0.997, "span": {"offset": 20, "length": 7}}, {"content": "Purchase", "boundingBox": + [1113, 322, 1365, 321, 1364, 370, 1113, 368], "confidence": 0.997, "span": + {"offset": 28, "length": 8}}, {"content": "Order", "boundingBox": [1381, 321, + 1549, 321, 1548, 370, 1380, 370], "confidence": 0.995, "span": {"offset": + 37, "length": 5}}, {"content": "Company", "boundingBox": [163, 353, 270, 351, + 270, 379, 164, 378], "confidence": 0.993, "span": {"offset": 43, "length": + 7}}, {"content": "Phone:", "boundingBox": [275, 351, 358, 351, 359, 378, 276, + 379], "confidence": 0.997, "span": {"offset": 51, "length": 6}}, {"content": + "555-348-6512", "boundingBox": [363, 351, 524, 351, 524, 374, 364, 378], "confidence": + 0.994, "span": {"offset": 58, "length": 12}}, {"content": "Website:", "boundingBox": + [167, 394, 265, 393, 265, 418, 167, 417], "confidence": 0.997, "span": {"offset": + 71, "length": 8}}, {"content": "www.herolimited.com", "boundingBox": [270, + 393, 522, 393, 522, 418, 270, 418], "confidence": 0.993, "span": {"offset": + 80, "length": 19}}, {"content": "Email:", "boundingBox": [165, 435, 237, 435, + 237, 460, 165, 460], "confidence": 0.995, "span": {"offset": 100, "length": + 6}}, {"content": "Dated", "boundingBox": [1025, 421, 1103, 420, 1103, 448, + 1025, 448], "confidence": 0.993, "span": {"offset": 107, "length": 5}}, {"content": + "As:", "boundingBox": [1110, 420, 1156, 420, 1156, 448, 1110, 448], "confidence": + 0.998, "span": {"offset": 113, "length": 3}}, {"content": "12/20/2020", "boundingBox": + [1162, 420, 1312, 421, 1312, 449, 1162, 448], "confidence": 0.992, "span": + {"offset": 117, "length": 10}}, {"content": "accounts@herolimited.com", "boundingBox": + [164, 481, 471, 479, 470, 503, 165, 503], "confidence": 0.959, "span": {"offset": + 128, "length": 24}}, {"content": "Purchase", "boundingBox": [1023, 461, 1146, + 461, 1147, 489, 1023, 488], "confidence": 0.997, "span": {"offset": 153, "length": + 8}}, {"content": "Order", "boundingBox": [1152, 461, 1237, 461, 1237, 489, + 1152, 489], "confidence": 0.995, "span": {"offset": 162, "length": 5}}, {"content": + "#:", "boundingBox": [1242, 461, 1270, 461, 1270, 489, 1243, 489], "confidence": + 0.997, "span": {"offset": 168, "length": 2}}, {"content": "948284", "boundingBox": + [1275, 461, 1373, 462, 1373, 489, 1275, 489], "confidence": 0.995, "span": + {"offset": 171, "length": 6}}, {"content": "Shipped", "boundingBox": [167, + 547, 328, 547, 327, 592, 168, 592], "confidence": 0.997, "span": {"offset": + 178, "length": 7}}, {"content": "To", "boundingBox": [337, 547, 392, 547, + 391, 591, 336, 592], "confidence": 0.963, "span": {"offset": 186, "length": + 2}}, {"content": "Vendor", "boundingBox": [160, 611, 250, 610, 250, 638, 160, + 637], "confidence": 0.997, "span": {"offset": 189, "length": 6}}, {"content": + "Name:", "boundingBox": [256, 610, 341, 609, 340, 639, 256, 638], "confidence": + 0.995, "span": {"offset": 196, "length": 5}}, {"content": "Hillary", "boundingBox": + [346, 609, 427, 609, 427, 639, 346, 639], "confidence": 0.997, "span": {"offset": + 202, "length": 7}}, {"content": "Swank", "boundingBox": [433, 609, 518, 610, + 517, 639, 433, 639], "confidence": 0.995, "span": {"offset": 210, "length": + 5}}, {"content": "Company", "boundingBox": [160, 649, 275, 647, 276, 678, + 161, 676], "confidence": 0.993, "span": {"offset": 216, "length": 7}}, {"content": + "Name:", "boundingBox": [281, 647, 366, 647, 366, 679, 282, 678], "confidence": + 0.995, "span": {"offset": 224, "length": 5}}, {"content": "Higgly", "boundingBox": + [372, 647, 449, 646, 449, 679, 372, 679], "confidence": 0.997, "span": {"offset": + 230, "length": 6}}, {"content": "Wiggly", "boundingBox": [455, 646, 541, 646, + 541, 678, 455, 679], "confidence": 0.997, "span": {"offset": 237, "length": + 6}}, {"content": "Books", "boundingBox": [547, 646, 628, 646, 628, 676, 547, + 678], "confidence": 0.995, "span": {"offset": 244, "length": 5}}, {"content": + "Address:", "boundingBox": [161, 685, 266, 685, 265, 712, 160, 711], "confidence": + 0.994, "span": {"offset": 250, "length": 8}}, {"content": "938", "boundingBox": + [271, 685, 319, 685, 318, 713, 271, 712], "confidence": 0.993, "span": {"offset": + 259, "length": 3}}, {"content": "NE", "boundingBox": [324, 685, 360, 685, + 359, 713, 323, 713], "confidence": 0.998, "span": {"offset": 263, "length": + 2}}, {"content": "Burner", "boundingBox": [366, 685, 452, 685, 452, 713, 365, + 713], "confidence": 0.997, "span": {"offset": 266, "length": 6}}, {"content": + "Road", "boundingBox": [458, 685, 521, 685, 521, 713, 457, 713], "confidence": + 0.992, "span": {"offset": 273, "length": 4}}, {"content": "Boulder", "boundingBox": + [279, 722, 369, 722, 370, 751, 280, 750], "confidence": 0.994, "span": {"offset": + 278, "length": 7}}, {"content": "City,", "boundingBox": [375, 722, 431, 722, + 432, 751, 376, 751], "confidence": 0.995, "span": {"offset": 286, "length": + 5}}, {"content": "CO", "boundingBox": [437, 722, 473, 722, 473, 751, 437, + 751], "confidence": 0.999, "span": {"offset": 292, "length": 2}}, {"content": + "92848", "boundingBox": [480, 722, 559, 722, 559, 749, 480, 751], "confidence": + 0.995, "span": {"offset": 295, "length": 5}}, {"content": "Phone:", "boundingBox": + [613, 722, 701, 722, 701, 749, 613, 749], "confidence": 0.997, "span": {"offset": + 301, "length": 6}}, {"content": "938-294-2949", "boundingBox": [706, 722, + 882, 722, 881, 748, 706, 749], "confidence": 0.983, "span": {"offset": 308, + "length": 12}}, {"content": "Shipped", "boundingBox": [167, 784, 324, 785, + 324, 830, 169, 830], "confidence": 0.997, "span": {"offset": 321, "length": + 7}}, {"content": "From", "boundingBox": [333, 785, 431, 785, 431, 827, 333, + 830], "confidence": 0.991, "span": {"offset": 329, "length": 4}}, {"content": + "Name:", "boundingBox": [166, 853, 246, 853, 245, 879, 166, 879], "confidence": + 0.994, "span": {"offset": 334, "length": 5}}, {"content": "Bernie", "boundingBox": + [251, 853, 333, 852, 332, 880, 251, 879], "confidence": 0.997, "span": {"offset": + 340, "length": 6}}, {"content": "Sanders", "boundingBox": [338, 852, 444, + 852, 444, 879, 338, 880], "confidence": 0.997, "span": {"offset": 347, "length": + 7}}, {"content": "Company", "boundingBox": [164, 890, 280, 890, 281, 919, + 165, 919], "confidence": 0.994, "span": {"offset": 355, "length": 7}}, {"content": + "Name:", "boundingBox": [285, 890, 372, 889, 372, 919, 286, 919], "confidence": + 0.995, "span": {"offset": 363, "length": 5}}, {"content": "Jupiter", "boundingBox": + [377, 889, 464, 889, 464, 919, 378, 919], "confidence": 0.997, "span": {"offset": + 369, "length": 7}}, {"content": "Book", "boundingBox": [469, 889, 532, 889, + 532, 920, 470, 919], "confidence": 0.992, "span": {"offset": 377, "length": + 4}}, {"content": "Supply", "boundingBox": [538, 889, 628, 890, 628, 920, 538, + 920], "confidence": 0.995, "span": {"offset": 382, "length": 6}}, {"content": + "Address:", "boundingBox": [166, 926, 271, 926, 271, 953, 166, 953], "confidence": + 0.994, "span": {"offset": 389, "length": 8}}, {"content": "383", "boundingBox": + [277, 925, 325, 925, 325, 953, 276, 953], "confidence": 0.997, "span": {"offset": + 398, "length": 3}}, {"content": "N", "boundingBox": [330, 925, 346, 926, 346, + 953, 330, 953], "confidence": 0.995, "span": {"offset": 402, "length": 1}}, + {"content": "Kinnick", "boundingBox": [355, 926, 444, 926, 444, 954, 355, + 953], "confidence": 0.997, "span": {"offset": 404, "length": 7}}, {"content": + "Road", "boundingBox": [450, 926, 516, 927, 515, 954, 449, 954], "confidence": + 0.983, "span": {"offset": 412, "length": 4}}, {"content": "Seattle,", "boundingBox": + [281, 965, 374, 964, 375, 991, 283, 991], "confidence": 0.996, "span": {"offset": + 417, "length": 8}}, {"content": "WA", "boundingBox": [380, 964, 424, 964, + 425, 991, 381, 991], "confidence": 0.998, "span": {"offset": 426, "length": + 2}}, {"content": "38383", "boundingBox": [432, 964, 510, 963, 511, 990, 432, + 991], "confidence": 0.995, "span": {"offset": 429, "length": 5}}, {"content": + "Phone:", "boundingBox": [760, 964, 847, 964, 846, 990, 760, 990], "confidence": + 0.997, "span": {"offset": 435, "length": 6}}, {"content": "932-299-0292", + "boundingBox": [852, 964, 1029, 963, 1028, 990, 851, 990], "confidence": 0.987, + "span": {"offset": 442, "length": 12}}, {"content": "Details", "boundingBox": + [447, 1048, 556, 1048, 555, 1078, 446, 1078], "confidence": 0.993, "span": + {"offset": 455, "length": 7}}, {"content": "Quantity", "boundingBox": [886, + 1048, 1030, 1047, 1029, 1084, 886, 1084], "confidence": 0.997, "span": {"offset": + 463, "length": 8}}, {"content": "Unit", "boundingBox": [1112, 1047, 1175, + 1047, 1175, 1078, 1111, 1078], "confidence": 0.992, "span": {"offset": 472, + "length": 4}}, {"content": "Price", "boundingBox": [1181, 1047, 1263, 1048, + 1262, 1078, 1181, 1078], "confidence": 0.995, "span": {"offset": 477, "length": + 5}}, {"content": "Total", "boundingBox": [1382, 1047, 1468, 1047, 1468, 1077, + 1382, 1077], "confidence": 0.995, "span": {"offset": 483, "length": 5}}, {"content": + "Bindings", "boundingBox": [172, 1094, 279, 1097, 279, 1123, 173, 1122], "confidence": + 0.993, "span": {"offset": 489, "length": 8}}, {"content": "20", "boundingBox": + [859, 1094, 887, 1094, 887, 1119, 859, 1119], "confidence": 0.997, "span": + {"offset": 498, "length": 2}}, {"content": "1.00", "boundingBox": [1240, 1095, + 1290, 1094, 1291, 1117, 1240, 1118], "confidence": 0.988, "span": {"offset": + 501, "length": 4}}, {"content": "20.00", "boundingBox": [1458, 1096, 1526, + 1095, 1525, 1120, 1459, 1119], "confidence": 0.995, "span": {"offset": 506, + "length": 5}}, {"content": "Covers", "boundingBox": [170, 1136, 251, 1136, + 251, 1161, 170, 1161], "confidence": 0.995, "span": {"offset": 512, "length": + 6}}, {"content": "Small", "boundingBox": [256, 1136, 332, 1135, 331, 1161, + 256, 1161], "confidence": 0.995, "span": {"offset": 519, "length": 5}}, {"content": + "20", "boundingBox": [859, 1135, 889, 1135, 889, 1160, 859, 1160], "confidence": + 0.997, "span": {"offset": 525, "length": 2}}, {"content": "1.00", "boundingBox": + [1239, 1135, 1290, 1135, 1291, 1160, 1239, 1160], "confidence": 0.984, "span": + {"offset": 528, "length": 4}}, {"content": "20.00", "boundingBox": [1458, + 1135, 1526, 1135, 1526, 1160, 1458, 1160], "confidence": 0.995, "span": {"offset": + 533, "length": 5}}, {"content": "Feather", "boundingBox": [173, 1180, 265, + 1179, 265, 1206, 174, 1206], "confidence": 0.997, "span": {"offset": 539, + "length": 7}}, {"content": "Bookmark", "boundingBox": [270, 1179, 399, 1178, + 400, 1206, 271, 1206], "confidence": 0.997, "span": {"offset": 547, "length": + 8}}, {"content": "20", "boundingBox": [860, 1179, 888, 1179, 888, 1204, 860, + 1203], "confidence": 0.995, "span": {"offset": 556, "length": 2}}, {"content": + "5.00", "boundingBox": [1239, 1179, 1290, 1178, 1291, 1203, 1239, 1204], "confidence": + 0.994, "span": {"offset": 559, "length": 4}}, {"content": "100.00", "boundingBox": + [1443, 1181, 1525, 1180, 1525, 1204, 1443, 1205], "confidence": 0.067, "span": + {"offset": 564, "length": 6}}, {"content": "Copper", "boundingBox": [170, + 1223, 257, 1222, 257, 1253, 170, 1253], "confidence": 0.995, "span": {"offset": + 571, "length": 6}}, {"content": "Swirl", "boundingBox": [263, 1222, 325, 1222, + 325, 1251, 262, 1252], "confidence": 0.995, "span": {"offset": 578, "length": + 5}}, {"content": "Marker", "boundingBox": [331, 1222, 429, 1223, 429, 1248, + 330, 1251], "confidence": 0.997, "span": {"offset": 584, "length": 6}}, {"content": + "20", "boundingBox": [860, 1223, 887, 1223, 887, 1247, 860, 1247], "confidence": + 0.997, "span": {"offset": 591, "length": 2}}, {"content": "5.00", "boundingBox": + [1239, 1221, 1291, 1221, 1291, 1247, 1239, 1247], "confidence": 0.988, "span": + {"offset": 594, "length": 4}}, {"content": "100.00", "boundingBox": [1444, + 1224, 1525, 1223, 1524, 1247, 1444, 1248], "confidence": 0.995, "span": {"offset": + 599, "length": 6}}, {"content": "SUBTOTAL", "boundingBox": [1147, 1575, 1293, + 1575, 1293, 1600, 1147, 1600], "confidence": 0.993, "span": {"offset": 606, + "length": 8}}, {"content": "$140.00", "boundingBox": [1426, 1572, 1526, 1572, + 1525, 1597, 1427, 1599], "confidence": 0.993, "span": {"offset": 615, "length": + 7}}, {"content": "TAX", "boundingBox": [1236, 1618, 1288, 1618, 1288, 1643, + 1236, 1643], "confidence": 0.994, "span": {"offset": 623, "length": 3}}, {"content": + "$4.00", "boundingBox": [1458, 1615, 1529, 1615, 1529, 1642, 1458, 1643], + "confidence": 0.988, "span": {"offset": 627, "length": 5}}, {"content": "Bernie", + "boundingBox": [484, 1671, 595, 1671, 595, 1706, 484, 1706], "confidence": + 0.997, "span": {"offset": 633, "length": 6}}, {"content": "Sanders", "boundingBox": + [602, 1671, 762, 1670, 763, 1708, 602, 1706], "confidence": 0.997, "span": + {"offset": 640, "length": 7}}, {"content": "TOTAL", "boundingBox": [1204, + 1674, 1292, 1674, 1292, 1699, 1205, 1699], "confidence": 0.994, "span": {"offset": + 648, "length": 5}}, {"content": "$144.00", "boundingBox": [1427, 1671, 1527, + 1669, 1527, 1697, 1429, 1698], "confidence": 0.983, "span": {"offset": 654, + "length": 7}}, {"content": "Bernie", "boundingBox": [542, 1719, 614, 1719, + 615, 1742, 544, 1742], "confidence": 0.995, "span": {"offset": 662, "length": + 6}}, {"content": "Sanders", "boundingBox": [618, 1719, 716, 1719, 716, 1743, + 619, 1742], "confidence": 0.997, "span": {"offset": 669, "length": 7}}, {"content": + "Manager", "boundingBox": [577, 1754, 681, 1756, 680, 1778, 578, 1776], "confidence": + 0.994, "span": {"offset": 677, "length": 7}}, {"content": "Additional", "boundingBox": + [173, 1796, 350, 1796, 349, 1832, 173, 1831], "confidence": 0.993, "span": + {"offset": 685, "length": 10}}, {"content": "Notes:", "boundingBox": [357, + 1796, 478, 1797, 477, 1833, 356, 1832], "confidence": 0.997, "span": {"offset": + 696, "length": 6}}, {"content": "Do", "boundingBox": [175, 1881, 201, 1881, + 202, 1907, 175, 1907], "confidence": 0.988, "span": {"offset": 703, "length": + 2}}, {"content": "not", "boundingBox": [207, 1881, 251, 1880, 252, 1908, 208, + 1907], "confidence": 0.998, "span": {"offset": 706, "length": 3}}, {"content": + "Jostle", "boundingBox": [257, 1880, 330, 1880, 330, 1909, 257, 1908], "confidence": + 0.997, "span": {"offset": 710, "length": 6}}, {"content": "Box.", "boundingBox": + [336, 1880, 397, 1880, 397, 1909, 336, 1909], "confidence": 0.991, "span": + {"offset": 717, "length": 4}}, {"content": "Unpack", "boundingBox": [403, + 1880, 497, 1880, 497, 1910, 403, 1909], "confidence": 0.997, "span": {"offset": + 722, "length": 6}}, {"content": "carefully.", "boundingBox": [503, 1880, 620, + 1880, 620, 1911, 503, 1910], "confidence": 0.996, "span": {"offset": 729, + "length": 10}}, {"content": "Enjoy.", "boundingBox": [626, 1880, 706, 1881, + 706, 1912, 626, 1911], "confidence": 0.995, "span": {"offset": 740, "length": + 6}}, {"content": "Jupiter", "boundingBox": [169, 1924, 265, 1924, 265, 1959, + 169, 1959], "confidence": 0.994, "span": {"offset": 747, "length": 7}}, {"content": + "Book", "boundingBox": [272, 1924, 350, 1924, 351, 1958, 272, 1959], "confidence": + 0.992, "span": {"offset": 755, "length": 4}}, {"content": "Supply", "boundingBox": + [357, 1924, 460, 1924, 460, 1958, 357, 1958], "confidence": 0.995, "span": + {"offset": 760, "length": 6}}, {"content": "will", "boundingBox": [467, 1924, + 516, 1924, 516, 1958, 467, 1958], "confidence": 0.991, "span": {"offset": + 767, "length": 4}}, {"content": "refund", "boundingBox": [523, 1924, 622, + 1924, 621, 1958, 523, 1958], "confidence": 0.997, "span": {"offset": 772, + "length": 6}}, {"content": "you", "boundingBox": [629, 1924, 685, 1924, 684, + 1958, 628, 1958], "confidence": 0.998, "span": {"offset": 779, "length": 3}}, + {"content": "50%", "boundingBox": [691, 1924, 761, 1924, 760, 1958, 691, 1958], + "confidence": 0.988, "span": {"offset": 783, "length": 3}}, {"content": "per", + "boundingBox": [768, 1924, 819, 1924, 819, 1958, 767, 1958], "confidence": + 0.998, "span": {"offset": 787, "length": 3}}, {"content": "book", "boundingBox": + [826, 1924, 900, 1924, 899, 1958, 825, 1958], "confidence": 0.992, "span": + {"offset": 791, "length": 4}}, {"content": "if", "boundingBox": [907, 1924, + 927, 1924, 926, 1958, 906, 1958], "confidence": 0.999, "span": {"offset": + 796, "length": 2}}, {"content": "returned", "boundingBox": [933, 1924, 1059, + 1924, 1058, 1958, 933, 1958], "confidence": 0.996, "span": {"offset": 799, + "length": 8}}, {"content": "within", "boundingBox": [1066, 1924, 1153, 1924, + 1152, 1958, 1065, 1958], "confidence": 0.997, "span": {"offset": 808, "length": + 6}}, {"content": "60", "boundingBox": [1160, 1924, 1200, 1924, 1199, 1958, + 1159, 1958], "confidence": 0.999, "span": {"offset": 815, "length": 2}}, {"content": + "days", "boundingBox": [1207, 1924, 1279, 1924, 1278, 1958, 1206, 1958], "confidence": + 0.992, "span": {"offset": 818, "length": 4}}, {"content": "of", "boundingBox": + [1286, 1924, 1317, 1924, 1316, 1958, 1284, 1958], "confidence": 0.997, "span": + {"offset": 823, "length": 2}}, {"content": "reading", "boundingBox": [1324, + 1924, 1438, 1924, 1437, 1958, 1322, 1958], "confidence": 0.997, "span": {"offset": + 826, "length": 7}}, {"content": "and", "boundingBox": [1445, 1924, 1505, 1924, + 1504, 1958, 1443, 1958], "confidence": 0.998, "span": {"offset": 834, "length": + 3}}, {"content": "offer", "boundingBox": [169, 1958, 231, 1958, 231, 1991, + 169, 1991], "confidence": 0.993, "span": {"offset": 838, "length": 5}}, {"content": + "you", "boundingBox": [237, 1958, 295, 1958, 295, 1992, 237, 1991], "confidence": + 0.989, "span": {"offset": 844, "length": 3}}, {"content": "25%", "boundingBox": + [303, 1958, 371, 1958, 372, 1992, 303, 1992], "confidence": 0.947, "span": + {"offset": 848, "length": 3}}, {"content": "off", "boundingBox": [378, 1958, + 420, 1958, 420, 1992, 378, 1992], "confidence": 0.998, "span": {"offset": + 852, "length": 3}}, {"content": "you", "boundingBox": [427, 1958, 482, 1958, + 482, 1992, 427, 1992], "confidence": 0.998, "span": {"offset": 856, "length": + 3}}, {"content": "next", "boundingBox": [488, 1958, 554, 1959, 555, 1992, + 489, 1992], "confidence": 0.992, "span": {"offset": 860, "length": 4}}, {"content": + "total", "boundingBox": [561, 1959, 627, 1959, 627, 1991, 561, 1992], "confidence": + 0.994, "span": {"offset": 865, "length": 5}}, {"content": "purchase.", "boundingBox": + [633, 1959, 786, 1961, 787, 1990, 633, 1991], "confidence": 0.996, "span": + {"offset": 871, "length": 9}}], "selectionMarks": [], "lines": [{"content": + "Purchase Order", "boundingBox": [136, 139, 351, 138, 351, 166, 136, 166], + "spans": [{"offset": 0, "length": 14}]}, {"content": "Hero Limited", "boundingBox": + [620, 205, 1074, 204, 1075, 265, 620, 266], "spans": [{"offset": 15, "length": + 12}]}, {"content": "Purchase Order", "boundingBox": [1112, 321, 1554, 321, + 1554, 369, 1112, 369], "spans": [{"offset": 28, "length": 14}]}, {"content": + "Company Phone: 555-348-6512", "boundingBox": [163, 352, 528, 350, 528, 376, + 163, 379], "spans": [{"offset": 43, "length": 27}]}, {"content": "Website: + www.herolimited.com", "boundingBox": [166, 393, 533, 393, 533, 418, 166, 418], + "spans": [{"offset": 71, "length": 28}]}, {"content": "Email:", "boundingBox": + [165, 435, 237, 435, 237, 460, 165, 460], "spans": [{"offset": 100, "length": + 6}]}, {"content": "Dated As: 12/20/2020", "boundingBox": [1024, 419, 1317, + 420, 1317, 448, 1024, 448], "spans": [{"offset": 107, "length": 20}]}, {"content": + "accounts@herolimited.com", "boundingBox": [164, 479, 482, 478, 483, 502, + 164, 503], "spans": [{"offset": 128, "length": 24}]}, {"content": "Purchase + Order #: 948284", "boundingBox": [1023, 461, 1376, 461, 1376, 489, 1023, 488], + "spans": [{"offset": 153, "length": 24}]}, {"content": "Shipped To", "boundingBox": + [167, 547, 397, 546, 397, 591, 167, 592], "spans": [{"offset": 178, "length": + 10}]}, {"content": "Vendor Name: Hillary Swank", "boundingBox": [159, 609, + 520, 609, 520, 638, 159, 638], "spans": [{"offset": 189, "length": 26}]}, + {"content": "Company Name: Higgly Wiggly Books", "boundingBox": [159, 647, + 629, 646, 629, 677, 160, 679], "spans": [{"offset": 216, "length": 33}]}, + {"content": "Address: 938 NE Burner Road", "boundingBox": [160, 684, 526, + 684, 526, 712, 160, 711], "spans": [{"offset": 250, "length": 27}]}, {"content": + "Boulder City, CO 92848", "boundingBox": [279, 722, 566, 721, 566, 750, 279, + 751], "spans": [{"offset": 278, "length": 22}]}, {"content": "Phone: 938-294-2949", + "boundingBox": [612, 721, 885, 721, 885, 747, 612, 748], "spans": [{"offset": + 301, "length": 19}]}, {"content": "Shipped From", "boundingBox": [167, 784, + 453, 784, 453, 829, 167, 830], "spans": [{"offset": 321, "length": 12}]}, + {"content": "Name: Bernie Sanders", "boundingBox": [165, 852, 445, 851, 445, + 878, 165, 879], "spans": [{"offset": 334, "length": 20}]}, {"content": "Company + Name: Jupiter Book Supply", "boundingBox": [164, 889, 629, 889, 629, 919, + 164, 919], "spans": [{"offset": 355, "length": 33}]}, {"content": "Address: + 383 N Kinnick Road", "boundingBox": [165, 925, 521, 926, 521, 953, 165, 952], + "spans": [{"offset": 389, "length": 27}]}, {"content": "Seattle, WA 38383", + "boundingBox": [280, 963, 514, 962, 514, 990, 281, 991], "spans": [{"offset": + 417, "length": 17}]}, {"content": "Phone: 932-299-0292", "boundingBox": [760, + 963, 1032, 963, 1032, 989, 760, 990], "spans": [{"offset": 435, "length": + 19}]}, {"content": "Details", "boundingBox": [446, 1047, 558, 1047, 558, 1077, + 446, 1077], "spans": [{"offset": 455, "length": 7}]}, {"content": "Quantity", + "boundingBox": [885, 1047, 1034, 1047, 1034, 1083, 886, 1083], "spans": [{"offset": + 463, "length": 8}]}, {"content": "Unit Price", "boundingBox": [1111, 1047, + 1270, 1047, 1269, 1078, 1111, 1077], "spans": [{"offset": 472, "length": 10}]}, + {"content": "Total", "boundingBox": [1382, 1047, 1468, 1047, 1467, 1077, 1382, + 1077], "spans": [{"offset": 483, "length": 5}]}, {"content": "Bindings", "boundingBox": + [172, 1093, 279, 1095, 279, 1123, 172, 1121], "spans": [{"offset": 489, "length": + 8}]}, {"content": "20", "boundingBox": [859, 1094, 893, 1094, 893, 1119, 859, + 1119], "spans": [{"offset": 498, "length": 2}]}, {"content": "1.00", "boundingBox": + [1240, 1096, 1295, 1094, 1294, 1118, 1241, 1118], "spans": [{"offset": 501, + "length": 4}]}, {"content": "20.00", "boundingBox": [1458, 1095, 1530, 1095, + 1530, 1119, 1458, 1119], "spans": [{"offset": 506, "length": 5}]}, {"content": + "Covers Small", "boundingBox": [169, 1135, 332, 1134, 333, 1160, 169, 1161], + "spans": [{"offset": 512, "length": 12}]}, {"content": "20", "boundingBox": + [859, 1135, 894, 1135, 891, 1160, 860, 1160], "spans": [{"offset": 525, "length": + 2}]}, {"content": "1.00", "boundingBox": [1239, 1135, 1295, 1135, 1294, 1159, + 1239, 1160], "spans": [{"offset": 528, "length": 4}]}, {"content": "20.00", + "boundingBox": [1458, 1135, 1530, 1135, 1530, 1159, 1459, 1160], "spans": + [{"offset": 533, "length": 5}]}, {"content": "Feather Bookmark", "boundingBox": + [173, 1178, 403, 1177, 403, 1205, 173, 1206], "spans": [{"offset": 539, "length": + 16}]}, {"content": "20", "boundingBox": [860, 1179, 892, 1179, 891, 1204, + 860, 1203], "spans": [{"offset": 556, "length": 2}]}, {"content": "5.00", + "boundingBox": [1239, 1179, 1295, 1178, 1295, 1203, 1239, 1204], "spans": + [{"offset": 559, "length": 4}]}, {"content": "100.00", "boundingBox": [1442, + 1180, 1530, 1180, 1530, 1203, 1443, 1204], "spans": [{"offset": 564, "length": + 6}]}, {"content": "Copper Swirl Marker", "boundingBox": [169, 1223, 429, 1222, + 430, 1249, 169, 1253], "spans": [{"offset": 571, "length": 19}]}, {"content": + "20", "boundingBox": [860, 1223, 893, 1223, 893, 1247, 860, 1247], "spans": + [{"offset": 591, "length": 2}]}, {"content": "5.00", "boundingBox": [1239, + 1221, 1294, 1222, 1294, 1246, 1239, 1247], "spans": [{"offset": 594, "length": + 4}]}, {"content": "100.00", "boundingBox": [1443, 1223, 1530, 1222, 1530, + 1246, 1444, 1247], "spans": [{"offset": 599, "length": 6}]}, {"content": "SUBTOTAL", + "boundingBox": [1146, 1573, 1296, 1573, 1296, 1600, 1146, 1600], "spans": + [{"offset": 606, "length": 8}]}, {"content": "$140.00", "boundingBox": [1426, + 1571, 1530, 1571, 1530, 1597, 1426, 1598], "spans": [{"offset": 615, "length": + 7}]}, {"content": "TAX", "boundingBox": [1236, 1618, 1296, 1618, 1295, 1643, + 1236, 1643], "spans": [{"offset": 623, "length": 3}]}, {"content": "$4.00", + "boundingBox": [1458, 1615, 1529, 1615, 1528, 1641, 1458, 1643], "spans": + [{"offset": 627, "length": 5}]}, {"content": "Bernie Sanders", "boundingBox": + [484, 1670, 764, 1670, 764, 1707, 484, 1706], "spans": [{"offset": 633, "length": + 14}]}, {"content": "TOTAL", "boundingBox": [1203, 1673, 1297, 1673, 1297, + 1698, 1204, 1699], "spans": [{"offset": 648, "length": 5}]}, {"content": "$144.00", + "boundingBox": [1427, 1670, 1529, 1669, 1530, 1696, 1427, 1697], "spans": + [{"offset": 654, "length": 7}]}, {"content": "Bernie Sanders", "boundingBox": + [542, 1718, 718, 1719, 718, 1742, 542, 1741], "spans": [{"offset": 662, "length": + 14}]}, {"content": "Manager", "boundingBox": [577, 1753, 681, 1755, 681, 1778, + 577, 1776], "spans": [{"offset": 677, "length": 7}]}, {"content": "Additional + Notes:", "boundingBox": [172, 1796, 478, 1796, 478, 1832, 172, 1831], "spans": + [{"offset": 685, "length": 17}]}, {"content": "Do not Jostle Box. Unpack carefully. + Enjoy.", "boundingBox": [174, 1879, 707, 1880, 707, 1911, 174, 1908], "spans": + [{"offset": 703, "length": 43}]}, {"content": "Jupiter Book Supply will refund + you 50% per book if returned within 60 days of reading and", "boundingBox": + [168, 1923, 1510, 1923, 1510, 1957, 168, 1958], "spans": [{"offset": 747, + "length": 90}]}, {"content": "offer you 25% off you next total purchase.", + "boundingBox": [168, 1957, 786, 1958, 786, 1991, 168, 1991], "spans": [{"offset": + 838, "length": 42}]}], "spans": [{"offset": 0, "length": 880}]}], "tables": + [{"rowCount": 5, "columnCount": 4, "cells": [{"kind": "columnHeader", "rowIndex": + 0, "columnIndex": 0, "rowSpan": 1, "columnSpan": 1, "content": "Details", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [157, 1037, 847, 1038, + 847, 1086, 155, 1086]}], "spans": [{"offset": 455, "length": 7}]}, {"kind": + "columnHeader", "rowIndex": 0, "columnIndex": 1, "rowSpan": 1, "columnSpan": + 1, "content": "Quantity", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [847, 1038, 1069, 1038, 1070, 1086, 847, 1086]}], "spans": [{"offset": 463, + "length": 8}]}, {"kind": "columnHeader", "rowIndex": 0, "columnIndex": 2, + "rowSpan": 1, "columnSpan": 1, "content": "Unit Price", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1069, 1038, 1309, 1038, 1309, 1086, 1070, + 1086]}], "spans": [{"offset": 472, "length": 10}]}, {"kind": "columnHeader", + "rowIndex": 0, "columnIndex": 3, "rowSpan": 1, "columnSpan": 1, "content": + "Total", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1309, 1038, + 1543, 1038, 1543, 1086, 1309, 1086]}], "spans": [{"offset": 483, "length": + 5}]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": 1, "columnSpan": 1, "content": + "Bindings", "boundingRegions": [{"pageNumber": 1, "boundingBox": [155, 1086, + 847, 1086, 847, 1127, 155, 1127]}], "spans": [{"offset": 489, "length": 8}]}, + {"rowIndex": 1, "columnIndex": 1, "rowSpan": 1, "columnSpan": 1, "content": + "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [847, 1086, 1070, + 1086, 1070, 1127, 847, 1127]}], "spans": [{"offset": 498, "length": 2}]}, + {"rowIndex": 1, "columnIndex": 2, "rowSpan": 1, "columnSpan": 1, "content": + "1.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1070, 1086, + 1309, 1086, 1309, 1127, 1070, 1127]}], "spans": [{"offset": 501, "length": + 4}]}, {"rowIndex": 1, "columnIndex": 3, "rowSpan": 1, "columnSpan": 1, "content": + "20.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1309, 1086, + 1543, 1086, 1543, 1127, 1309, 1127]}], "spans": [{"offset": 506, "length": + 5}]}, {"rowIndex": 2, "columnIndex": 0, "rowSpan": 1, "columnSpan": 1, "content": + "Covers Small", "boundingRegions": [{"pageNumber": 1, "boundingBox": [155, + 1127, 847, 1127, 847, 1171, 155, 1171]}], "spans": [{"offset": 512, "length": + 12}]}, {"rowIndex": 2, "columnIndex": 1, "rowSpan": 1, "columnSpan": 1, "content": + "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [847, 1127, 1070, + 1127, 1070, 1171, 847, 1171]}], "spans": [{"offset": 525, "length": 2}]}, + {"rowIndex": 2, "columnIndex": 2, "rowSpan": 1, "columnSpan": 1, "content": + "1.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1070, 1127, + 1309, 1127, 1309, 1171, 1070, 1171]}], "spans": [{"offset": 528, "length": + 4}]}, {"rowIndex": 2, "columnIndex": 3, "rowSpan": 1, "columnSpan": 1, "content": + "20.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1309, 1127, + 1543, 1127, 1543, 1171, 1309, 1171]}], "spans": [{"offset": 533, "length": + 5}]}, {"rowIndex": 3, "columnIndex": 0, "rowSpan": 1, "columnSpan": 1, "content": + "Feather Bookmark", "boundingRegions": [{"pageNumber": 1, "boundingBox": [155, + 1171, 847, 1171, 847, 1214, 155, 1214]}], "spans": [{"offset": 539, "length": + 16}]}, {"rowIndex": 3, "columnIndex": 1, "rowSpan": 1, "columnSpan": 1, "content": + "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [847, 1171, 1070, + 1171, 1070, 1214, 847, 1214]}], "spans": [{"offset": 556, "length": 2}]}, + {"rowIndex": 3, "columnIndex": 2, "rowSpan": 1, "columnSpan": 1, "content": + "5.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1070, 1171, + 1309, 1171, 1309, 1214, 1070, 1214]}], "spans": [{"offset": 559, "length": + 4}]}, {"rowIndex": 3, "columnIndex": 3, "rowSpan": 1, "columnSpan": 1, "content": + "100.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1309, 1171, + 1543, 1171, 1543, 1215, 1309, 1214]}], "spans": [{"offset": 564, "length": + 6}]}, {"rowIndex": 4, "columnIndex": 0, "rowSpan": 1, "columnSpan": 1, "content": + "Copper Swirl Marker", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [155, 1214, 847, 1214, 847, 1258, 155, 1258]}], "spans": [{"offset": 571, + "length": 19}]}, {"rowIndex": 4, "columnIndex": 1, "rowSpan": 1, "columnSpan": + 1, "content": "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [847, + 1214, 1070, 1214, 1070, 1258, 847, 1258]}], "spans": [{"offset": 591, "length": + 2}]}, {"rowIndex": 4, "columnIndex": 2, "rowSpan": 1, "columnSpan": 1, "content": + "5.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1070, 1214, + 1309, 1214, 1309, 1258, 1070, 1258]}], "spans": [{"offset": 594, "length": + 4}]}, {"rowIndex": 4, "columnIndex": 3, "rowSpan": 1, "columnSpan": 1, "content": + "100.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1309, 1214, + 1543, 1215, 1543, 1260, 1309, 1258]}], "spans": [{"offset": 599, "length": + 6}]}], "boundingRegions": [{"pageNumber": 1, "boundingBox": [153, 1036, 1548, + 1036, 1547, 1265, 153, 1265]}], "spans": [{"offset": 455, "length": 150}]}, + {"rowCount": 4, "columnCount": 2, "cells": [{"kind": "columnHeader", "rowIndex": + 0, "columnIndex": 0, "rowSpan": 1, "columnSpan": 1, "content": "SUBTOTAL", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [1070, 1565, 1309, 1565, + 1309, 1609, 1071, 1609]}], "spans": [{"offset": 606, "length": 8}]}, {"kind": + "columnHeader", "rowIndex": 0, "columnIndex": 1, "rowSpan": 1, "columnSpan": + 1, "content": "$140.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1309, 1565, 1544, 1564, 1544, 1609, 1309, 1609]}], "spans": [{"offset": 615, + "length": 7}]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": 1, "columnSpan": + 1, "content": "TAX", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1071, 1609, 1309, 1609, 1309, 1652, 1071, 1652]}], "spans": [{"offset": 623, + "length": 3}]}, {"rowIndex": 1, "columnIndex": 1, "rowSpan": 1, "columnSpan": + 1, "content": "$4.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1309, 1609, 1544, 1609, 1544, 1652, 1309, 1652]}], "spans": [{"offset": 627, + "length": 5}]}, {"rowIndex": 2, "columnIndex": 0, "rowSpan": 1, "columnSpan": + 1, "content": "", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1071, + 1652, 1309, 1652, 1309, 1664, 1071, 1664]}], "spans": []}, {"rowIndex": 2, + "columnIndex": 1, "rowSpan": 1, "columnSpan": 1, "content": "", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1309, 1652, 1544, 1652, 1544, 1664, 1309, + 1664]}], "spans": []}, {"rowIndex": 3, "columnIndex": 0, "rowSpan": 1, "columnSpan": + 1, "content": "TOTAL", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1071, 1664, 1309, 1664, 1309, 1707, 1071, 1706]}], "spans": [{"offset": 648, + "length": 5}]}, {"rowIndex": 3, "columnIndex": 1, "rowSpan": 1, "columnSpan": + 1, "content": "$144.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1309, 1664, 1544, 1664, 1544, 1707, 1309, 1707]}], "spans": [{"offset": 654, + "length": 7}]}], "boundingRegions": [{"pageNumber": 1, "boundingBox": [1062, + 1563, 1560, 1563, 1560, 1709, 1062, 1709]}], "spans": [{"offset": 606, "length": + 26}, {"offset": 648, "length": 13}]}], "styles": [{"isHandwritten": true, + "confidence": 0.9, "spans": [{"offset": 633, "length": 14}]}], "documents": + [{"docType": "prebuilt:invoice", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [0, 0, 1700, 0, 1700, 2200, 0, 2200]}], "fields": {"InvoiceDate": {"type": + "date", "valueDate": "2020-12-20", "content": "12/20/2020", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1162, 420, 1312, 421, 1312, 449, 1162, + 448]}], "confidence": 0.747, "spans": [{"offset": 117, "length": 10}]}, "InvoiceId": + {"type": "string", "valueString": "948284", "content": "948284", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1275, 461, 1373, 462, 1373, 489, 1275, + 489]}], "confidence": 0.367, "spans": [{"offset": 171, "length": 6}]}, "InvoiceTotal": + {"type": "number", "valueNumber": 144, "content": "$144.00", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1427, 1671, 1527, 1669, 1527, 1697, 1429, + 1698]}], "confidence": 0.989, "spans": [{"offset": 654, "length": 7}]}, "Items": + {"type": "array", "valueArray": [{"type": "object", "valueObject": {"Amount": + {"type": "number", "valueNumber": 20, "content": "20.00", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1458, 1096, 1526, 1095, 1525, 1120, 1459, + 1119]}], "confidence": 0.903, "spans": [{"offset": 506, "length": 5}]}, "Description": + {"type": "string", "valueString": "Bindings", "content": "Bindings", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [172, 1094, 279, 1097, 279, 1123, 173, 1122]}], + "confidence": 0.955, "spans": [{"offset": 489, "length": 8}]}, "Quantity": + {"type": "number", "valueNumber": 20, "content": "20", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [859, 1094, 887, 1094, 887, 1119, 859, 1119]}], + "confidence": 0.883, "spans": [{"offset": 498, "length": 2}]}, "UnitPrice": + {"type": "number", "valueNumber": 1, "content": "1.00", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1240, 1095, 1290, 1094, 1291, 1117, 1240, + 1118]}], "confidence": 0.864, "spans": [{"offset": 501, "length": 4}]}}, "content": + "Bindings 20 1.00 20.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [172, 1094, 1526, 1094, 1526, 1123, 172, 1123]}], "confidence": 0.88, "spans": + [{"offset": 489, "length": 22}]}, {"type": "object", "valueObject": {"Amount": + {"type": "number", "valueNumber": 20, "content": "20.00", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1458, 1135, 1526, 1135, 1526, 1160, 1458, + 1160]}], "confidence": 0.903, "spans": [{"offset": 533, "length": 5}]}, "Description": + {"type": "string", "valueString": "Covers Small", "content": "Covers Small", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [170, 1135, 332, 1135, + 332, 1161, 170, 1161]}], "confidence": 0.9, "spans": [{"offset": 512, "length": + 12}]}, "Quantity": {"type": "number", "valueNumber": 20, "content": "20", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [859, 1135, 889, 1135, + 889, 1160, 859, 1160]}], "confidence": 0.88, "spans": [{"offset": 525, "length": + 2}]}, "UnitPrice": {"type": "number", "valueNumber": 1, "content": "1.00", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [1239, 1135, 1290, 1135, + 1291, 1160, 1239, 1160]}], "confidence": 0.833, "spans": [{"offset": 528, + "length": 4}]}}, "content": "Covers Small 20 1.00 20.00", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [170, 1135, 1526, 1135, 1526, 1161, 170, + 1161]}], "confidence": 0.882, "spans": [{"offset": 512, "length": 26}]}, {"type": + "object", "valueObject": {"Amount": {"type": "number", "valueNumber": 100, + "content": "100.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1443, 1181, 1525, 1180, 1525, 1204, 1443, 1205]}], "confidence": 0.903, "spans": + [{"offset": 564, "length": 6}]}, "Description": {"type": "string", "valueString": + "Feather Bookmark", "content": "Feather Bookmark", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [173, 1179, 400, 1178, 400, 1206, 173, 1207]}], "confidence": + 0.9, "spans": [{"offset": 539, "length": 16}]}, "Quantity": {"type": "number", + "valueNumber": 20, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [860, 1179, 888, 1179, 888, 1204, 860, 1203]}], "confidence": + 0.898, "spans": [{"offset": 556, "length": 2}]}, "UnitPrice": {"type": "number", + "valueNumber": 5, "content": "5.00", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [1239, 1179, 1290, 1178, 1291, 1203, 1239, 1204]}], "confidence": + 0.873, "spans": [{"offset": 559, "length": 4}]}}, "content": "Feather Bookmark + 20 5.00 100.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [173, + 1179, 1525, 1172, 1525, 1205, 173, 1212]}], "confidence": 0.886, "spans": + [{"offset": 539, "length": 31}]}, {"type": "object", "valueObject": {"Amount": + {"type": "number", "valueNumber": 100, "content": "100.00", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1444, 1224, 1525, 1223, 1524, 1247, 1444, + 1248]}], "confidence": 0.961, "spans": [{"offset": 599, "length": 6}]}, "Description": + {"type": "string", "valueString": "Copper Swirl Marker", "content": "Copper + Swirl Marker", "boundingRegions": [{"pageNumber": 1, "boundingBox": [170, + 1223, 429, 1221, 429, 1252, 170, 1254]}], "confidence": 0.899, "spans": [{"offset": + 571, "length": 19}]}, "Quantity": {"type": "number", "valueNumber": 20, "content": + "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [860, 1223, 887, + 1223, 887, 1247, 860, 1247]}], "confidence": 0.899, "spans": [{"offset": 591, + "length": 2}]}, "UnitPrice": {"type": "number", "valueNumber": 5, "content": + "5.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1239, 1221, + 1291, 1221, 1291, 1247, 1239, 1247]}], "confidence": 0.888, "spans": [{"offset": + 594, "length": 4}]}}, "content": "Copper Swirl Marker 20 5.00 100.00", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [170, 1223, 1525, 1215, 1525, 1248, 170, + 1255]}], "confidence": 0.91, "spans": [{"offset": 571, "length": 34}]}]}, + "Locale": {"type": "string", "valueString": "en-US", "confidence": 1}, "SubTotal": + {"type": "number", "valueNumber": 140, "content": "$140.00", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1426, 1572, 1526, 1572, 1525, 1597, 1427, + 1599]}], "confidence": 0.989, "spans": [{"offset": 615, "length": 7}]}, "TotalTax": + {"type": "number", "valueNumber": 4, "content": "$4.00", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1458, 1615, 1529, 1615, 1529, 1642, 1458, + 1643]}], "confidence": 0.989, "spans": [{"offset": 627, "length": 5}]}, "VendorAddress": + {"type": "string", "valueString": "383 N Kinnick Road Seattle, WA 38383", + "content": "383 N Kinnick Road Seattle, WA 38383", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [276, 925, 516, 925, 516, 991, 276, 991]}], "confidence": + 0.946, "spans": [{"offset": 398, "length": 36}]}, "VendorAddressRecipient": + {"type": "string", "valueString": "Jupiter Book Supply", "content": "Jupiter + Book Supply", "boundingRegions": [{"pageNumber": 1, "boundingBox": [377, 888, + 628, 890, 628, 921, 377, 919]}], "confidence": 0.784, "spans": [{"offset": + 369, "length": 19}]}, "VendorName": {"type": "string", "valueString": "Hillary + Swank Higgly Wiggly Books", "content": "Hillary Swank Higgly Wiggly Books", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [346, 609, 628, 607, + 628, 678, 346, 680]}], "confidence": 0.747, "spans": [{"offset": 202, "length": + 13}, {"offset": 230, "length": 19}]}}, "confidence": 1, "spans": [{"offset": + 0, "length": 880}]}]}}' + headers: + apim-request-id: + - 04d3be80-c24d-43c9-9962-bbb69d2aafc1 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 25 Oct 2021 17:43:13 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '383' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_key_value_pair_get_children.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_key_value_pair_get_children.yaml new file mode 100644 index 000000000000..8fc7799c4bc6 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_key_value_pair_get_children.yaml @@ -0,0 +1,703 @@ +interactions: +- request: + body: '!!! The request body has been omitted from the recording because its size + 479269 is larger than 128KB. !!!' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '479269' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document:analyze?stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview + response: + body: + string: '' + headers: + apim-request-id: + - c74ee61a-8c2a-4488-92ab-72453037f7ad + content-length: + - '0' + date: + - Mon, 25 Oct 2021 17:43:15 GMT + operation-location: + - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/c74ee61a-8c2a-4488-92ab-72453037f7ad?api-version=2021-09-30-preview + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '543' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/c74ee61a-8c2a-4488-92ab-72453037f7ad?api-version=2021-09-30-preview + response: + body: + string: '{"status": "succeeded", "createdDateTime": "2021-10-25T17:43:15Z", + "lastUpdatedDateTime": "2021-10-25T17:43:20Z", "analyzeResult": {"apiVersion": + "2021-09-30-preview", "modelId": "prebuilt-document", "stringIndexType": "unicodeCodePoint", + "content": "Purchase Order\nHero Limited\nCompany Phone: 555-348-6512\nWebsite: + www.herolimited.com\nEmail:\nPurchase Order\nDated As: 12/20/2020\nPurchase + Order #: 948284\naccounts@herolimited.com\nShipped To\nVendor Name: Hillary + Swank\nCompany Name: Higgly Wiggly Books\nAddress: 938 NE Burner Road\nBoulder + City, CO 92848\nPhone: 938-294-2949\nShipped From\nName: Bernie Sanders\nCompany + Name: Jupiter Book Supply\nAddress: 383 N Kinnick Road\nSeattle, WA 38383\nPhone: + 932-299-0292\nDetails\nQuantity\nUnit Price\nTotal\nBindings\n20\n1.00\n20.00\nCovers + Small\n20\n1.00\n20.00\nFeather Bookmark\n20\n5.00\n100.00\nCopper Swirl Marker\n20\n5.00\n100.00\nBernie + Sanders\nBernie Sanders\nManager\nAdditional Notes:\nDo not Jostle Box. Unpack + carefully. Enjoy.\nSUBTOTAL\n$140.00\nTAX\n$4.00\nTOTAL\n$144.00\nJupiter + Book Supply will refund you 50% per book if returned within 60 days of reading + and\noffer you 25% off you next total purchase.", "pages": [{"pageNumber": + 1, "angle": 0, "width": 1700, "height": 2200, "unit": "pixel", "words": [{"content": + "Purchase", "boundingBox": [137, 140, 259, 139, 259, 167, 137, 167], "confidence": + 0.997, "span": {"offset": 0, "length": 8}}, {"content": "Order", "boundingBox": + [264, 139, 350, 139, 349, 167, 264, 167], "confidence": 0.995, "span": {"offset": + 9, "length": 5}}, {"content": "Hero", "boundingBox": [621, 208, 769, 206, + 769, 266, 620, 266], "confidence": 0.983, "span": {"offset": 15, "length": + 4}}, {"content": "Limited", "boundingBox": [793, 205, 1058, 204, 1057, 266, + 793, 266], "confidence": 0.997, "span": {"offset": 20, "length": 7}}, {"content": + "Company", "boundingBox": [163, 353, 270, 351, 270, 379, 164, 378], "confidence": + 0.993, "span": {"offset": 28, "length": 7}}, {"content": "Phone:", "boundingBox": + [275, 351, 358, 351, 359, 378, 276, 379], "confidence": 0.997, "span": {"offset": + 36, "length": 6}}, {"content": "555-348-6512", "boundingBox": [363, 351, 524, + 351, 524, 374, 364, 378], "confidence": 0.994, "span": {"offset": 43, "length": + 12}}, {"content": "Website:", "boundingBox": [167, 394, 265, 393, 265, 418, + 167, 417], "confidence": 0.997, "span": {"offset": 56, "length": 8}}, {"content": + "www.herolimited.com", "boundingBox": [270, 393, 522, 393, 522, 418, 270, + 418], "confidence": 0.993, "span": {"offset": 65, "length": 19}}, {"content": + "Email:", "boundingBox": [165, 435, 237, 435, 237, 460, 165, 460], "confidence": + 0.995, "span": {"offset": 85, "length": 6}}, {"content": "Purchase", "boundingBox": + [1113, 322, 1365, 321, 1364, 370, 1113, 368], "confidence": 0.997, "span": + {"offset": 92, "length": 8}}, {"content": "Order", "boundingBox": [1381, 321, + 1549, 321, 1548, 370, 1380, 370], "confidence": 0.995, "span": {"offset": + 101, "length": 5}}, {"content": "Dated", "boundingBox": [1025, 421, 1103, + 420, 1103, 448, 1025, 448], "confidence": 0.993, "span": {"offset": 107, "length": + 5}}, {"content": "As:", "boundingBox": [1110, 420, 1156, 420, 1156, 448, 1110, + 448], "confidence": 0.998, "span": {"offset": 113, "length": 3}}, {"content": + "12/20/2020", "boundingBox": [1162, 420, 1312, 421, 1312, 449, 1162, 448], + "confidence": 0.992, "span": {"offset": 117, "length": 10}}, {"content": "Purchase", + "boundingBox": [1023, 461, 1146, 461, 1147, 489, 1023, 488], "confidence": + 0.997, "span": {"offset": 128, "length": 8}}, {"content": "Order", "boundingBox": + [1152, 461, 1237, 461, 1237, 489, 1152, 489], "confidence": 0.995, "span": + {"offset": 137, "length": 5}}, {"content": "#:", "boundingBox": [1242, 461, + 1270, 461, 1270, 489, 1243, 489], "confidence": 0.997, "span": {"offset": + 143, "length": 2}}, {"content": "948284", "boundingBox": [1275, 461, 1373, + 462, 1373, 489, 1275, 489], "confidence": 0.995, "span": {"offset": 146, "length": + 6}}, {"content": "accounts@herolimited.com", "boundingBox": [164, 481, 471, + 479, 470, 503, 165, 503], "confidence": 0.959, "span": {"offset": 153, "length": + 24}}, {"content": "Shipped", "boundingBox": [167, 547, 328, 547, 327, 592, + 168, 592], "confidence": 0.997, "span": {"offset": 178, "length": 7}}, {"content": + "To", "boundingBox": [337, 547, 392, 547, 391, 591, 336, 592], "confidence": + 0.963, "span": {"offset": 186, "length": 2}}, {"content": "Vendor", "boundingBox": + [160, 611, 250, 610, 250, 638, 160, 637], "confidence": 0.997, "span": {"offset": + 189, "length": 6}}, {"content": "Name:", "boundingBox": [256, 610, 341, 609, + 340, 639, 256, 638], "confidence": 0.995, "span": {"offset": 196, "length": + 5}}, {"content": "Hillary", "boundingBox": [346, 609, 427, 609, 427, 639, + 346, 639], "confidence": 0.997, "span": {"offset": 202, "length": 7}}, {"content": + "Swank", "boundingBox": [433, 609, 518, 610, 517, 639, 433, 639], "confidence": + 0.995, "span": {"offset": 210, "length": 5}}, {"content": "Company", "boundingBox": + [160, 649, 275, 647, 276, 678, 161, 676], "confidence": 0.993, "span": {"offset": + 216, "length": 7}}, {"content": "Name:", "boundingBox": [281, 647, 366, 647, + 366, 679, 282, 678], "confidence": 0.995, "span": {"offset": 224, "length": + 5}}, {"content": "Higgly", "boundingBox": [372, 647, 449, 646, 449, 679, 372, + 679], "confidence": 0.997, "span": {"offset": 230, "length": 6}}, {"content": + "Wiggly", "boundingBox": [455, 646, 541, 646, 541, 678, 455, 679], "confidence": + 0.997, "span": {"offset": 237, "length": 6}}, {"content": "Books", "boundingBox": + [547, 646, 628, 646, 628, 676, 547, 678], "confidence": 0.995, "span": {"offset": + 244, "length": 5}}, {"content": "Address:", "boundingBox": [161, 685, 266, + 685, 265, 712, 160, 711], "confidence": 0.994, "span": {"offset": 250, "length": + 8}}, {"content": "938", "boundingBox": [271, 685, 319, 685, 318, 713, 271, + 712], "confidence": 0.993, "span": {"offset": 259, "length": 3}}, {"content": + "NE", "boundingBox": [324, 685, 360, 685, 359, 713, 323, 713], "confidence": + 0.998, "span": {"offset": 263, "length": 2}}, {"content": "Burner", "boundingBox": + [366, 685, 452, 685, 452, 713, 365, 713], "confidence": 0.997, "span": {"offset": + 266, "length": 6}}, {"content": "Road", "boundingBox": [458, 685, 521, 685, + 521, 713, 457, 713], "confidence": 0.992, "span": {"offset": 273, "length": + 4}}, {"content": "Boulder", "boundingBox": [279, 722, 369, 722, 370, 751, + 280, 750], "confidence": 0.994, "span": {"offset": 278, "length": 7}}, {"content": + "City,", "boundingBox": [375, 722, 431, 722, 432, 751, 376, 751], "confidence": + 0.995, "span": {"offset": 286, "length": 5}}, {"content": "CO", "boundingBox": + [437, 722, 473, 722, 473, 751, 437, 751], "confidence": 0.999, "span": {"offset": + 292, "length": 2}}, {"content": "92848", "boundingBox": [480, 722, 559, 722, + 559, 749, 480, 751], "confidence": 0.995, "span": {"offset": 295, "length": + 5}}, {"content": "Phone:", "boundingBox": [613, 722, 701, 722, 701, 749, 613, + 749], "confidence": 0.997, "span": {"offset": 301, "length": 6}}, {"content": + "938-294-2949", "boundingBox": [706, 722, 882, 722, 881, 748, 706, 749], "confidence": + 0.983, "span": {"offset": 308, "length": 12}}, {"content": "Shipped", "boundingBox": + [167, 784, 324, 785, 324, 830, 169, 830], "confidence": 0.997, "span": {"offset": + 321, "length": 7}}, {"content": "From", "boundingBox": [333, 785, 431, 785, + 431, 827, 333, 830], "confidence": 0.991, "span": {"offset": 329, "length": + 4}}, {"content": "Name:", "boundingBox": [166, 853, 246, 853, 245, 879, 166, + 879], "confidence": 0.994, "span": {"offset": 334, "length": 5}}, {"content": + "Bernie", "boundingBox": [251, 853, 333, 852, 332, 880, 251, 879], "confidence": + 0.997, "span": {"offset": 340, "length": 6}}, {"content": "Sanders", "boundingBox": + [338, 852, 444, 852, 444, 879, 338, 880], "confidence": 0.997, "span": {"offset": + 347, "length": 7}}, {"content": "Company", "boundingBox": [164, 890, 280, + 890, 281, 919, 165, 919], "confidence": 0.994, "span": {"offset": 355, "length": + 7}}, {"content": "Name:", "boundingBox": [285, 890, 372, 889, 372, 919, 286, + 919], "confidence": 0.995, "span": {"offset": 363, "length": 5}}, {"content": + "Jupiter", "boundingBox": [377, 889, 464, 889, 464, 919, 378, 919], "confidence": + 0.997, "span": {"offset": 369, "length": 7}}, {"content": "Book", "boundingBox": + [469, 889, 532, 889, 532, 920, 470, 919], "confidence": 0.992, "span": {"offset": + 377, "length": 4}}, {"content": "Supply", "boundingBox": [538, 889, 628, 890, + 628, 920, 538, 920], "confidence": 0.995, "span": {"offset": 382, "length": + 6}}, {"content": "Address:", "boundingBox": [166, 926, 271, 926, 271, 953, + 166, 953], "confidence": 0.994, "span": {"offset": 389, "length": 8}}, {"content": + "383", "boundingBox": [277, 925, 325, 925, 325, 953, 276, 953], "confidence": + 0.997, "span": {"offset": 398, "length": 3}}, {"content": "N", "boundingBox": + [330, 925, 346, 926, 346, 953, 330, 953], "confidence": 0.995, "span": {"offset": + 402, "length": 1}}, {"content": "Kinnick", "boundingBox": [355, 926, 444, + 926, 444, 954, 355, 953], "confidence": 0.997, "span": {"offset": 404, "length": + 7}}, {"content": "Road", "boundingBox": [450, 926, 516, 927, 515, 954, 449, + 954], "confidence": 0.983, "span": {"offset": 412, "length": 4}}, {"content": + "Seattle,", "boundingBox": [281, 965, 374, 964, 375, 991, 283, 991], "confidence": + 0.996, "span": {"offset": 417, "length": 8}}, {"content": "WA", "boundingBox": + [380, 964, 424, 964, 425, 991, 381, 991], "confidence": 0.998, "span": {"offset": + 426, "length": 2}}, {"content": "38383", "boundingBox": [432, 964, 510, 963, + 511, 990, 432, 991], "confidence": 0.995, "span": {"offset": 429, "length": + 5}}, {"content": "Phone:", "boundingBox": [760, 964, 847, 964, 846, 990, 760, + 990], "confidence": 0.997, "span": {"offset": 435, "length": 6}}, {"content": + "932-299-0292", "boundingBox": [852, 964, 1029, 963, 1028, 990, 851, 990], + "confidence": 0.987, "span": {"offset": 442, "length": 12}}, {"content": "Details", + "boundingBox": [447, 1048, 556, 1048, 555, 1078, 446, 1078], "confidence": + 0.993, "span": {"offset": 455, "length": 7}}, {"content": "Quantity", "boundingBox": + [886, 1048, 1030, 1047, 1029, 1084, 886, 1084], "confidence": 0.997, "span": + {"offset": 463, "length": 8}}, {"content": "Unit", "boundingBox": [1112, 1047, + 1175, 1047, 1175, 1078, 1111, 1078], "confidence": 0.992, "span": {"offset": + 472, "length": 4}}, {"content": "Price", "boundingBox": [1181, 1047, 1263, + 1048, 1262, 1078, 1181, 1078], "confidence": 0.995, "span": {"offset": 477, + "length": 5}}, {"content": "Total", "boundingBox": [1382, 1047, 1468, 1047, + 1468, 1077, 1382, 1077], "confidence": 0.995, "span": {"offset": 483, "length": + 5}}, {"content": "Bindings", "boundingBox": [172, 1094, 279, 1097, 279, 1123, + 173, 1122], "confidence": 0.993, "span": {"offset": 489, "length": 8}}, {"content": + "20", "boundingBox": [859, 1094, 887, 1094, 887, 1119, 859, 1119], "confidence": + 0.997, "span": {"offset": 498, "length": 2}}, {"content": "1.00", "boundingBox": + [1240, 1095, 1290, 1094, 1291, 1117, 1240, 1118], "confidence": 0.988, "span": + {"offset": 501, "length": 4}}, {"content": "20.00", "boundingBox": [1458, + 1096, 1526, 1095, 1525, 1120, 1459, 1119], "confidence": 0.995, "span": {"offset": + 506, "length": 5}}, {"content": "Covers", "boundingBox": [170, 1136, 251, + 1136, 251, 1161, 170, 1161], "confidence": 0.995, "span": {"offset": 512, + "length": 6}}, {"content": "Small", "boundingBox": [256, 1136, 332, 1135, + 331, 1161, 256, 1161], "confidence": 0.995, "span": {"offset": 519, "length": + 5}}, {"content": "20", "boundingBox": [859, 1135, 889, 1135, 889, 1160, 859, + 1160], "confidence": 0.997, "span": {"offset": 525, "length": 2}}, {"content": + "1.00", "boundingBox": [1239, 1135, 1290, 1135, 1291, 1160, 1239, 1160], "confidence": + 0.984, "span": {"offset": 528, "length": 4}}, {"content": "20.00", "boundingBox": + [1458, 1135, 1526, 1135, 1526, 1160, 1458, 1160], "confidence": 0.995, "span": + {"offset": 533, "length": 5}}, {"content": "Feather", "boundingBox": [173, + 1180, 265, 1179, 265, 1206, 174, 1206], "confidence": 0.997, "span": {"offset": + 539, "length": 7}}, {"content": "Bookmark", "boundingBox": [270, 1179, 399, + 1178, 400, 1206, 271, 1206], "confidence": 0.997, "span": {"offset": 547, + "length": 8}}, {"content": "20", "boundingBox": [860, 1179, 888, 1179, 888, + 1204, 860, 1203], "confidence": 0.995, "span": {"offset": 556, "length": 2}}, + {"content": "5.00", "boundingBox": [1239, 1179, 1290, 1178, 1291, 1203, 1239, + 1204], "confidence": 0.994, "span": {"offset": 559, "length": 4}}, {"content": + "100.00", "boundingBox": [1443, 1181, 1525, 1180, 1525, 1204, 1443, 1205], + "confidence": 0.067, "span": {"offset": 564, "length": 6}}, {"content": "Copper", + "boundingBox": [170, 1223, 257, 1222, 257, 1253, 170, 1253], "confidence": + 0.995, "span": {"offset": 571, "length": 6}}, {"content": "Swirl", "boundingBox": + [263, 1222, 325, 1222, 325, 1251, 262, 1252], "confidence": 0.995, "span": + {"offset": 578, "length": 5}}, {"content": "Marker", "boundingBox": [331, + 1222, 429, 1223, 429, 1248, 330, 1251], "confidence": 0.997, "span": {"offset": + 584, "length": 6}}, {"content": "20", "boundingBox": [860, 1223, 887, 1223, + 887, 1247, 860, 1247], "confidence": 0.997, "span": {"offset": 591, "length": + 2}}, {"content": "5.00", "boundingBox": [1239, 1221, 1291, 1221, 1291, 1247, + 1239, 1247], "confidence": 0.988, "span": {"offset": 594, "length": 4}}, {"content": + "100.00", "boundingBox": [1444, 1224, 1525, 1223, 1524, 1247, 1444, 1248], + "confidence": 0.995, "span": {"offset": 599, "length": 6}}, {"content": "Bernie", + "boundingBox": [484, 1671, 595, 1671, 595, 1706, 484, 1706], "confidence": + 0.997, "span": {"offset": 606, "length": 6}}, {"content": "Sanders", "boundingBox": + [602, 1671, 762, 1670, 763, 1708, 602, 1706], "confidence": 0.997, "span": + {"offset": 613, "length": 7}}, {"content": "Bernie", "boundingBox": [542, + 1719, 614, 1719, 615, 1742, 544, 1742], "confidence": 0.995, "span": {"offset": + 621, "length": 6}}, {"content": "Sanders", "boundingBox": [618, 1719, 716, + 1719, 716, 1743, 619, 1742], "confidence": 0.997, "span": {"offset": 628, + "length": 7}}, {"content": "Manager", "boundingBox": [577, 1754, 681, 1756, + 680, 1778, 578, 1776], "confidence": 0.994, "span": {"offset": 636, "length": + 7}}, {"content": "Additional", "boundingBox": [173, 1796, 350, 1796, 349, + 1832, 173, 1831], "confidence": 0.993, "span": {"offset": 644, "length": 10}}, + {"content": "Notes:", "boundingBox": [357, 1796, 478, 1797, 477, 1833, 356, + 1832], "confidence": 0.997, "span": {"offset": 655, "length": 6}}, {"content": + "Do", "boundingBox": [175, 1881, 201, 1881, 202, 1907, 175, 1907], "confidence": + 0.988, "span": {"offset": 662, "length": 2}}, {"content": "not", "boundingBox": + [207, 1881, 251, 1880, 252, 1908, 208, 1907], "confidence": 0.998, "span": + {"offset": 665, "length": 3}}, {"content": "Jostle", "boundingBox": [257, + 1880, 330, 1880, 330, 1909, 257, 1908], "confidence": 0.997, "span": {"offset": + 669, "length": 6}}, {"content": "Box.", "boundingBox": [336, 1880, 397, 1880, + 397, 1909, 336, 1909], "confidence": 0.991, "span": {"offset": 676, "length": + 4}}, {"content": "Unpack", "boundingBox": [403, 1880, 497, 1880, 497, 1910, + 403, 1909], "confidence": 0.997, "span": {"offset": 681, "length": 6}}, {"content": + "carefully.", "boundingBox": [503, 1880, 620, 1880, 620, 1911, 503, 1910], + "confidence": 0.996, "span": {"offset": 688, "length": 10}}, {"content": "Enjoy.", + "boundingBox": [626, 1880, 706, 1881, 706, 1912, 626, 1911], "confidence": + 0.995, "span": {"offset": 699, "length": 6}}, {"content": "SUBTOTAL", "boundingBox": + [1147, 1575, 1293, 1575, 1293, 1600, 1147, 1600], "confidence": 0.993, "span": + {"offset": 706, "length": 8}}, {"content": "$140.00", "boundingBox": [1426, + 1572, 1526, 1572, 1525, 1597, 1427, 1599], "confidence": 0.993, "span": {"offset": + 715, "length": 7}}, {"content": "TAX", "boundingBox": [1236, 1618, 1288, 1618, + 1288, 1643, 1236, 1643], "confidence": 0.994, "span": {"offset": 723, "length": + 3}}, {"content": "$4.00", "boundingBox": [1458, 1615, 1529, 1615, 1529, 1642, + 1458, 1643], "confidence": 0.988, "span": {"offset": 727, "length": 5}}, {"content": + "TOTAL", "boundingBox": [1204, 1674, 1292, 1674, 1292, 1699, 1205, 1699], + "confidence": 0.994, "span": {"offset": 733, "length": 5}}, {"content": "$144.00", + "boundingBox": [1427, 1671, 1527, 1669, 1527, 1697, 1429, 1698], "confidence": + 0.983, "span": {"offset": 739, "length": 7}}, {"content": "Jupiter", "boundingBox": + [169, 1924, 265, 1924, 265, 1959, 169, 1959], "confidence": 0.994, "span": + {"offset": 747, "length": 7}}, {"content": "Book", "boundingBox": [272, 1924, + 350, 1924, 351, 1958, 272, 1959], "confidence": 0.992, "span": {"offset": + 755, "length": 4}}, {"content": "Supply", "boundingBox": [357, 1924, 460, + 1924, 460, 1958, 357, 1958], "confidence": 0.995, "span": {"offset": 760, + "length": 6}}, {"content": "will", "boundingBox": [467, 1924, 516, 1924, 516, + 1958, 467, 1958], "confidence": 0.991, "span": {"offset": 767, "length": 4}}, + {"content": "refund", "boundingBox": [523, 1924, 622, 1924, 621, 1958, 523, + 1958], "confidence": 0.997, "span": {"offset": 772, "length": 6}}, {"content": + "you", "boundingBox": [629, 1924, 685, 1924, 684, 1958, 628, 1958], "confidence": + 0.998, "span": {"offset": 779, "length": 3}}, {"content": "50%", "boundingBox": + [691, 1924, 761, 1924, 760, 1958, 691, 1958], "confidence": 0.988, "span": + {"offset": 783, "length": 3}}, {"content": "per", "boundingBox": [768, 1924, + 819, 1924, 819, 1958, 767, 1958], "confidence": 0.998, "span": {"offset": + 787, "length": 3}}, {"content": "book", "boundingBox": [826, 1924, 900, 1924, + 899, 1958, 825, 1958], "confidence": 0.992, "span": {"offset": 791, "length": + 4}}, {"content": "if", "boundingBox": [907, 1924, 927, 1924, 926, 1958, 906, + 1958], "confidence": 0.999, "span": {"offset": 796, "length": 2}}, {"content": + "returned", "boundingBox": [933, 1924, 1059, 1924, 1058, 1958, 933, 1958], + "confidence": 0.996, "span": {"offset": 799, "length": 8}}, {"content": "within", + "boundingBox": [1066, 1924, 1153, 1924, 1152, 1958, 1065, 1958], "confidence": + 0.997, "span": {"offset": 808, "length": 6}}, {"content": "60", "boundingBox": + [1160, 1924, 1200, 1924, 1199, 1958, 1159, 1958], "confidence": 0.999, "span": + {"offset": 815, "length": 2}}, {"content": "days", "boundingBox": [1207, 1924, + 1279, 1924, 1278, 1958, 1206, 1958], "confidence": 0.992, "span": {"offset": + 818, "length": 4}}, {"content": "of", "boundingBox": [1286, 1924, 1317, 1924, + 1316, 1958, 1284, 1958], "confidence": 0.997, "span": {"offset": 823, "length": + 2}}, {"content": "reading", "boundingBox": [1324, 1924, 1438, 1924, 1437, + 1958, 1322, 1958], "confidence": 0.997, "span": {"offset": 826, "length": + 7}}, {"content": "and", "boundingBox": [1445, 1924, 1505, 1924, 1504, 1958, + 1443, 1958], "confidence": 0.998, "span": {"offset": 834, "length": 3}}, {"content": + "offer", "boundingBox": [169, 1958, 231, 1958, 231, 1991, 169, 1991], "confidence": + 0.993, "span": {"offset": 838, "length": 5}}, {"content": "you", "boundingBox": + [237, 1958, 295, 1958, 295, 1992, 237, 1991], "confidence": 0.989, "span": + {"offset": 844, "length": 3}}, {"content": "25%", "boundingBox": [303, 1958, + 371, 1958, 372, 1992, 303, 1992], "confidence": 0.947, "span": {"offset": + 848, "length": 3}}, {"content": "off", "boundingBox": [378, 1958, 420, 1958, + 420, 1992, 378, 1992], "confidence": 0.998, "span": {"offset": 852, "length": + 3}}, {"content": "you", "boundingBox": [427, 1958, 482, 1958, 482, 1992, 427, + 1992], "confidence": 0.998, "span": {"offset": 856, "length": 3}}, {"content": + "next", "boundingBox": [488, 1958, 554, 1959, 555, 1992, 489, 1992], "confidence": + 0.992, "span": {"offset": 860, "length": 4}}, {"content": "total", "boundingBox": + [561, 1959, 627, 1959, 627, 1991, 561, 1992], "confidence": 0.994, "span": + {"offset": 865, "length": 5}}, {"content": "purchase.", "boundingBox": [633, + 1959, 786, 1961, 787, 1990, 633, 1991], "confidence": 0.996, "span": {"offset": + 871, "length": 9}}], "selectionMarks": [], "lines": [{"content": "Purchase + Order", "boundingBox": [136, 139, 351, 138, 351, 166, 136, 166], "spans": + [{"offset": 0, "length": 14}]}, {"content": "Hero Limited", "boundingBox": + [620, 205, 1074, 204, 1075, 265, 620, 266], "spans": [{"offset": 15, "length": + 12}]}, {"content": "Company Phone: 555-348-6512", "boundingBox": [163, 352, + 528, 350, 528, 376, 163, 379], "spans": [{"offset": 28, "length": 27}]}, {"content": + "Website: www.herolimited.com", "boundingBox": [166, 393, 533, 393, 533, 418, + 166, 418], "spans": [{"offset": 56, "length": 28}]}, {"content": "Email:", + "boundingBox": [165, 435, 237, 435, 237, 460, 165, 460], "spans": [{"offset": + 85, "length": 6}]}, {"content": "Purchase Order", "boundingBox": [1112, 321, + 1554, 321, 1554, 369, 1112, 369], "spans": [{"offset": 92, "length": 14}]}, + {"content": "Dated As: 12/20/2020", "boundingBox": [1024, 419, 1317, 420, + 1317, 448, 1024, 448], "spans": [{"offset": 107, "length": 20}]}, {"content": + "Purchase Order #: 948284", "boundingBox": [1023, 461, 1376, 461, 1376, 489, + 1023, 488], "spans": [{"offset": 128, "length": 24}]}, {"content": "accounts@herolimited.com", + "boundingBox": [164, 479, 482, 478, 483, 502, 164, 503], "spans": [{"offset": + 153, "length": 24}]}, {"content": "Shipped To", "boundingBox": [167, 547, + 397, 546, 397, 591, 167, 592], "spans": [{"offset": 178, "length": 10}]}, + {"content": "Vendor Name: Hillary Swank", "boundingBox": [159, 609, 520, 609, + 520, 638, 159, 638], "spans": [{"offset": 189, "length": 26}]}, {"content": + "Company Name: Higgly Wiggly Books", "boundingBox": [159, 647, 629, 646, 629, + 677, 160, 679], "spans": [{"offset": 216, "length": 33}]}, {"content": "Address: + 938 NE Burner Road", "boundingBox": [160, 684, 526, 684, 526, 712, 160, 711], + "spans": [{"offset": 250, "length": 27}]}, {"content": "Boulder City, CO 92848", + "boundingBox": [279, 722, 566, 721, 566, 750, 279, 751], "spans": [{"offset": + 278, "length": 22}]}, {"content": "Phone: 938-294-2949", "boundingBox": [612, + 721, 885, 721, 885, 747, 612, 748], "spans": [{"offset": 301, "length": 19}]}, + {"content": "Shipped From", "boundingBox": [167, 784, 453, 784, 453, 829, + 167, 830], "spans": [{"offset": 321, "length": 12}]}, {"content": "Name: Bernie + Sanders", "boundingBox": [165, 852, 445, 851, 445, 878, 165, 879], "spans": + [{"offset": 334, "length": 20}]}, {"content": "Company Name: Jupiter Book + Supply", "boundingBox": [164, 889, 629, 889, 629, 919, 164, 919], "spans": + [{"offset": 355, "length": 33}]}, {"content": "Address: 383 N Kinnick Road", + "boundingBox": [165, 925, 521, 926, 521, 953, 165, 952], "spans": [{"offset": + 389, "length": 27}]}, {"content": "Seattle, WA 38383", "boundingBox": [280, + 963, 514, 962, 514, 990, 281, 991], "spans": [{"offset": 417, "length": 17}]}, + {"content": "Phone: 932-299-0292", "boundingBox": [760, 963, 1032, 963, 1032, + 989, 760, 990], "spans": [{"offset": 435, "length": 19}]}, {"content": "Details", + "boundingBox": [446, 1047, 558, 1047, 558, 1077, 446, 1077], "spans": [{"offset": + 455, "length": 7}]}, {"content": "Quantity", "boundingBox": [885, 1047, 1034, + 1047, 1034, 1083, 886, 1083], "spans": [{"offset": 463, "length": 8}]}, {"content": + "Unit Price", "boundingBox": [1111, 1047, 1270, 1047, 1269, 1078, 1111, 1077], + "spans": [{"offset": 472, "length": 10}]}, {"content": "Total", "boundingBox": + [1382, 1047, 1468, 1047, 1467, 1077, 1382, 1077], "spans": [{"offset": 483, + "length": 5}]}, {"content": "Bindings", "boundingBox": [172, 1093, 279, 1095, + 279, 1123, 172, 1121], "spans": [{"offset": 489, "length": 8}]}, {"content": + "20", "boundingBox": [859, 1094, 893, 1094, 893, 1119, 859, 1119], "spans": + [{"offset": 498, "length": 2}]}, {"content": "1.00", "boundingBox": [1240, + 1096, 1295, 1094, 1294, 1118, 1241, 1118], "spans": [{"offset": 501, "length": + 4}]}, {"content": "20.00", "boundingBox": [1458, 1095, 1530, 1095, 1530, 1119, + 1458, 1119], "spans": [{"offset": 506, "length": 5}]}, {"content": "Covers + Small", "boundingBox": [169, 1135, 332, 1134, 333, 1160, 169, 1161], "spans": + [{"offset": 512, "length": 12}]}, {"content": "20", "boundingBox": [859, 1135, + 894, 1135, 891, 1160, 860, 1160], "spans": [{"offset": 525, "length": 2}]}, + {"content": "1.00", "boundingBox": [1239, 1135, 1295, 1135, 1294, 1159, 1239, + 1160], "spans": [{"offset": 528, "length": 4}]}, {"content": "20.00", "boundingBox": + [1458, 1135, 1530, 1135, 1530, 1159, 1459, 1160], "spans": [{"offset": 533, + "length": 5}]}, {"content": "Feather Bookmark", "boundingBox": [173, 1178, + 403, 1177, 403, 1205, 173, 1206], "spans": [{"offset": 539, "length": 16}]}, + {"content": "20", "boundingBox": [860, 1179, 892, 1179, 891, 1204, 860, 1203], + "spans": [{"offset": 556, "length": 2}]}, {"content": "5.00", "boundingBox": + [1239, 1179, 1295, 1178, 1295, 1203, 1239, 1204], "spans": [{"offset": 559, + "length": 4}]}, {"content": "100.00", "boundingBox": [1442, 1180, 1530, 1180, + 1530, 1203, 1443, 1204], "spans": [{"offset": 564, "length": 6}]}, {"content": + "Copper Swirl Marker", "boundingBox": [169, 1223, 429, 1222, 430, 1249, 169, + 1253], "spans": [{"offset": 571, "length": 19}]}, {"content": "20", "boundingBox": + [860, 1223, 893, 1223, 893, 1247, 860, 1247], "spans": [{"offset": 591, "length": + 2}]}, {"content": "5.00", "boundingBox": [1239, 1221, 1294, 1222, 1294, 1246, + 1239, 1247], "spans": [{"offset": 594, "length": 4}]}, {"content": "100.00", + "boundingBox": [1443, 1223, 1530, 1222, 1530, 1246, 1444, 1247], "spans": + [{"offset": 599, "length": 6}]}, {"content": "Bernie Sanders", "boundingBox": + [484, 1670, 764, 1670, 764, 1707, 484, 1706], "spans": [{"offset": 606, "length": + 14}]}, {"content": "Bernie Sanders", "boundingBox": [542, 1718, 718, 1719, + 718, 1742, 542, 1741], "spans": [{"offset": 621, "length": 14}]}, {"content": + "Manager", "boundingBox": [577, 1753, 681, 1755, 681, 1778, 577, 1776], "spans": + [{"offset": 636, "length": 7}]}, {"content": "Additional Notes:", "boundingBox": + [172, 1796, 478, 1796, 478, 1832, 172, 1831], "spans": [{"offset": 644, "length": + 17}]}, {"content": "Do not Jostle Box. Unpack carefully. Enjoy.", "boundingBox": + [174, 1879, 707, 1880, 707, 1911, 174, 1908], "spans": [{"offset": 662, "length": + 43}]}, {"content": "SUBTOTAL", "boundingBox": [1146, 1573, 1296, 1573, 1296, + 1600, 1146, 1600], "spans": [{"offset": 706, "length": 8}]}, {"content": "$140.00", + "boundingBox": [1426, 1571, 1530, 1571, 1530, 1597, 1426, 1598], "spans": + [{"offset": 715, "length": 7}]}, {"content": "TAX", "boundingBox": [1236, + 1618, 1296, 1618, 1295, 1643, 1236, 1643], "spans": [{"offset": 723, "length": + 3}]}, {"content": "$4.00", "boundingBox": [1458, 1615, 1529, 1615, 1528, 1641, + 1458, 1643], "spans": [{"offset": 727, "length": 5}]}, {"content": "TOTAL", + "boundingBox": [1203, 1673, 1297, 1673, 1297, 1698, 1204, 1699], "spans": + [{"offset": 733, "length": 5}]}, {"content": "$144.00", "boundingBox": [1427, + 1670, 1529, 1669, 1530, 1696, 1427, 1697], "spans": [{"offset": 739, "length": + 7}]}, {"content": "Jupiter Book Supply will refund you 50% per book if returned + within 60 days of reading and", "boundingBox": [168, 1923, 1510, 1923, 1510, + 1957, 168, 1958], "spans": [{"offset": 747, "length": 90}]}, {"content": "offer + you 25% off you next total purchase.", "boundingBox": [168, 1957, 786, 1958, + 786, 1991, 168, 1991], "spans": [{"offset": 838, "length": 42}]}], "spans": + [{"offset": 0, "length": 880}]}], "tables": [{"rowCount": 5, "columnCount": + 4, "cells": [{"kind": "columnHeader", "rowIndex": 0, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Details", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [157, 1037, 847, 1038, 847, 1086, 155, 1086]}], "spans": + [{"offset": 455, "length": 7}]}, {"kind": "columnHeader", "rowIndex": 0, "columnIndex": + 1, "rowSpan": 1, "columnSpan": 1, "content": "Quantity", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [847, 1038, 1069, 1038, 1070, 1086, 847, + 1086]}], "spans": [{"offset": 463, "length": 8}]}, {"kind": "columnHeader", + "rowIndex": 0, "columnIndex": 2, "rowSpan": 1, "columnSpan": 1, "content": + "Unit Price", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1069, + 1038, 1309, 1038, 1309, 1086, 1070, 1086]}], "spans": [{"offset": 472, "length": + 10}]}, {"kind": "columnHeader", "rowIndex": 0, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "Total", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1038, 1543, 1038, 1543, 1086, 1309, 1086]}], "spans": + [{"offset": 483, "length": 5}]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Bindings", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1086, 847, 1086, 847, 1127, 155, 1127]}], "spans": + [{"offset": 489, "length": 8}]}, {"rowIndex": 1, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1086, 1070, 1086, 1070, 1127, 847, 1127]}], "spans": + [{"offset": 498, "length": 2}]}, {"rowIndex": 1, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "1.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1086, 1309, 1086, 1309, 1127, 1070, 1127]}], "spans": + [{"offset": 501, "length": 4}]}, {"rowIndex": 1, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "20.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1086, 1543, 1086, 1543, 1127, 1309, 1127]}], "spans": + [{"offset": 506, "length": 5}]}, {"rowIndex": 2, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Covers Small", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1127, 847, 1127, 847, 1171, 155, 1171]}], "spans": + [{"offset": 512, "length": 12}]}, {"rowIndex": 2, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1127, 1070, 1127, 1070, 1171, 847, 1171]}], "spans": + [{"offset": 525, "length": 2}]}, {"rowIndex": 2, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "1.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1127, 1309, 1127, 1309, 1171, 1070, 1171]}], "spans": + [{"offset": 528, "length": 4}]}, {"rowIndex": 2, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "20.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1127, 1543, 1127, 1543, 1171, 1309, 1171]}], "spans": + [{"offset": 533, "length": 5}]}, {"rowIndex": 3, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Feather Bookmark", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1171, 847, 1171, 847, 1214, 155, 1214]}], "spans": + [{"offset": 539, "length": 16}]}, {"rowIndex": 3, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1171, 1070, 1171, 1070, 1214, 847, 1214]}], "spans": + [{"offset": 556, "length": 2}]}, {"rowIndex": 3, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "5.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1171, 1309, 1171, 1309, 1214, 1070, 1214]}], "spans": + [{"offset": 559, "length": 4}]}, {"rowIndex": 3, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "100.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1171, 1543, 1171, 1543, 1215, 1309, 1214]}], "spans": + [{"offset": 564, "length": 6}]}, {"rowIndex": 4, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Copper Swirl Marker", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1214, 847, 1214, 847, 1258, 155, 1258]}], "spans": + [{"offset": 571, "length": 19}]}, {"rowIndex": 4, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1214, 1070, 1214, 1070, 1258, 847, 1258]}], "spans": + [{"offset": 591, "length": 2}]}, {"rowIndex": 4, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "5.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1214, 1309, 1214, 1309, 1258, 1070, 1258]}], "spans": + [{"offset": 594, "length": 4}]}, {"rowIndex": 4, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "100.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1214, 1543, 1215, 1543, 1260, 1309, 1258]}], "spans": + [{"offset": 599, "length": 6}]}], "boundingRegions": [{"pageNumber": 1, "boundingBox": + [153, 1036, 1548, 1036, 1547, 1265, 153, 1265]}], "spans": [{"offset": 455, + "length": 150}]}, {"rowCount": 4, "columnCount": 2, "cells": [{"kind": "columnHeader", + "rowIndex": 0, "columnIndex": 0, "rowSpan": 1, "columnSpan": 1, "content": + "SUBTOTAL", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1070, 1565, + 1309, 1565, 1309, 1609, 1071, 1609]}], "spans": [{"offset": 706, "length": + 8}]}, {"kind": "columnHeader", "rowIndex": 0, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "$140.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1565, 1544, 1564, 1544, 1609, 1309, 1609]}], "spans": + [{"offset": 715, "length": 7}]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "TAX", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [1071, 1609, 1309, 1609, 1309, 1652, 1071, 1652]}], "spans": + [{"offset": 723, "length": 3}]}, {"rowIndex": 1, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "$4.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1609, 1544, 1609, 1544, 1652, 1309, 1652]}], "spans": + [{"offset": 727, "length": 5}]}, {"rowIndex": 2, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1071, 1652, 1309, 1652, 1309, 1664, 1071, 1664]}], "spans": []}, {"rowIndex": + 2, "columnIndex": 1, "rowSpan": 1, "columnSpan": 1, "content": "", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1309, 1652, 1544, 1652, 1544, 1664, 1309, + 1664]}], "spans": []}, {"rowIndex": 3, "columnIndex": 0, "rowSpan": 1, "columnSpan": + 1, "content": "TOTAL", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1071, 1664, 1309, 1664, 1309, 1707, 1071, 1706]}], "spans": [{"offset": 733, + "length": 5}]}, {"rowIndex": 3, "columnIndex": 1, "rowSpan": 1, "columnSpan": + 1, "content": "$144.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1309, 1664, 1544, 1664, 1544, 1707, 1309, 1707]}], "spans": [{"offset": 739, + "length": 7}]}], "boundingRegions": [{"pageNumber": 1, "boundingBox": [1062, + 1563, 1560, 1563, 1560, 1709, 1062, 1709]}], "spans": [{"offset": 706, "length": + 40}]}], "keyValuePairs": [{"key": {"content": "Company Phone:", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [163, 352, 359, 351, 359, 379, 163, 380]}], + "spans": [{"offset": 28, "length": 14}]}, "value": {"content": "555-348-6512", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [363, 351, 524, 351, + 524, 374, 364, 378]}], "spans": [{"offset": 43, "length": 12}]}, "confidence": + 0.932}, {"key": {"content": "Website:", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [167, 394, 265, 393, 265, 418, 167, 417]}], "spans": [{"offset": + 56, "length": 8}]}, "value": {"content": "www.herolimited.com", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [270, 393, 522, 393, 522, 418, 270, 418]}], + "spans": [{"offset": 65, "length": 19}]}, "confidence": 0.943}, {"key": {"content": + "Dated As:", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1025, 420, + 1156, 420, 1156, 448, 1025, 448]}], "spans": [{"offset": 107, "length": 9}]}, + "value": {"content": "12/20/2020", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1162, 420, 1312, 421, 1312, 449, 1162, 448]}], "spans": [{"offset": 117, + "length": 10}]}, "confidence": 0.932}, {"key": {"content": "Email:", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [165, 435, 237, 435, 237, 460, 165, 460]}], + "spans": [{"offset": 85, "length": 6}]}, "value": {"content": "accounts@herolimited.com", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [164, 481, 471, 479, + 470, 503, 165, 503]}], "spans": [{"offset": 153, "length": 24}]}, "confidence": + 0.938}, {"key": {"content": "Purchase Order #:", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1023, 461, 1270, 461, 1270, 489, 1023, 489]}], "spans": + [{"offset": 128, "length": 17}]}, "value": {"content": "948284", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1275, 461, 1373, 462, 1373, 489, 1275, + 489]}], "spans": [{"offset": 146, "length": 6}]}, "confidence": 0.923}, {"key": + {"content": "Vendor Name:", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [160, 609, 341, 609, 341, 639, 160, 639]}], "spans": [{"offset": 189, "length": + 12}]}, "value": {"content": "Hillary Swank", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [346, 608, 518, 610, 518, 640, 346, 639]}], "spans": [{"offset": + 202, "length": 13}]}, "confidence": 0.905}, {"key": {"content": "Company Name:", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [160, 646, 366, 647, + 366, 679, 160, 678]}], "spans": [{"offset": 216, "length": 13}]}, "value": + {"content": "Higgly Wiggly Books", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [372, 647, 628, 645, 628, 678, 372, 680]}], "spans": [{"offset": 230, "length": + 19}]}, "confidence": 0.871}, {"key": {"content": "Address:", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [161, 685, 266, 685, 265, 712, 160, 711]}], + "spans": [{"offset": 250, "length": 8}]}, "value": {"content": "938 NE Burner + Road Boulder City, CO 92848", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [271, 685, 559, 685, 559, 751, 271, 751]}], "spans": [{"offset": 259, "length": + 41}]}, "confidence": 0.796}, {"key": {"content": "Phone:", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [613, 722, 701, 722, 701, 749, 613, 749]}], + "spans": [{"offset": 301, "length": 6}]}, "value": {"content": "938-294-2949", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [706, 722, 882, 722, + 881, 748, 706, 749]}], "spans": [{"offset": 308, "length": 12}]}, "confidence": + 0.943}, {"key": {"content": "Name:", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [166, 853, 246, 853, 245, 879, 166, 879]}], "spans": [{"offset": + 334, "length": 5}]}, "value": {"content": "Bernie Sanders", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [251, 852, 444, 852, 444, 880, 251, 880]}], + "spans": [{"offset": 340, "length": 14}]}, "confidence": 0.917}, {"key": {"content": + "Company Name:", "boundingRegions": [{"pageNumber": 1, "boundingBox": [164, + 889, 372, 889, 372, 919, 164, 919]}], "spans": [{"offset": 355, "length": + 13}]}, "value": {"content": "Jupiter Book Supply", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [377, 888, 628, 890, 628, 921, 377, 919]}], "spans": [{"offset": + 369, "length": 19}]}, "confidence": 0.871}, {"key": {"content": "Address:", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [166, 926, 271, 926, + 271, 953, 166, 953]}], "spans": [{"offset": 389, "length": 8}]}, "value": + {"content": "383 N Kinnick Road Seattle, WA 38383", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [276, 925, 516, 925, 516, 991, 276, 991]}], "spans": [{"offset": + 398, "length": 36}]}, "confidence": 0.803}, {"key": {"content": "Phone:", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [760, 964, 847, 964, + 846, 990, 760, 990]}], "spans": [{"offset": 435, "length": 6}]}, "value": + {"content": "932-299-0292", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [852, 964, 1029, 963, 1028, 990, 851, 990]}], "spans": [{"offset": 442, "length": + 12}]}, "confidence": 0.943}, {"key": {"content": "SUBTOTAL", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1147, 1575, 1293, 1575, 1293, 1600, 1147, + 1600]}], "spans": [{"offset": 706, "length": 8}]}, "value": {"content": "$140.00", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [1426, 1572, 1526, 1572, + 1525, 1597, 1427, 1599]}], "spans": [{"offset": 715, "length": 7}]}, "confidence": + 0.943}, {"key": {"content": "TAX", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1236, 1618, 1288, 1618, 1288, 1643, 1236, 1643]}], "spans": [{"offset": 723, + "length": 3}]}, "value": {"content": "$4.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1458, 1615, 1529, 1615, 1529, 1642, 1458, 1643]}], "spans": + [{"offset": 727, "length": 5}]}, "confidence": 0.943}, {"key": {"content": + "TOTAL", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1204, 1674, + 1292, 1674, 1292, 1699, 1205, 1699]}], "spans": [{"offset": 733, "length": + 5}]}, "value": {"content": "$144.00", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [1427, 1671, 1527, 1669, 1527, 1697, 1429, 1698]}], "spans": + [{"offset": 739, "length": 7}]}, "confidence": 0.943}], "entities": [{"category": + "Quantity", "subCategory": "Number", "content": "20", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [859, 1094, 887, 1094, 887, 1119, 859, 1119]}], "confidence": + 0.8, "spans": [{"offset": 498, "length": 2}]}, {"category": "Quantity", "subCategory": + "Number", "content": "1.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1240, 1095, 1291, 1094, 1291, 1117, 1240, 1118]}], "confidence": 0.8, "spans": + [{"offset": 501, "length": 4}]}, {"category": "Quantity", "subCategory": "Number", + "content": "20.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1458, + 1095, 1526, 1095, 1526, 1120, 1458, 1120]}], "confidence": 0.8, "spans": [{"offset": + 506, "length": 5}]}, {"category": "Quantity", "subCategory": "Number", "content": + "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [859, 1135, 889, + 1135, 889, 1160, 859, 1160]}], "confidence": 0.8, "spans": [{"offset": 525, + "length": 2}]}, {"category": "Quantity", "subCategory": "Number", "content": + "1.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1239, 1135, + 1291, 1135, 1291, 1160, 1239, 1160]}], "confidence": 0.8, "spans": [{"offset": + 528, "length": 4}]}, {"category": "Quantity", "subCategory": "Number", "content": + "20.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1458, 1135, + 1526, 1135, 1526, 1160, 1458, 1160]}], "confidence": 0.8, "spans": [{"offset": + 533, "length": 5}]}, {"category": "Quantity", "subCategory": "Number", "content": + "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [860, 1179, 888, + 1179, 888, 1204, 860, 1203]}], "confidence": 0.8, "spans": [{"offset": 556, + "length": 2}]}, {"category": "Quantity", "subCategory": "Number", "content": + "5.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1239, 1179, + 1291, 1178, 1291, 1203, 1239, 1204]}], "confidence": 0.8, "spans": [{"offset": + 559, "length": 4}]}, {"category": "Quantity", "subCategory": "Number", "content": + "100.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1443, 1181, + 1525, 1180, 1525, 1204, 1443, 1205]}], "confidence": 0.8, "spans": [{"offset": + 564, "length": 6}]}, {"category": "Quantity", "subCategory": "Number", "content": + "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [860, 1223, 887, + 1223, 887, 1247, 860, 1247]}], "confidence": 0.8, "spans": [{"offset": 591, + "length": 2}]}, {"category": "Quantity", "subCategory": "Number", "content": + "5.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1239, 1221, + 1291, 1221, 1291, 1247, 1239, 1247]}], "confidence": 0.8, "spans": [{"offset": + 594, "length": 4}]}, {"category": "Quantity", "subCategory": "Number", "content": + "100.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1444, 1224, + 1525, 1223, 1525, 1247, 1444, 1248]}], "confidence": 0.8, "spans": [{"offset": + 599, "length": 6}]}, {"category": "Quantity", "subCategory": "Currency", "content": + "$140.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1426, 1572, + 1526, 1571, 1526, 1598, 1426, 1599]}], "confidence": 0.8, "spans": [{"offset": + 715, "length": 7}]}, {"category": "Quantity", "subCategory": "Currency", "content": + "$4.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1458, 1615, + 1529, 1615, 1529, 1642, 1458, 1643]}], "confidence": 0.8, "spans": [{"offset": + 727, "length": 5}]}, {"category": "Quantity", "subCategory": "Currency", "content": + "$144.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1427, 1671, + 1527, 1669, 1527, 1697, 1427, 1699]}], "confidence": 0.8, "spans": [{"offset": + 739, "length": 7}]}, {"category": "Organization", "content": "Hero Limited + Company", "boundingRegions": [{"pageNumber": 1, "boundingBox": [620, 205, + 1058, 204, 1058, 266, 620, 267]}, {"pageNumber": 1, "boundingBox": [163, 352, + 270, 351, 270, 379, 163, 380]}], "confidence": 0.78, "spans": [{"offset": + 15, "length": 20}]}, {"category": "URL", "content": "www.herolimited.com", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [270, 393, 522, 393, + 522, 418, 270, 418]}], "confidence": 0.8, "spans": [{"offset": 65, "length": + 19}]}, {"category": "DateTime", "subCategory": "Date", "content": "12/20/2020", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [1162, 420, 1312, 421, + 1312, 449, 1162, 448]}], "confidence": 0.8, "spans": [{"offset": 117, "length": + 10}]}, {"category": "Quantity", "subCategory": "Number", "content": "948284", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [1275, 461, 1373, 462, + 1373, 489, 1275, 489]}], "confidence": 0.8, "spans": [{"offset": 146, "length": + 6}]}, {"category": "Email", "content": "accounts@herolimited.com", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [164, 480, 471, 479, 471, 503, 164, 504]}], + "confidence": 0.8, "spans": [{"offset": 153, "length": 24}]}, {"category": + "Person", "content": "Hillary Swank", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [346, 608, 518, 610, 518, 640, 346, 639]}], "confidence": 0.91, + "spans": [{"offset": 202, "length": 13}]}, {"category": "Person", "content": + "Higgly Wiggly", "boundingRegions": [{"pageNumber": 1, "boundingBox": [372, + 646, 541, 645, 541, 678, 372, 679]}], "confidence": 0.44, "spans": [{"offset": + 230, "length": 13}]}, {"category": "Address", "content": "938 NE Burner Road + Boulder City, CO", "boundingRegions": [{"pageNumber": 1, "boundingBox": [271, + 685, 521, 685, 521, 713, 271, 713]}, {"pageNumber": 1, "boundingBox": [279, + 722, 473, 722, 473, 751, 279, 751]}], "confidence": 0.78, "spans": [{"offset": + 259, "length": 35}]}, {"category": "Quantity", "subCategory": "Number", "content": + "938", "boundingRegions": [{"pageNumber": 1, "boundingBox": [271, 684, 319, + 685, 319, 713, 271, 713]}], "confidence": 0.8, "spans": [{"offset": 259, "length": + 3}]}, {"category": "Quantity", "subCategory": "Number", "content": "92848", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [480, 722, 559, 721, + 559, 750, 480, 751]}], "confidence": 0.8, "spans": [{"offset": 295, "length": + 5}]}, {"category": "Person", "content": "Bernie Sanders", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [251, 852, 444, 852, 444, 880, 251, 880]}], + "confidence": 0.83, "spans": [{"offset": 340, "length": 14}]}, {"category": + "Organization", "subCategory": "Sports", "content": "Jupiter", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [377, 889, 464, 889, 464, 919, 377, 919]}], + "confidence": 0.79, "spans": [{"offset": 369, "length": 7}]}, {"category": + "Address", "content": "383 N Kinnick Road", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [276, 925, 516, 926, 516, 955, 276, 953]}], "confidence": + 0.96, "spans": [{"offset": 398, "length": 18}]}, {"category": "Quantity", + "subCategory": "Number", "content": "383", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [276, 925, 325, 925, 325, 953, 276, 953]}], "confidence": + 0.8, "spans": [{"offset": 398, "length": 3}]}, {"category": "Location", "subCategory": + "GPE", "content": "Seattle", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [281, 965, 375, 964, 375, 991, 281, 992]}], "confidence": 0.77, "spans": [{"offset": + 417, "length": 7}]}, {"category": "Location", "subCategory": "GPE", "content": + "WA", "boundingRegions": [{"pageNumber": 1, "boundingBox": [380, 964, 425, + 964, 425, 991, 380, 991]}], "confidence": 0.43, "spans": [{"offset": 426, + "length": 2}]}, {"category": "Quantity", "subCategory": "Number", "content": + "38383", "boundingRegions": [{"pageNumber": 1, "boundingBox": [432, 964, 511, + 963, 511, 990, 432, 991]}], "confidence": 0.8, "spans": [{"offset": 429, "length": + 5}]}, {"category": "Person", "content": "Bernie Sanders", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [484, 1669, 763, 1670, 763, 1708, 484, 1707]}], + "confidence": 0.78, "spans": [{"offset": 606, "length": 14}]}, {"category": + "Person", "content": "Bernie Sanders", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [542, 1718, 716, 1719, 716, 1743, 542, 1742]}], "confidence": + 0.37, "spans": [{"offset": 621, "length": 14}]}, {"category": "Organization", + "content": "Jupiter Book Supply", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [169, 1924, 460, 1924, 460, 1959, 169, 1959]}], "confidence": 0.99, "spans": + [{"offset": 747, "length": 19}]}, {"category": "Quantity", "subCategory": + "Percentage", "content": "50%", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [691, 1924, 761, 1924, 761, 1958, 691, 1958]}], "confidence": 0.8, "spans": + [{"offset": 783, "length": 3}]}, {"category": "DateTime", "subCategory": "DateRange", + "content": "within 60 days", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1065, 1924, 1279, 1924, 1279, 1958, 1065, 1958]}], "confidence": 0.8, "spans": + [{"offset": 808, "length": 14}]}, {"category": "Quantity", "subCategory": + "Percentage", "content": "25%", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [303, 1958, 372, 1958, 372, 1992, 303, 1992]}], "confidence": 0.8, "spans": + [{"offset": 848, "length": 3}]}], "styles": [{"isHandwritten": true, "confidence": + 0.9, "spans": [{"offset": 606, "length": 14}]}]}}' + headers: + apim-request-id: + - 2fcbaf34-eacf-418c-82b8-ebb63fac09db + content-type: + - application/json; charset=utf-8 + date: + - Mon, 25 Oct 2021 17:43:20 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '336' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_line_get_children.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_line_get_children.yaml new file mode 100644 index 000000000000..27840a428ead --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_line_get_children.yaml @@ -0,0 +1,378 @@ +interactions: +- request: + body: '!!! The request body has been omitted from the recording because its size + 147362 is larger than 128KB. !!!' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '147362' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document:analyze?stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview + response: + body: + string: '' + headers: + apim-request-id: + - 1f5c3ae8-1775-4795-9b34-91b99e72fb64 + content-length: + - '0' + date: + - Mon, 25 Oct 2021 17:43:21 GMT + operation-location: + - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/1f5c3ae8-1775-4795-9b34-91b99e72fb64?api-version=2021-09-30-preview + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '388' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/1f5c3ae8-1775-4795-9b34-91b99e72fb64?api-version=2021-09-30-preview + response: + body: + string: '{"status": "running", "createdDateTime": "2021-10-25T17:43:22Z", "lastUpdatedDateTime": + "2021-10-25T17:43:26Z"}' + headers: + apim-request-id: + - d2019806-678e-4577-9a1a-332448fae5f1 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 25 Oct 2021 17:43:26 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '90' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/1f5c3ae8-1775-4795-9b34-91b99e72fb64?api-version=2021-09-30-preview + response: + body: + string: '{"status": "running", "createdDateTime": "2021-10-25T17:43:22Z", "lastUpdatedDateTime": + "2021-10-25T17:43:26Z"}' + headers: + apim-request-id: + - b6611fcd-7bd3-454f-9c82-f9fea4cc78cf + content-type: + - application/json; charset=utf-8 + date: + - Mon, 25 Oct 2021 17:43:32 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '91' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/1f5c3ae8-1775-4795-9b34-91b99e72fb64?api-version=2021-09-30-preview + response: + body: + string: '{"status": "succeeded", "createdDateTime": "2021-10-25T17:43:22Z", + "lastUpdatedDateTime": "2021-10-25T17:43:35Z", "analyzeResult": {"apiVersion": + "2021-09-30-preview", "modelId": "prebuilt-document", "stringIndexType": "unicodeCodePoint", + "content": "Contoso\nAddress:\n1 Redmond way Suite\n6000 Redmond, WA\n99243\nInvoice + For: Microsoft\n1020 Enterprise Way\nSunnayvale, CA 87659\nInvoice Number\nInvoice + Date\nInvoice Due Date\nCharges\nVAT ID\n34278587\n6/18/2017\n6/24/2017\n$56,651.49\nPT", + "pages": [{"pageNumber": 1, "angle": 0, "width": 8.5, "height": 11, "unit": + "inch", "words": [{"content": "Contoso", "boundingBox": [0.5384, 1.1583, 1.4466, + 1.1583, 1.4466, 1.3534, 0.5384, 1.3534], "confidence": 1, "span": {"offset": + 0, "length": 7}}, {"content": "Address:", "boundingBox": [0.7994, 1.5143, + 1.3836, 1.5143, 1.3836, 1.6154, 0.7994, 1.6154], "confidence": 1, "span": + {"offset": 8, "length": 8}}, {"content": "1", "boundingBox": [0.8106, 1.708, + 0.8463, 1.708, 0.8463, 1.8053, 0.8106, 1.8053], "confidence": 1, "span": {"offset": + 17, "length": 1}}, {"content": "Redmond", "boundingBox": [0.923, 1.7047, 1.5018, + 1.7047, 1.5018, 1.8068, 0.923, 1.8068], "confidence": 1, "span": {"offset": + 19, "length": 7}}, {"content": "way", "boundingBox": [1.5506, 1.7309, 1.7949, + 1.7309, 1.7949, 1.8342, 1.5506, 1.8342], "confidence": 1, "span": {"offset": + 27, "length": 3}}, {"content": "Suite", "boundingBox": [1.8415, 1.7033, 2.1445, + 1.7033, 2.1445, 1.8078, 1.8415, 1.8078], "confidence": 1, "span": {"offset": + 31, "length": 5}}, {"content": "6000", "boundingBox": [0.8019, 1.896, 1.0991, + 1.896, 1.0991, 1.9994, 0.8019, 1.9994], "confidence": 1, "span": {"offset": + 37, "length": 4}}, {"content": "Redmond,", "boundingBox": [1.1537, 1.8964, + 1.7689, 1.8964, 1.7689, 2.0171, 1.1537, 2.0171], "confidence": 1, "span": + {"offset": 42, "length": 8}}, {"content": "WA", "boundingBox": [1.8196, 1.8976, + 2.0384, 1.8976, 2.0384, 1.9969, 1.8196, 1.9969], "confidence": 1, "span": + {"offset": 51, "length": 2}}, {"content": "99243", "boundingBox": [0.8025, + 2.0876, 1.175, 2.0876, 1.175, 2.1911, 0.8025, 2.1911], "confidence": 1, "span": + {"offset": 54, "length": 5}}, {"content": "Invoice", "boundingBox": [4.4033, + 1.5143, 4.8234, 1.5143, 4.8234, 1.6155, 4.4033, 1.6155], "confidence": 1, + "span": {"offset": 60, "length": 7}}, {"content": "For:", "boundingBox": [4.8793, + 1.5143, 5.1013, 1.5143, 5.1013, 1.6154, 4.8793, 1.6154], "confidence": 1, + "span": {"offset": 68, "length": 4}}, {"content": "Microsoft", "boundingBox": + [5.2045, 1.5114, 5.8155, 1.5114, 5.8155, 1.6151, 5.2045, 1.6151], "confidence": + 1, "span": {"offset": 73, "length": 9}}, {"content": "1020", "boundingBox": + [5.2036, 1.716, 5.4935, 1.716, 5.4935, 1.8185, 5.2036, 1.8185], "confidence": + 1, "span": {"offset": 83, "length": 4}}, {"content": "Enterprise", "boundingBox": + [5.5488, 1.7164, 6.2178, 1.7164, 6.2178, 1.8441, 5.5488, 1.8441], "confidence": + 1, "span": {"offset": 88, "length": 10}}, {"content": "Way", "boundingBox": + [6.2618, 1.7164, 6.5436, 1.7164, 6.5436, 1.8459, 6.2618, 1.8459], "confidence": + 1, "span": {"offset": 99, "length": 3}}, {"content": "Sunnayvale,", "boundingBox": + [5.196, 1.9047, 5.9894, 1.9047, 5.9894, 2.0359, 5.196, 2.0359], "confidence": + 1, "span": {"offset": 103, "length": 11}}, {"content": "CA", "boundingBox": + [6.0427, 1.9047, 6.2354, 1.9047, 6.2354, 2.0085, 6.0427, 2.0085], "confidence": + 1, "span": {"offset": 115, "length": 2}}, {"content": "87659", "boundingBox": + [6.2801, 1.906, 6.6526, 1.906, 6.6526, 2.0086, 6.2801, 2.0086], "confidence": + 1, "span": {"offset": 118, "length": 5}}, {"content": "Invoice", "boundingBox": + [0.5439, 2.8733, 1.0098, 2.8733, 1.0098, 2.9754, 0.5439, 2.9754], "confidence": + 1, "span": {"offset": 124, "length": 7}}, {"content": "Number", "boundingBox": + [1.0611, 2.8743, 1.5729, 2.8743, 1.5729, 2.9754, 1.0611, 2.9754], "confidence": + 1, "span": {"offset": 132, "length": 6}}, {"content": "Invoice", "boundingBox": + [1.9491, 2.8733, 2.415, 2.8733, 2.415, 2.9754, 1.9491, 2.9754], "confidence": + 1, "span": {"offset": 139, "length": 7}}, {"content": "Date", "boundingBox": + [2.4673, 2.8743, 2.7527, 2.8743, 2.7527, 2.9754, 2.4673, 2.9754], "confidence": + 1, "span": {"offset": 147, "length": 4}}, {"content": "Invoice", "boundingBox": + [3.3495, 2.8733, 3.8155, 2.8733, 3.8155, 2.9754, 3.3495, 2.9754], "confidence": + 1, "span": {"offset": 152, "length": 7}}, {"content": "Due", "boundingBox": + [3.8677, 2.8743, 4.1149, 2.8743, 4.1149, 2.9754, 3.8677, 2.9754], "confidence": + 1, "span": {"offset": 160, "length": 3}}, {"content": "Date", "boundingBox": + [4.1678, 2.8743, 4.4547, 2.8743, 4.4547, 2.9754, 4.1678, 2.9754], "confidence": + 1, "span": {"offset": 164, "length": 4}}, {"content": "Charges", "boundingBox": + [4.7468, 2.8717, 5.289, 2.8717, 5.289, 3.0035, 4.7468, 3.0035], "confidence": + 1, "span": {"offset": 169, "length": 7}}, {"content": "VAT", "boundingBox": + [6.141, 2.873, 6.4147, 2.873, 6.4147, 2.9736, 6.141, 2.9736], "confidence": + 1, "span": {"offset": 177, "length": 3}}, {"content": "ID", "boundingBox": + [6.4655, 2.873, 6.5875, 2.873, 6.5875, 2.9736, 6.4655, 2.9736], "confidence": + 1, "span": {"offset": 181, "length": 2}}, {"content": "34278587", "boundingBox": + [0.5397, 3.411, 1.1457, 3.411, 1.1457, 3.5144, 0.5397, 3.5144], "confidence": + 1, "span": {"offset": 184, "length": 8}}, {"content": "6/18/2017", "boundingBox": + [1.9455, 3.41, 2.551, 3.41, 2.551, 3.5144, 1.9455, 3.5144], "confidence": + 1, "span": {"offset": 193, "length": 9}}, {"content": "6/24/2017", "boundingBox": + [3.346, 3.41, 3.9514, 3.41, 3.9514, 3.5144, 3.346, 3.5144], "confidence": + 1, "span": {"offset": 203, "length": 9}}, {"content": "$56,651.49", "boundingBox": + [5.3871, 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, 3.5321], "confidence": + 1, "span": {"offset": 213, "length": 10}}, {"content": "PT", "boundingBox": + [6.2285, 3.4114, 6.3919, 3.4114, 6.3919, 3.5119, 6.2285, 3.5119], "confidence": + 1, "span": {"offset": 224, "length": 2}}], "selectionMarks": [], "lines": + [{"content": "Contoso", "boundingBox": [0.5384, 1.1583, 1.4466, 1.1583, 1.4466, + 1.3534, 0.5384, 1.3534], "spans": [{"offset": 0, "length": 7}]}, {"content": + "Address:", "boundingBox": [0.7994, 1.5143, 1.3836, 1.5143, 1.3836, 1.6154, + 0.7994, 1.6154], "spans": [{"offset": 8, "length": 8}]}, {"content": "1 Redmond + way Suite", "boundingBox": [0.8106, 1.7033, 2.1445, 1.7033, 2.1445, 1.8342, + 0.8106, 1.8342], "spans": [{"offset": 17, "length": 19}]}, {"content": "6000 + Redmond, WA", "boundingBox": [0.8019, 1.896, 2.0384, 1.896, 2.0384, 2.0171, + 0.8019, 2.0171], "spans": [{"offset": 37, "length": 16}]}, {"content": "99243", + "boundingBox": [0.8025, 2.0876, 1.175, 2.0876, 1.175, 2.1911, 0.8025, 2.1911], + "spans": [{"offset": 54, "length": 5}]}, {"content": "Invoice For: Microsoft", + "boundingBox": [4.4033, 1.5114, 5.8155, 1.5114, 5.8155, 1.6155, 4.4033, 1.6155], + "spans": [{"offset": 60, "length": 22}]}, {"content": "1020 Enterprise Way", + "boundingBox": [5.2036, 1.716, 6.5436, 1.716, 6.5436, 1.8459, 5.2036, 1.8459], + "spans": [{"offset": 83, "length": 19}]}, {"content": "Sunnayvale, CA 87659", + "boundingBox": [5.196, 1.9047, 6.6526, 1.9047, 6.6526, 2.0359, 5.196, 2.0359], + "spans": [{"offset": 103, "length": 20}]}, {"content": "Invoice Number", "boundingBox": + [0.5439, 2.8733, 1.5729, 2.8733, 1.5729, 2.9754, 0.5439, 2.9754], "spans": + [{"offset": 124, "length": 14}]}, {"content": "Invoice Date", "boundingBox": + [1.9491, 2.8733, 2.7527, 2.8733, 2.7527, 2.9754, 1.9491, 2.9754], "spans": + [{"offset": 139, "length": 12}]}, {"content": "Invoice Due Date", "boundingBox": + [3.3495, 2.8733, 4.4547, 2.8733, 4.4547, 2.9754, 3.3495, 2.9754], "spans": + [{"offset": 152, "length": 16}]}, {"content": "Charges", "boundingBox": [4.7468, + 2.8717, 5.289, 2.8717, 5.289, 3.0035, 4.7468, 3.0035], "spans": [{"offset": + 169, "length": 7}]}, {"content": "VAT ID", "boundingBox": [6.141, 2.873, 6.5875, + 2.873, 6.5875, 2.9736, 6.141, 2.9736], "spans": [{"offset": 177, "length": + 6}]}, {"content": "34278587", "boundingBox": [0.5397, 3.411, 1.1457, 3.411, + 1.1457, 3.5144, 0.5397, 3.5144], "spans": [{"offset": 184, "length": 8}]}, + {"content": "6/18/2017", "boundingBox": [1.9455, 3.41, 2.551, 3.41, 2.551, + 3.5144, 1.9455, 3.5144], "spans": [{"offset": 193, "length": 9}]}, {"content": + "6/24/2017", "boundingBox": [3.346, 3.41, 3.9514, 3.41, 3.9514, 3.5144, 3.346, + 3.5144], "spans": [{"offset": 203, "length": 9}]}, {"content": "$56,651.49", + "boundingBox": [5.3871, 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, 3.5321], + "spans": [{"offset": 213, "length": 10}]}, {"content": "PT", "boundingBox": + [6.2285, 3.4114, 6.3919, 3.4114, 6.3919, 3.5119, 6.2285, 3.5119], "spans": + [{"offset": 224, "length": 2}]}], "spans": [{"offset": 0, "length": 226}]}], + "tables": [{"rowCount": 3, "columnCount": 5, "cells": [{"kind": "columnHeader", + "rowIndex": 0, "columnIndex": 0, "rowSpan": 1, "columnSpan": 1, "content": + "Invoice Number", "boundingRegions": [{"pageNumber": 1, "boundingBox": [0.497, + 2.7887, 1.9036, 2.7887, 1.8965, 3.3133, 0.5041, 3.3133]}], "spans": [{"offset": + 124, "length": 14}]}, {"kind": "columnHeader", "rowIndex": 0, "columnIndex": + 1, "rowSpan": 1, "columnSpan": 1, "content": "Invoice Date", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1.9036, 2.7887, 3.296, 2.7887, 3.3031, + 3.3205, 1.8965, 3.3133]}], "spans": [{"offset": 139, "length": 12}]}, {"kind": + "columnHeader", "rowIndex": 0, "columnIndex": 2, "rowSpan": 1, "columnSpan": + 1, "content": "Invoice Due Date", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [3.296, 2.7887, 4.7026, 2.7887, 4.7026, 3.3205, 3.3031, 3.3205]}], "spans": + [{"offset": 152, "length": 16}]}, {"kind": "columnHeader", "rowIndex": 0, + "columnIndex": 3, "rowSpan": 1, "columnSpan": 1, "content": "Charges", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [4.7026, 2.7887, 6.1021, 2.7887, 6.1021, + 3.3133, 4.7026, 3.3205]}], "spans": [{"offset": 169, "length": 7}]}, {"kind": + "columnHeader", "rowIndex": 0, "columnIndex": 4, "rowSpan": 1, "columnSpan": + 1, "content": "VAT ID", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [6.1021, 2.7887, 7.4945, 2.7887, 7.4945, 3.3133, 6.1021, 3.3133]}], "spans": + [{"offset": 177, "length": 6}]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": + 2, "columnSpan": 1, "content": "34278587", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [0.5041, 3.3133, 1.8965, 3.3133, 1.8965, 3.8523, 0.5113, + 3.8523]}], "spans": [{"offset": 184, "length": 8}]}, {"rowIndex": 1, "columnIndex": + 1, "rowSpan": 2, "columnSpan": 1, "content": "6/18/2017", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1.8965, 3.3133, 3.3031, 3.3205, 3.3031, + 3.8523, 1.8965, 3.8523]}], "spans": [{"offset": 193, "length": 9}]}, {"rowIndex": + 1, "columnIndex": 2, "rowSpan": 2, "columnSpan": 1, "content": "6/24/2017", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [3.3031, 3.3205, 4.7026, + 3.3205, 4.7026, 3.8523, 3.3031, 3.8523]}], "spans": [{"offset": 203, "length": + 9}]}, {"rowIndex": 1, "columnIndex": 3, "rowSpan": 2, "columnSpan": 1, "content": + "$56,651.49", "boundingRegions": [{"pageNumber": 1, "boundingBox": [4.7026, + 3.3205, 6.1021, 3.3133, 6.1021, 3.8523, 4.7026, 3.8523]}], "spans": [{"offset": + 213, "length": 10}]}, {"rowIndex": 1, "columnIndex": 4, "rowSpan": 2, "columnSpan": + 1, "content": "PT", "boundingRegions": [{"pageNumber": 1, "boundingBox": [6.1021, + 3.3133, 7.4945, 3.3133, 7.4945, 3.8523, 6.1021, 3.8523]}], "spans": [{"offset": + 224, "length": 2}]}], "boundingRegions": [{"pageNumber": 1, "boundingBox": + [0.5052, 2.7836, 7.4995, 2.7844, 7.4985, 3.8596, 0.5038, 3.859]}], "spans": + [{"offset": 124, "length": 102}]}], "keyValuePairs": [{"key": {"content": + "Address:", "boundingRegions": [{"pageNumber": 1, "boundingBox": [0.7994, + 1.5143, 1.3836, 1.5143, 1.3836, 1.6154, 0.7994, 1.6154]}], "spans": [{"offset": + 8, "length": 8}]}, "value": {"content": "1 Redmond way Suite 6000 Redmond, + WA 99243", "boundingRegions": [{"pageNumber": 1, "boundingBox": [0.8019, 1.7033, + 2.1445, 1.7033, 2.1445, 2.1911, 0.8019, 2.1911]}], "spans": [{"offset": 17, + "length": 42}]}, "confidence": 0.959}, {"key": {"content": "Invoice For:", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [4.4033, 1.5143, 5.1013, + 1.5143, 5.1013, 1.6155, 4.4033, 1.6155]}], "spans": [{"offset": 60, "length": + 12}]}, "value": {"content": "Microsoft 1020 Enterprise Way Sunnayvale, CA + 87659", "boundingRegions": [{"pageNumber": 1, "boundingBox": [5.196, 1.5114, + 6.6526, 1.5114, 6.6526, 2.0359, 5.196, 2.0359]}], "spans": [{"offset": 73, + "length": 50}]}, "confidence": 0.761}, {"key": {"content": "Invoice Number", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [0.5439, 2.8733, 1.5729, + 2.8733, 1.5729, 2.9754, 0.5439, 2.9754]}], "spans": [{"offset": 124, "length": + 14}]}, "value": {"content": "34278587", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [0.5397, 3.411, 1.1457, 3.411, 1.1457, 3.5144, 0.5397, 3.5144]}], + "spans": [{"offset": 184, "length": 8}]}, "confidence": 0.972}, {"key": {"content": + "Invoice Date", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1.9491, + 2.8733, 2.7527, 2.8733, 2.7527, 2.9754, 1.9491, 2.9754]}], "spans": [{"offset": + 139, "length": 12}]}, "value": {"content": "6/18/2017", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1.9455, 3.41, 2.551, 3.41, 2.551, 3.5144, + 1.9455, 3.5144]}], "spans": [{"offset": 193, "length": 9}]}, "confidence": + 0.972}, {"key": {"content": "Invoice Due Date", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [3.3495, 2.8733, 4.4547, 2.8733, 4.4547, 2.9754, 3.3495, + 2.9754]}], "spans": [{"offset": 152, "length": 16}]}, "value": {"content": + "6/24/2017", "boundingRegions": [{"pageNumber": 1, "boundingBox": [3.346, + 3.41, 3.9514, 3.41, 3.9514, 3.5144, 3.346, 3.5144]}], "spans": [{"offset": + 203, "length": 9}]}, "confidence": 0.951}, {"key": {"content": "Charges", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [4.7468, 2.8717, 5.289, + 2.8717, 5.289, 3.0035, 4.7468, 3.0035]}], "spans": [{"offset": 169, "length": + 7}]}, "value": {"content": "$56,651.49", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [5.3871, 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, + 3.5321]}], "spans": [{"offset": 213, "length": 10}]}, "confidence": 0.339}, + {"key": {"content": "VAT ID", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [6.141, 2.873, 6.5875, 2.873, 6.5875, 2.9736, 6.141, 2.9736]}], "spans": [{"offset": + 177, "length": 6}]}, "value": {"content": "PT", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [6.2285, 3.4114, 6.3919, 3.4114, 6.3919, 3.5119, 6.2285, + 3.5119]}], "spans": [{"offset": 224, "length": 2}]}, "confidence": 0.972}], + "entities": [{"category": "Quantity", "subCategory": "Number", "content": + "34278587", "boundingRegions": [{"pageNumber": 1, "boundingBox": [0.5397, + 3.411, 1.1457, 3.411, 1.1457, 3.5144, 0.5397, 3.5144]}], "confidence": 0.8, + "spans": [{"offset": 184, "length": 8}]}, {"category": "DateTime", "subCategory": + "Date", "content": "6/18/2017", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1.9455, 3.41, 2.551, 3.41, 2.551, 3.5144, 1.9455, 3.5144]}], "confidence": + 0.8, "spans": [{"offset": 193, "length": 9}]}, {"category": "DateTime", "subCategory": + "Date", "content": "6/24/2017", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [3.346, 3.41, 3.9514, 3.41, 3.9514, 3.5144, 3.346, 3.5144]}], "confidence": + 0.8, "spans": [{"offset": 203, "length": 9}]}, {"category": "Quantity", "subCategory": + "Currency", "content": "$56,651.49", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [5.3871, 3.4047, 6.0702, 3.4047, 6.0702, 3.5321, 5.3871, 3.5321]}], + "confidence": 0.8, "spans": [{"offset": 213, "length": 10}]}, {"category": + "Organization", "content": "PT", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [6.2285, 3.4114, 6.3919, 3.4114, 6.3919, 3.5119, 6.2285, 3.5119]}], "confidence": + 0.91, "spans": [{"offset": 224, "length": 2}]}, {"category": "Organization", + "content": "Contoso", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [0.5384, 1.1583, 1.4466, 1.1583, 1.4466, 1.3534, 0.5384, 1.3534]}], "confidence": + 0.44, "spans": [{"offset": 0, "length": 7}]}, {"category": "Address", "content": + "1 Redmond way Suite 6000 Redmond, WA 99243", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [0.8106, 1.7033, 2.1445, 1.7033, 2.1445, 1.8342, 0.8106, + 1.8342]}, {"pageNumber": 1, "boundingBox": [0.8019, 1.896, 2.0384, 1.896, + 2.0384, 2.0171, 0.8019, 2.0171]}, {"pageNumber": 1, "boundingBox": [0.8025, + 2.0876, 1.175, 2.0876, 1.175, 2.1911, 0.8025, 2.1911]}], "confidence": 0.74, + "spans": [{"offset": 17, "length": 42}]}, {"category": "Quantity", "subCategory": + "Number", "content": "1", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [0.8106, 1.708, 0.8463, 1.708, 0.8463, 1.8053, 0.8106, 1.8053]}], "confidence": + 0.8, "spans": [{"offset": 17, "length": 1}]}, {"category": "Quantity", "subCategory": + "Number", "content": "6000", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [0.8019, 1.896, 1.0991, 1.896, 1.0991, 1.9994, 0.8019, 1.9994]}], "confidence": + 0.8, "spans": [{"offset": 37, "length": 4}]}, {"category": "Quantity", "subCategory": + "Number", "content": "99243", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [0.8025, 2.0876, 1.175, 2.0876, 1.175, 2.1911, 0.8025, 2.1911]}], "confidence": + 0.8, "spans": [{"offset": 54, "length": 5}]}, {"category": "Organization", + "content": "Microsoft", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [5.2045, 1.5114, 5.8155, 1.5114, 5.8155, 1.6151, 5.2045, 1.6151]}], "confidence": + 0.78, "spans": [{"offset": 73, "length": 9}]}, {"category": "Address", "content": + "1020 Enterprise Way Sunnayvale, CA 87659", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [5.2036, 1.716, 6.5436, 1.716, 6.5436, 1.8459, 5.2036, 1.8459]}, + {"pageNumber": 1, "boundingBox": [5.196, 1.9047, 6.6526, 1.9047, 6.6526, 2.0359, + 5.196, 2.0359]}], "confidence": 0.86, "spans": [{"offset": 83, "length": 40}]}, + {"category": "Quantity", "subCategory": "Number", "content": "1020", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [5.2036, 1.716, 5.4935, 1.716, 5.4935, 1.8185, + 5.2036, 1.8185]}], "confidence": 0.8, "spans": [{"offset": 83, "length": 4}]}, + {"category": "Quantity", "subCategory": "Number", "content": "87659", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [6.2801, 1.906, 6.6526, 1.906, 6.6526, 2.0086, + 6.2801, 2.0086]}], "confidence": 0.8, "spans": [{"offset": 118, "length": + 5}]}]}}' + headers: + apim-request-id: + - dc4283d6-10d2-4f27-adab-b066075c76b2 + content-type: + - application/json; charset=utf-8 + date: + - Mon, 25 Oct 2021 17:43:38 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '180' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_table_cell_get_children.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_table_cell_get_children.yaml new file mode 100644 index 000000000000..f721fd637121 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_table_cell_get_children.yaml @@ -0,0 +1,514 @@ +interactions: +- request: + body: '!!! The request body has been omitted from the recording because its size + 479269 is larger than 128KB. !!!' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '479269' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-layout:analyze?stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview + response: + body: + string: '' + headers: + apim-request-id: + - 14b116a2-9e00-4044-b466-8c53d03b99d1 + content-length: + - '0' + date: + - Mon, 25 Oct 2021 17:43:39 GMT + operation-location: + - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-layout/analyzeResults/14b116a2-9e00-4044-b466-8c53d03b99d1?api-version=2021-09-30-preview + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '586' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-layout/analyzeResults/14b116a2-9e00-4044-b466-8c53d03b99d1?api-version=2021-09-30-preview + response: + body: + string: '{"status": "succeeded", "createdDateTime": "2021-10-25T17:43:38Z", + "lastUpdatedDateTime": "2021-10-25T17:43:42Z", "analyzeResult": {"apiVersion": + "2021-09-30-preview", "modelId": "prebuilt-layout", "stringIndexType": "unicodeCodePoint", + "content": "Purchase Order\nHero Limited\nCompany Phone: 555-348-6512\nWebsite: + www.herolimited.com\nEmail:\nPurchase Order\nDated As: 12/20/2020\nPurchase + Order #: 948284\naccounts@herolimited.com\nShipped To\nVendor Name: Hillary + Swank\nCompany Name: Higgly Wiggly Books\nAddress: 938 NE Burner Road\nBoulder + City, CO 92848\nPhone: 938-294-2949\nShipped From\nName: Bernie Sanders\nCompany + Name: Jupiter Book Supply\nAddress: 383 N Kinnick Road\nSeattle, WA 38383\nPhone: + 932-299-0292\nDetails\nQuantity\nUnit Price\nTotal\nBindings\n20\n1.00\n20.00\nCovers + Small\n20\n1.00\n20.00\nFeather Bookmark\n20\n5.00\n100.00\nCopper Swirl Marker\n20\n5.00\n100.00\nBernie + Sanders\nBernie Sanders\nManager\nAdditional Notes:\nDo not Jostle Box. Unpack + carefully. Enjoy.\nSUBTOTAL\n$140.00\nTAX\n$4.00\nTOTAL\n$144.00\nJupiter + Book Supply will refund you 50% per book if returned within 60 days of reading + and\noffer you 25% off you next total purchase.", "pages": [{"pageNumber": + 1, "angle": 0, "width": 1700, "height": 2200, "unit": "pixel", "words": [{"content": + "Purchase", "boundingBox": [137, 140, 259, 139, 259, 167, 137, 167], "confidence": + 0.997, "span": {"offset": 0, "length": 8}}, {"content": "Order", "boundingBox": + [264, 139, 350, 139, 349, 167, 264, 167], "confidence": 0.995, "span": {"offset": + 9, "length": 5}}, {"content": "Hero", "boundingBox": [621, 208, 769, 206, + 769, 266, 620, 266], "confidence": 0.983, "span": {"offset": 15, "length": + 4}}, {"content": "Limited", "boundingBox": [793, 205, 1058, 204, 1057, 266, + 793, 266], "confidence": 0.997, "span": {"offset": 20, "length": 7}}, {"content": + "Company", "boundingBox": [163, 353, 270, 351, 270, 379, 164, 378], "confidence": + 0.993, "span": {"offset": 28, "length": 7}}, {"content": "Phone:", "boundingBox": + [275, 351, 358, 351, 359, 378, 276, 379], "confidence": 0.997, "span": {"offset": + 36, "length": 6}}, {"content": "555-348-6512", "boundingBox": [363, 351, 524, + 351, 524, 374, 364, 378], "confidence": 0.994, "span": {"offset": 43, "length": + 12}}, {"content": "Website:", "boundingBox": [167, 394, 265, 393, 265, 418, + 167, 417], "confidence": 0.997, "span": {"offset": 56, "length": 8}}, {"content": + "www.herolimited.com", "boundingBox": [270, 393, 522, 393, 522, 418, 270, + 418], "confidence": 0.993, "span": {"offset": 65, "length": 19}}, {"content": + "Email:", "boundingBox": [165, 435, 237, 435, 237, 460, 165, 460], "confidence": + 0.995, "span": {"offset": 85, "length": 6}}, {"content": "Purchase", "boundingBox": + [1113, 322, 1365, 321, 1364, 370, 1113, 368], "confidence": 0.997, "span": + {"offset": 92, "length": 8}}, {"content": "Order", "boundingBox": [1381, 321, + 1549, 321, 1548, 370, 1380, 370], "confidence": 0.995, "span": {"offset": + 101, "length": 5}}, {"content": "Dated", "boundingBox": [1025, 421, 1103, + 420, 1103, 448, 1025, 448], "confidence": 0.993, "span": {"offset": 107, "length": + 5}}, {"content": "As:", "boundingBox": [1110, 420, 1156, 420, 1156, 448, 1110, + 448], "confidence": 0.998, "span": {"offset": 113, "length": 3}}, {"content": + "12/20/2020", "boundingBox": [1162, 420, 1312, 421, 1312, 449, 1162, 448], + "confidence": 0.992, "span": {"offset": 117, "length": 10}}, {"content": "Purchase", + "boundingBox": [1023, 461, 1146, 461, 1147, 489, 1023, 488], "confidence": + 0.997, "span": {"offset": 128, "length": 8}}, {"content": "Order", "boundingBox": + [1152, 461, 1237, 461, 1237, 489, 1152, 489], "confidence": 0.995, "span": + {"offset": 137, "length": 5}}, {"content": "#:", "boundingBox": [1242, 461, + 1270, 461, 1270, 489, 1243, 489], "confidence": 0.997, "span": {"offset": + 143, "length": 2}}, {"content": "948284", "boundingBox": [1275, 461, 1373, + 462, 1373, 489, 1275, 489], "confidence": 0.995, "span": {"offset": 146, "length": + 6}}, {"content": "accounts@herolimited.com", "boundingBox": [164, 481, 471, + 479, 470, 503, 165, 503], "confidence": 0.959, "span": {"offset": 153, "length": + 24}}, {"content": "Shipped", "boundingBox": [167, 547, 328, 547, 327, 592, + 168, 592], "confidence": 0.997, "span": {"offset": 178, "length": 7}}, {"content": + "To", "boundingBox": [337, 547, 392, 547, 391, 591, 336, 592], "confidence": + 0.963, "span": {"offset": 186, "length": 2}}, {"content": "Vendor", "boundingBox": + [160, 611, 250, 610, 250, 638, 160, 637], "confidence": 0.997, "span": {"offset": + 189, "length": 6}}, {"content": "Name:", "boundingBox": [256, 610, 341, 609, + 340, 639, 256, 638], "confidence": 0.995, "span": {"offset": 196, "length": + 5}}, {"content": "Hillary", "boundingBox": [346, 609, 427, 609, 427, 639, + 346, 639], "confidence": 0.997, "span": {"offset": 202, "length": 7}}, {"content": + "Swank", "boundingBox": [433, 609, 518, 610, 517, 639, 433, 639], "confidence": + 0.995, "span": {"offset": 210, "length": 5}}, {"content": "Company", "boundingBox": + [160, 649, 275, 647, 276, 678, 161, 676], "confidence": 0.993, "span": {"offset": + 216, "length": 7}}, {"content": "Name:", "boundingBox": [281, 647, 366, 647, + 366, 679, 282, 678], "confidence": 0.995, "span": {"offset": 224, "length": + 5}}, {"content": "Higgly", "boundingBox": [372, 647, 449, 646, 449, 679, 372, + 679], "confidence": 0.997, "span": {"offset": 230, "length": 6}}, {"content": + "Wiggly", "boundingBox": [455, 646, 541, 646, 541, 678, 455, 679], "confidence": + 0.997, "span": {"offset": 237, "length": 6}}, {"content": "Books", "boundingBox": + [547, 646, 628, 646, 628, 676, 547, 678], "confidence": 0.995, "span": {"offset": + 244, "length": 5}}, {"content": "Address:", "boundingBox": [161, 685, 266, + 685, 265, 712, 160, 711], "confidence": 0.994, "span": {"offset": 250, "length": + 8}}, {"content": "938", "boundingBox": [271, 685, 319, 685, 318, 713, 271, + 712], "confidence": 0.993, "span": {"offset": 259, "length": 3}}, {"content": + "NE", "boundingBox": [324, 685, 360, 685, 359, 713, 323, 713], "confidence": + 0.998, "span": {"offset": 263, "length": 2}}, {"content": "Burner", "boundingBox": + [366, 685, 452, 685, 452, 713, 365, 713], "confidence": 0.997, "span": {"offset": + 266, "length": 6}}, {"content": "Road", "boundingBox": [458, 685, 521, 685, + 521, 713, 457, 713], "confidence": 0.992, "span": {"offset": 273, "length": + 4}}, {"content": "Boulder", "boundingBox": [279, 722, 369, 722, 370, 751, + 280, 750], "confidence": 0.994, "span": {"offset": 278, "length": 7}}, {"content": + "City,", "boundingBox": [375, 722, 431, 722, 432, 751, 376, 751], "confidence": + 0.995, "span": {"offset": 286, "length": 5}}, {"content": "CO", "boundingBox": + [437, 722, 473, 722, 473, 751, 437, 751], "confidence": 0.999, "span": {"offset": + 292, "length": 2}}, {"content": "92848", "boundingBox": [480, 722, 559, 722, + 559, 749, 480, 751], "confidence": 0.995, "span": {"offset": 295, "length": + 5}}, {"content": "Phone:", "boundingBox": [613, 722, 701, 722, 701, 749, 613, + 749], "confidence": 0.997, "span": {"offset": 301, "length": 6}}, {"content": + "938-294-2949", "boundingBox": [706, 722, 882, 722, 881, 748, 706, 749], "confidence": + 0.983, "span": {"offset": 308, "length": 12}}, {"content": "Shipped", "boundingBox": + [167, 784, 324, 785, 324, 830, 169, 830], "confidence": 0.997, "span": {"offset": + 321, "length": 7}}, {"content": "From", "boundingBox": [333, 785, 431, 785, + 431, 827, 333, 830], "confidence": 0.991, "span": {"offset": 329, "length": + 4}}, {"content": "Name:", "boundingBox": [166, 853, 246, 853, 245, 879, 166, + 879], "confidence": 0.994, "span": {"offset": 334, "length": 5}}, {"content": + "Bernie", "boundingBox": [251, 853, 333, 852, 332, 880, 251, 879], "confidence": + 0.997, "span": {"offset": 340, "length": 6}}, {"content": "Sanders", "boundingBox": + [338, 852, 444, 852, 444, 879, 338, 880], "confidence": 0.997, "span": {"offset": + 347, "length": 7}}, {"content": "Company", "boundingBox": [164, 890, 280, + 890, 281, 919, 165, 919], "confidence": 0.994, "span": {"offset": 355, "length": + 7}}, {"content": "Name:", "boundingBox": [285, 890, 372, 889, 372, 919, 286, + 919], "confidence": 0.995, "span": {"offset": 363, "length": 5}}, {"content": + "Jupiter", "boundingBox": [377, 889, 464, 889, 464, 919, 378, 919], "confidence": + 0.997, "span": {"offset": 369, "length": 7}}, {"content": "Book", "boundingBox": + [469, 889, 532, 889, 532, 920, 470, 919], "confidence": 0.992, "span": {"offset": + 377, "length": 4}}, {"content": "Supply", "boundingBox": [538, 889, 628, 890, + 628, 920, 538, 920], "confidence": 0.995, "span": {"offset": 382, "length": + 6}}, {"content": "Address:", "boundingBox": [166, 926, 271, 926, 271, 953, + 166, 953], "confidence": 0.994, "span": {"offset": 389, "length": 8}}, {"content": + "383", "boundingBox": [277, 925, 325, 925, 325, 953, 276, 953], "confidence": + 0.997, "span": {"offset": 398, "length": 3}}, {"content": "N", "boundingBox": + [330, 925, 346, 926, 346, 953, 330, 953], "confidence": 0.995, "span": {"offset": + 402, "length": 1}}, {"content": "Kinnick", "boundingBox": [355, 926, 444, + 926, 444, 954, 355, 953], "confidence": 0.997, "span": {"offset": 404, "length": + 7}}, {"content": "Road", "boundingBox": [450, 926, 516, 927, 515, 954, 449, + 954], "confidence": 0.983, "span": {"offset": 412, "length": 4}}, {"content": + "Seattle,", "boundingBox": [281, 965, 374, 964, 375, 991, 283, 991], "confidence": + 0.996, "span": {"offset": 417, "length": 8}}, {"content": "WA", "boundingBox": + [380, 964, 424, 964, 425, 991, 381, 991], "confidence": 0.998, "span": {"offset": + 426, "length": 2}}, {"content": "38383", "boundingBox": [432, 964, 510, 963, + 511, 990, 432, 991], "confidence": 0.995, "span": {"offset": 429, "length": + 5}}, {"content": "Phone:", "boundingBox": [760, 964, 847, 964, 846, 990, 760, + 990], "confidence": 0.997, "span": {"offset": 435, "length": 6}}, {"content": + "932-299-0292", "boundingBox": [852, 964, 1029, 963, 1028, 990, 851, 990], + "confidence": 0.987, "span": {"offset": 442, "length": 12}}, {"content": "Details", + "boundingBox": [447, 1048, 556, 1048, 555, 1078, 446, 1078], "confidence": + 0.993, "span": {"offset": 455, "length": 7}}, {"content": "Quantity", "boundingBox": + [886, 1048, 1030, 1047, 1029, 1084, 886, 1084], "confidence": 0.997, "span": + {"offset": 463, "length": 8}}, {"content": "Unit", "boundingBox": [1112, 1047, + 1175, 1047, 1175, 1078, 1111, 1078], "confidence": 0.992, "span": {"offset": + 472, "length": 4}}, {"content": "Price", "boundingBox": [1181, 1047, 1263, + 1048, 1262, 1078, 1181, 1078], "confidence": 0.995, "span": {"offset": 477, + "length": 5}}, {"content": "Total", "boundingBox": [1382, 1047, 1468, 1047, + 1468, 1077, 1382, 1077], "confidence": 0.995, "span": {"offset": 483, "length": + 5}}, {"content": "Bindings", "boundingBox": [172, 1094, 279, 1097, 279, 1123, + 173, 1122], "confidence": 0.993, "span": {"offset": 489, "length": 8}}, {"content": + "20", "boundingBox": [859, 1094, 887, 1094, 887, 1119, 859, 1119], "confidence": + 0.997, "span": {"offset": 498, "length": 2}}, {"content": "1.00", "boundingBox": + [1240, 1095, 1290, 1094, 1291, 1117, 1240, 1118], "confidence": 0.988, "span": + {"offset": 501, "length": 4}}, {"content": "20.00", "boundingBox": [1458, + 1096, 1526, 1095, 1525, 1120, 1459, 1119], "confidence": 0.995, "span": {"offset": + 506, "length": 5}}, {"content": "Covers", "boundingBox": [170, 1136, 251, + 1136, 251, 1161, 170, 1161], "confidence": 0.995, "span": {"offset": 512, + "length": 6}}, {"content": "Small", "boundingBox": [256, 1136, 332, 1135, + 331, 1161, 256, 1161], "confidence": 0.995, "span": {"offset": 519, "length": + 5}}, {"content": "20", "boundingBox": [859, 1135, 889, 1135, 889, 1160, 859, + 1160], "confidence": 0.997, "span": {"offset": 525, "length": 2}}, {"content": + "1.00", "boundingBox": [1239, 1135, 1290, 1135, 1291, 1160, 1239, 1160], "confidence": + 0.984, "span": {"offset": 528, "length": 4}}, {"content": "20.00", "boundingBox": + [1458, 1135, 1526, 1135, 1526, 1160, 1458, 1160], "confidence": 0.995, "span": + {"offset": 533, "length": 5}}, {"content": "Feather", "boundingBox": [173, + 1180, 265, 1179, 265, 1206, 174, 1206], "confidence": 0.997, "span": {"offset": + 539, "length": 7}}, {"content": "Bookmark", "boundingBox": [270, 1179, 399, + 1178, 400, 1206, 271, 1206], "confidence": 0.997, "span": {"offset": 547, + "length": 8}}, {"content": "20", "boundingBox": [860, 1179, 888, 1179, 888, + 1204, 860, 1203], "confidence": 0.995, "span": {"offset": 556, "length": 2}}, + {"content": "5.00", "boundingBox": [1239, 1179, 1290, 1178, 1291, 1203, 1239, + 1204], "confidence": 0.994, "span": {"offset": 559, "length": 4}}, {"content": + "100.00", "boundingBox": [1443, 1181, 1525, 1180, 1525, 1204, 1443, 1205], + "confidence": 0.067, "span": {"offset": 564, "length": 6}}, {"content": "Copper", + "boundingBox": [170, 1223, 257, 1222, 257, 1253, 170, 1253], "confidence": + 0.995, "span": {"offset": 571, "length": 6}}, {"content": "Swirl", "boundingBox": + [263, 1222, 325, 1222, 325, 1251, 262, 1252], "confidence": 0.995, "span": + {"offset": 578, "length": 5}}, {"content": "Marker", "boundingBox": [331, + 1222, 429, 1223, 429, 1248, 330, 1251], "confidence": 0.997, "span": {"offset": + 584, "length": 6}}, {"content": "20", "boundingBox": [860, 1223, 887, 1223, + 887, 1247, 860, 1247], "confidence": 0.997, "span": {"offset": 591, "length": + 2}}, {"content": "5.00", "boundingBox": [1239, 1221, 1291, 1221, 1291, 1247, + 1239, 1247], "confidence": 0.988, "span": {"offset": 594, "length": 4}}, {"content": + "100.00", "boundingBox": [1444, 1224, 1525, 1223, 1524, 1247, 1444, 1248], + "confidence": 0.995, "span": {"offset": 599, "length": 6}}, {"content": "Bernie", + "boundingBox": [484, 1671, 595, 1671, 595, 1706, 484, 1706], "confidence": + 0.997, "span": {"offset": 606, "length": 6}}, {"content": "Sanders", "boundingBox": + [602, 1671, 762, 1670, 763, 1708, 602, 1706], "confidence": 0.997, "span": + {"offset": 613, "length": 7}}, {"content": "Bernie", "boundingBox": [542, + 1719, 614, 1719, 615, 1742, 544, 1742], "confidence": 0.995, "span": {"offset": + 621, "length": 6}}, {"content": "Sanders", "boundingBox": [618, 1719, 716, + 1719, 716, 1743, 619, 1742], "confidence": 0.997, "span": {"offset": 628, + "length": 7}}, {"content": "Manager", "boundingBox": [577, 1754, 681, 1756, + 680, 1778, 578, 1776], "confidence": 0.994, "span": {"offset": 636, "length": + 7}}, {"content": "Additional", "boundingBox": [173, 1796, 350, 1796, 349, + 1832, 173, 1831], "confidence": 0.993, "span": {"offset": 644, "length": 10}}, + {"content": "Notes:", "boundingBox": [357, 1796, 478, 1797, 477, 1833, 356, + 1832], "confidence": 0.997, "span": {"offset": 655, "length": 6}}, {"content": + "Do", "boundingBox": [175, 1881, 201, 1881, 202, 1907, 175, 1907], "confidence": + 0.988, "span": {"offset": 662, "length": 2}}, {"content": "not", "boundingBox": + [207, 1881, 251, 1880, 252, 1908, 208, 1907], "confidence": 0.998, "span": + {"offset": 665, "length": 3}}, {"content": "Jostle", "boundingBox": [257, + 1880, 330, 1880, 330, 1909, 257, 1908], "confidence": 0.997, "span": {"offset": + 669, "length": 6}}, {"content": "Box.", "boundingBox": [336, 1880, 397, 1880, + 397, 1909, 336, 1909], "confidence": 0.991, "span": {"offset": 676, "length": + 4}}, {"content": "Unpack", "boundingBox": [403, 1880, 497, 1880, 497, 1910, + 403, 1909], "confidence": 0.997, "span": {"offset": 681, "length": 6}}, {"content": + "carefully.", "boundingBox": [503, 1880, 620, 1880, 620, 1911, 503, 1910], + "confidence": 0.996, "span": {"offset": 688, "length": 10}}, {"content": "Enjoy.", + "boundingBox": [626, 1880, 706, 1881, 706, 1912, 626, 1911], "confidence": + 0.995, "span": {"offset": 699, "length": 6}}, {"content": "SUBTOTAL", "boundingBox": + [1147, 1575, 1293, 1575, 1293, 1600, 1147, 1600], "confidence": 0.993, "span": + {"offset": 706, "length": 8}}, {"content": "$140.00", "boundingBox": [1426, + 1572, 1526, 1572, 1525, 1597, 1427, 1599], "confidence": 0.993, "span": {"offset": + 715, "length": 7}}, {"content": "TAX", "boundingBox": [1236, 1618, 1288, 1618, + 1288, 1643, 1236, 1643], "confidence": 0.994, "span": {"offset": 723, "length": + 3}}, {"content": "$4.00", "boundingBox": [1458, 1615, 1529, 1615, 1529, 1642, + 1458, 1643], "confidence": 0.988, "span": {"offset": 727, "length": 5}}, {"content": + "TOTAL", "boundingBox": [1204, 1674, 1292, 1674, 1292, 1699, 1205, 1699], + "confidence": 0.994, "span": {"offset": 733, "length": 5}}, {"content": "$144.00", + "boundingBox": [1427, 1671, 1527, 1669, 1527, 1697, 1429, 1698], "confidence": + 0.983, "span": {"offset": 739, "length": 7}}, {"content": "Jupiter", "boundingBox": + [169, 1924, 265, 1924, 265, 1959, 169, 1959], "confidence": 0.994, "span": + {"offset": 747, "length": 7}}, {"content": "Book", "boundingBox": [272, 1924, + 350, 1924, 351, 1958, 272, 1959], "confidence": 0.992, "span": {"offset": + 755, "length": 4}}, {"content": "Supply", "boundingBox": [357, 1924, 460, + 1924, 460, 1958, 357, 1958], "confidence": 0.995, "span": {"offset": 760, + "length": 6}}, {"content": "will", "boundingBox": [467, 1924, 516, 1924, 516, + 1958, 467, 1958], "confidence": 0.991, "span": {"offset": 767, "length": 4}}, + {"content": "refund", "boundingBox": [523, 1924, 622, 1924, 621, 1958, 523, + 1958], "confidence": 0.997, "span": {"offset": 772, "length": 6}}, {"content": + "you", "boundingBox": [629, 1924, 685, 1924, 684, 1958, 628, 1958], "confidence": + 0.998, "span": {"offset": 779, "length": 3}}, {"content": "50%", "boundingBox": + [691, 1924, 761, 1924, 760, 1958, 691, 1958], "confidence": 0.988, "span": + {"offset": 783, "length": 3}}, {"content": "per", "boundingBox": [768, 1924, + 819, 1924, 819, 1958, 767, 1958], "confidence": 0.998, "span": {"offset": + 787, "length": 3}}, {"content": "book", "boundingBox": [826, 1924, 900, 1924, + 899, 1958, 825, 1958], "confidence": 0.992, "span": {"offset": 791, "length": + 4}}, {"content": "if", "boundingBox": [907, 1924, 927, 1924, 926, 1958, 906, + 1958], "confidence": 0.999, "span": {"offset": 796, "length": 2}}, {"content": + "returned", "boundingBox": [933, 1924, 1059, 1924, 1058, 1958, 933, 1958], + "confidence": 0.996, "span": {"offset": 799, "length": 8}}, {"content": "within", + "boundingBox": [1066, 1924, 1153, 1924, 1152, 1958, 1065, 1958], "confidence": + 0.997, "span": {"offset": 808, "length": 6}}, {"content": "60", "boundingBox": + [1160, 1924, 1200, 1924, 1199, 1958, 1159, 1958], "confidence": 0.999, "span": + {"offset": 815, "length": 2}}, {"content": "days", "boundingBox": [1207, 1924, + 1279, 1924, 1278, 1958, 1206, 1958], "confidence": 0.992, "span": {"offset": + 818, "length": 4}}, {"content": "of", "boundingBox": [1286, 1924, 1317, 1924, + 1316, 1958, 1284, 1958], "confidence": 0.997, "span": {"offset": 823, "length": + 2}}, {"content": "reading", "boundingBox": [1324, 1924, 1438, 1924, 1437, + 1958, 1322, 1958], "confidence": 0.997, "span": {"offset": 826, "length": + 7}}, {"content": "and", "boundingBox": [1445, 1924, 1505, 1924, 1504, 1958, + 1443, 1958], "confidence": 0.998, "span": {"offset": 834, "length": 3}}, {"content": + "offer", "boundingBox": [169, 1958, 231, 1958, 231, 1991, 169, 1991], "confidence": + 0.993, "span": {"offset": 838, "length": 5}}, {"content": "you", "boundingBox": + [237, 1958, 295, 1958, 295, 1992, 237, 1991], "confidence": 0.989, "span": + {"offset": 844, "length": 3}}, {"content": "25%", "boundingBox": [303, 1958, + 371, 1958, 372, 1992, 303, 1992], "confidence": 0.947, "span": {"offset": + 848, "length": 3}}, {"content": "off", "boundingBox": [378, 1958, 420, 1958, + 420, 1992, 378, 1992], "confidence": 0.998, "span": {"offset": 852, "length": + 3}}, {"content": "you", "boundingBox": [427, 1958, 482, 1958, 482, 1992, 427, + 1992], "confidence": 0.998, "span": {"offset": 856, "length": 3}}, {"content": + "next", "boundingBox": [488, 1958, 554, 1959, 555, 1992, 489, 1992], "confidence": + 0.992, "span": {"offset": 860, "length": 4}}, {"content": "total", "boundingBox": + [561, 1959, 627, 1959, 627, 1991, 561, 1992], "confidence": 0.994, "span": + {"offset": 865, "length": 5}}, {"content": "purchase.", "boundingBox": [633, + 1959, 786, 1961, 787, 1990, 633, 1991], "confidence": 0.996, "span": {"offset": + 871, "length": 9}}], "selectionMarks": [], "lines": [{"content": "Purchase + Order", "boundingBox": [136, 139, 351, 138, 351, 166, 136, 166], "spans": + [{"offset": 0, "length": 14}]}, {"content": "Hero Limited", "boundingBox": + [620, 205, 1074, 204, 1075, 265, 620, 266], "spans": [{"offset": 15, "length": + 12}]}, {"content": "Company Phone: 555-348-6512", "boundingBox": [163, 352, + 528, 350, 528, 376, 163, 379], "spans": [{"offset": 28, "length": 27}]}, {"content": + "Website: www.herolimited.com", "boundingBox": [166, 393, 533, 393, 533, 418, + 166, 418], "spans": [{"offset": 56, "length": 28}]}, {"content": "Email:", + "boundingBox": [165, 435, 237, 435, 237, 460, 165, 460], "spans": [{"offset": + 85, "length": 6}]}, {"content": "Purchase Order", "boundingBox": [1112, 321, + 1554, 321, 1554, 369, 1112, 369], "spans": [{"offset": 92, "length": 14}]}, + {"content": "Dated As: 12/20/2020", "boundingBox": [1024, 419, 1317, 420, + 1317, 448, 1024, 448], "spans": [{"offset": 107, "length": 20}]}, {"content": + "Purchase Order #: 948284", "boundingBox": [1023, 461, 1376, 461, 1376, 489, + 1023, 488], "spans": [{"offset": 128, "length": 24}]}, {"content": "accounts@herolimited.com", + "boundingBox": [164, 479, 482, 478, 483, 502, 164, 503], "spans": [{"offset": + 153, "length": 24}]}, {"content": "Shipped To", "boundingBox": [167, 547, + 397, 546, 397, 591, 167, 592], "spans": [{"offset": 178, "length": 10}]}, + {"content": "Vendor Name: Hillary Swank", "boundingBox": [159, 609, 520, 609, + 520, 638, 159, 638], "spans": [{"offset": 189, "length": 26}]}, {"content": + "Company Name: Higgly Wiggly Books", "boundingBox": [159, 647, 629, 646, 629, + 677, 160, 679], "spans": [{"offset": 216, "length": 33}]}, {"content": "Address: + 938 NE Burner Road", "boundingBox": [160, 684, 526, 684, 526, 712, 160, 711], + "spans": [{"offset": 250, "length": 27}]}, {"content": "Boulder City, CO 92848", + "boundingBox": [279, 722, 566, 721, 566, 750, 279, 751], "spans": [{"offset": + 278, "length": 22}]}, {"content": "Phone: 938-294-2949", "boundingBox": [612, + 721, 885, 721, 885, 747, 612, 748], "spans": [{"offset": 301, "length": 19}]}, + {"content": "Shipped From", "boundingBox": [167, 784, 453, 784, 453, 829, + 167, 830], "spans": [{"offset": 321, "length": 12}]}, {"content": "Name: Bernie + Sanders", "boundingBox": [165, 852, 445, 851, 445, 878, 165, 879], "spans": + [{"offset": 334, "length": 20}]}, {"content": "Company Name: Jupiter Book + Supply", "boundingBox": [164, 889, 629, 889, 629, 919, 164, 919], "spans": + [{"offset": 355, "length": 33}]}, {"content": "Address: 383 N Kinnick Road", + "boundingBox": [165, 925, 521, 926, 521, 953, 165, 952], "spans": [{"offset": + 389, "length": 27}]}, {"content": "Seattle, WA 38383", "boundingBox": [280, + 963, 514, 962, 514, 990, 281, 991], "spans": [{"offset": 417, "length": 17}]}, + {"content": "Phone: 932-299-0292", "boundingBox": [760, 963, 1032, 963, 1032, + 989, 760, 990], "spans": [{"offset": 435, "length": 19}]}, {"content": "Details", + "boundingBox": [446, 1047, 558, 1047, 558, 1077, 446, 1077], "spans": [{"offset": + 455, "length": 7}]}, {"content": "Quantity", "boundingBox": [885, 1047, 1034, + 1047, 1034, 1083, 886, 1083], "spans": [{"offset": 463, "length": 8}]}, {"content": + "Unit Price", "boundingBox": [1111, 1047, 1270, 1047, 1269, 1078, 1111, 1077], + "spans": [{"offset": 472, "length": 10}]}, {"content": "Total", "boundingBox": + [1382, 1047, 1468, 1047, 1467, 1077, 1382, 1077], "spans": [{"offset": 483, + "length": 5}]}, {"content": "Bindings", "boundingBox": [172, 1093, 279, 1095, + 279, 1123, 172, 1121], "spans": [{"offset": 489, "length": 8}]}, {"content": + "20", "boundingBox": [859, 1094, 893, 1094, 893, 1119, 859, 1119], "spans": + [{"offset": 498, "length": 2}]}, {"content": "1.00", "boundingBox": [1240, + 1096, 1295, 1094, 1294, 1118, 1241, 1118], "spans": [{"offset": 501, "length": + 4}]}, {"content": "20.00", "boundingBox": [1458, 1095, 1530, 1095, 1530, 1119, + 1458, 1119], "spans": [{"offset": 506, "length": 5}]}, {"content": "Covers + Small", "boundingBox": [169, 1135, 332, 1134, 333, 1160, 169, 1161], "spans": + [{"offset": 512, "length": 12}]}, {"content": "20", "boundingBox": [859, 1135, + 894, 1135, 891, 1160, 860, 1160], "spans": [{"offset": 525, "length": 2}]}, + {"content": "1.00", "boundingBox": [1239, 1135, 1295, 1135, 1294, 1159, 1239, + 1160], "spans": [{"offset": 528, "length": 4}]}, {"content": "20.00", "boundingBox": + [1458, 1135, 1530, 1135, 1530, 1159, 1459, 1160], "spans": [{"offset": 533, + "length": 5}]}, {"content": "Feather Bookmark", "boundingBox": [173, 1178, + 403, 1177, 403, 1205, 173, 1206], "spans": [{"offset": 539, "length": 16}]}, + {"content": "20", "boundingBox": [860, 1179, 892, 1179, 891, 1204, 860, 1203], + "spans": [{"offset": 556, "length": 2}]}, {"content": "5.00", "boundingBox": + [1239, 1179, 1295, 1178, 1295, 1203, 1239, 1204], "spans": [{"offset": 559, + "length": 4}]}, {"content": "100.00", "boundingBox": [1442, 1180, 1530, 1180, + 1530, 1203, 1443, 1204], "spans": [{"offset": 564, "length": 6}]}, {"content": + "Copper Swirl Marker", "boundingBox": [169, 1223, 429, 1222, 430, 1249, 169, + 1253], "spans": [{"offset": 571, "length": 19}]}, {"content": "20", "boundingBox": + [860, 1223, 893, 1223, 893, 1247, 860, 1247], "spans": [{"offset": 591, "length": + 2}]}, {"content": "5.00", "boundingBox": [1239, 1221, 1294, 1222, 1294, 1246, + 1239, 1247], "spans": [{"offset": 594, "length": 4}]}, {"content": "100.00", + "boundingBox": [1443, 1223, 1530, 1222, 1530, 1246, 1444, 1247], "spans": + [{"offset": 599, "length": 6}]}, {"content": "Bernie Sanders", "boundingBox": + [484, 1670, 764, 1670, 764, 1707, 484, 1706], "spans": [{"offset": 606, "length": + 14}]}, {"content": "Bernie Sanders", "boundingBox": [542, 1718, 718, 1719, + 718, 1742, 542, 1741], "spans": [{"offset": 621, "length": 14}]}, {"content": + "Manager", "boundingBox": [577, 1753, 681, 1755, 681, 1778, 577, 1776], "spans": + [{"offset": 636, "length": 7}]}, {"content": "Additional Notes:", "boundingBox": + [172, 1796, 478, 1796, 478, 1832, 172, 1831], "spans": [{"offset": 644, "length": + 17}]}, {"content": "Do not Jostle Box. Unpack carefully. Enjoy.", "boundingBox": + [174, 1879, 707, 1880, 707, 1911, 174, 1908], "spans": [{"offset": 662, "length": + 43}]}, {"content": "SUBTOTAL", "boundingBox": [1146, 1573, 1296, 1573, 1296, + 1600, 1146, 1600], "spans": [{"offset": 706, "length": 8}]}, {"content": "$140.00", + "boundingBox": [1426, 1571, 1530, 1571, 1530, 1597, 1426, 1598], "spans": + [{"offset": 715, "length": 7}]}, {"content": "TAX", "boundingBox": [1236, + 1618, 1296, 1618, 1295, 1643, 1236, 1643], "spans": [{"offset": 723, "length": + 3}]}, {"content": "$4.00", "boundingBox": [1458, 1615, 1529, 1615, 1528, 1641, + 1458, 1643], "spans": [{"offset": 727, "length": 5}]}, {"content": "TOTAL", + "boundingBox": [1203, 1673, 1297, 1673, 1297, 1698, 1204, 1699], "spans": + [{"offset": 733, "length": 5}]}, {"content": "$144.00", "boundingBox": [1427, + 1670, 1529, 1669, 1530, 1696, 1427, 1697], "spans": [{"offset": 739, "length": + 7}]}, {"content": "Jupiter Book Supply will refund you 50% per book if returned + within 60 days of reading and", "boundingBox": [168, 1923, 1510, 1923, 1510, + 1957, 168, 1958], "spans": [{"offset": 747, "length": 90}]}, {"content": "offer + you 25% off you next total purchase.", "boundingBox": [168, 1957, 786, 1958, + 786, 1991, 168, 1991], "spans": [{"offset": 838, "length": 42}]}], "spans": + [{"offset": 0, "length": 880}]}], "tables": [{"rowCount": 5, "columnCount": + 4, "cells": [{"kind": "columnHeader", "rowIndex": 0, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Details", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [157, 1037, 847, 1038, 847, 1086, 155, 1086]}], "spans": + [{"offset": 455, "length": 7}]}, {"kind": "columnHeader", "rowIndex": 0, "columnIndex": + 1, "rowSpan": 1, "columnSpan": 1, "content": "Quantity", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [847, 1038, 1069, 1038, 1070, 1086, 847, + 1086]}], "spans": [{"offset": 463, "length": 8}]}, {"kind": "columnHeader", + "rowIndex": 0, "columnIndex": 2, "rowSpan": 1, "columnSpan": 1, "content": + "Unit Price", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1069, + 1038, 1309, 1038, 1309, 1086, 1070, 1086]}], "spans": [{"offset": 472, "length": + 10}]}, {"kind": "columnHeader", "rowIndex": 0, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "Total", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1038, 1543, 1038, 1543, 1086, 1309, 1086]}], "spans": + [{"offset": 483, "length": 5}]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Bindings", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1086, 847, 1086, 847, 1127, 155, 1127]}], "spans": + [{"offset": 489, "length": 8}]}, {"rowIndex": 1, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1086, 1070, 1086, 1070, 1127, 847, 1127]}], "spans": + [{"offset": 498, "length": 2}]}, {"rowIndex": 1, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "1.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1086, 1309, 1086, 1309, 1127, 1070, 1127]}], "spans": + [{"offset": 501, "length": 4}]}, {"rowIndex": 1, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "20.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1086, 1543, 1086, 1543, 1127, 1309, 1127]}], "spans": + [{"offset": 506, "length": 5}]}, {"rowIndex": 2, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Covers Small", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1127, 847, 1127, 847, 1171, 155, 1171]}], "spans": + [{"offset": 512, "length": 12}]}, {"rowIndex": 2, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1127, 1070, 1127, 1070, 1171, 847, 1171]}], "spans": + [{"offset": 525, "length": 2}]}, {"rowIndex": 2, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "1.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1127, 1309, 1127, 1309, 1171, 1070, 1171]}], "spans": + [{"offset": 528, "length": 4}]}, {"rowIndex": 2, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "20.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1127, 1543, 1127, 1543, 1171, 1309, 1171]}], "spans": + [{"offset": 533, "length": 5}]}, {"rowIndex": 3, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Feather Bookmark", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1171, 847, 1171, 847, 1214, 155, 1214]}], "spans": + [{"offset": 539, "length": 16}]}, {"rowIndex": 3, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1171, 1070, 1171, 1070, 1214, 847, 1214]}], "spans": + [{"offset": 556, "length": 2}]}, {"rowIndex": 3, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "5.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1171, 1309, 1171, 1309, 1214, 1070, 1214]}], "spans": + [{"offset": 559, "length": 4}]}, {"rowIndex": 3, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "100.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1171, 1543, 1171, 1543, 1215, 1309, 1214]}], "spans": + [{"offset": 564, "length": 6}]}, {"rowIndex": 4, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Copper Swirl Marker", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1214, 847, 1214, 847, 1258, 155, 1258]}], "spans": + [{"offset": 571, "length": 19}]}, {"rowIndex": 4, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1214, 1070, 1214, 1070, 1258, 847, 1258]}], "spans": + [{"offset": 591, "length": 2}]}, {"rowIndex": 4, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "5.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1214, 1309, 1214, 1309, 1258, 1070, 1258]}], "spans": + [{"offset": 594, "length": 4}]}, {"rowIndex": 4, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "100.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1214, 1543, 1215, 1543, 1260, 1309, 1258]}], "spans": + [{"offset": 599, "length": 6}]}], "boundingRegions": [{"pageNumber": 1, "boundingBox": + [153, 1036, 1548, 1036, 1547, 1265, 153, 1265]}], "spans": [{"offset": 455, + "length": 150}]}, {"rowCount": 4, "columnCount": 2, "cells": [{"kind": "columnHeader", + "rowIndex": 0, "columnIndex": 0, "rowSpan": 1, "columnSpan": 1, "content": + "SUBTOTAL", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1070, 1565, + 1309, 1565, 1309, 1609, 1071, 1609]}], "spans": [{"offset": 706, "length": + 8}]}, {"kind": "columnHeader", "rowIndex": 0, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "$140.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1565, 1544, 1564, 1544, 1609, 1309, 1609]}], "spans": + [{"offset": 715, "length": 7}]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "TAX", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [1071, 1609, 1309, 1609, 1309, 1652, 1071, 1652]}], "spans": + [{"offset": 723, "length": 3}]}, {"rowIndex": 1, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "$4.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1609, 1544, 1609, 1544, 1652, 1309, 1652]}], "spans": + [{"offset": 727, "length": 5}]}, {"rowIndex": 2, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1071, 1652, 1309, 1652, 1309, 1664, 1071, 1664]}], "spans": []}, {"rowIndex": + 2, "columnIndex": 1, "rowSpan": 1, "columnSpan": 1, "content": "", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1309, 1652, 1544, 1652, 1544, 1664, 1309, + 1664]}], "spans": []}, {"rowIndex": 3, "columnIndex": 0, "rowSpan": 1, "columnSpan": + 1, "content": "TOTAL", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1071, 1664, 1309, 1664, 1309, 1707, 1071, 1706]}], "spans": [{"offset": 733, + "length": 5}]}, {"rowIndex": 3, "columnIndex": 1, "rowSpan": 1, "columnSpan": + 1, "content": "$144.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1309, 1664, 1544, 1664, 1544, 1707, 1309, 1707]}], "spans": [{"offset": 739, + "length": 7}]}], "boundingRegions": [{"pageNumber": 1, "boundingBox": [1062, + 1563, 1560, 1563, 1560, 1709, 1062, 1709]}], "spans": [{"offset": 706, "length": + 40}]}], "styles": [{"isHandwritten": true, "confidence": 0.9, "spans": [{"offset": + 606, "length": 14}]}]}}' + headers: + apim-request-id: + - 37249584-bc35-4542-9682-81399bc0826b + content-type: + - application/json; charset=utf-8 + date: + - Mon, 25 Oct 2021 17:43:44 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '160' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_table_get_children.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_table_get_children.yaml new file mode 100644 index 000000000000..c99b3aa1de1d --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_table_get_children.yaml @@ -0,0 +1,514 @@ +interactions: +- request: + body: '!!! The request body has been omitted from the recording because its size + 479269 is larger than 128KB. !!!' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '479269' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-layout:analyze?stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview + response: + body: + string: '' + headers: + apim-request-id: + - 928593dc-c767-4634-ae4d-317636498acf + content-length: + - '0' + date: + - Mon, 25 Oct 2021 17:43:45 GMT + operation-location: + - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-layout/analyzeResults/928593dc-c767-4634-ae4d-317636498acf?api-version=2021-09-30-preview + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '479' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-layout/analyzeResults/928593dc-c767-4634-ae4d-317636498acf?api-version=2021-09-30-preview + response: + body: + string: '{"status": "succeeded", "createdDateTime": "2021-10-25T17:43:45Z", + "lastUpdatedDateTime": "2021-10-25T17:43:48Z", "analyzeResult": {"apiVersion": + "2021-09-30-preview", "modelId": "prebuilt-layout", "stringIndexType": "unicodeCodePoint", + "content": "Purchase Order\nHero Limited\nCompany Phone: 555-348-6512\nWebsite: + www.herolimited.com\nEmail:\nPurchase Order\nDated As: 12/20/2020\nPurchase + Order #: 948284\naccounts@herolimited.com\nShipped To\nVendor Name: Hillary + Swank\nCompany Name: Higgly Wiggly Books\nAddress: 938 NE Burner Road\nBoulder + City, CO 92848\nPhone: 938-294-2949\nShipped From\nName: Bernie Sanders\nCompany + Name: Jupiter Book Supply\nAddress: 383 N Kinnick Road\nSeattle, WA 38383\nPhone: + 932-299-0292\nDetails\nQuantity\nUnit Price\nTotal\nBindings\n20\n1.00\n20.00\nCovers + Small\n20\n1.00\n20.00\nFeather Bookmark\n20\n5.00\n100.00\nCopper Swirl Marker\n20\n5.00\n100.00\nBernie + Sanders\nBernie Sanders\nManager\nAdditional Notes:\nDo not Jostle Box. Unpack + carefully. Enjoy.\nSUBTOTAL\n$140.00\nTAX\n$4.00\nTOTAL\n$144.00\nJupiter + Book Supply will refund you 50% per book if returned within 60 days of reading + and\noffer you 25% off you next total purchase.", "pages": [{"pageNumber": + 1, "angle": 0, "width": 1700, "height": 2200, "unit": "pixel", "words": [{"content": + "Purchase", "boundingBox": [137, 140, 259, 139, 259, 167, 137, 167], "confidence": + 0.997, "span": {"offset": 0, "length": 8}}, {"content": "Order", "boundingBox": + [264, 139, 350, 139, 349, 167, 264, 167], "confidence": 0.995, "span": {"offset": + 9, "length": 5}}, {"content": "Hero", "boundingBox": [621, 208, 769, 206, + 769, 266, 620, 266], "confidence": 0.983, "span": {"offset": 15, "length": + 4}}, {"content": "Limited", "boundingBox": [793, 205, 1058, 204, 1057, 266, + 793, 266], "confidence": 0.997, "span": {"offset": 20, "length": 7}}, {"content": + "Company", "boundingBox": [163, 353, 270, 351, 270, 379, 164, 378], "confidence": + 0.993, "span": {"offset": 28, "length": 7}}, {"content": "Phone:", "boundingBox": + [275, 351, 358, 351, 359, 378, 276, 379], "confidence": 0.997, "span": {"offset": + 36, "length": 6}}, {"content": "555-348-6512", "boundingBox": [363, 351, 524, + 351, 524, 374, 364, 378], "confidence": 0.994, "span": {"offset": 43, "length": + 12}}, {"content": "Website:", "boundingBox": [167, 394, 265, 393, 265, 418, + 167, 417], "confidence": 0.997, "span": {"offset": 56, "length": 8}}, {"content": + "www.herolimited.com", "boundingBox": [270, 393, 522, 393, 522, 418, 270, + 418], "confidence": 0.993, "span": {"offset": 65, "length": 19}}, {"content": + "Email:", "boundingBox": [165, 435, 237, 435, 237, 460, 165, 460], "confidence": + 0.995, "span": {"offset": 85, "length": 6}}, {"content": "Purchase", "boundingBox": + [1113, 322, 1365, 321, 1364, 370, 1113, 368], "confidence": 0.997, "span": + {"offset": 92, "length": 8}}, {"content": "Order", "boundingBox": [1381, 321, + 1549, 321, 1548, 370, 1380, 370], "confidence": 0.995, "span": {"offset": + 101, "length": 5}}, {"content": "Dated", "boundingBox": [1025, 421, 1103, + 420, 1103, 448, 1025, 448], "confidence": 0.993, "span": {"offset": 107, "length": + 5}}, {"content": "As:", "boundingBox": [1110, 420, 1156, 420, 1156, 448, 1110, + 448], "confidence": 0.998, "span": {"offset": 113, "length": 3}}, {"content": + "12/20/2020", "boundingBox": [1162, 420, 1312, 421, 1312, 449, 1162, 448], + "confidence": 0.992, "span": {"offset": 117, "length": 10}}, {"content": "Purchase", + "boundingBox": [1023, 461, 1146, 461, 1147, 489, 1023, 488], "confidence": + 0.997, "span": {"offset": 128, "length": 8}}, {"content": "Order", "boundingBox": + [1152, 461, 1237, 461, 1237, 489, 1152, 489], "confidence": 0.995, "span": + {"offset": 137, "length": 5}}, {"content": "#:", "boundingBox": [1242, 461, + 1270, 461, 1270, 489, 1243, 489], "confidence": 0.997, "span": {"offset": + 143, "length": 2}}, {"content": "948284", "boundingBox": [1275, 461, 1373, + 462, 1373, 489, 1275, 489], "confidence": 0.995, "span": {"offset": 146, "length": + 6}}, {"content": "accounts@herolimited.com", "boundingBox": [164, 481, 471, + 479, 470, 503, 165, 503], "confidence": 0.959, "span": {"offset": 153, "length": + 24}}, {"content": "Shipped", "boundingBox": [167, 547, 328, 547, 327, 592, + 168, 592], "confidence": 0.997, "span": {"offset": 178, "length": 7}}, {"content": + "To", "boundingBox": [337, 547, 392, 547, 391, 591, 336, 592], "confidence": + 0.963, "span": {"offset": 186, "length": 2}}, {"content": "Vendor", "boundingBox": + [160, 611, 250, 610, 250, 638, 160, 637], "confidence": 0.997, "span": {"offset": + 189, "length": 6}}, {"content": "Name:", "boundingBox": [256, 610, 341, 609, + 340, 639, 256, 638], "confidence": 0.995, "span": {"offset": 196, "length": + 5}}, {"content": "Hillary", "boundingBox": [346, 609, 427, 609, 427, 639, + 346, 639], "confidence": 0.997, "span": {"offset": 202, "length": 7}}, {"content": + "Swank", "boundingBox": [433, 609, 518, 610, 517, 639, 433, 639], "confidence": + 0.995, "span": {"offset": 210, "length": 5}}, {"content": "Company", "boundingBox": + [160, 649, 275, 647, 276, 678, 161, 676], "confidence": 0.993, "span": {"offset": + 216, "length": 7}}, {"content": "Name:", "boundingBox": [281, 647, 366, 647, + 366, 679, 282, 678], "confidence": 0.995, "span": {"offset": 224, "length": + 5}}, {"content": "Higgly", "boundingBox": [372, 647, 449, 646, 449, 679, 372, + 679], "confidence": 0.997, "span": {"offset": 230, "length": 6}}, {"content": + "Wiggly", "boundingBox": [455, 646, 541, 646, 541, 678, 455, 679], "confidence": + 0.997, "span": {"offset": 237, "length": 6}}, {"content": "Books", "boundingBox": + [547, 646, 628, 646, 628, 676, 547, 678], "confidence": 0.995, "span": {"offset": + 244, "length": 5}}, {"content": "Address:", "boundingBox": [161, 685, 266, + 685, 265, 712, 160, 711], "confidence": 0.994, "span": {"offset": 250, "length": + 8}}, {"content": "938", "boundingBox": [271, 685, 319, 685, 318, 713, 271, + 712], "confidence": 0.993, "span": {"offset": 259, "length": 3}}, {"content": + "NE", "boundingBox": [324, 685, 360, 685, 359, 713, 323, 713], "confidence": + 0.998, "span": {"offset": 263, "length": 2}}, {"content": "Burner", "boundingBox": + [366, 685, 452, 685, 452, 713, 365, 713], "confidence": 0.997, "span": {"offset": + 266, "length": 6}}, {"content": "Road", "boundingBox": [458, 685, 521, 685, + 521, 713, 457, 713], "confidence": 0.992, "span": {"offset": 273, "length": + 4}}, {"content": "Boulder", "boundingBox": [279, 722, 369, 722, 370, 751, + 280, 750], "confidence": 0.994, "span": {"offset": 278, "length": 7}}, {"content": + "City,", "boundingBox": [375, 722, 431, 722, 432, 751, 376, 751], "confidence": + 0.995, "span": {"offset": 286, "length": 5}}, {"content": "CO", "boundingBox": + [437, 722, 473, 722, 473, 751, 437, 751], "confidence": 0.999, "span": {"offset": + 292, "length": 2}}, {"content": "92848", "boundingBox": [480, 722, 559, 722, + 559, 749, 480, 751], "confidence": 0.995, "span": {"offset": 295, "length": + 5}}, {"content": "Phone:", "boundingBox": [613, 722, 701, 722, 701, 749, 613, + 749], "confidence": 0.997, "span": {"offset": 301, "length": 6}}, {"content": + "938-294-2949", "boundingBox": [706, 722, 882, 722, 881, 748, 706, 749], "confidence": + 0.983, "span": {"offset": 308, "length": 12}}, {"content": "Shipped", "boundingBox": + [167, 784, 324, 785, 324, 830, 169, 830], "confidence": 0.997, "span": {"offset": + 321, "length": 7}}, {"content": "From", "boundingBox": [333, 785, 431, 785, + 431, 827, 333, 830], "confidence": 0.991, "span": {"offset": 329, "length": + 4}}, {"content": "Name:", "boundingBox": [166, 853, 246, 853, 245, 879, 166, + 879], "confidence": 0.994, "span": {"offset": 334, "length": 5}}, {"content": + "Bernie", "boundingBox": [251, 853, 333, 852, 332, 880, 251, 879], "confidence": + 0.997, "span": {"offset": 340, "length": 6}}, {"content": "Sanders", "boundingBox": + [338, 852, 444, 852, 444, 879, 338, 880], "confidence": 0.997, "span": {"offset": + 347, "length": 7}}, {"content": "Company", "boundingBox": [164, 890, 280, + 890, 281, 919, 165, 919], "confidence": 0.994, "span": {"offset": 355, "length": + 7}}, {"content": "Name:", "boundingBox": [285, 890, 372, 889, 372, 919, 286, + 919], "confidence": 0.995, "span": {"offset": 363, "length": 5}}, {"content": + "Jupiter", "boundingBox": [377, 889, 464, 889, 464, 919, 378, 919], "confidence": + 0.997, "span": {"offset": 369, "length": 7}}, {"content": "Book", "boundingBox": + [469, 889, 532, 889, 532, 920, 470, 919], "confidence": 0.992, "span": {"offset": + 377, "length": 4}}, {"content": "Supply", "boundingBox": [538, 889, 628, 890, + 628, 920, 538, 920], "confidence": 0.995, "span": {"offset": 382, "length": + 6}}, {"content": "Address:", "boundingBox": [166, 926, 271, 926, 271, 953, + 166, 953], "confidence": 0.994, "span": {"offset": 389, "length": 8}}, {"content": + "383", "boundingBox": [277, 925, 325, 925, 325, 953, 276, 953], "confidence": + 0.997, "span": {"offset": 398, "length": 3}}, {"content": "N", "boundingBox": + [330, 925, 346, 926, 346, 953, 330, 953], "confidence": 0.995, "span": {"offset": + 402, "length": 1}}, {"content": "Kinnick", "boundingBox": [355, 926, 444, + 926, 444, 954, 355, 953], "confidence": 0.997, "span": {"offset": 404, "length": + 7}}, {"content": "Road", "boundingBox": [450, 926, 516, 927, 515, 954, 449, + 954], "confidence": 0.983, "span": {"offset": 412, "length": 4}}, {"content": + "Seattle,", "boundingBox": [281, 965, 374, 964, 375, 991, 283, 991], "confidence": + 0.996, "span": {"offset": 417, "length": 8}}, {"content": "WA", "boundingBox": + [380, 964, 424, 964, 425, 991, 381, 991], "confidence": 0.998, "span": {"offset": + 426, "length": 2}}, {"content": "38383", "boundingBox": [432, 964, 510, 963, + 511, 990, 432, 991], "confidence": 0.995, "span": {"offset": 429, "length": + 5}}, {"content": "Phone:", "boundingBox": [760, 964, 847, 964, 846, 990, 760, + 990], "confidence": 0.997, "span": {"offset": 435, "length": 6}}, {"content": + "932-299-0292", "boundingBox": [852, 964, 1029, 963, 1028, 990, 851, 990], + "confidence": 0.987, "span": {"offset": 442, "length": 12}}, {"content": "Details", + "boundingBox": [447, 1048, 556, 1048, 555, 1078, 446, 1078], "confidence": + 0.993, "span": {"offset": 455, "length": 7}}, {"content": "Quantity", "boundingBox": + [886, 1048, 1030, 1047, 1029, 1084, 886, 1084], "confidence": 0.997, "span": + {"offset": 463, "length": 8}}, {"content": "Unit", "boundingBox": [1112, 1047, + 1175, 1047, 1175, 1078, 1111, 1078], "confidence": 0.992, "span": {"offset": + 472, "length": 4}}, {"content": "Price", "boundingBox": [1181, 1047, 1263, + 1048, 1262, 1078, 1181, 1078], "confidence": 0.995, "span": {"offset": 477, + "length": 5}}, {"content": "Total", "boundingBox": [1382, 1047, 1468, 1047, + 1468, 1077, 1382, 1077], "confidence": 0.995, "span": {"offset": 483, "length": + 5}}, {"content": "Bindings", "boundingBox": [172, 1094, 279, 1097, 279, 1123, + 173, 1122], "confidence": 0.993, "span": {"offset": 489, "length": 8}}, {"content": + "20", "boundingBox": [859, 1094, 887, 1094, 887, 1119, 859, 1119], "confidence": + 0.997, "span": {"offset": 498, "length": 2}}, {"content": "1.00", "boundingBox": + [1240, 1095, 1290, 1094, 1291, 1117, 1240, 1118], "confidence": 0.988, "span": + {"offset": 501, "length": 4}}, {"content": "20.00", "boundingBox": [1458, + 1096, 1526, 1095, 1525, 1120, 1459, 1119], "confidence": 0.995, "span": {"offset": + 506, "length": 5}}, {"content": "Covers", "boundingBox": [170, 1136, 251, + 1136, 251, 1161, 170, 1161], "confidence": 0.995, "span": {"offset": 512, + "length": 6}}, {"content": "Small", "boundingBox": [256, 1136, 332, 1135, + 331, 1161, 256, 1161], "confidence": 0.995, "span": {"offset": 519, "length": + 5}}, {"content": "20", "boundingBox": [859, 1135, 889, 1135, 889, 1160, 859, + 1160], "confidence": 0.997, "span": {"offset": 525, "length": 2}}, {"content": + "1.00", "boundingBox": [1239, 1135, 1290, 1135, 1291, 1160, 1239, 1160], "confidence": + 0.984, "span": {"offset": 528, "length": 4}}, {"content": "20.00", "boundingBox": + [1458, 1135, 1526, 1135, 1526, 1160, 1458, 1160], "confidence": 0.995, "span": + {"offset": 533, "length": 5}}, {"content": "Feather", "boundingBox": [173, + 1180, 265, 1179, 265, 1206, 174, 1206], "confidence": 0.997, "span": {"offset": + 539, "length": 7}}, {"content": "Bookmark", "boundingBox": [270, 1179, 399, + 1178, 400, 1206, 271, 1206], "confidence": 0.997, "span": {"offset": 547, + "length": 8}}, {"content": "20", "boundingBox": [860, 1179, 888, 1179, 888, + 1204, 860, 1203], "confidence": 0.995, "span": {"offset": 556, "length": 2}}, + {"content": "5.00", "boundingBox": [1239, 1179, 1290, 1178, 1291, 1203, 1239, + 1204], "confidence": 0.994, "span": {"offset": 559, "length": 4}}, {"content": + "100.00", "boundingBox": [1443, 1181, 1525, 1180, 1525, 1204, 1443, 1205], + "confidence": 0.067, "span": {"offset": 564, "length": 6}}, {"content": "Copper", + "boundingBox": [170, 1223, 257, 1222, 257, 1253, 170, 1253], "confidence": + 0.995, "span": {"offset": 571, "length": 6}}, {"content": "Swirl", "boundingBox": + [263, 1222, 325, 1222, 325, 1251, 262, 1252], "confidence": 0.995, "span": + {"offset": 578, "length": 5}}, {"content": "Marker", "boundingBox": [331, + 1222, 429, 1223, 429, 1248, 330, 1251], "confidence": 0.997, "span": {"offset": + 584, "length": 6}}, {"content": "20", "boundingBox": [860, 1223, 887, 1223, + 887, 1247, 860, 1247], "confidence": 0.997, "span": {"offset": 591, "length": + 2}}, {"content": "5.00", "boundingBox": [1239, 1221, 1291, 1221, 1291, 1247, + 1239, 1247], "confidence": 0.988, "span": {"offset": 594, "length": 4}}, {"content": + "100.00", "boundingBox": [1444, 1224, 1525, 1223, 1524, 1247, 1444, 1248], + "confidence": 0.995, "span": {"offset": 599, "length": 6}}, {"content": "Bernie", + "boundingBox": [484, 1671, 595, 1671, 595, 1706, 484, 1706], "confidence": + 0.997, "span": {"offset": 606, "length": 6}}, {"content": "Sanders", "boundingBox": + [602, 1671, 762, 1670, 763, 1708, 602, 1706], "confidence": 0.997, "span": + {"offset": 613, "length": 7}}, {"content": "Bernie", "boundingBox": [542, + 1719, 614, 1719, 615, 1742, 544, 1742], "confidence": 0.995, "span": {"offset": + 621, "length": 6}}, {"content": "Sanders", "boundingBox": [618, 1719, 716, + 1719, 716, 1743, 619, 1742], "confidence": 0.997, "span": {"offset": 628, + "length": 7}}, {"content": "Manager", "boundingBox": [577, 1754, 681, 1756, + 680, 1778, 578, 1776], "confidence": 0.994, "span": {"offset": 636, "length": + 7}}, {"content": "Additional", "boundingBox": [173, 1796, 350, 1796, 349, + 1832, 173, 1831], "confidence": 0.993, "span": {"offset": 644, "length": 10}}, + {"content": "Notes:", "boundingBox": [357, 1796, 478, 1797, 477, 1833, 356, + 1832], "confidence": 0.997, "span": {"offset": 655, "length": 6}}, {"content": + "Do", "boundingBox": [175, 1881, 201, 1881, 202, 1907, 175, 1907], "confidence": + 0.988, "span": {"offset": 662, "length": 2}}, {"content": "not", "boundingBox": + [207, 1881, 251, 1880, 252, 1908, 208, 1907], "confidence": 0.998, "span": + {"offset": 665, "length": 3}}, {"content": "Jostle", "boundingBox": [257, + 1880, 330, 1880, 330, 1909, 257, 1908], "confidence": 0.997, "span": {"offset": + 669, "length": 6}}, {"content": "Box.", "boundingBox": [336, 1880, 397, 1880, + 397, 1909, 336, 1909], "confidence": 0.991, "span": {"offset": 676, "length": + 4}}, {"content": "Unpack", "boundingBox": [403, 1880, 497, 1880, 497, 1910, + 403, 1909], "confidence": 0.997, "span": {"offset": 681, "length": 6}}, {"content": + "carefully.", "boundingBox": [503, 1880, 620, 1880, 620, 1911, 503, 1910], + "confidence": 0.996, "span": {"offset": 688, "length": 10}}, {"content": "Enjoy.", + "boundingBox": [626, 1880, 706, 1881, 706, 1912, 626, 1911], "confidence": + 0.995, "span": {"offset": 699, "length": 6}}, {"content": "SUBTOTAL", "boundingBox": + [1147, 1575, 1293, 1575, 1293, 1600, 1147, 1600], "confidence": 0.993, "span": + {"offset": 706, "length": 8}}, {"content": "$140.00", "boundingBox": [1426, + 1572, 1526, 1572, 1525, 1597, 1427, 1599], "confidence": 0.993, "span": {"offset": + 715, "length": 7}}, {"content": "TAX", "boundingBox": [1236, 1618, 1288, 1618, + 1288, 1643, 1236, 1643], "confidence": 0.994, "span": {"offset": 723, "length": + 3}}, {"content": "$4.00", "boundingBox": [1458, 1615, 1529, 1615, 1529, 1642, + 1458, 1643], "confidence": 0.988, "span": {"offset": 727, "length": 5}}, {"content": + "TOTAL", "boundingBox": [1204, 1674, 1292, 1674, 1292, 1699, 1205, 1699], + "confidence": 0.994, "span": {"offset": 733, "length": 5}}, {"content": "$144.00", + "boundingBox": [1427, 1671, 1527, 1669, 1527, 1697, 1429, 1698], "confidence": + 0.983, "span": {"offset": 739, "length": 7}}, {"content": "Jupiter", "boundingBox": + [169, 1924, 265, 1924, 265, 1959, 169, 1959], "confidence": 0.994, "span": + {"offset": 747, "length": 7}}, {"content": "Book", "boundingBox": [272, 1924, + 350, 1924, 351, 1958, 272, 1959], "confidence": 0.992, "span": {"offset": + 755, "length": 4}}, {"content": "Supply", "boundingBox": [357, 1924, 460, + 1924, 460, 1958, 357, 1958], "confidence": 0.995, "span": {"offset": 760, + "length": 6}}, {"content": "will", "boundingBox": [467, 1924, 516, 1924, 516, + 1958, 467, 1958], "confidence": 0.991, "span": {"offset": 767, "length": 4}}, + {"content": "refund", "boundingBox": [523, 1924, 622, 1924, 621, 1958, 523, + 1958], "confidence": 0.997, "span": {"offset": 772, "length": 6}}, {"content": + "you", "boundingBox": [629, 1924, 685, 1924, 684, 1958, 628, 1958], "confidence": + 0.998, "span": {"offset": 779, "length": 3}}, {"content": "50%", "boundingBox": + [691, 1924, 761, 1924, 760, 1958, 691, 1958], "confidence": 0.988, "span": + {"offset": 783, "length": 3}}, {"content": "per", "boundingBox": [768, 1924, + 819, 1924, 819, 1958, 767, 1958], "confidence": 0.998, "span": {"offset": + 787, "length": 3}}, {"content": "book", "boundingBox": [826, 1924, 900, 1924, + 899, 1958, 825, 1958], "confidence": 0.992, "span": {"offset": 791, "length": + 4}}, {"content": "if", "boundingBox": [907, 1924, 927, 1924, 926, 1958, 906, + 1958], "confidence": 0.999, "span": {"offset": 796, "length": 2}}, {"content": + "returned", "boundingBox": [933, 1924, 1059, 1924, 1058, 1958, 933, 1958], + "confidence": 0.996, "span": {"offset": 799, "length": 8}}, {"content": "within", + "boundingBox": [1066, 1924, 1153, 1924, 1152, 1958, 1065, 1958], "confidence": + 0.997, "span": {"offset": 808, "length": 6}}, {"content": "60", "boundingBox": + [1160, 1924, 1200, 1924, 1199, 1958, 1159, 1958], "confidence": 0.999, "span": + {"offset": 815, "length": 2}}, {"content": "days", "boundingBox": [1207, 1924, + 1279, 1924, 1278, 1958, 1206, 1958], "confidence": 0.992, "span": {"offset": + 818, "length": 4}}, {"content": "of", "boundingBox": [1286, 1924, 1317, 1924, + 1316, 1958, 1284, 1958], "confidence": 0.997, "span": {"offset": 823, "length": + 2}}, {"content": "reading", "boundingBox": [1324, 1924, 1438, 1924, 1437, + 1958, 1322, 1958], "confidence": 0.997, "span": {"offset": 826, "length": + 7}}, {"content": "and", "boundingBox": [1445, 1924, 1505, 1924, 1504, 1958, + 1443, 1958], "confidence": 0.998, "span": {"offset": 834, "length": 3}}, {"content": + "offer", "boundingBox": [169, 1958, 231, 1958, 231, 1991, 169, 1991], "confidence": + 0.993, "span": {"offset": 838, "length": 5}}, {"content": "you", "boundingBox": + [237, 1958, 295, 1958, 295, 1992, 237, 1991], "confidence": 0.989, "span": + {"offset": 844, "length": 3}}, {"content": "25%", "boundingBox": [303, 1958, + 371, 1958, 372, 1992, 303, 1992], "confidence": 0.947, "span": {"offset": + 848, "length": 3}}, {"content": "off", "boundingBox": [378, 1958, 420, 1958, + 420, 1992, 378, 1992], "confidence": 0.998, "span": {"offset": 852, "length": + 3}}, {"content": "you", "boundingBox": [427, 1958, 482, 1958, 482, 1992, 427, + 1992], "confidence": 0.998, "span": {"offset": 856, "length": 3}}, {"content": + "next", "boundingBox": [488, 1958, 554, 1959, 555, 1992, 489, 1992], "confidence": + 0.992, "span": {"offset": 860, "length": 4}}, {"content": "total", "boundingBox": + [561, 1959, 627, 1959, 627, 1991, 561, 1992], "confidence": 0.994, "span": + {"offset": 865, "length": 5}}, {"content": "purchase.", "boundingBox": [633, + 1959, 786, 1961, 787, 1990, 633, 1991], "confidence": 0.996, "span": {"offset": + 871, "length": 9}}], "selectionMarks": [], "lines": [{"content": "Purchase + Order", "boundingBox": [136, 139, 351, 138, 351, 166, 136, 166], "spans": + [{"offset": 0, "length": 14}]}, {"content": "Hero Limited", "boundingBox": + [620, 205, 1074, 204, 1075, 265, 620, 266], "spans": [{"offset": 15, "length": + 12}]}, {"content": "Company Phone: 555-348-6512", "boundingBox": [163, 352, + 528, 350, 528, 376, 163, 379], "spans": [{"offset": 28, "length": 27}]}, {"content": + "Website: www.herolimited.com", "boundingBox": [166, 393, 533, 393, 533, 418, + 166, 418], "spans": [{"offset": 56, "length": 28}]}, {"content": "Email:", + "boundingBox": [165, 435, 237, 435, 237, 460, 165, 460], "spans": [{"offset": + 85, "length": 6}]}, {"content": "Purchase Order", "boundingBox": [1112, 321, + 1554, 321, 1554, 369, 1112, 369], "spans": [{"offset": 92, "length": 14}]}, + {"content": "Dated As: 12/20/2020", "boundingBox": [1024, 419, 1317, 420, + 1317, 448, 1024, 448], "spans": [{"offset": 107, "length": 20}]}, {"content": + "Purchase Order #: 948284", "boundingBox": [1023, 461, 1376, 461, 1376, 489, + 1023, 488], "spans": [{"offset": 128, "length": 24}]}, {"content": "accounts@herolimited.com", + "boundingBox": [164, 479, 482, 478, 483, 502, 164, 503], "spans": [{"offset": + 153, "length": 24}]}, {"content": "Shipped To", "boundingBox": [167, 547, + 397, 546, 397, 591, 167, 592], "spans": [{"offset": 178, "length": 10}]}, + {"content": "Vendor Name: Hillary Swank", "boundingBox": [159, 609, 520, 609, + 520, 638, 159, 638], "spans": [{"offset": 189, "length": 26}]}, {"content": + "Company Name: Higgly Wiggly Books", "boundingBox": [159, 647, 629, 646, 629, + 677, 160, 679], "spans": [{"offset": 216, "length": 33}]}, {"content": "Address: + 938 NE Burner Road", "boundingBox": [160, 684, 526, 684, 526, 712, 160, 711], + "spans": [{"offset": 250, "length": 27}]}, {"content": "Boulder City, CO 92848", + "boundingBox": [279, 722, 566, 721, 566, 750, 279, 751], "spans": [{"offset": + 278, "length": 22}]}, {"content": "Phone: 938-294-2949", "boundingBox": [612, + 721, 885, 721, 885, 747, 612, 748], "spans": [{"offset": 301, "length": 19}]}, + {"content": "Shipped From", "boundingBox": [167, 784, 453, 784, 453, 829, + 167, 830], "spans": [{"offset": 321, "length": 12}]}, {"content": "Name: Bernie + Sanders", "boundingBox": [165, 852, 445, 851, 445, 878, 165, 879], "spans": + [{"offset": 334, "length": 20}]}, {"content": "Company Name: Jupiter Book + Supply", "boundingBox": [164, 889, 629, 889, 629, 919, 164, 919], "spans": + [{"offset": 355, "length": 33}]}, {"content": "Address: 383 N Kinnick Road", + "boundingBox": [165, 925, 521, 926, 521, 953, 165, 952], "spans": [{"offset": + 389, "length": 27}]}, {"content": "Seattle, WA 38383", "boundingBox": [280, + 963, 514, 962, 514, 990, 281, 991], "spans": [{"offset": 417, "length": 17}]}, + {"content": "Phone: 932-299-0292", "boundingBox": [760, 963, 1032, 963, 1032, + 989, 760, 990], "spans": [{"offset": 435, "length": 19}]}, {"content": "Details", + "boundingBox": [446, 1047, 558, 1047, 558, 1077, 446, 1077], "spans": [{"offset": + 455, "length": 7}]}, {"content": "Quantity", "boundingBox": [885, 1047, 1034, + 1047, 1034, 1083, 886, 1083], "spans": [{"offset": 463, "length": 8}]}, {"content": + "Unit Price", "boundingBox": [1111, 1047, 1270, 1047, 1269, 1078, 1111, 1077], + "spans": [{"offset": 472, "length": 10}]}, {"content": "Total", "boundingBox": + [1382, 1047, 1468, 1047, 1467, 1077, 1382, 1077], "spans": [{"offset": 483, + "length": 5}]}, {"content": "Bindings", "boundingBox": [172, 1093, 279, 1095, + 279, 1123, 172, 1121], "spans": [{"offset": 489, "length": 8}]}, {"content": + "20", "boundingBox": [859, 1094, 893, 1094, 893, 1119, 859, 1119], "spans": + [{"offset": 498, "length": 2}]}, {"content": "1.00", "boundingBox": [1240, + 1096, 1295, 1094, 1294, 1118, 1241, 1118], "spans": [{"offset": 501, "length": + 4}]}, {"content": "20.00", "boundingBox": [1458, 1095, 1530, 1095, 1530, 1119, + 1458, 1119], "spans": [{"offset": 506, "length": 5}]}, {"content": "Covers + Small", "boundingBox": [169, 1135, 332, 1134, 333, 1160, 169, 1161], "spans": + [{"offset": 512, "length": 12}]}, {"content": "20", "boundingBox": [859, 1135, + 894, 1135, 891, 1160, 860, 1160], "spans": [{"offset": 525, "length": 2}]}, + {"content": "1.00", "boundingBox": [1239, 1135, 1295, 1135, 1294, 1159, 1239, + 1160], "spans": [{"offset": 528, "length": 4}]}, {"content": "20.00", "boundingBox": + [1458, 1135, 1530, 1135, 1530, 1159, 1459, 1160], "spans": [{"offset": 533, + "length": 5}]}, {"content": "Feather Bookmark", "boundingBox": [173, 1178, + 403, 1177, 403, 1205, 173, 1206], "spans": [{"offset": 539, "length": 16}]}, + {"content": "20", "boundingBox": [860, 1179, 892, 1179, 891, 1204, 860, 1203], + "spans": [{"offset": 556, "length": 2}]}, {"content": "5.00", "boundingBox": + [1239, 1179, 1295, 1178, 1295, 1203, 1239, 1204], "spans": [{"offset": 559, + "length": 4}]}, {"content": "100.00", "boundingBox": [1442, 1180, 1530, 1180, + 1530, 1203, 1443, 1204], "spans": [{"offset": 564, "length": 6}]}, {"content": + "Copper Swirl Marker", "boundingBox": [169, 1223, 429, 1222, 430, 1249, 169, + 1253], "spans": [{"offset": 571, "length": 19}]}, {"content": "20", "boundingBox": + [860, 1223, 893, 1223, 893, 1247, 860, 1247], "spans": [{"offset": 591, "length": + 2}]}, {"content": "5.00", "boundingBox": [1239, 1221, 1294, 1222, 1294, 1246, + 1239, 1247], "spans": [{"offset": 594, "length": 4}]}, {"content": "100.00", + "boundingBox": [1443, 1223, 1530, 1222, 1530, 1246, 1444, 1247], "spans": + [{"offset": 599, "length": 6}]}, {"content": "Bernie Sanders", "boundingBox": + [484, 1670, 764, 1670, 764, 1707, 484, 1706], "spans": [{"offset": 606, "length": + 14}]}, {"content": "Bernie Sanders", "boundingBox": [542, 1718, 718, 1719, + 718, 1742, 542, 1741], "spans": [{"offset": 621, "length": 14}]}, {"content": + "Manager", "boundingBox": [577, 1753, 681, 1755, 681, 1778, 577, 1776], "spans": + [{"offset": 636, "length": 7}]}, {"content": "Additional Notes:", "boundingBox": + [172, 1796, 478, 1796, 478, 1832, 172, 1831], "spans": [{"offset": 644, "length": + 17}]}, {"content": "Do not Jostle Box. Unpack carefully. Enjoy.", "boundingBox": + [174, 1879, 707, 1880, 707, 1911, 174, 1908], "spans": [{"offset": 662, "length": + 43}]}, {"content": "SUBTOTAL", "boundingBox": [1146, 1573, 1296, 1573, 1296, + 1600, 1146, 1600], "spans": [{"offset": 706, "length": 8}]}, {"content": "$140.00", + "boundingBox": [1426, 1571, 1530, 1571, 1530, 1597, 1426, 1598], "spans": + [{"offset": 715, "length": 7}]}, {"content": "TAX", "boundingBox": [1236, + 1618, 1296, 1618, 1295, 1643, 1236, 1643], "spans": [{"offset": 723, "length": + 3}]}, {"content": "$4.00", "boundingBox": [1458, 1615, 1529, 1615, 1528, 1641, + 1458, 1643], "spans": [{"offset": 727, "length": 5}]}, {"content": "TOTAL", + "boundingBox": [1203, 1673, 1297, 1673, 1297, 1698, 1204, 1699], "spans": + [{"offset": 733, "length": 5}]}, {"content": "$144.00", "boundingBox": [1427, + 1670, 1529, 1669, 1530, 1696, 1427, 1697], "spans": [{"offset": 739, "length": + 7}]}, {"content": "Jupiter Book Supply will refund you 50% per book if returned + within 60 days of reading and", "boundingBox": [168, 1923, 1510, 1923, 1510, + 1957, 168, 1958], "spans": [{"offset": 747, "length": 90}]}, {"content": "offer + you 25% off you next total purchase.", "boundingBox": [168, 1957, 786, 1958, + 786, 1991, 168, 1991], "spans": [{"offset": 838, "length": 42}]}], "spans": + [{"offset": 0, "length": 880}]}], "tables": [{"rowCount": 5, "columnCount": + 4, "cells": [{"kind": "columnHeader", "rowIndex": 0, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Details", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [157, 1037, 847, 1038, 847, 1086, 155, 1086]}], "spans": + [{"offset": 455, "length": 7}]}, {"kind": "columnHeader", "rowIndex": 0, "columnIndex": + 1, "rowSpan": 1, "columnSpan": 1, "content": "Quantity", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [847, 1038, 1069, 1038, 1070, 1086, 847, + 1086]}], "spans": [{"offset": 463, "length": 8}]}, {"kind": "columnHeader", + "rowIndex": 0, "columnIndex": 2, "rowSpan": 1, "columnSpan": 1, "content": + "Unit Price", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1069, + 1038, 1309, 1038, 1309, 1086, 1070, 1086]}], "spans": [{"offset": 472, "length": + 10}]}, {"kind": "columnHeader", "rowIndex": 0, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "Total", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1038, 1543, 1038, 1543, 1086, 1309, 1086]}], "spans": + [{"offset": 483, "length": 5}]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Bindings", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1086, 847, 1086, 847, 1127, 155, 1127]}], "spans": + [{"offset": 489, "length": 8}]}, {"rowIndex": 1, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1086, 1070, 1086, 1070, 1127, 847, 1127]}], "spans": + [{"offset": 498, "length": 2}]}, {"rowIndex": 1, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "1.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1086, 1309, 1086, 1309, 1127, 1070, 1127]}], "spans": + [{"offset": 501, "length": 4}]}, {"rowIndex": 1, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "20.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1086, 1543, 1086, 1543, 1127, 1309, 1127]}], "spans": + [{"offset": 506, "length": 5}]}, {"rowIndex": 2, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Covers Small", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1127, 847, 1127, 847, 1171, 155, 1171]}], "spans": + [{"offset": 512, "length": 12}]}, {"rowIndex": 2, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1127, 1070, 1127, 1070, 1171, 847, 1171]}], "spans": + [{"offset": 525, "length": 2}]}, {"rowIndex": 2, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "1.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1127, 1309, 1127, 1309, 1171, 1070, 1171]}], "spans": + [{"offset": 528, "length": 4}]}, {"rowIndex": 2, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "20.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1127, 1543, 1127, 1543, 1171, 1309, 1171]}], "spans": + [{"offset": 533, "length": 5}]}, {"rowIndex": 3, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Feather Bookmark", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1171, 847, 1171, 847, 1214, 155, 1214]}], "spans": + [{"offset": 539, "length": 16}]}, {"rowIndex": 3, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1171, 1070, 1171, 1070, 1214, 847, 1214]}], "spans": + [{"offset": 556, "length": 2}]}, {"rowIndex": 3, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "5.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1171, 1309, 1171, 1309, 1214, 1070, 1214]}], "spans": + [{"offset": 559, "length": 4}]}, {"rowIndex": 3, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "100.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1171, 1543, 1171, 1543, 1215, 1309, 1214]}], "spans": + [{"offset": 564, "length": 6}]}, {"rowIndex": 4, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Copper Swirl Marker", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1214, 847, 1214, 847, 1258, 155, 1258]}], "spans": + [{"offset": 571, "length": 19}]}, {"rowIndex": 4, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1214, 1070, 1214, 1070, 1258, 847, 1258]}], "spans": + [{"offset": 591, "length": 2}]}, {"rowIndex": 4, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "5.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1214, 1309, 1214, 1309, 1258, 1070, 1258]}], "spans": + [{"offset": 594, "length": 4}]}, {"rowIndex": 4, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "100.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1214, 1543, 1215, 1543, 1260, 1309, 1258]}], "spans": + [{"offset": 599, "length": 6}]}], "boundingRegions": [{"pageNumber": 1, "boundingBox": + [153, 1036, 1548, 1036, 1547, 1265, 153, 1265]}], "spans": [{"offset": 455, + "length": 150}]}, {"rowCount": 4, "columnCount": 2, "cells": [{"kind": "columnHeader", + "rowIndex": 0, "columnIndex": 0, "rowSpan": 1, "columnSpan": 1, "content": + "SUBTOTAL", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1070, 1565, + 1309, 1565, 1309, 1609, 1071, 1609]}], "spans": [{"offset": 706, "length": + 8}]}, {"kind": "columnHeader", "rowIndex": 0, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "$140.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1565, 1544, 1564, 1544, 1609, 1309, 1609]}], "spans": + [{"offset": 715, "length": 7}]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "TAX", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [1071, 1609, 1309, 1609, 1309, 1652, 1071, 1652]}], "spans": + [{"offset": 723, "length": 3}]}, {"rowIndex": 1, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "$4.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1609, 1544, 1609, 1544, 1652, 1309, 1652]}], "spans": + [{"offset": 727, "length": 5}]}, {"rowIndex": 2, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1071, 1652, 1309, 1652, 1309, 1664, 1071, 1664]}], "spans": []}, {"rowIndex": + 2, "columnIndex": 1, "rowSpan": 1, "columnSpan": 1, "content": "", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1309, 1652, 1544, 1652, 1544, 1664, 1309, + 1664]}], "spans": []}, {"rowIndex": 3, "columnIndex": 0, "rowSpan": 1, "columnSpan": + 1, "content": "TOTAL", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1071, 1664, 1309, 1664, 1309, 1707, 1071, 1706]}], "spans": [{"offset": 733, + "length": 5}]}, {"rowIndex": 3, "columnIndex": 1, "rowSpan": 1, "columnSpan": + 1, "content": "$144.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1309, 1664, 1544, 1664, 1544, 1707, 1309, 1707]}], "spans": [{"offset": 739, + "length": 7}]}], "boundingRegions": [{"pageNumber": 1, "boundingBox": [1062, + 1563, 1560, 1563, 1560, 1709, 1062, 1709]}], "spans": [{"offset": 706, "length": + 40}]}], "styles": [{"isHandwritten": true, "confidence": 0.9, "spans": [{"offset": + 606, "length": 14}]}]}}' + headers: + apim-request-id: + - df8d0eba-78d4-410b-9bf4-672e51d4e76c + content-type: + - application/json; charset=utf-8 + date: + - Mon, 25 Oct 2021 17:43:50 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '151' + status: + code: 200 + message: OK +version: 1 From 1e220e5e7e56fcfd222f46d218210c2e65e1c2fd Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Mon, 25 Oct 2021 13:46:44 -0700 Subject: [PATCH 05/27] update DocumentContentElement test --- .../azure-ai-formrecognizer/tests/test_to_dict_v3.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_to_dict_v3.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_to_dict_v3.py index 6ecfc856fc78..593503d62b12 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_to_dict_v3.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_to_dict_v3.py @@ -53,7 +53,7 @@ def test_document_span_to_dict(self): } assert d == final - def test_document_element_to_dict(self): + def test_document_content_element_to_dict(self): model = _models.DocumentContentElement( content="sample", bounding_box=[ @@ -62,7 +62,12 @@ def test_document_element_to_dict(self): _models.Point(1527.0, 1698.0), _models.Point(1427.0, 1698.0), ], + span=_models.DocumentSpan( + offset=5, + length=2, + ), kind="word", + confidence=0.99, ) d = model.to_dict() @@ -74,6 +79,11 @@ def test_document_element_to_dict(self): {"x": 1527.0, "y": 1698.0}, {"x": 1427.0, "y": 1698.0}, ], + "span": { + "offset": 5, + "length": 2, + }, + "confidence": 0.99, "kind": "word", } assert d == final From ff9e39848e94b11e24930aef0422a5d904642a42 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Mon, 25 Oct 2021 15:20:30 -0700 Subject: [PATCH 06/27] move get children to DocumentKeyValueElement, typing fixes --- .../azure/ai/formrecognizer/_models.py | 100 ++++++++---------- 1 file changed, 44 insertions(+), 56 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index a98549588187..fef42024b176 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -6,7 +6,7 @@ # pylint: disable=protected-access, too-many-lines -from typing import Union, Any +from typing import Union, Any, List from enum import Enum from collections import namedtuple from ._generated.v2021_09_30_preview.models import ModelInfo, Error @@ -2186,7 +2186,7 @@ def from_dict(cls, data): bounding_box=[Point.from_dict(v) for v in data.get("bounding_box")] # type: ignore if len(data.get("bounding_box", [])) > 0 else [], - span=DocumentSpan.from_dict(data.get("span")) if data.get("span") else None, + span=DocumentSpan.from_dict(data.get("span")) if data.get("span") else None, # type: ignore confidence=data.get("confidence", None), kind=data.get("kind", None), ) @@ -2287,7 +2287,7 @@ def from_dict(cls, data): def get_children( self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] """Get the child elements found in the span of this AnalyzedDocument. :ivar str element_types: List of the child elements to retreive from the span of this item. :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] @@ -2421,7 +2421,7 @@ def from_dict(cls, data): def get_children( self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] """Get the child elements found in the span of this DocumentEntity. :ivar str element_types: List of the child elements to retreive from the span of this item. :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] @@ -2563,7 +2563,7 @@ def from_dict(cls, data): def get_children( self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] """Get the child elements found in the span of this DocumentField. :ivar str element_types: List of the child elements to retreive from the span of this item. :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] @@ -2664,6 +2664,30 @@ def from_dict(cls, data): else [], ) + def get_children( + self, **kwargs + ): # pylint: disable=unused-argument,no-self-use + # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + """Get the child elements found in the span of this DocumentKeyValueElement. + :ivar str element_types: List of the child elements to retreive from the span of this item. + :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + """ + element_types = kwargs.get("element_types", ["word", "line"]) + + result = [] + for elem in element_types: + result.extend(_find_cross_page_elements( + self, + elem, + allowed_elements=[ + "line", + "word", + "selection_mark", + ], + )) + return result + class DocumentKeyValuePair(object): """An object representing a document field with distinct field label (key) and field value (may be empty). @@ -2677,15 +2701,13 @@ class DocumentKeyValuePair(object): """ def __init__(self, **kwargs): - self._parent = kwargs.get("_parent", None) self.key = kwargs.get("key", None) self.value = kwargs.get("value", None) self.confidence = kwargs.get("confidence", None) @classmethod - def _from_generated(cls, key_value_pair, parent): + def _from_generated(cls, key_value_pair): return cls( - _parent=parent, key=DocumentKeyValueElement._from_generated(key_value_pair.key, parent) if key_value_pair.key else None, @@ -2734,39 +2756,6 @@ def from_dict(cls, data): confidence=data.get("confidence", None), ) - def get_children( - self, **kwargs - ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] - """Get the child elements found in the span of this DocumentKeyValuePair. - :ivar str element_types: List of the child elements to retreive from the span of this item. - :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] - :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] - """ - element_types = kwargs.get("element_types", ["word", "line"]) - - result = [] - for elem in element_types: - result.extend(_find_cross_page_elements( - self.key, - elem, - allowed_elements=[ - "line", - "word", - "selection_mark", - ], - )) - result.extend(_find_cross_page_elements( - self.key, - elem, - allowed_elements=[ - "line", - "word", - "selection_mark", - ], - )) - return result - class DocumentLine(object): """A content line object representing the content found on a single line of the document. @@ -2841,7 +2830,7 @@ def from_dict(cls, data): def get_children( self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> list[Union[DocumentContentElement, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> List[Union[DocumentContentElement, DocumentWord, DocumentSelectionMark]] """Get the child elements found in the span of this DocumentLine. :ivar list[str] element_types: List of the child elements to retreive from the span of the line. :return: list[Union[DocumentContentElement, DocumentWord, DocumentSelectionMark]] @@ -2856,7 +2845,7 @@ def get_children( elem, self.spans, allowed_elements=[ - "word", # TODO add selection marks once they're ready. The spans on selection marks dont match up with the spans of the line + "word", ], )) return result @@ -3240,7 +3229,7 @@ def from_dict(cls, data): def get_children( self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> list[Union[DocumentLine, DocumentContentElement, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> List[Union[DocumentLine, DocumentContentElement, DocumentWord, DocumentSelectionMark]] """Get the child elements found in the span of this DocumentTable. :ivar str element_types: List of the child elements to retreive from the span of this item. :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] @@ -3380,7 +3369,7 @@ def from_dict(cls, data): def get_children( self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] """Get the child elements found in the span of this DocumentTableCellElement. :ivar str element_types: List of the child elements to retreive from the span of this item. :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] @@ -4243,26 +4232,26 @@ def from_dict(cls, data): def _find_elements(parent, element, spans, **kwargs): - # type: (AnalyzeResult, str, list[DocumentSpan], Any) -> list[Any] + # type: (DocumentPage, str, List[DocumentSpan], Any) -> List[Any] allowed = kwargs.get("allowed_elements", None) if element not in allowed: raise ValueError("received an unsupported child element") result = [] for elem in _get_element_list(parent, element): - if in_span(elem, spans): + if _in_span(elem, spans): result.append(elem) return result def _find_cross_page_elements(source, element, **kwargs): - # type: (Union[DocumentTable, DocumentField], str, Any) -> list[Any] + # type: (Union[AnalyzedDocument, DocumentEntity, DocumentField, DocumentKeyValueElement, DocumentTable, DocumentTableCell], str, Any) -> List[Any] allowed = kwargs.get("allowed_elements", None) if element not in allowed: raise ValueError("received an unsupported child element") result = [] for region in source.bounding_regions: for elem in _get_element_list(_get_page(source._parent.pages, region.page_number), element): - if in_span(elem, source.spans): + if _in_span(elem, source.spans): result.append(elem) return result @@ -4273,19 +4262,18 @@ def _get_page(pages, page_number): raise "could not find page" def _get_element_list(parent, element): - # type: (DocumentPage, str) -> list[Any] + # type: (DocumentPage, str) -> List[Any] if element == "word": return parent.words - elif element == "selection_mark": + if element == "selection_mark": return parent.selection_marks - elif element == "line": + if element == "line": return parent.lines - else: - raise ValueError("Unsupported element requested.") + raise ValueError("Unsupported element requested.") -def in_span(element, spans): - # type: (Any, list[Point]) -> bool +def _in_span(element, spans): + # type: (Any, List[DocumentSpan]) -> bool if hasattr(element, "span"): for span in spans: if element.span.offset >= span.offset and ( From 7f9462fa55f40da1fb92ca305c5c3a9de6c96d0b Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Mon, 25 Oct 2021 15:23:22 -0700 Subject: [PATCH 07/27] remove references to selection marks --- .../azure/ai/formrecognizer/_models.py | 53 +++++++++---------- 1 file changed, 24 insertions(+), 29 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index fef42024b176..58e35d15227b 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -2287,11 +2287,11 @@ def from_dict(cls, data): def get_children( self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord]] """Get the child elements found in the span of this AnalyzedDocument. :ivar str element_types: List of the child elements to retreive from the span of this item. - :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] - :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] + :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ element_types = kwargs.get("element_types", ["word", "line"]) @@ -2303,7 +2303,6 @@ def get_children( allowed_elements=[ "line", "word", - "selection_mark", ], )) return result @@ -2421,11 +2420,11 @@ def from_dict(cls, data): def get_children( self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord]] """Get the child elements found in the span of this DocumentEntity. :ivar str element_types: List of the child elements to retreive from the span of this item. - :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] - :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] + :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ element_types = kwargs.get("element_types", ["word", "line"]) @@ -2437,7 +2436,6 @@ def get_children( allowed_elements=[ "line", "word", - "selection_mark", ], )) return result @@ -2563,11 +2561,11 @@ def from_dict(cls, data): def get_children( self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord]] """Get the child elements found in the span of this DocumentField. :ivar str element_types: List of the child elements to retreive from the span of this item. - :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] - :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] + :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ element_types = kwargs.get("element_types", ["word", "line"]) @@ -2579,7 +2577,6 @@ def get_children( allowed_elements=[ "line", "word", - "selection_mark", ], )) return result @@ -2667,11 +2664,11 @@ def from_dict(cls, data): def get_children( self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord]] """Get the child elements found in the span of this DocumentKeyValueElement. :ivar str element_types: List of the child elements to retreive from the span of this item. - :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] - :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] + :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ element_types = kwargs.get("element_types", ["word", "line"]) @@ -2683,7 +2680,6 @@ def get_children( allowed_elements=[ "line", "word", - "selection_mark", ], )) return result @@ -2830,11 +2826,11 @@ def from_dict(cls, data): def get_children( self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> List[Union[DocumentContentElement, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> List[Union[DocumentContentElement, DocumentWord]] """Get the child elements found in the span of this DocumentLine. :ivar list[str] element_types: List of the child elements to retreive from the span of the line. - :return: list[Union[DocumentContentElement, DocumentWord, DocumentSelectionMark]] - :rtype: list[Union[DocumentContentElement, DocumentWord, DocumentSelectionMark]] + :return: list[Union[DocumentContentElement, DocumentWord]] + :rtype: list[Union[DocumentContentElement, DocumentWord]] """ element_types = kwargs.get("element_types", ["word"]) @@ -3229,11 +3225,11 @@ def from_dict(cls, data): def get_children( self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> List[Union[DocumentLine, DocumentContentElement, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> List[Union[DocumentLine, DocumentContentElement, DocumentWord]] """Get the child elements found in the span of this DocumentTable. :ivar str element_types: List of the child elements to retreive from the span of this item. - :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] - :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] + :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ element_types = kwargs.get("element_types", ["word", "line"]) @@ -3245,7 +3241,6 @@ def get_children( allowed_elements=[ "line", "word", - "selection_mark", ], )) return result @@ -3369,11 +3364,11 @@ def from_dict(cls, data): def get_children( self, **kwargs ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord]] """Get the child elements found in the span of this DocumentTableCellElement. :ivar str element_types: List of the child elements to retreive from the span of this item. - :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] - :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord, DocumentSelectionMark]] + :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] + :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ element_types = kwargs.get("element_types", ["word"]) @@ -3385,7 +3380,6 @@ def get_children( allowed_elements=[ "line", "word", - "selection_mark", ], )) return result @@ -4265,8 +4259,9 @@ def _get_element_list(parent, element): # type: (DocumentPage, str) -> List[Any] if element == "word": return parent.words - if element == "selection_mark": - return parent.selection_marks + # TODO uncomment once selection marks issue is fixed + # if element == "selection_mark": + # return parent.selection_marks if element == "line": return parent.lines raise ValueError("Unsupported element requested.") From 948e86597ad1de3d0a9864b9ac81f88336b1929d Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Mon, 25 Oct 2021 15:56:23 -0700 Subject: [PATCH 08/27] fix document key value element test --- .../azure/ai/formrecognizer/_models.py | 2 +- ...ument_key_value_element_get_children.yaml} | 20 +++++++++---------- .../tests/test_get_children.py | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) rename sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/{test_get_children.test_document_key_value_pair_get_children.yaml => test_get_children.test_document_key_value_element_get_children.yaml} (99%) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index 58e35d15227b..655068a5588d 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -2702,7 +2702,7 @@ def __init__(self, **kwargs): self.confidence = kwargs.get("confidence", None) @classmethod - def _from_generated(cls, key_value_pair): + def _from_generated(cls, key_value_pair, parent): return cls( key=DocumentKeyValueElement._from_generated(key_value_pair.key, parent) if key_value_pair.key diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_key_value_pair_get_children.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_key_value_element_get_children.yaml similarity index 99% rename from sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_key_value_pair_get_children.yaml rename to sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_key_value_element_get_children.yaml index 8fc7799c4bc6..0af515e2b0ff 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_key_value_pair_get_children.yaml +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_key_value_element_get_children.yaml @@ -22,19 +22,19 @@ interactions: string: '' headers: apim-request-id: - - c74ee61a-8c2a-4488-92ab-72453037f7ad + - 768e76b3-a51c-4dbc-bdd5-54fb90e0d7cf content-length: - '0' date: - - Mon, 25 Oct 2021 17:43:15 GMT + - Mon, 25 Oct 2021 22:55:14 GMT operation-location: - - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/c74ee61a-8c2a-4488-92ab-72453037f7ad?api-version=2021-09-30-preview + - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/768e76b3-a51c-4dbc-bdd5-54fb90e0d7cf?api-version=2021-09-30-preview strict-transport-security: - max-age=31536000; includeSubDomains; preload x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '543' + - '470' status: code: 202 message: Accepted @@ -50,11 +50,11 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/c74ee61a-8c2a-4488-92ab-72453037f7ad?api-version=2021-09-30-preview + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/768e76b3-a51c-4dbc-bdd5-54fb90e0d7cf?api-version=2021-09-30-preview response: body: - string: '{"status": "succeeded", "createdDateTime": "2021-10-25T17:43:15Z", - "lastUpdatedDateTime": "2021-10-25T17:43:20Z", "analyzeResult": {"apiVersion": + string: '{"status": "succeeded", "createdDateTime": "2021-10-25T22:55:14Z", + "lastUpdatedDateTime": "2021-10-25T22:55:18Z", "analyzeResult": {"apiVersion": "2021-09-30-preview", "modelId": "prebuilt-document", "stringIndexType": "unicodeCodePoint", "content": "Purchase Order\nHero Limited\nCompany Phone: 555-348-6512\nWebsite: www.herolimited.com\nEmail:\nPurchase Order\nDated As: 12/20/2020\nPurchase @@ -684,11 +684,11 @@ interactions: 0.9, "spans": [{"offset": 606, "length": 14}]}]}}' headers: apim-request-id: - - 2fcbaf34-eacf-418c-82b8-ebb63fac09db + - 6cf91e39-98b2-4a03-8d6a-0cca10d9da5a content-type: - application/json; charset=utf-8 date: - - Mon, 25 Oct 2021 17:43:20 GMT + - Mon, 25 Oct 2021 22:55:19 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -696,7 +696,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '336' + - '408' status: code: 200 message: OK diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py index 1e387461f3b2..893d9f1c4f35 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py @@ -108,15 +108,15 @@ def test_document_entity_get_children(self, client): @FormRecognizerPreparer() @DocumentAnalysisClientPreparer() - def test_document_key_value_pair_get_children(self, client): + def test_document_key_value_element_get_children(self, client): with open(self.form_jpg, "rb") as fd: document = fd.read() poller = client.begin_analyze_document("prebuilt-document", document) result = poller.result() - elements = result.key_value_pairs[0].get_children() - assert len(elements) == 4 + elements = result.key_value_pairs[0].key.get_children() + assert len(elements) == 2 - elements = result.key_value_pairs[0].get_children(element_types=["line"]) + elements = result.key_value_pairs[0].key.get_children(element_types=["line"]) assert len(elements) == 0 From bdd1eac19cf53b1098127d518ad9733febd74b72 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Mon, 25 Oct 2021 16:24:16 -0700 Subject: [PATCH 09/27] remove long type annotation --- .../azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index 655068a5588d..47d0ac493240 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -4238,7 +4238,6 @@ def _find_elements(parent, element, spans, **kwargs): def _find_cross_page_elements(source, element, **kwargs): - # type: (Union[AnalyzedDocument, DocumentEntity, DocumentField, DocumentKeyValueElement, DocumentTable, DocumentTableCell], str, Any) -> List[Any] allowed = kwargs.get("allowed_elements", None) if element not in allowed: raise ValueError("received an unsupported child element") From 3a1ec40244f506cd708ee4c3ca9c6e3c679a0262 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Mon, 25 Oct 2021 17:10:13 -0700 Subject: [PATCH 10/27] update changelog --- sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md index 529617aea0e7..01ed034f92b4 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md @@ -3,7 +3,7 @@ ## 3.2.0b2 (Unreleased) ### Features Added - +- Added `get_children` methods on `AnalyzedDocument`, `DocumentEntity`, `DocumentField`, `DocumentLine`, `DocumentKeyValueElement`, `DocumentTable`, `DocumentTableCellElement`. ### Breaking Changes - Renamed `DocumentElement` to `DocumentContentElement`. From 39cc81d528d726309b6b1f08ced49772f92dd3c7 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Mon, 25 Oct 2021 17:11:22 -0700 Subject: [PATCH 11/27] newline --- sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md index 01ed034f92b4..ff5f9767bcd2 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md @@ -4,6 +4,7 @@ ### Features Added - Added `get_children` methods on `AnalyzedDocument`, `DocumentEntity`, `DocumentField`, `DocumentLine`, `DocumentKeyValueElement`, `DocumentTable`, `DocumentTableCellElement`. + ### Breaking Changes - Renamed `DocumentElement` to `DocumentContentElement`. From 97ddd1611ff1e722549792de644b37f3b8e8f36c Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Wed, 27 Oct 2021 10:54:03 -0700 Subject: [PATCH 12/27] doc fixes and improvements --- .../azure-ai-formrecognizer/CHANGELOG.md | 2 +- .../azure/ai/formrecognizer/_models.py | 121 +++++++++--------- 2 files changed, 65 insertions(+), 58 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md index ff5f9767bcd2..64d12197c7dd 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md @@ -3,7 +3,7 @@ ## 3.2.0b2 (Unreleased) ### Features Added -- Added `get_children` methods on `AnalyzedDocument`, `DocumentEntity`, `DocumentField`, `DocumentLine`, `DocumentKeyValueElement`, `DocumentTable`, `DocumentTableCellElement`. +- Added `get_children` methods on `AnalyzedDocument`, `DocumentEntity`, `DocumentField`, `DocumentLine`, `DocumentKeyValueElement`, `DocumentTable`, `DocumentTableCell`. ### Breaking Changes - Renamed `DocumentElement` to `DocumentContentElement`. diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index 47d0ac493240..213e64145c5e 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -6,7 +6,7 @@ # pylint: disable=protected-access, too-many-lines -from typing import Union, Any, List +from typing import Union, Any, Iterable, List from enum import Enum from collections import namedtuple from ._generated.v2021_09_30_preview.models import ModelInfo, Error @@ -2216,14 +2216,14 @@ def __init__(self, **kwargs): self.confidence = kwargs.get("confidence", None) @classmethod - def _from_generated(cls, document, parent): + def _from_generated(cls, document, analyze_result): return cls( - _parent=parent, + _parent=analyze_result, doc_type=document.doc_type, bounding_regions=prepare_bounding_regions(document.bounding_regions), spans=prepare_document_spans(document.spans), fields={ - key: DocumentField._from_generated(field, parent) + key: DocumentField._from_generated(field, analyze_result) for key, field in document.fields.items() } if document.fields @@ -2284,12 +2284,13 @@ def from_dict(cls, data): confidence=data.get("confidence", None), ) - def get_children( - self, **kwargs - ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord]] + def get_children(self, **kwargs): + # type: (Any) -> Iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] """Get the child elements found in the span of this AnalyzedDocument. - :ivar str element_types: List of the child elements to retreive from the span of this item. + + :keyword list[str] element_types: List of the child elements to retrieve from the span of this item. + Please note that by default all values are included. To get a subset of the childre elements please + specify the elements to retrieve in the list. Acceptable values: "word", "line". :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ @@ -2335,9 +2336,9 @@ def __init__(self, **kwargs): self.confidence = kwargs.get("confidence", None) @classmethod - def _from_generated(cls, entity, parent): + def _from_generated(cls, entity, analyze_result): return cls( - _parent=parent, + _parent=analyze_result, category=entity.category, sub_category=entity.sub_category, content=entity.content, @@ -2417,12 +2418,13 @@ def from_dict(cls, data): confidence=data.get("confidence", None), ) - def get_children( - self, **kwargs - ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord]] + def get_children(self, **kwargs): + # type: (Any) -> Iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] """Get the child elements found in the span of this DocumentEntity. - :ivar str element_types: List of the child elements to retreive from the span of this item. + + :keyword list[str] element_types: List of the child elements to retrieve from the span of this item. + Please note that by default all values are included. To get a subset of the childre elements please + specify the elements to retrieve in the list. Acceptable values: "word", "line". :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ @@ -2474,12 +2476,12 @@ def __init__(self, **kwargs): self.confidence = kwargs.get("confidence", None) @classmethod - def _from_generated(cls, field, parent): + def _from_generated(cls, field, analyze_result): if field is None: return None return cls( - _parent=parent, - value=get_field_value_v3(field, parent), + _parent=analyze_result, + value=get_field_value_v3(field, analyze_result), value_type=adjust_value_type(field.type) if field.type else None, content=field.content if field.content else None, bounding_regions=[ @@ -2558,12 +2560,13 @@ def from_dict(cls, data): confidence=data.get("confidence", None), ) - def get_children( - self, **kwargs - ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord]] + def get_children(self, **kwargs): + # type: (Any) -> Iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] """Get the child elements found in the span of this DocumentField. - :ivar str element_types: List of the child elements to retreive from the span of this item. + + :keyword list[str] element_types: List of the child elements to retrieve from the span of this item. + Please note that by default all values are included. To get a subset of the childre elements please + specify the elements to retrieve in the list. Acceptable values: "word", "line". :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ @@ -2601,9 +2604,9 @@ def __init__(self, **kwargs): self.spans = kwargs.get("spans", None) @classmethod - def _from_generated(cls, element, parent): + def _from_generated(cls, element, analyze_result): return cls( - _parent=parent, + _parent=analyze_result, content=element.content, bounding_regions=[ BoundingRegion._from_generated(region) @@ -2661,12 +2664,13 @@ def from_dict(cls, data): else [], ) - def get_children( - self, **kwargs - ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord]] + def get_children(self, **kwargs): + # type: (Any) -> Iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] """Get the child elements found in the span of this DocumentKeyValueElement. - :ivar str element_types: List of the child elements to retreive from the span of this item. + + :keyword list[str] element_types: List of the child elements to retrieve from the span of this item. + Please note that by default all values are included. To get a subset of the childre elements please + specify the elements to retrieve in the list. Acceptable values: "word", "line". :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ @@ -2702,12 +2706,12 @@ def __init__(self, **kwargs): self.confidence = kwargs.get("confidence", None) @classmethod - def _from_generated(cls, key_value_pair, parent): + def _from_generated(cls, key_value_pair, analyze_result): return cls( - key=DocumentKeyValueElement._from_generated(key_value_pair.key, parent) + key=DocumentKeyValueElement._from_generated(key_value_pair.key, analyze_result) if key_value_pair.key else None, - value=DocumentKeyValueElement._from_generated(key_value_pair.value, parent) + value=DocumentKeyValueElement._from_generated(key_value_pair.value, analyze_result) if key_value_pair.value else None, confidence=key_value_pair.confidence, @@ -2771,9 +2775,9 @@ def __init__(self, **kwargs): self.spans = kwargs.get("spans", None) @classmethod - def _from_generated(cls, line, parent): + def _from_generated(cls, line, document_page): return cls( - _parent=parent, + _parent=document_page, content=line.content, bounding_box=get_bounding_box(line), spans=prepare_document_spans(line.spans), @@ -2823,12 +2827,13 @@ def from_dict(cls, data): ) - def get_children( - self, **kwargs - ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> List[Union[DocumentContentElement, DocumentWord]] + def get_children(self, **kwargs): + # type: (Any) -> Iterable[Union[DocumentContentElement, DocumentWord]] """Get the child elements found in the span of this DocumentLine. - :ivar list[str] element_types: List of the child elements to retreive from the span of the line. + + :ivar list[str] element_types: List of the child elements to retrieve from the span of the line. + Please note that by default all values are included. To get a subset of the childre elements please + specify the elements to retrieve in the list. Acceptable values: "word". :return: list[Union[DocumentContentElement, DocumentWord]] :rtype: list[Union[DocumentContentElement, DocumentWord]] """ @@ -3154,12 +3159,12 @@ def __init__(self, **kwargs): self.spans = kwargs.get("spans", None) @classmethod - def _from_generated(cls, table, parent): + def _from_generated(cls, table, analyze_result): return cls( - _parent=parent, + _parent=analyze_result, row_count=table.row_count, column_count=table.column_count, - cells=[DocumentTableCell._from_generated(cell, parent) for cell in table.cells] + cells=[DocumentTableCell._from_generated(cell, analyze_result) for cell in table.cells] if table.cells else [], bounding_regions=prepare_bounding_regions(table.bounding_regions), @@ -3222,12 +3227,13 @@ def from_dict(cls, data): else [], ) - def get_children( - self, **kwargs - ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> List[Union[DocumentLine, DocumentContentElement, DocumentWord]] + def get_children(self, **kwargs): + # type: (Any) -> Iterable[Union[DocumentLine, DocumentContentElement, DocumentWord]] """Get the child elements found in the span of this DocumentTable. - :ivar str element_types: List of the child elements to retreive from the span of this item. + + :keyword list[str] element_types: List of the child elements to retrieve from the span of this item. + Please note that by default all values are included. To get a subset of the childre elements please + specify the elements to retrieve in the list. Acceptable values: "word", "line". :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ @@ -3280,9 +3286,9 @@ def __init__(self, **kwargs): self.spans = kwargs.get("spans", None) @classmethod - def _from_generated(cls, cell, parent): + def _from_generated(cls, cell, analyze_result): return cls( - _parent=parent, + _parent=analyze_result, kind=cell.kind if cell.kind else "content", row_index=cell.row_index, column_index=cell.column_index, @@ -3361,12 +3367,13 @@ def from_dict(cls, data): else [], ) - def get_children( - self, **kwargs - ): # pylint: disable=unused-argument,no-self-use - # type: (Any) -> List[Union[DocumentContentElement, DocumentLine, DocumentWord]] + def get_children(self, **kwargs): + # type: (Any) -> Iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] """Get the child elements found in the span of this DocumentTableCellElement. - :ivar str element_types: List of the child elements to retreive from the span of this item. + + :keyword list[str] element_types: List of the child elements to retrieve from the span of this item. + Please note that by default all values are included. To get a subset of the childre elements please + specify the elements to retrieve in the list. Acceptable values: "word", "line". :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ @@ -4226,7 +4233,7 @@ def from_dict(cls, data): def _find_elements(parent, element, spans, **kwargs): - # type: (DocumentPage, str, List[DocumentSpan], Any) -> List[Any] + # type: (DocumentPage, str, List[DocumentSpan], Any) -> Iterable[Any] allowed = kwargs.get("allowed_elements", None) if element not in allowed: raise ValueError("received an unsupported child element") From 36ccaf20f181e045b0e766ad25508d2fd34433eb Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Wed, 27 Oct 2021 14:03:00 -0700 Subject: [PATCH 13/27] rename test class --- .../azure-ai-formrecognizer/tests/test_get_children.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py index 893d9f1c4f35..c036530c379e 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py @@ -5,9 +5,7 @@ # ------------------------------------ import functools -from azure.ai.formrecognizer._generated.models import AnalyzeResultOperation from azure.ai.formrecognizer import DocumentAnalysisClient -from azure.ai.formrecognizer import AnalyzeResult from preparers import FormRecognizerPreparer from testcase import FormRecognizerTest from preparers import GlobalClientPreparer as _GlobalClientPreparer @@ -16,7 +14,7 @@ DocumentAnalysisClientPreparer = functools.partial(_GlobalClientPreparer, DocumentAnalysisClient) -class TestDocumentFromStream(FormRecognizerTest): +class TestGetChildren(FormRecognizerTest): @FormRecognizerPreparer() @DocumentAnalysisClientPreparer() From 430bbd3c7c2069c3ef8a5fb9d4595d99725e6f1a Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Wed, 27 Oct 2021 14:13:45 -0700 Subject: [PATCH 14/27] refactor get children methods --- .../azure/ai/formrecognizer/_models.py | 133 +++++------------- .../tests/test_get_children.py | 2 +- 2 files changed, 36 insertions(+), 99 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index 213e64145c5e..ebe732e968ba 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -2295,18 +2295,9 @@ def get_children(self, **kwargs): :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ element_types = kwargs.get("element_types", ["word", "line"]) + allowed_elements=["line", "word"] - result = [] - for elem in element_types: - result.extend(_find_cross_page_elements( - self, - elem, - allowed_elements=[ - "line", - "word", - ], - )) - return result + return _get_children(self, element_types, allowed_elements, True) class DocumentEntity(object): @@ -2429,18 +2420,9 @@ def get_children(self, **kwargs): :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ element_types = kwargs.get("element_types", ["word", "line"]) + allowed_elements=["line", "word"] - result = [] - for elem in element_types: - result.extend(_find_cross_page_elements( - self, - elem, - allowed_elements=[ - "line", - "word", - ], - )) - return result + return _get_children(self, element_types, allowed_elements, True) class DocumentField(object): @@ -2571,18 +2553,9 @@ def get_children(self, **kwargs): :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ element_types = kwargs.get("element_types", ["word", "line"]) + allowed_elements=["line", "word"] - result = [] - for elem in element_types: - result.extend(_find_cross_page_elements( - self, - elem, - allowed_elements=[ - "line", - "word", - ], - )) - return result + return _get_children(self, element_types, allowed_elements, True) class DocumentKeyValueElement(object): @@ -2675,18 +2648,9 @@ def get_children(self, **kwargs): :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ element_types = kwargs.get("element_types", ["word", "line"]) + allowed_elements=["line", "word"] - result = [] - for elem in element_types: - result.extend(_find_cross_page_elements( - self, - elem, - allowed_elements=[ - "line", - "word", - ], - )) - return result + return _get_children(self, element_types, allowed_elements, True) class DocumentKeyValuePair(object): @@ -2838,18 +2802,9 @@ def get_children(self, **kwargs): :rtype: list[Union[DocumentContentElement, DocumentWord]] """ element_types = kwargs.get("element_types", ["word"]) + allowed_elements=["word"] - result = [] - for elem in element_types: - result.extend(_find_elements( - self._parent, - elem, - self.spans, - allowed_elements=[ - "word", - ], - )) - return result + return _get_children(self, element_types, allowed_elements, False) class DocumentPage(object): @@ -3238,18 +3193,9 @@ def get_children(self, **kwargs): :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ element_types = kwargs.get("element_types", ["word", "line"]) + allowed_elements=["line", "word"] - result = [] - for elem in element_types: - result.extend(_find_cross_page_elements( - self, - elem, - allowed_elements=[ - "line", - "word", - ], - )) - return result + return _get_children(self, element_types, allowed_elements, True) class DocumentTableCell(object): @@ -3377,19 +3323,10 @@ def get_children(self, **kwargs): :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ - element_types = kwargs.get("element_types", ["word"]) + element_types = kwargs.get("element_types", ["word", "line"]) + allowed_elements=["line", "word"] - result = [] - for elem in element_types: - result.extend(_find_cross_page_elements( - self, - elem, - allowed_elements=[ - "line", - "word", - ], - )) - return result + return _get_children(self, element_types, allowed_elements, True) class ModelOperationInfo(object): @@ -4231,35 +4168,35 @@ def from_dict(cls, data): if data.get("innererror") else None ) - -def _find_elements(parent, element, spans, **kwargs): - # type: (DocumentPage, str, List[DocumentSpan], Any) -> Iterable[Any] - allowed = kwargs.get("allowed_elements", None) - if element not in allowed: - raise ValueError("received an unsupported child element") +def _get_children(source_element, search_elements, allowed_elements, cross_page=False, **kwargs): + # Check if the element types that are passed in are allowed, + # fail fast if an incorrect element is requested. + for elem in search_elements: + if elem not in allowed_elements: + raise ValueError("Received an unsupported value in element_types") result = [] - for elem in _get_element_list(parent, element): - if _in_span(elem, spans): - result.append(elem) - return result + # search for elements across pages if cross_page is set to True + if cross_page: + for elem in search_elements: + for region in source_element.bounding_regions: + for element in _get_element_list(_get_page(source_element._parent.pages, region.page_number), elem): + if _in_span(element, source_element.spans): + result.append(element) + return result -def _find_cross_page_elements(source, element, **kwargs): - allowed = kwargs.get("allowed_elements", None) - if element not in allowed: - raise ValueError("received an unsupported child element") - result = [] - for region in source.bounding_regions: - for elem in _get_element_list(_get_page(source._parent.pages, region.page_number), element): - if _in_span(elem, source.spans): - result.append(elem) + # look for elements on a specific page + for elem in search_elements: + for element in _get_element_list(source_element._parent, elem): + if _in_span(element, source_element.spans): + result.append(element) return result def _get_page(pages, page_number): for page in pages: if page.page_number == page_number: return page - raise "could not find page" + raise ValueError("Could not find page to search for elements") def _get_element_list(parent, element): # type: (DocumentPage, str) -> List[Any] diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py index c036530c379e..99a735f35014 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py @@ -56,7 +56,7 @@ def test_document_table_cell_get_children(self, client): result = poller.result() elements = result.tables[0].cells[0].get_children() - assert len(elements) == 1 + assert len(elements) == 2 @FormRecognizerPreparer() From ff3bff5422f257ab3c5f2e24820bdadb8822f78d Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Wed, 27 Oct 2021 14:16:15 -0700 Subject: [PATCH 15/27] update wording for confidence --- .../azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index ebe732e968ba..c82670423f9d 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -2136,7 +2136,7 @@ class DocumentContentElement(object): :ivar span: Location of the element in the reading order concatenated content. :vartype span: ~azure.ai.formrecognizer.DocumentSpan - :ivar confidence: Confidence of correctly extracting the selection mark. + :ivar confidence: Confidence of accurately extracting the selection mark. :vartype confidence: float :ivar str kind: The kind of document element. Possible kinds are "word" or "selectionMark" which correspond to a :class:`~azure.ai.formrecognizer.DocumentWord` or From 78d9e23bc9e33765d03d74b6ced01ca6218e1c80 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Wed, 27 Oct 2021 14:18:30 -0700 Subject: [PATCH 16/27] fix document content element docs --- .../azure/ai/formrecognizer/_models.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index c82670423f9d..e96dda413135 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -2129,14 +2129,13 @@ def from_dict(cls, data): class DocumentContentElement(object): """A DocumentContentElement. - :ivar content: Text content of the word. + :ivar content: Text content of the document content element. :vartype content: str - :ivar bounding_box: Bounding box of the word. + :ivar bounding_box: Bounding box of the document content element. :vartype bounding_box: list[Point] - :ivar span: Location of the element in the reading order concatenated - content. + :ivar span: Location of the element in the full document content. :vartype span: ~azure.ai.formrecognizer.DocumentSpan - :ivar confidence: Confidence of accurately extracting the selection mark. + :ivar confidence: Confidence of accurately extracting the document content element. :vartype confidence: float :ivar str kind: The kind of document element. Possible kinds are "word" or "selectionMark" which correspond to a :class:`~azure.ai.formrecognizer.DocumentWord` or From b8b69e459f5ad485757ef445661112051a826d50 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Wed, 27 Oct 2021 14:34:10 -0700 Subject: [PATCH 17/27] specify return type in get element list helper --- .../azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index e96dda413135..1243e8e819d6 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -4198,7 +4198,7 @@ def _get_page(pages, page_number): raise ValueError("Could not find page to search for elements") def _get_element_list(parent, element): - # type: (DocumentPage, str) -> List[Any] + # type: (DocumentPage, str) -> List[DocumentContentElement, DocumentWord, DocumentLine] if element == "word": return parent.words # TODO uncomment once selection marks issue is fixed From 0b0e4e9f4aef48fa7fa1e3af8c5404cc969e25b2 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Wed, 27 Oct 2021 16:38:09 -0700 Subject: [PATCH 18/27] more doc fixes --- .../azure/ai/formrecognizer/_models.py | 93 ++++++++++--------- 1 file changed, 50 insertions(+), 43 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index 1243e8e819d6..3b86385cfc8b 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -2287,14 +2287,15 @@ def get_children(self, **kwargs): # type: (Any) -> Iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] """Get the child elements found in the span of this AnalyzedDocument. - :keyword list[str] element_types: List of the child elements to retrieve from the span of this item. - Please note that by default all values are included. To get a subset of the childre elements please - specify the elements to retrieve in the list. Acceptable values: "word", "line". - :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] - :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] + :keyword list[str] element_types: List of the child elements to retrieve from the spans of this element. +         Please note that by default all child elements are included. To get a subset of the child elements + please specify the elements to retrieve by passing the in a custom list. + Acceptable values: "word", "line". + :return: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] + :rtype: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ element_types = kwargs.get("element_types", ["word", "line"]) - allowed_elements=["line", "word"] + allowed_elements = ["line", "word"] return _get_children(self, element_types, allowed_elements, True) @@ -2412,14 +2413,15 @@ def get_children(self, **kwargs): # type: (Any) -> Iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] """Get the child elements found in the span of this DocumentEntity. - :keyword list[str] element_types: List of the child elements to retrieve from the span of this item. - Please note that by default all values are included. To get a subset of the childre elements please - specify the elements to retrieve in the list. Acceptable values: "word", "line". - :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] - :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] + :keyword list[str] element_types: List of the child elements to retrieve from the spans of this element. +         Please note that by default all child elements are included. To get a subset of the child elements + please specify the elements to retrieve by passing the in a custom list. + Acceptable values: "word", "line". + :return: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] + :rtype: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ element_types = kwargs.get("element_types", ["word", "line"]) - allowed_elements=["line", "word"] + allowed_elements = ["line", "word"] return _get_children(self, element_types, allowed_elements, True) @@ -2545,14 +2547,15 @@ def get_children(self, **kwargs): # type: (Any) -> Iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] """Get the child elements found in the span of this DocumentField. - :keyword list[str] element_types: List of the child elements to retrieve from the span of this item. - Please note that by default all values are included. To get a subset of the childre elements please - specify the elements to retrieve in the list. Acceptable values: "word", "line". - :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] - :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] + :keyword list[str] element_types: List of the child elements to retrieve from the spans of this element. +         Please note that by default all child elements are included. To get a subset of the child elements + please specify the elements to retrieve by passing the in a custom list. + Acceptable values: "word", "line". + :return: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] + :rtype: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ element_types = kwargs.get("element_types", ["word", "line"]) - allowed_elements=["line", "word"] + allowed_elements = ["line", "word"] return _get_children(self, element_types, allowed_elements, True) @@ -2640,14 +2643,15 @@ def get_children(self, **kwargs): # type: (Any) -> Iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] """Get the child elements found in the span of this DocumentKeyValueElement. - :keyword list[str] element_types: List of the child elements to retrieve from the span of this item. - Please note that by default all values are included. To get a subset of the childre elements please - specify the elements to retrieve in the list. Acceptable values: "word", "line". - :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] - :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] + :keyword list[str] element_types: List of the child elements to retrieve from the spans of this element. +         Please note that by default all child elements are included. To get a subset of the child elements + please specify the elements to retrieve by passing the in a custom list. + Acceptable values: "word", "line". + :return: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] + :rtype: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ element_types = kwargs.get("element_types", ["word", "line"]) - allowed_elements=["line", "word"] + allowed_elements = ["line", "word"] return _get_children(self, element_types, allowed_elements, True) @@ -2794,14 +2798,15 @@ def get_children(self, **kwargs): # type: (Any) -> Iterable[Union[DocumentContentElement, DocumentWord]] """Get the child elements found in the span of this DocumentLine. - :ivar list[str] element_types: List of the child elements to retrieve from the span of the line. - Please note that by default all values are included. To get a subset of the childre elements please - specify the elements to retrieve in the list. Acceptable values: "word". - :return: list[Union[DocumentContentElement, DocumentWord]] - :rtype: list[Union[DocumentContentElement, DocumentWord]] + :ivar list[str] element_types: List of the child elements to retrieve from the spans of this element. +         Please note that by default all child elements are included. To get a subset of the child elements + please specify the elements to retrieve by passing the in a custom list. + Acceptable values: "word". + :return: iterable[Union[DocumentContentElement, DocumentWord]] + :rtype: iterable[Union[DocumentContentElement, DocumentWord]] """ element_types = kwargs.get("element_types", ["word"]) - allowed_elements=["word"] + allowed_elements = ["word"] return _get_children(self, element_types, allowed_elements, False) @@ -3185,14 +3190,15 @@ def get_children(self, **kwargs): # type: (Any) -> Iterable[Union[DocumentLine, DocumentContentElement, DocumentWord]] """Get the child elements found in the span of this DocumentTable. - :keyword list[str] element_types: List of the child elements to retrieve from the span of this item. - Please note that by default all values are included. To get a subset of the childre elements please - specify the elements to retrieve in the list. Acceptable values: "word", "line". - :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] - :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] + :keyword list[str] element_types: List of the child elements to retrieve from the spans of this element. +         Please note that by default all child elements are included. To get a subset of the child elements + please specify the elements to retrieve by passing the in a custom list. + Acceptable values: "word", "line". + :return: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] + :rtype: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ element_types = kwargs.get("element_types", ["word", "line"]) - allowed_elements=["line", "word"] + allowed_elements = ["line", "word"] return _get_children(self, element_types, allowed_elements, True) @@ -3316,14 +3322,15 @@ def get_children(self, **kwargs): # type: (Any) -> Iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] """Get the child elements found in the span of this DocumentTableCellElement. - :keyword list[str] element_types: List of the child elements to retrieve from the span of this item. - Please note that by default all values are included. To get a subset of the childre elements please - specify the elements to retrieve in the list. Acceptable values: "word", "line". - :return: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] - :rtype: list[Union[DocumentContentElement, DocumentLine, DocumentWord]] + :keyword list[str] element_types: List of the child elements to retrieve from the spans of this element. +         Please note that by default all child elements are included. To get a subset of the child elements + please specify the elements to retrieve by passing the in a custom list. + Acceptable values: "word", "line". + :return: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] + :rtype: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] """ element_types = kwargs.get("element_types", ["word", "line"]) - allowed_elements=["line", "word"] + allowed_elements = ["line", "word"] return _get_children(self, element_types, allowed_elements, True) @@ -4167,7 +4174,7 @@ def from_dict(cls, data): if data.get("innererror") else None ) -def _get_children(source_element, search_elements, allowed_elements, cross_page=False, **kwargs): +def _get_children(source_element, search_elements, allowed_elements, cross_page=False): # Check if the element types that are passed in are allowed, # fail fast if an incorrect element is requested. for elem in search_elements: From 492513e5066a0b9d08dcba997e41e89e1df6c3f2 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Thu, 28 Oct 2021 13:28:59 -0700 Subject: [PATCH 19/27] fix type return --- .../azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index 3b86385cfc8b..230fe5d190b1 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -4205,7 +4205,7 @@ def _get_page(pages, page_number): raise ValueError("Could not find page to search for elements") def _get_element_list(parent, element): - # type: (DocumentPage, str) -> List[DocumentContentElement, DocumentWord, DocumentLine] + # type: (DocumentPage, str) -> List[Union[DocumentContentElement, DocumentWord, DocumentLine]] if element == "word": return parent.words # TODO uncomment once selection marks issue is fixed From 001c5c401ffdfce712bd90f8025e91c8219e283d Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Thu, 28 Oct 2021 17:25:09 -0700 Subject: [PATCH 20/27] refactor get_children into separate methods --- .../azure/ai/formrecognizer/_models.py | 141 +++++------------- 1 file changed, 40 insertions(+), 101 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index 230fe5d190b1..9cca3dcc5499 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -2283,21 +2283,13 @@ def from_dict(cls, data): confidence=data.get("confidence", None), ) - def get_children(self, **kwargs): - # type: (Any) -> Iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] - """Get the child elements found in the span of this AnalyzedDocument. - - :keyword list[str] element_types: List of the child elements to retrieve from the spans of this element. -         Please note that by default all child elements are included. To get a subset of the child elements - please specify the elements to retrieve by passing the in a custom list. - Acceptable values: "word", "line". - :return: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] - :rtype: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] - """ - element_types = kwargs.get("element_types", ["word", "line"]) - allowed_elements = ["line", "word"] + def get_words(self, **kwargs): # pylint: disable=unused-argument + # type (Any) -> Iterable[DocumentWord] + return _get_children(self, ["word"], ["word"], True) - return _get_children(self, element_types, allowed_elements, True) + def get_lines(self, **kwargs): # pylint: disable=unused-argument + # type (Any) -> Iterable[DocumentLine] + return _get_children(self, ["line"], ["line"], True) class DocumentEntity(object): @@ -2408,22 +2400,14 @@ def from_dict(cls, data): else [], confidence=data.get("confidence", None), ) + + def get_words(self, **kwargs): # pylint: disable=unused-argument + # type (Any) -> Iterable[DocumentWord] + return _get_children(self, ["word"], ["word"], True) - def get_children(self, **kwargs): - # type: (Any) -> Iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] - """Get the child elements found in the span of this DocumentEntity. - - :keyword list[str] element_types: List of the child elements to retrieve from the spans of this element. -         Please note that by default all child elements are included. To get a subset of the child elements - please specify the elements to retrieve by passing the in a custom list. - Acceptable values: "word", "line". - :return: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] - :rtype: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] - """ - element_types = kwargs.get("element_types", ["word", "line"]) - allowed_elements = ["line", "word"] - - return _get_children(self, element_types, allowed_elements, True) + def get_lines(self, **kwargs): # pylint: disable=unused-argument + # type (Any) -> Iterable[DocumentLine] + return _get_children(self, ["line"], ["line"], True) class DocumentField(object): @@ -2543,21 +2527,13 @@ def from_dict(cls, data): confidence=data.get("confidence", None), ) - def get_children(self, **kwargs): - # type: (Any) -> Iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] - """Get the child elements found in the span of this DocumentField. + def get_words(self, **kwargs): # pylint: disable=unused-argument + # type (Any) -> Iterable[DocumentWord] + return _get_children(self, ["word"], ["word"], True) - :keyword list[str] element_types: List of the child elements to retrieve from the spans of this element. -         Please note that by default all child elements are included. To get a subset of the child elements - please specify the elements to retrieve by passing the in a custom list. - Acceptable values: "word", "line". - :return: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] - :rtype: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] - """ - element_types = kwargs.get("element_types", ["word", "line"]) - allowed_elements = ["line", "word"] - - return _get_children(self, element_types, allowed_elements, True) + def get_lines(self, **kwargs): # pylint: disable=unused-argument + # type (Any) -> Iterable[DocumentLine] + return _get_children(self, ["line"], ["line"], True) class DocumentKeyValueElement(object): @@ -2639,21 +2615,13 @@ def from_dict(cls, data): else [], ) - def get_children(self, **kwargs): - # type: (Any) -> Iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] - """Get the child elements found in the span of this DocumentKeyValueElement. - - :keyword list[str] element_types: List of the child elements to retrieve from the spans of this element. -         Please note that by default all child elements are included. To get a subset of the child elements - please specify the elements to retrieve by passing the in a custom list. - Acceptable values: "word", "line". - :return: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] - :rtype: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] - """ - element_types = kwargs.get("element_types", ["word", "line"]) - allowed_elements = ["line", "word"] + def get_words(self, **kwargs): # pylint: disable=unused-argument + # type (Any) -> Iterable[DocumentWord] + return _get_children(self, ["word"], ["word"], True) - return _get_children(self, element_types, allowed_elements, True) + def get_lines(self, **kwargs): # pylint: disable=unused-argument + # type (Any) -> Iterable[DocumentLine] + return _get_children(self, ["line"], ["line"], True) class DocumentKeyValuePair(object): @@ -2793,22 +2761,9 @@ def from_dict(cls, data): else [], ) - - def get_children(self, **kwargs): - # type: (Any) -> Iterable[Union[DocumentContentElement, DocumentWord]] - """Get the child elements found in the span of this DocumentLine. - - :ivar list[str] element_types: List of the child elements to retrieve from the spans of this element. -         Please note that by default all child elements are included. To get a subset of the child elements - please specify the elements to retrieve by passing the in a custom list. - Acceptable values: "word". - :return: iterable[Union[DocumentContentElement, DocumentWord]] - :rtype: iterable[Union[DocumentContentElement, DocumentWord]] - """ - element_types = kwargs.get("element_types", ["word"]) - allowed_elements = ["word"] - - return _get_children(self, element_types, allowed_elements, False) + def get_words(self, **kwargs): # pylint: disable=unused-argument + # type (Any) -> Iterable[DocumentWord] + return _get_children(self, ["word"], ["word"], False) class DocumentPage(object): @@ -3186,21 +3141,13 @@ def from_dict(cls, data): else [], ) - def get_children(self, **kwargs): - # type: (Any) -> Iterable[Union[DocumentLine, DocumentContentElement, DocumentWord]] - """Get the child elements found in the span of this DocumentTable. + def get_words(self, **kwargs): # pylint: disable=unused-argument + # type (Any) -> Iterable[DocumentWord] + return _get_children(self, ["word"], ["word"], True) - :keyword list[str] element_types: List of the child elements to retrieve from the spans of this element. -         Please note that by default all child elements are included. To get a subset of the child elements - please specify the elements to retrieve by passing the in a custom list. - Acceptable values: "word", "line". - :return: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] - :rtype: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] - """ - element_types = kwargs.get("element_types", ["word", "line"]) - allowed_elements = ["line", "word"] - - return _get_children(self, element_types, allowed_elements, True) + def get_lines(self, **kwargs): # pylint: disable=unused-argument + # type (Any) -> Iterable[DocumentLine] + return _get_children(self, ["line"], ["line"], True) class DocumentTableCell(object): @@ -3318,21 +3265,13 @@ def from_dict(cls, data): else [], ) - def get_children(self, **kwargs): - # type: (Any) -> Iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] - """Get the child elements found in the span of this DocumentTableCellElement. - - :keyword list[str] element_types: List of the child elements to retrieve from the spans of this element. -         Please note that by default all child elements are included. To get a subset of the child elements - please specify the elements to retrieve by passing the in a custom list. - Acceptable values: "word", "line". - :return: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] - :rtype: iterable[Union[DocumentContentElement, DocumentLine, DocumentWord]] - """ - element_types = kwargs.get("element_types", ["word", "line"]) - allowed_elements = ["line", "word"] + def get_words(self, **kwargs): # pylint: disable=unused-argument + # type (Any) -> Iterable[DocumentWord] + return _get_children(self, ["word"], ["word"], True) - return _get_children(self, element_types, allowed_elements, True) + def get_lines(self, **kwargs): # pylint: disable=unused-argument + # type (Any) -> Iterable[DocumentLine] + return _get_children(self, ["line"], ["line"], True) class ModelOperationInfo(object): From 55eb9cb6cacb7c476baaea0338122f4822551a9a Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Thu, 28 Oct 2021 17:44:31 -0700 Subject: [PATCH 21/27] update tests for new methods --- ...hildren.test_document_line_get_words.yaml} | 67 +++++-------------- .../tests/test_get_children.py | 42 +++++++----- 2 files changed, 40 insertions(+), 69 deletions(-) rename sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/{test_get_children.test_document_line_get_children.yaml => test_get_children.test_document_line_get_words.yaml} (92%) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_line_get_children.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_line_get_words.yaml similarity index 92% rename from sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_line_get_children.yaml rename to sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_line_get_words.yaml index 27840a428ead..098230806ecc 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_line_get_children.yaml +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_document_line_get_words.yaml @@ -22,19 +22,19 @@ interactions: string: '' headers: apim-request-id: - - 1f5c3ae8-1775-4795-9b34-91b99e72fb64 + - fd6e5a97-a81b-40bf-946e-72d5ae1f25dd content-length: - '0' date: - - Mon, 25 Oct 2021 17:43:21 GMT + - Fri, 29 Oct 2021 00:43:08 GMT operation-location: - - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/1f5c3ae8-1775-4795-9b34-91b99e72fb64?api-version=2021-09-30-preview + - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/fd6e5a97-a81b-40bf-946e-72d5ae1f25dd?api-version=2021-09-30-preview strict-transport-security: - max-age=31536000; includeSubDomains; preload x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '388' + - '389' status: code: 202 message: Accepted @@ -50,18 +50,18 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/1f5c3ae8-1775-4795-9b34-91b99e72fb64?api-version=2021-09-30-preview + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/fd6e5a97-a81b-40bf-946e-72d5ae1f25dd?api-version=2021-09-30-preview response: body: - string: '{"status": "running", "createdDateTime": "2021-10-25T17:43:22Z", "lastUpdatedDateTime": - "2021-10-25T17:43:26Z"}' + string: '{"status": "running", "createdDateTime": "2021-10-29T00:43:08Z", "lastUpdatedDateTime": + "2021-10-29T00:43:13Z"}' headers: apim-request-id: - - d2019806-678e-4577-9a1a-332448fae5f1 + - 236ec9a1-e7a3-4c05-9835-ea33b3de3d0d content-type: - application/json; charset=utf-8 date: - - Mon, 25 Oct 2021 17:43:26 GMT + - Fri, 29 Oct 2021 00:43:13 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -69,7 +69,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '90' + - '83' status: code: 200 message: OK @@ -85,46 +85,11 @@ interactions: User-Agent: - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/1f5c3ae8-1775-4795-9b34-91b99e72fb64?api-version=2021-09-30-preview + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/fd6e5a97-a81b-40bf-946e-72d5ae1f25dd?api-version=2021-09-30-preview response: body: - string: '{"status": "running", "createdDateTime": "2021-10-25T17:43:22Z", "lastUpdatedDateTime": - "2021-10-25T17:43:26Z"}' - headers: - apim-request-id: - - b6611fcd-7bd3-454f-9c82-f9fea4cc78cf - content-type: - - application/json; charset=utf-8 - date: - - Mon, 25 Oct 2021 17:43:32 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains; preload - transfer-encoding: - - chunked - x-content-type-options: - - nosniff - x-envoy-upstream-service-time: - - '91' - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/1f5c3ae8-1775-4795-9b34-91b99e72fb64?api-version=2021-09-30-preview - response: - body: - string: '{"status": "succeeded", "createdDateTime": "2021-10-25T17:43:22Z", - "lastUpdatedDateTime": "2021-10-25T17:43:35Z", "analyzeResult": {"apiVersion": + string: '{"status": "succeeded", "createdDateTime": "2021-10-29T00:43:08Z", + "lastUpdatedDateTime": "2021-10-29T00:43:13Z", "analyzeResult": {"apiVersion": "2021-09-30-preview", "modelId": "prebuilt-document", "stringIndexType": "unicodeCodePoint", "content": "Contoso\nAddress:\n1 Redmond way Suite\n6000 Redmond, WA\n99243\nInvoice For: Microsoft\n1020 Enterprise Way\nSunnayvale, CA 87659\nInvoice Number\nInvoice @@ -359,11 +324,11 @@ interactions: 5}]}]}}' headers: apim-request-id: - - dc4283d6-10d2-4f27-adab-b066075c76b2 + - c74a0f69-42cd-4ffd-afb3-013a511988c9 content-type: - application/json; charset=utf-8 date: - - Mon, 25 Oct 2021 17:43:38 GMT + - Fri, 29 Oct 2021 00:43:19 GMT strict-transport-security: - max-age=31536000; includeSubDomains; preload transfer-encoding: @@ -371,7 +336,7 @@ interactions: x-content-type-options: - nosniff x-envoy-upstream-service-time: - - '180' + - '427' status: code: 200 message: OK diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py index 99a735f35014..e2227b337862 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py @@ -18,14 +18,14 @@ class TestGetChildren(FormRecognizerTest): @FormRecognizerPreparer() @DocumentAnalysisClientPreparer() - def test_document_line_get_children(self, client): + def test_document_line_get_words(self, client): with open(self.invoice_pdf, "rb") as fd: document = fd.read() poller = client.begin_analyze_document("prebuilt-document", document) result = poller.result() - elements = result.pages[0].lines[0].get_children() + elements = result.pages[0].lines[0].get_words() assert len(elements) == 1 assert elements[0].content == "Contoso" @@ -39,12 +39,12 @@ def test_document_table_get_children(self, client): poller = client.begin_analyze_document("prebuilt-layout", document) result = poller.result() - elements = result.tables[0].get_children() - assert len(elements) == 45 - - elements = result.tables[0].get_children(element_types=["word"]) + elements = result.tables[0].get_words() assert len(elements) == 25 + elements = result.tables[0].get_lines() + assert len(elements) == 20 + @FormRecognizerPreparer() @DocumentAnalysisClientPreparer() @@ -55,8 +55,11 @@ def test_document_table_cell_get_children(self, client): poller = client.begin_analyze_document("prebuilt-layout", document) result = poller.result() - elements = result.tables[0].cells[0].get_children() - assert len(elements) == 2 + elements = result.tables[0].cells[0].get_words() + assert len(elements) == 1 + + elements = result.tables[0].cells[0].get_lines() + assert len(elements) == 1 @FormRecognizerPreparer() @@ -68,8 +71,11 @@ def test_analyzed_document_get_children(self, client): poller = client.begin_analyze_document("prebuilt-invoice", document) result = poller.result() - elements = result.documents[0].get_children() - assert len(elements) == 186 + elements = result.documents[0].get_words() + assert len(elements) == 132 + + elements = result.documents[0].get_lines() + assert len(elements) == 54 @FormRecognizerPreparer() @@ -81,10 +87,10 @@ def test_document_field_get_children(self, client): poller = client.begin_analyze_document("prebuilt-invoice", document) result = poller.result() - elements = result.documents[0].fields.get("InvoiceTotal").get_children() - assert len(elements) == 2 + elements = result.documents[0].fields.get("InvoiceTotal").get_words() + assert len(elements) == 1 - elements = result.documents[0].fields.get("InvoiceTotal").get_children(element_types=["line"]) + elements = result.documents[0].fields.get("InvoiceTotal").get_lines() assert len(elements) == 1 @@ -97,10 +103,10 @@ def test_document_entity_get_children(self, client): poller = client.begin_analyze_document("prebuilt-document", document) result = poller.result() - elements = result.entities[0].get_children() - assert len(elements) == 2 + elements = result.entities[0].get_words() + assert len(elements) == 1 - elements = result.entities[0].get_children(element_types=["word"]) + elements = result.entities[0].get_lines() assert len(elements) == 1 @@ -113,8 +119,8 @@ def test_document_key_value_element_get_children(self, client): poller = client.begin_analyze_document("prebuilt-document", document) result = poller.result() - elements = result.key_value_pairs[0].key.get_children() + elements = result.key_value_pairs[0].key.get_words() assert len(elements) == 2 - elements = result.key_value_pairs[0].key.get_children(element_types=["line"]) + elements = result.key_value_pairs[0].key.get_lines() assert len(elements) == 0 From 8828df844c68604a7cdcfef9b478ed484043d43c Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Fri, 29 Oct 2021 12:23:15 -0700 Subject: [PATCH 22/27] add docs --- .../azure/ai/formrecognizer/_models.py | 93 ++++++++++++++++--- 1 file changed, 79 insertions(+), 14 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index 9cca3dcc5499..e33fa95abf55 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -2284,11 +2284,21 @@ def from_dict(cls, data): ) def get_words(self, **kwargs): # pylint: disable=unused-argument - # type (Any) -> Iterable[DocumentWord] + # type: (Any) -> Iterable[DocumentWord] + """Get the words found in the spans of this AnalyzedDocument. + + :return: iterable[DocumentWord] + :rtype: iterable[DocumentWord] + """ return _get_children(self, ["word"], ["word"], True) def get_lines(self, **kwargs): # pylint: disable=unused-argument - # type (Any) -> Iterable[DocumentLine] + # type: (Any) -> Iterable[DocumentLine] + """Get the lines found in the spans of this AnalyzedDocument. + + :return: iterable[DocumentLine] + :rtype: iterable[DocumentLine] + """ return _get_children(self, ["line"], ["line"], True) @@ -2400,13 +2410,23 @@ def from_dict(cls, data): else [], confidence=data.get("confidence", None), ) - + def get_words(self, **kwargs): # pylint: disable=unused-argument - # type (Any) -> Iterable[DocumentWord] + # type: (Any) -> Iterable[DocumentWord] + """Get the words found in the spans of this DocumentEntity. + + :return: iterable[DocumentWord] + :rtype: iterable[DocumentWord] + """ return _get_children(self, ["word"], ["word"], True) def get_lines(self, **kwargs): # pylint: disable=unused-argument - # type (Any) -> Iterable[DocumentLine] + # type: (Any) -> Iterable[DocumentLine] + """Get the lines found in the spans of this DocumentEntity. + + :return: iterable[DocumentLine] + :rtype: iterable[DocumentLine] + """ return _get_children(self, ["line"], ["line"], True) @@ -2528,11 +2548,21 @@ def from_dict(cls, data): ) def get_words(self, **kwargs): # pylint: disable=unused-argument - # type (Any) -> Iterable[DocumentWord] + # type: (Any) -> Iterable[DocumentWord] + """Get the words found in the spans of this DocumentField. + + :return: iterable[DocumentWord] + :rtype: iterable[DocumentWord] + """ return _get_children(self, ["word"], ["word"], True) def get_lines(self, **kwargs): # pylint: disable=unused-argument - # type (Any) -> Iterable[DocumentLine] + # type: (Any) -> Iterable[DocumentLine] + """Get the lines found in the spans of this DocumentField. + + :return: iterable[DocumentLine] + :rtype: iterable[DocumentLine] + """ return _get_children(self, ["line"], ["line"], True) @@ -2616,11 +2646,21 @@ def from_dict(cls, data): ) def get_words(self, **kwargs): # pylint: disable=unused-argument - # type (Any) -> Iterable[DocumentWord] + # type: (Any) -> Iterable[DocumentWord] + """Get the words found in the spans of this DocumentKeyValueElement. + + :return: iterable[DocumentWord] + :rtype: iterable[DocumentWord] + """ return _get_children(self, ["word"], ["word"], True) def get_lines(self, **kwargs): # pylint: disable=unused-argument - # type (Any) -> Iterable[DocumentLine] + # type: (Any) -> Iterable[DocumentLine] + """Get the lines found in the spans of this DocumentKeyValueElement. + + :return: iterable[DocumentLine] + :rtype: iterable[DocumentLine] + """ return _get_children(self, ["line"], ["line"], True) @@ -2762,7 +2802,12 @@ def from_dict(cls, data): ) def get_words(self, **kwargs): # pylint: disable=unused-argument - # type (Any) -> Iterable[DocumentWord] + # type: (Any) -> Iterable[DocumentWord] + """Get the words found in the spans of this DocumentLine. + + :return: iterable[DocumentWord] + :rtype: iterable[DocumentWord] + """ return _get_children(self, ["word"], ["word"], False) @@ -3142,11 +3187,21 @@ def from_dict(cls, data): ) def get_words(self, **kwargs): # pylint: disable=unused-argument - # type (Any) -> Iterable[DocumentWord] + # type: (Any) -> Iterable[DocumentWord] + """Get the words found in the spans of this DocumentTable. + + :return: iterable[DocumentWord] + :rtype: iterable[DocumentWord] + """ return _get_children(self, ["word"], ["word"], True) def get_lines(self, **kwargs): # pylint: disable=unused-argument - # type (Any) -> Iterable[DocumentLine] + # type: (Any) -> Iterable[DocumentLine] + """Get the lines found in the spans of this DocumentTable. + + :return: iterable[DocumentLine] + :rtype: iterable[DocumentLine] + """ return _get_children(self, ["line"], ["line"], True) @@ -3266,11 +3321,21 @@ def from_dict(cls, data): ) def get_words(self, **kwargs): # pylint: disable=unused-argument - # type (Any) -> Iterable[DocumentWord] + # type: (Any) -> Iterable[DocumentWord] + """Get the words found in the spans of this DocumentTableCell. + + :return: iterable[DocumentWord] + :rtype: iterable[DocumentWord] + """ return _get_children(self, ["word"], ["word"], True) def get_lines(self, **kwargs): # pylint: disable=unused-argument - # type (Any) -> Iterable[DocumentLine] + # type: (Any) -> Iterable[DocumentLine] + """Get the lines found in the spans of this DocumentTableCell. + + :return: iterable[DocumentLine] + :rtype: iterable[DocumentLine] + """ return _get_children(self, ["line"], ["line"], True) From 7c9a08837305adcad348aec6eba81055ece8bc8f Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Fri, 29 Oct 2021 12:31:06 -0700 Subject: [PATCH 23/27] update changelog --- sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md index 64d12197c7dd..156f783cc7c6 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md @@ -3,7 +3,8 @@ ## 3.2.0b2 (Unreleased) ### Features Added -- Added `get_children` methods on `AnalyzedDocument`, `DocumentEntity`, `DocumentField`, `DocumentLine`, `DocumentKeyValueElement`, `DocumentTable`, `DocumentTableCell`. +- Added `get_words` methods on `AnalyzedDocument`, `DocumentEntity`, `DocumentField`, `DocumentLine`, `DocumentKeyValueElement`, `DocumentTable`, `DocumentTableCell`. +- Added `get_lines` methods on `AnalyzedDocument`, `DocumentEntity`, `DocumentField`, `DocumentKeyValueElement`, `DocumentTable`, `DocumentTableCell`. ### Breaking Changes - Renamed `DocumentElement` to `DocumentContentElement`. From c9fcbde34674fbd411c1255c2b319e942eb3ae8b Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Fri, 29 Oct 2021 17:36:54 -0700 Subject: [PATCH 24/27] remove extra param and check from internal _get_children --- .../azure/ai/formrecognizer/_models.py | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index e33fa95abf55..0ba9f113e0f1 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -2290,7 +2290,7 @@ def get_words(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentWord] :rtype: iterable[DocumentWord] """ - return _get_children(self, ["word"], ["word"], True) + return _get_children(self, ["word"], True) def get_lines(self, **kwargs): # pylint: disable=unused-argument # type: (Any) -> Iterable[DocumentLine] @@ -2299,7 +2299,7 @@ def get_lines(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentLine] :rtype: iterable[DocumentLine] """ - return _get_children(self, ["line"], ["line"], True) + return _get_children(self, ["line"], True) class DocumentEntity(object): @@ -2418,7 +2418,7 @@ def get_words(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentWord] :rtype: iterable[DocumentWord] """ - return _get_children(self, ["word"], ["word"], True) + return _get_children(self, ["word"], True) def get_lines(self, **kwargs): # pylint: disable=unused-argument # type: (Any) -> Iterable[DocumentLine] @@ -2427,7 +2427,7 @@ def get_lines(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentLine] :rtype: iterable[DocumentLine] """ - return _get_children(self, ["line"], ["line"], True) + return _get_children(self, ["line"], True) class DocumentField(object): @@ -2554,7 +2554,7 @@ def get_words(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentWord] :rtype: iterable[DocumentWord] """ - return _get_children(self, ["word"], ["word"], True) + return _get_children(self, ["word"], True) def get_lines(self, **kwargs): # pylint: disable=unused-argument # type: (Any) -> Iterable[DocumentLine] @@ -2563,7 +2563,7 @@ def get_lines(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentLine] :rtype: iterable[DocumentLine] """ - return _get_children(self, ["line"], ["line"], True) + return _get_children(self, ["line"], True) class DocumentKeyValueElement(object): @@ -2652,7 +2652,7 @@ def get_words(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentWord] :rtype: iterable[DocumentWord] """ - return _get_children(self, ["word"], ["word"], True) + return _get_children(self, ["word"], True) def get_lines(self, **kwargs): # pylint: disable=unused-argument # type: (Any) -> Iterable[DocumentLine] @@ -2661,7 +2661,7 @@ def get_lines(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentLine] :rtype: iterable[DocumentLine] """ - return _get_children(self, ["line"], ["line"], True) + return _get_children(self, ["line"], True) class DocumentKeyValuePair(object): @@ -2808,7 +2808,7 @@ def get_words(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentWord] :rtype: iterable[DocumentWord] """ - return _get_children(self, ["word"], ["word"], False) + return _get_children(self, ["word"], False) class DocumentPage(object): @@ -3193,7 +3193,7 @@ def get_words(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentWord] :rtype: iterable[DocumentWord] """ - return _get_children(self, ["word"], ["word"], True) + return _get_children(self, ["word"], True) def get_lines(self, **kwargs): # pylint: disable=unused-argument # type: (Any) -> Iterable[DocumentLine] @@ -3202,7 +3202,7 @@ def get_lines(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentLine] :rtype: iterable[DocumentLine] """ - return _get_children(self, ["line"], ["line"], True) + return _get_children(self, ["line"], True) class DocumentTableCell(object): @@ -3327,7 +3327,7 @@ def get_words(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentWord] :rtype: iterable[DocumentWord] """ - return _get_children(self, ["word"], ["word"], True) + return _get_children(self, ["word"], True) def get_lines(self, **kwargs): # pylint: disable=unused-argument # type: (Any) -> Iterable[DocumentLine] @@ -3336,7 +3336,7 @@ def get_lines(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentLine] :rtype: iterable[DocumentLine] """ - return _get_children(self, ["line"], ["line"], True) + return _get_children(self, ["line"], True) class ModelOperationInfo(object): @@ -4178,12 +4178,7 @@ def from_dict(cls, data): if data.get("innererror") else None ) -def _get_children(source_element, search_elements, allowed_elements, cross_page=False): - # Check if the element types that are passed in are allowed, - # fail fast if an incorrect element is requested. - for elem in search_elements: - if elem not in allowed_elements: - raise ValueError("Received an unsupported value in element_types") +def _get_children(source_element, search_elements, cross_page=False): result = [] # search for elements across pages if cross_page is set to True From a1c8f24957b5107dee8ef0f3818cddd8ff8a4053 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Fri, 29 Oct 2021 17:39:06 -0700 Subject: [PATCH 25/27] transform words and lines to convenience layer versions --- .../azure/ai/formrecognizer/_models.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index 0ba9f113e0f1..2d944aec33c9 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -4204,14 +4204,11 @@ def _get_page(pages, page_number): raise ValueError("Could not find page to search for elements") def _get_element_list(parent, element): - # type: (DocumentPage, str) -> List[Union[DocumentContentElement, DocumentWord, DocumentLine]] + # type: (DocumentPage, str) -> List[Union[DocumentWord, DocumentLine]] if element == "word": - return parent.words - # TODO uncomment once selection marks issue is fixed - # if element == "selection_mark": - # return parent.selection_marks + return [DocumentWord._from_generated(word) for word in parent.words] if element == "line": - return parent.lines + return [DocumentLine._from_generated(line, parent) for line in parent.lines] raise ValueError("Unsupported element requested.") From 61c8feeb8ddb8edde453f62205f7a9c557419ef2 Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Fri, 29 Oct 2021 17:39:24 -0700 Subject: [PATCH 26/27] add test --- ...ildren.test_get_words_after_get_lines.yaml | 738 ++++++++++++++++++ .../tests/test_get_children.py | 16 + 2 files changed, 754 insertions(+) create mode 100644 sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_get_words_after_get_lines.yaml diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_get_words_after_get_lines.yaml b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_get_words_after_get_lines.yaml new file mode 100644 index 000000000000..295f038a8d56 --- /dev/null +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/recordings/test_get_children.test_get_words_after_get_lines.yaml @@ -0,0 +1,738 @@ +interactions: +- request: + body: '!!! The request body has been omitted from the recording because its size + 479269 is larger than 128KB. !!!' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '479269' + Content-Type: + - application/octet-stream + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: POST + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document:analyze?stringIndexType=unicodeCodePoint&api-version=2021-09-30-preview + response: + body: + string: '' + headers: + apim-request-id: + - 9a20ecda-2d70-4f9f-995f-cb2ea6168cf6 + content-length: + - '0' + date: + - Sat, 30 Oct 2021 00:32:47 GMT + operation-location: + - https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/9a20ecda-2d70-4f9f-995f-cb2ea6168cf6?api-version=2021-09-30-preview + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '490' + status: + code: 202 + message: Accepted +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/9a20ecda-2d70-4f9f-995f-cb2ea6168cf6?api-version=2021-09-30-preview + response: + body: + string: '{"status": "running", "createdDateTime": "2021-10-30T00:32:47Z", "lastUpdatedDateTime": + "2021-10-30T00:32:51Z"}' + headers: + apim-request-id: + - f0b6cbd9-b4a7-44e5-b78c-22b61bffb2cd + content-type: + - application/json; charset=utf-8 + date: + - Sat, 30 Oct 2021 00:32:52 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '78' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-ai-formrecognizer/3.2.0b2 Python/3.8.5 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://region.api.cognitive.microsoft.com/formrecognizer/documentModels/prebuilt-document/analyzeResults/9a20ecda-2d70-4f9f-995f-cb2ea6168cf6?api-version=2021-09-30-preview + response: + body: + string: '{"status": "succeeded", "createdDateTime": "2021-10-30T00:32:47Z", + "lastUpdatedDateTime": "2021-10-30T00:32:53Z", "analyzeResult": {"apiVersion": + "2021-09-30-preview", "modelId": "prebuilt-document", "stringIndexType": "unicodeCodePoint", + "content": "Purchase Order\nHero Limited\nCompany Phone: 555-348-6512\nWebsite: + www.herolimited.com\nEmail:\nPurchase Order\nDated As: 12/20/2020\nPurchase + Order #: 948284\naccounts@herolimited.com\nShipped To\nVendor Name: Hillary + Swank\nCompany Name: Higgly Wiggly Books\nAddress: 938 NE Burner Road\nBoulder + City, CO 92848\nPhone: 938-294-2949\nShipped From\nName: Bernie Sanders\nCompany + Name: Jupiter Book Supply\nAddress: 383 N Kinnick Road\nSeattle, WA 38383\nPhone: + 932-299-0292\nDetails\nQuantity\nUnit Price\nTotal\nBindings\n20\n1.00\n20.00\nCovers + Small\n20\n1.00\n20.00\nFeather Bookmark\n20\n5.00\n100.00\nCopper Swirl Marker\n20\n5.00\n100.00\nBernie + Sanders\nBernie Sanders\nManager\nAdditional Notes:\nDo not Jostle Box. Unpack + carefully. Enjoy.\nSUBTOTAL\n$140.00\nTAX\n$4.00\nTOTAL\n$144.00\nJupiter + Book Supply will refund you 50% per book if returned within 60 days of reading + and\noffer you 25% off you next total purchase.", "pages": [{"pageNumber": + 1, "angle": 0, "width": 1700, "height": 2200, "unit": "pixel", "words": [{"content": + "Purchase", "boundingBox": [137, 140, 259, 139, 259, 167, 137, 167], "confidence": + 0.997, "span": {"offset": 0, "length": 8}}, {"content": "Order", "boundingBox": + [264, 139, 350, 139, 349, 167, 264, 167], "confidence": 0.995, "span": {"offset": + 9, "length": 5}}, {"content": "Hero", "boundingBox": [621, 208, 769, 206, + 769, 266, 620, 266], "confidence": 0.983, "span": {"offset": 15, "length": + 4}}, {"content": "Limited", "boundingBox": [793, 205, 1058, 204, 1057, 266, + 793, 266], "confidence": 0.997, "span": {"offset": 20, "length": 7}}, {"content": + "Company", "boundingBox": [163, 353, 270, 351, 270, 379, 164, 378], "confidence": + 0.993, "span": {"offset": 28, "length": 7}}, {"content": "Phone:", "boundingBox": + [275, 351, 358, 351, 359, 378, 276, 379], "confidence": 0.997, "span": {"offset": + 36, "length": 6}}, {"content": "555-348-6512", "boundingBox": [363, 351, 524, + 351, 524, 374, 364, 378], "confidence": 0.994, "span": {"offset": 43, "length": + 12}}, {"content": "Website:", "boundingBox": [167, 394, 265, 393, 265, 418, + 167, 417], "confidence": 0.997, "span": {"offset": 56, "length": 8}}, {"content": + "www.herolimited.com", "boundingBox": [270, 393, 522, 393, 522, 418, 270, + 418], "confidence": 0.993, "span": {"offset": 65, "length": 19}}, {"content": + "Email:", "boundingBox": [165, 435, 237, 435, 237, 460, 165, 460], "confidence": + 0.995, "span": {"offset": 85, "length": 6}}, {"content": "Purchase", "boundingBox": + [1113, 322, 1365, 321, 1364, 370, 1113, 368], "confidence": 0.997, "span": + {"offset": 92, "length": 8}}, {"content": "Order", "boundingBox": [1381, 321, + 1549, 321, 1548, 370, 1380, 370], "confidence": 0.995, "span": {"offset": + 101, "length": 5}}, {"content": "Dated", "boundingBox": [1025, 421, 1103, + 420, 1103, 448, 1025, 448], "confidence": 0.993, "span": {"offset": 107, "length": + 5}}, {"content": "As:", "boundingBox": [1110, 420, 1156, 420, 1156, 448, 1110, + 448], "confidence": 0.998, "span": {"offset": 113, "length": 3}}, {"content": + "12/20/2020", "boundingBox": [1162, 420, 1312, 421, 1312, 449, 1162, 448], + "confidence": 0.992, "span": {"offset": 117, "length": 10}}, {"content": "Purchase", + "boundingBox": [1023, 461, 1146, 461, 1147, 489, 1023, 488], "confidence": + 0.997, "span": {"offset": 128, "length": 8}}, {"content": "Order", "boundingBox": + [1152, 461, 1237, 461, 1237, 489, 1152, 489], "confidence": 0.995, "span": + {"offset": 137, "length": 5}}, {"content": "#:", "boundingBox": [1242, 461, + 1270, 461, 1270, 489, 1243, 489], "confidence": 0.997, "span": {"offset": + 143, "length": 2}}, {"content": "948284", "boundingBox": [1275, 461, 1373, + 462, 1373, 489, 1275, 489], "confidence": 0.995, "span": {"offset": 146, "length": + 6}}, {"content": "accounts@herolimited.com", "boundingBox": [164, 481, 471, + 479, 470, 503, 165, 503], "confidence": 0.959, "span": {"offset": 153, "length": + 24}}, {"content": "Shipped", "boundingBox": [167, 547, 328, 547, 327, 592, + 168, 592], "confidence": 0.997, "span": {"offset": 178, "length": 7}}, {"content": + "To", "boundingBox": [337, 547, 392, 547, 391, 591, 336, 592], "confidence": + 0.963, "span": {"offset": 186, "length": 2}}, {"content": "Vendor", "boundingBox": + [160, 611, 250, 610, 250, 638, 160, 637], "confidence": 0.997, "span": {"offset": + 189, "length": 6}}, {"content": "Name:", "boundingBox": [256, 610, 341, 609, + 340, 639, 256, 638], "confidence": 0.995, "span": {"offset": 196, "length": + 5}}, {"content": "Hillary", "boundingBox": [346, 609, 427, 609, 427, 639, + 346, 639], "confidence": 0.997, "span": {"offset": 202, "length": 7}}, {"content": + "Swank", "boundingBox": [433, 609, 518, 610, 517, 639, 433, 639], "confidence": + 0.995, "span": {"offset": 210, "length": 5}}, {"content": "Company", "boundingBox": + [160, 649, 275, 647, 276, 678, 161, 676], "confidence": 0.993, "span": {"offset": + 216, "length": 7}}, {"content": "Name:", "boundingBox": [281, 647, 366, 647, + 366, 679, 282, 678], "confidence": 0.995, "span": {"offset": 224, "length": + 5}}, {"content": "Higgly", "boundingBox": [372, 647, 449, 646, 449, 679, 372, + 679], "confidence": 0.997, "span": {"offset": 230, "length": 6}}, {"content": + "Wiggly", "boundingBox": [455, 646, 541, 646, 541, 678, 455, 679], "confidence": + 0.997, "span": {"offset": 237, "length": 6}}, {"content": "Books", "boundingBox": + [547, 646, 628, 646, 628, 676, 547, 678], "confidence": 0.995, "span": {"offset": + 244, "length": 5}}, {"content": "Address:", "boundingBox": [161, 685, 266, + 685, 265, 712, 160, 711], "confidence": 0.994, "span": {"offset": 250, "length": + 8}}, {"content": "938", "boundingBox": [271, 685, 319, 685, 318, 713, 271, + 712], "confidence": 0.993, "span": {"offset": 259, "length": 3}}, {"content": + "NE", "boundingBox": [324, 685, 360, 685, 359, 713, 323, 713], "confidence": + 0.998, "span": {"offset": 263, "length": 2}}, {"content": "Burner", "boundingBox": + [366, 685, 452, 685, 452, 713, 365, 713], "confidence": 0.997, "span": {"offset": + 266, "length": 6}}, {"content": "Road", "boundingBox": [458, 685, 521, 685, + 521, 713, 457, 713], "confidence": 0.992, "span": {"offset": 273, "length": + 4}}, {"content": "Boulder", "boundingBox": [279, 722, 369, 722, 370, 751, + 280, 750], "confidence": 0.994, "span": {"offset": 278, "length": 7}}, {"content": + "City,", "boundingBox": [375, 722, 431, 722, 432, 751, 376, 751], "confidence": + 0.995, "span": {"offset": 286, "length": 5}}, {"content": "CO", "boundingBox": + [437, 722, 473, 722, 473, 751, 437, 751], "confidence": 0.999, "span": {"offset": + 292, "length": 2}}, {"content": "92848", "boundingBox": [480, 722, 559, 722, + 559, 749, 480, 751], "confidence": 0.995, "span": {"offset": 295, "length": + 5}}, {"content": "Phone:", "boundingBox": [613, 722, 701, 722, 701, 749, 613, + 749], "confidence": 0.997, "span": {"offset": 301, "length": 6}}, {"content": + "938-294-2949", "boundingBox": [706, 722, 882, 722, 881, 748, 706, 749], "confidence": + 0.983, "span": {"offset": 308, "length": 12}}, {"content": "Shipped", "boundingBox": + [167, 784, 324, 785, 324, 830, 169, 830], "confidence": 0.997, "span": {"offset": + 321, "length": 7}}, {"content": "From", "boundingBox": [333, 785, 431, 785, + 431, 827, 333, 830], "confidence": 0.991, "span": {"offset": 329, "length": + 4}}, {"content": "Name:", "boundingBox": [166, 853, 246, 853, 245, 879, 166, + 879], "confidence": 0.994, "span": {"offset": 334, "length": 5}}, {"content": + "Bernie", "boundingBox": [251, 853, 333, 852, 332, 880, 251, 879], "confidence": + 0.997, "span": {"offset": 340, "length": 6}}, {"content": "Sanders", "boundingBox": + [338, 852, 444, 852, 444, 879, 338, 880], "confidence": 0.997, "span": {"offset": + 347, "length": 7}}, {"content": "Company", "boundingBox": [164, 890, 280, + 890, 281, 919, 165, 919], "confidence": 0.994, "span": {"offset": 355, "length": + 7}}, {"content": "Name:", "boundingBox": [285, 890, 372, 889, 372, 919, 286, + 919], "confidence": 0.995, "span": {"offset": 363, "length": 5}}, {"content": + "Jupiter", "boundingBox": [377, 889, 464, 889, 464, 919, 378, 919], "confidence": + 0.997, "span": {"offset": 369, "length": 7}}, {"content": "Book", "boundingBox": + [469, 889, 532, 889, 532, 920, 470, 919], "confidence": 0.992, "span": {"offset": + 377, "length": 4}}, {"content": "Supply", "boundingBox": [538, 889, 628, 890, + 628, 920, 538, 920], "confidence": 0.995, "span": {"offset": 382, "length": + 6}}, {"content": "Address:", "boundingBox": [166, 926, 271, 926, 271, 953, + 166, 953], "confidence": 0.994, "span": {"offset": 389, "length": 8}}, {"content": + "383", "boundingBox": [277, 925, 325, 925, 325, 953, 276, 953], "confidence": + 0.997, "span": {"offset": 398, "length": 3}}, {"content": "N", "boundingBox": + [330, 925, 346, 926, 346, 953, 330, 953], "confidence": 0.995, "span": {"offset": + 402, "length": 1}}, {"content": "Kinnick", "boundingBox": [355, 926, 444, + 926, 444, 954, 355, 953], "confidence": 0.997, "span": {"offset": 404, "length": + 7}}, {"content": "Road", "boundingBox": [450, 926, 516, 927, 515, 954, 449, + 954], "confidence": 0.983, "span": {"offset": 412, "length": 4}}, {"content": + "Seattle,", "boundingBox": [281, 965, 374, 964, 375, 991, 283, 991], "confidence": + 0.996, "span": {"offset": 417, "length": 8}}, {"content": "WA", "boundingBox": + [380, 964, 424, 964, 425, 991, 381, 991], "confidence": 0.998, "span": {"offset": + 426, "length": 2}}, {"content": "38383", "boundingBox": [432, 964, 510, 963, + 511, 990, 432, 991], "confidence": 0.995, "span": {"offset": 429, "length": + 5}}, {"content": "Phone:", "boundingBox": [760, 964, 847, 964, 846, 990, 760, + 990], "confidence": 0.997, "span": {"offset": 435, "length": 6}}, {"content": + "932-299-0292", "boundingBox": [852, 964, 1029, 963, 1028, 990, 851, 990], + "confidence": 0.987, "span": {"offset": 442, "length": 12}}, {"content": "Details", + "boundingBox": [447, 1048, 556, 1048, 555, 1078, 446, 1078], "confidence": + 0.993, "span": {"offset": 455, "length": 7}}, {"content": "Quantity", "boundingBox": + [886, 1048, 1030, 1047, 1029, 1084, 886, 1084], "confidence": 0.997, "span": + {"offset": 463, "length": 8}}, {"content": "Unit", "boundingBox": [1112, 1047, + 1175, 1047, 1175, 1078, 1111, 1078], "confidence": 0.992, "span": {"offset": + 472, "length": 4}}, {"content": "Price", "boundingBox": [1181, 1047, 1263, + 1048, 1262, 1078, 1181, 1078], "confidence": 0.995, "span": {"offset": 477, + "length": 5}}, {"content": "Total", "boundingBox": [1382, 1047, 1468, 1047, + 1468, 1077, 1382, 1077], "confidence": 0.995, "span": {"offset": 483, "length": + 5}}, {"content": "Bindings", "boundingBox": [172, 1094, 279, 1097, 279, 1123, + 173, 1122], "confidence": 0.993, "span": {"offset": 489, "length": 8}}, {"content": + "20", "boundingBox": [859, 1094, 887, 1094, 887, 1119, 859, 1119], "confidence": + 0.997, "span": {"offset": 498, "length": 2}}, {"content": "1.00", "boundingBox": + [1240, 1095, 1290, 1094, 1291, 1117, 1240, 1118], "confidence": 0.988, "span": + {"offset": 501, "length": 4}}, {"content": "20.00", "boundingBox": [1458, + 1096, 1526, 1095, 1525, 1120, 1459, 1119], "confidence": 0.995, "span": {"offset": + 506, "length": 5}}, {"content": "Covers", "boundingBox": [170, 1136, 251, + 1136, 251, 1161, 170, 1161], "confidence": 0.995, "span": {"offset": 512, + "length": 6}}, {"content": "Small", "boundingBox": [256, 1136, 332, 1135, + 331, 1161, 256, 1161], "confidence": 0.995, "span": {"offset": 519, "length": + 5}}, {"content": "20", "boundingBox": [859, 1135, 889, 1135, 889, 1160, 859, + 1160], "confidence": 0.997, "span": {"offset": 525, "length": 2}}, {"content": + "1.00", "boundingBox": [1239, 1135, 1290, 1135, 1291, 1160, 1239, 1160], "confidence": + 0.984, "span": {"offset": 528, "length": 4}}, {"content": "20.00", "boundingBox": + [1458, 1135, 1526, 1135, 1526, 1160, 1458, 1160], "confidence": 0.995, "span": + {"offset": 533, "length": 5}}, {"content": "Feather", "boundingBox": [173, + 1180, 265, 1179, 265, 1206, 174, 1206], "confidence": 0.997, "span": {"offset": + 539, "length": 7}}, {"content": "Bookmark", "boundingBox": [270, 1179, 399, + 1178, 400, 1206, 271, 1206], "confidence": 0.997, "span": {"offset": 547, + "length": 8}}, {"content": "20", "boundingBox": [860, 1179, 888, 1179, 888, + 1204, 860, 1203], "confidence": 0.995, "span": {"offset": 556, "length": 2}}, + {"content": "5.00", "boundingBox": [1239, 1179, 1290, 1178, 1291, 1203, 1239, + 1204], "confidence": 0.994, "span": {"offset": 559, "length": 4}}, {"content": + "100.00", "boundingBox": [1443, 1181, 1525, 1180, 1525, 1204, 1443, 1205], + "confidence": 0.067, "span": {"offset": 564, "length": 6}}, {"content": "Copper", + "boundingBox": [170, 1223, 257, 1222, 257, 1253, 170, 1253], "confidence": + 0.995, "span": {"offset": 571, "length": 6}}, {"content": "Swirl", "boundingBox": + [263, 1222, 325, 1222, 325, 1251, 262, 1252], "confidence": 0.995, "span": + {"offset": 578, "length": 5}}, {"content": "Marker", "boundingBox": [331, + 1222, 429, 1223, 429, 1248, 330, 1251], "confidence": 0.997, "span": {"offset": + 584, "length": 6}}, {"content": "20", "boundingBox": [860, 1223, 887, 1223, + 887, 1247, 860, 1247], "confidence": 0.997, "span": {"offset": 591, "length": + 2}}, {"content": "5.00", "boundingBox": [1239, 1221, 1291, 1221, 1291, 1247, + 1239, 1247], "confidence": 0.988, "span": {"offset": 594, "length": 4}}, {"content": + "100.00", "boundingBox": [1444, 1224, 1525, 1223, 1524, 1247, 1444, 1248], + "confidence": 0.995, "span": {"offset": 599, "length": 6}}, {"content": "Bernie", + "boundingBox": [484, 1671, 595, 1671, 595, 1706, 484, 1706], "confidence": + 0.997, "span": {"offset": 606, "length": 6}}, {"content": "Sanders", "boundingBox": + [602, 1671, 762, 1670, 763, 1708, 602, 1706], "confidence": 0.997, "span": + {"offset": 613, "length": 7}}, {"content": "Bernie", "boundingBox": [542, + 1719, 614, 1719, 615, 1742, 544, 1742], "confidence": 0.995, "span": {"offset": + 621, "length": 6}}, {"content": "Sanders", "boundingBox": [618, 1719, 716, + 1719, 716, 1743, 619, 1742], "confidence": 0.997, "span": {"offset": 628, + "length": 7}}, {"content": "Manager", "boundingBox": [577, 1754, 681, 1756, + 680, 1778, 578, 1776], "confidence": 0.994, "span": {"offset": 636, "length": + 7}}, {"content": "Additional", "boundingBox": [173, 1796, 350, 1796, 349, + 1832, 173, 1831], "confidence": 0.993, "span": {"offset": 644, "length": 10}}, + {"content": "Notes:", "boundingBox": [357, 1796, 478, 1797, 477, 1833, 356, + 1832], "confidence": 0.997, "span": {"offset": 655, "length": 6}}, {"content": + "Do", "boundingBox": [175, 1881, 201, 1881, 202, 1907, 175, 1907], "confidence": + 0.988, "span": {"offset": 662, "length": 2}}, {"content": "not", "boundingBox": + [207, 1881, 251, 1880, 252, 1908, 208, 1907], "confidence": 0.998, "span": + {"offset": 665, "length": 3}}, {"content": "Jostle", "boundingBox": [257, + 1880, 330, 1880, 330, 1909, 257, 1908], "confidence": 0.997, "span": {"offset": + 669, "length": 6}}, {"content": "Box.", "boundingBox": [336, 1880, 397, 1880, + 397, 1909, 336, 1909], "confidence": 0.991, "span": {"offset": 676, "length": + 4}}, {"content": "Unpack", "boundingBox": [403, 1880, 497, 1880, 497, 1910, + 403, 1909], "confidence": 0.997, "span": {"offset": 681, "length": 6}}, {"content": + "carefully.", "boundingBox": [503, 1880, 620, 1880, 620, 1911, 503, 1910], + "confidence": 0.996, "span": {"offset": 688, "length": 10}}, {"content": "Enjoy.", + "boundingBox": [626, 1880, 706, 1881, 706, 1912, 626, 1911], "confidence": + 0.995, "span": {"offset": 699, "length": 6}}, {"content": "SUBTOTAL", "boundingBox": + [1147, 1575, 1293, 1575, 1293, 1600, 1147, 1600], "confidence": 0.993, "span": + {"offset": 706, "length": 8}}, {"content": "$140.00", "boundingBox": [1426, + 1572, 1526, 1572, 1525, 1597, 1427, 1599], "confidence": 0.993, "span": {"offset": + 715, "length": 7}}, {"content": "TAX", "boundingBox": [1236, 1618, 1288, 1618, + 1288, 1643, 1236, 1643], "confidence": 0.994, "span": {"offset": 723, "length": + 3}}, {"content": "$4.00", "boundingBox": [1458, 1615, 1529, 1615, 1529, 1642, + 1458, 1643], "confidence": 0.988, "span": {"offset": 727, "length": 5}}, {"content": + "TOTAL", "boundingBox": [1204, 1674, 1292, 1674, 1292, 1699, 1205, 1699], + "confidence": 0.994, "span": {"offset": 733, "length": 5}}, {"content": "$144.00", + "boundingBox": [1427, 1671, 1527, 1669, 1527, 1697, 1429, 1698], "confidence": + 0.983, "span": {"offset": 739, "length": 7}}, {"content": "Jupiter", "boundingBox": + [169, 1924, 265, 1924, 265, 1959, 169, 1959], "confidence": 0.994, "span": + {"offset": 747, "length": 7}}, {"content": "Book", "boundingBox": [272, 1924, + 350, 1924, 351, 1958, 272, 1959], "confidence": 0.992, "span": {"offset": + 755, "length": 4}}, {"content": "Supply", "boundingBox": [357, 1924, 460, + 1924, 460, 1958, 357, 1958], "confidence": 0.995, "span": {"offset": 760, + "length": 6}}, {"content": "will", "boundingBox": [467, 1924, 516, 1924, 516, + 1958, 467, 1958], "confidence": 0.991, "span": {"offset": 767, "length": 4}}, + {"content": "refund", "boundingBox": [523, 1924, 622, 1924, 621, 1958, 523, + 1958], "confidence": 0.997, "span": {"offset": 772, "length": 6}}, {"content": + "you", "boundingBox": [629, 1924, 685, 1924, 684, 1958, 628, 1958], "confidence": + 0.998, "span": {"offset": 779, "length": 3}}, {"content": "50%", "boundingBox": + [691, 1924, 761, 1924, 760, 1958, 691, 1958], "confidence": 0.988, "span": + {"offset": 783, "length": 3}}, {"content": "per", "boundingBox": [768, 1924, + 819, 1924, 819, 1958, 767, 1958], "confidence": 0.998, "span": {"offset": + 787, "length": 3}}, {"content": "book", "boundingBox": [826, 1924, 900, 1924, + 899, 1958, 825, 1958], "confidence": 0.992, "span": {"offset": 791, "length": + 4}}, {"content": "if", "boundingBox": [907, 1924, 927, 1924, 926, 1958, 906, + 1958], "confidence": 0.999, "span": {"offset": 796, "length": 2}}, {"content": + "returned", "boundingBox": [933, 1924, 1059, 1924, 1058, 1958, 933, 1958], + "confidence": 0.996, "span": {"offset": 799, "length": 8}}, {"content": "within", + "boundingBox": [1066, 1924, 1153, 1924, 1152, 1958, 1065, 1958], "confidence": + 0.997, "span": {"offset": 808, "length": 6}}, {"content": "60", "boundingBox": + [1160, 1924, 1200, 1924, 1199, 1958, 1159, 1958], "confidence": 0.999, "span": + {"offset": 815, "length": 2}}, {"content": "days", "boundingBox": [1207, 1924, + 1279, 1924, 1278, 1958, 1206, 1958], "confidence": 0.992, "span": {"offset": + 818, "length": 4}}, {"content": "of", "boundingBox": [1286, 1924, 1317, 1924, + 1316, 1958, 1284, 1958], "confidence": 0.997, "span": {"offset": 823, "length": + 2}}, {"content": "reading", "boundingBox": [1324, 1924, 1438, 1924, 1437, + 1958, 1322, 1958], "confidence": 0.997, "span": {"offset": 826, "length": + 7}}, {"content": "and", "boundingBox": [1445, 1924, 1505, 1924, 1504, 1958, + 1443, 1958], "confidence": 0.998, "span": {"offset": 834, "length": 3}}, {"content": + "offer", "boundingBox": [169, 1958, 231, 1958, 231, 1991, 169, 1991], "confidence": + 0.993, "span": {"offset": 838, "length": 5}}, {"content": "you", "boundingBox": + [237, 1958, 295, 1958, 295, 1992, 237, 1991], "confidence": 0.989, "span": + {"offset": 844, "length": 3}}, {"content": "25%", "boundingBox": [303, 1958, + 371, 1958, 372, 1992, 303, 1992], "confidence": 0.947, "span": {"offset": + 848, "length": 3}}, {"content": "off", "boundingBox": [378, 1958, 420, 1958, + 420, 1992, 378, 1992], "confidence": 0.998, "span": {"offset": 852, "length": + 3}}, {"content": "you", "boundingBox": [427, 1958, 482, 1958, 482, 1992, 427, + 1992], "confidence": 0.998, "span": {"offset": 856, "length": 3}}, {"content": + "next", "boundingBox": [488, 1958, 554, 1959, 555, 1992, 489, 1992], "confidence": + 0.992, "span": {"offset": 860, "length": 4}}, {"content": "total", "boundingBox": + [561, 1959, 627, 1959, 627, 1991, 561, 1992], "confidence": 0.994, "span": + {"offset": 865, "length": 5}}, {"content": "purchase.", "boundingBox": [633, + 1959, 786, 1961, 787, 1990, 633, 1991], "confidence": 0.996, "span": {"offset": + 871, "length": 9}}], "selectionMarks": [], "lines": [{"content": "Purchase + Order", "boundingBox": [136, 139, 351, 138, 351, 166, 136, 166], "spans": + [{"offset": 0, "length": 14}]}, {"content": "Hero Limited", "boundingBox": + [620, 205, 1074, 204, 1075, 265, 620, 266], "spans": [{"offset": 15, "length": + 12}]}, {"content": "Company Phone: 555-348-6512", "boundingBox": [163, 352, + 528, 350, 528, 376, 163, 379], "spans": [{"offset": 28, "length": 27}]}, {"content": + "Website: www.herolimited.com", "boundingBox": [166, 393, 533, 393, 533, 418, + 166, 418], "spans": [{"offset": 56, "length": 28}]}, {"content": "Email:", + "boundingBox": [165, 435, 237, 435, 237, 460, 165, 460], "spans": [{"offset": + 85, "length": 6}]}, {"content": "Purchase Order", "boundingBox": [1112, 321, + 1554, 321, 1554, 369, 1112, 369], "spans": [{"offset": 92, "length": 14}]}, + {"content": "Dated As: 12/20/2020", "boundingBox": [1024, 419, 1317, 420, + 1317, 448, 1024, 448], "spans": [{"offset": 107, "length": 20}]}, {"content": + "Purchase Order #: 948284", "boundingBox": [1023, 461, 1376, 461, 1376, 489, + 1023, 488], "spans": [{"offset": 128, "length": 24}]}, {"content": "accounts@herolimited.com", + "boundingBox": [164, 479, 482, 478, 483, 502, 164, 503], "spans": [{"offset": + 153, "length": 24}]}, {"content": "Shipped To", "boundingBox": [167, 547, + 397, 546, 397, 591, 167, 592], "spans": [{"offset": 178, "length": 10}]}, + {"content": "Vendor Name: Hillary Swank", "boundingBox": [159, 609, 520, 609, + 520, 638, 159, 638], "spans": [{"offset": 189, "length": 26}]}, {"content": + "Company Name: Higgly Wiggly Books", "boundingBox": [159, 647, 629, 646, 629, + 677, 160, 679], "spans": [{"offset": 216, "length": 33}]}, {"content": "Address: + 938 NE Burner Road", "boundingBox": [160, 684, 526, 684, 526, 712, 160, 711], + "spans": [{"offset": 250, "length": 27}]}, {"content": "Boulder City, CO 92848", + "boundingBox": [279, 722, 566, 721, 566, 750, 279, 751], "spans": [{"offset": + 278, "length": 22}]}, {"content": "Phone: 938-294-2949", "boundingBox": [612, + 721, 885, 721, 885, 747, 612, 748], "spans": [{"offset": 301, "length": 19}]}, + {"content": "Shipped From", "boundingBox": [167, 784, 453, 784, 453, 829, + 167, 830], "spans": [{"offset": 321, "length": 12}]}, {"content": "Name: Bernie + Sanders", "boundingBox": [165, 852, 445, 851, 445, 878, 165, 879], "spans": + [{"offset": 334, "length": 20}]}, {"content": "Company Name: Jupiter Book + Supply", "boundingBox": [164, 889, 629, 889, 629, 919, 164, 919], "spans": + [{"offset": 355, "length": 33}]}, {"content": "Address: 383 N Kinnick Road", + "boundingBox": [165, 925, 521, 926, 521, 953, 165, 952], "spans": [{"offset": + 389, "length": 27}]}, {"content": "Seattle, WA 38383", "boundingBox": [280, + 963, 514, 962, 514, 990, 281, 991], "spans": [{"offset": 417, "length": 17}]}, + {"content": "Phone: 932-299-0292", "boundingBox": [760, 963, 1032, 963, 1032, + 989, 760, 990], "spans": [{"offset": 435, "length": 19}]}, {"content": "Details", + "boundingBox": [446, 1047, 558, 1047, 558, 1077, 446, 1077], "spans": [{"offset": + 455, "length": 7}]}, {"content": "Quantity", "boundingBox": [885, 1047, 1034, + 1047, 1034, 1083, 886, 1083], "spans": [{"offset": 463, "length": 8}]}, {"content": + "Unit Price", "boundingBox": [1111, 1047, 1270, 1047, 1269, 1078, 1111, 1077], + "spans": [{"offset": 472, "length": 10}]}, {"content": "Total", "boundingBox": + [1382, 1047, 1468, 1047, 1467, 1077, 1382, 1077], "spans": [{"offset": 483, + "length": 5}]}, {"content": "Bindings", "boundingBox": [172, 1093, 279, 1095, + 279, 1123, 172, 1121], "spans": [{"offset": 489, "length": 8}]}, {"content": + "20", "boundingBox": [859, 1094, 893, 1094, 893, 1119, 859, 1119], "spans": + [{"offset": 498, "length": 2}]}, {"content": "1.00", "boundingBox": [1240, + 1096, 1295, 1094, 1294, 1118, 1241, 1118], "spans": [{"offset": 501, "length": + 4}]}, {"content": "20.00", "boundingBox": [1458, 1095, 1530, 1095, 1530, 1119, + 1458, 1119], "spans": [{"offset": 506, "length": 5}]}, {"content": "Covers + Small", "boundingBox": [169, 1135, 332, 1134, 333, 1160, 169, 1161], "spans": + [{"offset": 512, "length": 12}]}, {"content": "20", "boundingBox": [859, 1135, + 894, 1135, 891, 1160, 860, 1160], "spans": [{"offset": 525, "length": 2}]}, + {"content": "1.00", "boundingBox": [1239, 1135, 1295, 1135, 1294, 1159, 1239, + 1160], "spans": [{"offset": 528, "length": 4}]}, {"content": "20.00", "boundingBox": + [1458, 1135, 1530, 1135, 1530, 1159, 1459, 1160], "spans": [{"offset": 533, + "length": 5}]}, {"content": "Feather Bookmark", "boundingBox": [173, 1178, + 403, 1177, 403, 1205, 173, 1206], "spans": [{"offset": 539, "length": 16}]}, + {"content": "20", "boundingBox": [860, 1179, 892, 1179, 891, 1204, 860, 1203], + "spans": [{"offset": 556, "length": 2}]}, {"content": "5.00", "boundingBox": + [1239, 1179, 1295, 1178, 1295, 1203, 1239, 1204], "spans": [{"offset": 559, + "length": 4}]}, {"content": "100.00", "boundingBox": [1442, 1180, 1530, 1180, + 1530, 1203, 1443, 1204], "spans": [{"offset": 564, "length": 6}]}, {"content": + "Copper Swirl Marker", "boundingBox": [169, 1223, 429, 1222, 430, 1249, 169, + 1253], "spans": [{"offset": 571, "length": 19}]}, {"content": "20", "boundingBox": + [860, 1223, 893, 1223, 893, 1247, 860, 1247], "spans": [{"offset": 591, "length": + 2}]}, {"content": "5.00", "boundingBox": [1239, 1221, 1294, 1222, 1294, 1246, + 1239, 1247], "spans": [{"offset": 594, "length": 4}]}, {"content": "100.00", + "boundingBox": [1443, 1223, 1530, 1222, 1530, 1246, 1444, 1247], "spans": + [{"offset": 599, "length": 6}]}, {"content": "Bernie Sanders", "boundingBox": + [484, 1670, 764, 1670, 764, 1707, 484, 1706], "spans": [{"offset": 606, "length": + 14}]}, {"content": "Bernie Sanders", "boundingBox": [542, 1718, 718, 1719, + 718, 1742, 542, 1741], "spans": [{"offset": 621, "length": 14}]}, {"content": + "Manager", "boundingBox": [577, 1753, 681, 1755, 681, 1778, 577, 1776], "spans": + [{"offset": 636, "length": 7}]}, {"content": "Additional Notes:", "boundingBox": + [172, 1796, 478, 1796, 478, 1832, 172, 1831], "spans": [{"offset": 644, "length": + 17}]}, {"content": "Do not Jostle Box. Unpack carefully. Enjoy.", "boundingBox": + [174, 1879, 707, 1880, 707, 1911, 174, 1908], "spans": [{"offset": 662, "length": + 43}]}, {"content": "SUBTOTAL", "boundingBox": [1146, 1573, 1296, 1573, 1296, + 1600, 1146, 1600], "spans": [{"offset": 706, "length": 8}]}, {"content": "$140.00", + "boundingBox": [1426, 1571, 1530, 1571, 1530, 1597, 1426, 1598], "spans": + [{"offset": 715, "length": 7}]}, {"content": "TAX", "boundingBox": [1236, + 1618, 1296, 1618, 1295, 1643, 1236, 1643], "spans": [{"offset": 723, "length": + 3}]}, {"content": "$4.00", "boundingBox": [1458, 1615, 1529, 1615, 1528, 1641, + 1458, 1643], "spans": [{"offset": 727, "length": 5}]}, {"content": "TOTAL", + "boundingBox": [1203, 1673, 1297, 1673, 1297, 1698, 1204, 1699], "spans": + [{"offset": 733, "length": 5}]}, {"content": "$144.00", "boundingBox": [1427, + 1670, 1529, 1669, 1530, 1696, 1427, 1697], "spans": [{"offset": 739, "length": + 7}]}, {"content": "Jupiter Book Supply will refund you 50% per book if returned + within 60 days of reading and", "boundingBox": [168, 1923, 1510, 1923, 1510, + 1957, 168, 1958], "spans": [{"offset": 747, "length": 90}]}, {"content": "offer + you 25% off you next total purchase.", "boundingBox": [168, 1957, 786, 1958, + 786, 1991, 168, 1991], "spans": [{"offset": 838, "length": 42}]}], "spans": + [{"offset": 0, "length": 880}]}], "tables": [{"rowCount": 5, "columnCount": + 4, "cells": [{"kind": "columnHeader", "rowIndex": 0, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Details", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [157, 1037, 847, 1038, 847, 1086, 155, 1086]}], "spans": + [{"offset": 455, "length": 7}]}, {"kind": "columnHeader", "rowIndex": 0, "columnIndex": + 1, "rowSpan": 1, "columnSpan": 1, "content": "Quantity", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [847, 1038, 1069, 1038, 1070, 1086, 847, + 1086]}], "spans": [{"offset": 463, "length": 8}]}, {"kind": "columnHeader", + "rowIndex": 0, "columnIndex": 2, "rowSpan": 1, "columnSpan": 1, "content": + "Unit Price", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1069, + 1038, 1309, 1038, 1309, 1086, 1070, 1086]}], "spans": [{"offset": 472, "length": + 10}]}, {"kind": "columnHeader", "rowIndex": 0, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "Total", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1038, 1543, 1038, 1543, 1086, 1309, 1086]}], "spans": + [{"offset": 483, "length": 5}]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Bindings", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1086, 847, 1086, 847, 1127, 155, 1127]}], "spans": + [{"offset": 489, "length": 8}]}, {"rowIndex": 1, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1086, 1070, 1086, 1070, 1127, 847, 1127]}], "spans": + [{"offset": 498, "length": 2}]}, {"rowIndex": 1, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "1.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1086, 1309, 1086, 1309, 1127, 1070, 1127]}], "spans": + [{"offset": 501, "length": 4}]}, {"rowIndex": 1, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "20.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1086, 1543, 1086, 1543, 1127, 1309, 1127]}], "spans": + [{"offset": 506, "length": 5}]}, {"rowIndex": 2, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Covers Small", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1127, 847, 1127, 847, 1171, 155, 1171]}], "spans": + [{"offset": 512, "length": 12}]}, {"rowIndex": 2, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1127, 1070, 1127, 1070, 1171, 847, 1171]}], "spans": + [{"offset": 525, "length": 2}]}, {"rowIndex": 2, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "1.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1127, 1309, 1127, 1309, 1171, 1070, 1171]}], "spans": + [{"offset": 528, "length": 4}]}, {"rowIndex": 2, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "20.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1127, 1543, 1127, 1543, 1171, 1309, 1171]}], "spans": + [{"offset": 533, "length": 5}]}, {"rowIndex": 3, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Feather Bookmark", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1171, 847, 1171, 847, 1214, 155, 1214]}], "spans": + [{"offset": 539, "length": 16}]}, {"rowIndex": 3, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1171, 1070, 1171, 1070, 1214, 847, 1214]}], "spans": + [{"offset": 556, "length": 2}]}, {"rowIndex": 3, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "5.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1171, 1309, 1171, 1309, 1214, 1070, 1214]}], "spans": + [{"offset": 559, "length": 4}]}, {"rowIndex": 3, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "100.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1171, 1543, 1171, 1543, 1215, 1309, 1214]}], "spans": + [{"offset": 564, "length": 6}]}, {"rowIndex": 4, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "Copper Swirl Marker", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [155, 1214, 847, 1214, 847, 1258, 155, 1258]}], "spans": + [{"offset": 571, "length": 19}]}, {"rowIndex": 4, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "20", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [847, 1214, 1070, 1214, 1070, 1258, 847, 1258]}], "spans": + [{"offset": 591, "length": 2}]}, {"rowIndex": 4, "columnIndex": 2, "rowSpan": + 1, "columnSpan": 1, "content": "5.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1070, 1214, 1309, 1214, 1309, 1258, 1070, 1258]}], "spans": + [{"offset": 594, "length": 4}]}, {"rowIndex": 4, "columnIndex": 3, "rowSpan": + 1, "columnSpan": 1, "content": "100.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1214, 1543, 1215, 1543, 1260, 1309, 1258]}], "spans": + [{"offset": 599, "length": 6}]}], "boundingRegions": [{"pageNumber": 1, "boundingBox": + [153, 1036, 1548, 1036, 1547, 1265, 153, 1265]}], "spans": [{"offset": 455, + "length": 150}]}, {"rowCount": 4, "columnCount": 2, "cells": [{"kind": "columnHeader", + "rowIndex": 0, "columnIndex": 0, "rowSpan": 1, "columnSpan": 1, "content": + "SUBTOTAL", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1070, 1565, + 1309, 1565, 1309, 1609, 1071, 1609]}], "spans": [{"offset": 706, "length": + 8}]}, {"kind": "columnHeader", "rowIndex": 0, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "$140.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1565, 1544, 1564, 1544, 1609, 1309, 1609]}], "spans": + [{"offset": 715, "length": 7}]}, {"rowIndex": 1, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "TAX", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [1071, 1609, 1309, 1609, 1309, 1652, 1071, 1652]}], "spans": + [{"offset": 723, "length": 3}]}, {"rowIndex": 1, "columnIndex": 1, "rowSpan": + 1, "columnSpan": 1, "content": "$4.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1309, 1609, 1544, 1609, 1544, 1652, 1309, 1652]}], "spans": + [{"offset": 727, "length": 5}]}, {"rowIndex": 2, "columnIndex": 0, "rowSpan": + 1, "columnSpan": 1, "content": "", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1071, 1652, 1309, 1652, 1309, 1664, 1071, 1664]}], "spans": []}, {"rowIndex": + 2, "columnIndex": 1, "rowSpan": 1, "columnSpan": 1, "content": "", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1309, 1652, 1544, 1652, 1544, 1664, 1309, + 1664]}], "spans": []}, {"rowIndex": 3, "columnIndex": 0, "rowSpan": 1, "columnSpan": + 1, "content": "TOTAL", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1071, 1664, 1309, 1664, 1309, 1707, 1071, 1706]}], "spans": [{"offset": 733, + "length": 5}]}, {"rowIndex": 3, "columnIndex": 1, "rowSpan": 1, "columnSpan": + 1, "content": "$144.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1309, 1664, 1544, 1664, 1544, 1707, 1309, 1707]}], "spans": [{"offset": 739, + "length": 7}]}], "boundingRegions": [{"pageNumber": 1, "boundingBox": [1062, + 1563, 1560, 1563, 1560, 1709, 1062, 1709]}], "spans": [{"offset": 706, "length": + 40}]}], "keyValuePairs": [{"key": {"content": "Company Phone:", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [163, 352, 359, 351, 359, 379, 163, 380]}], + "spans": [{"offset": 28, "length": 14}]}, "value": {"content": "555-348-6512", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [363, 351, 524, 351, + 524, 374, 364, 378]}], "spans": [{"offset": 43, "length": 12}]}, "confidence": + 0.932}, {"key": {"content": "Website:", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [167, 394, 265, 393, 265, 418, 167, 417]}], "spans": [{"offset": + 56, "length": 8}]}, "value": {"content": "www.herolimited.com", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [270, 393, 522, 393, 522, 418, 270, 418]}], + "spans": [{"offset": 65, "length": 19}]}, "confidence": 0.943}, {"key": {"content": + "Dated As:", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1025, 420, + 1156, 420, 1156, 448, 1025, 448]}], "spans": [{"offset": 107, "length": 9}]}, + "value": {"content": "12/20/2020", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1162, 420, 1312, 421, 1312, 449, 1162, 448]}], "spans": [{"offset": 117, + "length": 10}]}, "confidence": 0.932}, {"key": {"content": "Email:", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [165, 435, 237, 435, 237, 460, 165, 460]}], + "spans": [{"offset": 85, "length": 6}]}, "value": {"content": "accounts@herolimited.com", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [164, 481, 471, 479, + 470, 503, 165, 503]}], "spans": [{"offset": 153, "length": 24}]}, "confidence": + 0.938}, {"key": {"content": "Purchase Order #:", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1023, 461, 1270, 461, 1270, 489, 1023, 489]}], "spans": + [{"offset": 128, "length": 17}]}, "value": {"content": "948284", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1275, 461, 1373, 462, 1373, 489, 1275, + 489]}], "spans": [{"offset": 146, "length": 6}]}, "confidence": 0.923}, {"key": + {"content": "Vendor Name:", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [160, 609, 341, 609, 341, 639, 160, 639]}], "spans": [{"offset": 189, "length": + 12}]}, "value": {"content": "Hillary Swank", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [346, 608, 518, 610, 518, 640, 346, 639]}], "spans": [{"offset": + 202, "length": 13}]}, "confidence": 0.905}, {"key": {"content": "Company Name:", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [160, 646, 366, 647, + 366, 679, 160, 678]}], "spans": [{"offset": 216, "length": 13}]}, "value": + {"content": "Higgly Wiggly Books", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [372, 647, 628, 645, 628, 678, 372, 680]}], "spans": [{"offset": 230, "length": + 19}]}, "confidence": 0.871}, {"key": {"content": "Address:", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [161, 685, 266, 685, 265, 712, 160, 711]}], + "spans": [{"offset": 250, "length": 8}]}, "value": {"content": "938 NE Burner + Road Boulder City, CO 92848", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [271, 685, 559, 685, 559, 751, 271, 751]}], "spans": [{"offset": 259, "length": + 41}]}, "confidence": 0.796}, {"key": {"content": "Phone:", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [613, 722, 701, 722, 701, 749, 613, 749]}], + "spans": [{"offset": 301, "length": 6}]}, "value": {"content": "938-294-2949", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [706, 722, 882, 722, + 881, 748, 706, 749]}], "spans": [{"offset": 308, "length": 12}]}, "confidence": + 0.943}, {"key": {"content": "Name:", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [166, 853, 246, 853, 245, 879, 166, 879]}], "spans": [{"offset": + 334, "length": 5}]}, "value": {"content": "Bernie Sanders", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [251, 852, 444, 852, 444, 880, 251, 880]}], + "spans": [{"offset": 340, "length": 14}]}, "confidence": 0.917}, {"key": {"content": + "Company Name:", "boundingRegions": [{"pageNumber": 1, "boundingBox": [164, + 889, 372, 889, 372, 919, 164, 919]}], "spans": [{"offset": 355, "length": + 13}]}, "value": {"content": "Jupiter Book Supply", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [377, 888, 628, 890, 628, 921, 377, 919]}], "spans": [{"offset": + 369, "length": 19}]}, "confidence": 0.871}, {"key": {"content": "Address:", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [166, 926, 271, 926, + 271, 953, 166, 953]}], "spans": [{"offset": 389, "length": 8}]}, "value": + {"content": "383 N Kinnick Road Seattle, WA 38383", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [276, 925, 516, 925, 516, 991, 276, 991]}], "spans": [{"offset": + 398, "length": 36}]}, "confidence": 0.803}, {"key": {"content": "Phone:", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [760, 964, 847, 964, + 846, 990, 760, 990]}], "spans": [{"offset": 435, "length": 6}]}, "value": + {"content": "932-299-0292", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [852, 964, 1029, 963, 1028, 990, 851, 990]}], "spans": [{"offset": 442, "length": + 12}]}, "confidence": 0.943}, {"key": {"content": "SUBTOTAL", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [1147, 1575, 1293, 1575, 1293, 1600, 1147, + 1600]}], "spans": [{"offset": 706, "length": 8}]}, "value": {"content": "$140.00", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [1426, 1572, 1526, 1572, + 1525, 1597, 1427, 1599]}], "spans": [{"offset": 715, "length": 7}]}, "confidence": + 0.943}, {"key": {"content": "TAX", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1236, 1618, 1288, 1618, 1288, 1643, 1236, 1643]}], "spans": [{"offset": 723, + "length": 3}]}, "value": {"content": "$4.00", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [1458, 1615, 1529, 1615, 1529, 1642, 1458, 1643]}], "spans": + [{"offset": 727, "length": 5}]}, "confidence": 0.943}, {"key": {"content": + "TOTAL", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1204, 1674, + 1292, 1674, 1292, 1699, 1205, 1699]}], "spans": [{"offset": 733, "length": + 5}]}, "value": {"content": "$144.00", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [1427, 1671, 1527, 1669, 1527, 1697, 1429, 1698]}], "spans": + [{"offset": 739, "length": 7}]}, "confidence": 0.943}], "entities": [{"category": + "Quantity", "subCategory": "Number", "content": "20", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [859, 1094, 887, 1094, 887, 1119, 859, 1119]}], "confidence": + 0.8, "spans": [{"offset": 498, "length": 2}]}, {"category": "Quantity", "subCategory": + "Number", "content": "1.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1240, 1095, 1291, 1094, 1291, 1117, 1240, 1118]}], "confidence": 0.8, "spans": + [{"offset": 501, "length": 4}]}, {"category": "Quantity", "subCategory": "Number", + "content": "20.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1458, + 1095, 1526, 1095, 1526, 1120, 1458, 1120]}], "confidence": 0.8, "spans": [{"offset": + 506, "length": 5}]}, {"category": "Quantity", "subCategory": "Number", "content": + "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [859, 1135, 889, + 1135, 889, 1160, 859, 1160]}], "confidence": 0.8, "spans": [{"offset": 525, + "length": 2}]}, {"category": "Quantity", "subCategory": "Number", "content": + "1.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1239, 1135, + 1291, 1135, 1291, 1160, 1239, 1160]}], "confidence": 0.8, "spans": [{"offset": + 528, "length": 4}]}, {"category": "Quantity", "subCategory": "Number", "content": + "20.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1458, 1135, + 1526, 1135, 1526, 1160, 1458, 1160]}], "confidence": 0.8, "spans": [{"offset": + 533, "length": 5}]}, {"category": "Quantity", "subCategory": "Number", "content": + "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [860, 1179, 888, + 1179, 888, 1204, 860, 1203]}], "confidence": 0.8, "spans": [{"offset": 556, + "length": 2}]}, {"category": "Quantity", "subCategory": "Number", "content": + "5.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1239, 1179, + 1291, 1178, 1291, 1203, 1239, 1204]}], "confidence": 0.8, "spans": [{"offset": + 559, "length": 4}]}, {"category": "Quantity", "subCategory": "Number", "content": + "100.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1443, 1181, + 1525, 1180, 1525, 1204, 1443, 1205]}], "confidence": 0.8, "spans": [{"offset": + 564, "length": 6}]}, {"category": "Quantity", "subCategory": "Number", "content": + "20", "boundingRegions": [{"pageNumber": 1, "boundingBox": [860, 1223, 887, + 1223, 887, 1247, 860, 1247]}], "confidence": 0.8, "spans": [{"offset": 591, + "length": 2}]}, {"category": "Quantity", "subCategory": "Number", "content": + "5.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1239, 1221, + 1291, 1221, 1291, 1247, 1239, 1247]}], "confidence": 0.8, "spans": [{"offset": + 594, "length": 4}]}, {"category": "Quantity", "subCategory": "Number", "content": + "100.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1444, 1224, + 1525, 1223, 1525, 1247, 1444, 1248]}], "confidence": 0.8, "spans": [{"offset": + 599, "length": 6}]}, {"category": "Quantity", "subCategory": "Currency", "content": + "$140.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1426, 1572, + 1526, 1571, 1526, 1598, 1426, 1599]}], "confidence": 0.8, "spans": [{"offset": + 715, "length": 7}]}, {"category": "Quantity", "subCategory": "Currency", "content": + "$4.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1458, 1615, + 1529, 1615, 1529, 1642, 1458, 1643]}], "confidence": 0.8, "spans": [{"offset": + 727, "length": 5}]}, {"category": "Quantity", "subCategory": "Currency", "content": + "$144.00", "boundingRegions": [{"pageNumber": 1, "boundingBox": [1427, 1671, + 1527, 1669, 1527, 1697, 1427, 1699]}], "confidence": 0.8, "spans": [{"offset": + 739, "length": 7}]}, {"category": "Organization", "content": "Hero Limited + Company", "boundingRegions": [{"pageNumber": 1, "boundingBox": [620, 205, + 1058, 204, 1058, 266, 620, 267]}, {"pageNumber": 1, "boundingBox": [163, 352, + 270, 351, 270, 379, 163, 380]}], "confidence": 0.78, "spans": [{"offset": + 15, "length": 20}]}, {"category": "URL", "content": "www.herolimited.com", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [270, 393, 522, 393, + 522, 418, 270, 418]}], "confidence": 0.8, "spans": [{"offset": 65, "length": + 19}]}, {"category": "DateTime", "subCategory": "Date", "content": "12/20/2020", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [1162, 420, 1312, 421, + 1312, 449, 1162, 448]}], "confidence": 0.8, "spans": [{"offset": 117, "length": + 10}]}, {"category": "Quantity", "subCategory": "Number", "content": "948284", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [1275, 461, 1373, 462, + 1373, 489, 1275, 489]}], "confidence": 0.8, "spans": [{"offset": 146, "length": + 6}]}, {"category": "Email", "content": "accounts@herolimited.com", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [164, 480, 471, 479, 471, 503, 164, 504]}], + "confidence": 0.8, "spans": [{"offset": 153, "length": 24}]}, {"category": + "Person", "content": "Hillary Swank", "boundingRegions": [{"pageNumber": 1, + "boundingBox": [346, 608, 518, 610, 518, 640, 346, 639]}], "confidence": 0.91, + "spans": [{"offset": 202, "length": 13}]}, {"category": "Person", "content": + "Higgly Wiggly", "boundingRegions": [{"pageNumber": 1, "boundingBox": [372, + 646, 541, 645, 541, 678, 372, 679]}], "confidence": 0.44, "spans": [{"offset": + 230, "length": 13}]}, {"category": "Address", "content": "938 NE Burner Road + Boulder City, CO", "boundingRegions": [{"pageNumber": 1, "boundingBox": [271, + 685, 521, 685, 521, 713, 271, 713]}, {"pageNumber": 1, "boundingBox": [279, + 722, 473, 722, 473, 751, 279, 751]}], "confidence": 0.78, "spans": [{"offset": + 259, "length": 35}]}, {"category": "Quantity", "subCategory": "Number", "content": + "938", "boundingRegions": [{"pageNumber": 1, "boundingBox": [271, 684, 319, + 685, 319, 713, 271, 713]}], "confidence": 0.8, "spans": [{"offset": 259, "length": + 3}]}, {"category": "Quantity", "subCategory": "Number", "content": "92848", + "boundingRegions": [{"pageNumber": 1, "boundingBox": [480, 722, 559, 721, + 559, 750, 480, 751]}], "confidence": 0.8, "spans": [{"offset": 295, "length": + 5}]}, {"category": "Person", "content": "Bernie Sanders", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [251, 852, 444, 852, 444, 880, 251, 880]}], + "confidence": 0.83, "spans": [{"offset": 340, "length": 14}]}, {"category": + "Organization", "subCategory": "Sports", "content": "Jupiter", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [377, 889, 464, 889, 464, 919, 377, 919]}], + "confidence": 0.79, "spans": [{"offset": 369, "length": 7}]}, {"category": + "Address", "content": "383 N Kinnick Road", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [276, 925, 516, 926, 516, 955, 276, 953]}], "confidence": + 0.96, "spans": [{"offset": 398, "length": 18}]}, {"category": "Quantity", + "subCategory": "Number", "content": "383", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [276, 925, 325, 925, 325, 953, 276, 953]}], "confidence": + 0.8, "spans": [{"offset": 398, "length": 3}]}, {"category": "Location", "subCategory": + "GPE", "content": "Seattle", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [281, 965, 375, 964, 375, 991, 281, 992]}], "confidence": 0.77, "spans": [{"offset": + 417, "length": 7}]}, {"category": "Location", "subCategory": "GPE", "content": + "WA", "boundingRegions": [{"pageNumber": 1, "boundingBox": [380, 964, 425, + 964, 425, 991, 380, 991]}], "confidence": 0.43, "spans": [{"offset": 426, + "length": 2}]}, {"category": "Quantity", "subCategory": "Number", "content": + "38383", "boundingRegions": [{"pageNumber": 1, "boundingBox": [432, 964, 511, + 963, 511, 990, 432, 991]}], "confidence": 0.8, "spans": [{"offset": 429, "length": + 5}]}, {"category": "Person", "content": "Bernie Sanders", "boundingRegions": + [{"pageNumber": 1, "boundingBox": [484, 1669, 763, 1670, 763, 1708, 484, 1707]}], + "confidence": 0.78, "spans": [{"offset": 606, "length": 14}]}, {"category": + "Person", "content": "Bernie Sanders", "boundingRegions": [{"pageNumber": + 1, "boundingBox": [542, 1718, 716, 1719, 716, 1743, 542, 1742]}], "confidence": + 0.37, "spans": [{"offset": 621, "length": 14}]}, {"category": "Organization", + "content": "Jupiter Book Supply", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [169, 1924, 460, 1924, 460, 1959, 169, 1959]}], "confidence": 0.99, "spans": + [{"offset": 747, "length": 19}]}, {"category": "Quantity", "subCategory": + "Percentage", "content": "50%", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [691, 1924, 761, 1924, 761, 1958, 691, 1958]}], "confidence": 0.8, "spans": + [{"offset": 783, "length": 3}]}, {"category": "DateTime", "subCategory": "DateRange", + "content": "within 60 days", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [1065, 1924, 1279, 1924, 1279, 1958, 1065, 1958]}], "confidence": 0.8, "spans": + [{"offset": 808, "length": 14}]}, {"category": "Quantity", "subCategory": + "Percentage", "content": "25%", "boundingRegions": [{"pageNumber": 1, "boundingBox": + [303, 1958, 372, 1958, 372, 1992, 303, 1992]}], "confidence": 0.8, "spans": + [{"offset": 848, "length": 3}]}], "styles": [{"isHandwritten": true, "confidence": + 0.9, "spans": [{"offset": 606, "length": 14}]}]}}' + headers: + apim-request-id: + - ff142a6e-32b8-4c20-b27c-914ae8cec3ce + content-type: + - application/json; charset=utf-8 + date: + - Sat, 30 Oct 2021 00:32:58 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains; preload + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-envoy-upstream-service-time: + - '466' + status: + code: 200 + message: OK +version: 1 diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py index e2227b337862..5c659cf4f5b0 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_get_children.py @@ -124,3 +124,19 @@ def test_document_key_value_element_get_children(self, client): elements = result.key_value_pairs[0].key.get_lines() assert len(elements) == 0 + + + @FormRecognizerPreparer() + @DocumentAnalysisClientPreparer() + def test_get_words_after_get_lines(self, client): + with open(self.form_jpg, "rb") as fd: + document = fd.read() + + poller = client.begin_analyze_document("prebuilt-document", document) + result = poller.result() + + lines = result.entities[0].get_lines() + assert len(lines) == 1 + + words = lines[0].get_words() + assert len(words) == 1 From 1c193f7145dd14540cee9a6c26c4babdc0a88fee Mon Sep 17 00:00:00 2001 From: Catalina Peralta Date: Fri, 29 Oct 2021 18:09:58 -0700 Subject: [PATCH 27/27] pass named params --- .../azure/ai/formrecognizer/_models.py | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py index 2d944aec33c9..302ab0f779ec 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -2290,7 +2290,7 @@ def get_words(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentWord] :rtype: iterable[DocumentWord] """ - return _get_children(self, ["word"], True) + return _get_children(self, search_elements=["word"], cross_page=True) def get_lines(self, **kwargs): # pylint: disable=unused-argument # type: (Any) -> Iterable[DocumentLine] @@ -2299,7 +2299,7 @@ def get_lines(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentLine] :rtype: iterable[DocumentLine] """ - return _get_children(self, ["line"], True) + return _get_children(self, search_elements=["line"], cross_page=True) class DocumentEntity(object): @@ -2418,7 +2418,7 @@ def get_words(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentWord] :rtype: iterable[DocumentWord] """ - return _get_children(self, ["word"], True) + return _get_children(self, search_elements=["word"], cross_page=True) def get_lines(self, **kwargs): # pylint: disable=unused-argument # type: (Any) -> Iterable[DocumentLine] @@ -2427,7 +2427,7 @@ def get_lines(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentLine] :rtype: iterable[DocumentLine] """ - return _get_children(self, ["line"], True) + return _get_children(self, search_elements=["line"], cross_page=True) class DocumentField(object): @@ -2554,7 +2554,7 @@ def get_words(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentWord] :rtype: iterable[DocumentWord] """ - return _get_children(self, ["word"], True) + return _get_children(self, search_elements=["word"], cross_page=True) def get_lines(self, **kwargs): # pylint: disable=unused-argument # type: (Any) -> Iterable[DocumentLine] @@ -2563,7 +2563,7 @@ def get_lines(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentLine] :rtype: iterable[DocumentLine] """ - return _get_children(self, ["line"], True) + return _get_children(self, search_elements=["line"], cross_page=True) class DocumentKeyValueElement(object): @@ -2652,7 +2652,7 @@ def get_words(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentWord] :rtype: iterable[DocumentWord] """ - return _get_children(self, ["word"], True) + return _get_children(self, search_elements=["word"], cross_page=True) def get_lines(self, **kwargs): # pylint: disable=unused-argument # type: (Any) -> Iterable[DocumentLine] @@ -2661,7 +2661,7 @@ def get_lines(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentLine] :rtype: iterable[DocumentLine] """ - return _get_children(self, ["line"], True) + return _get_children(self, search_elements=["line"], cross_page=True) class DocumentKeyValuePair(object): @@ -2808,7 +2808,7 @@ def get_words(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentWord] :rtype: iterable[DocumentWord] """ - return _get_children(self, ["word"], False) + return _get_children(self, search_elements=["word"], cross_page=False) class DocumentPage(object): @@ -3193,7 +3193,7 @@ def get_words(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentWord] :rtype: iterable[DocumentWord] """ - return _get_children(self, ["word"], True) + return _get_children(self, search_elements=["word"], cross_page=True) def get_lines(self, **kwargs): # pylint: disable=unused-argument # type: (Any) -> Iterable[DocumentLine] @@ -3202,7 +3202,7 @@ def get_lines(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentLine] :rtype: iterable[DocumentLine] """ - return _get_children(self, ["line"], True) + return _get_children(self, search_elements=["line"], cross_page=True) class DocumentTableCell(object): @@ -3327,7 +3327,7 @@ def get_words(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentWord] :rtype: iterable[DocumentWord] """ - return _get_children(self, ["word"], True) + return _get_children(self, search_elements=["word"], cross_page=True) def get_lines(self, **kwargs): # pylint: disable=unused-argument # type: (Any) -> Iterable[DocumentLine] @@ -3336,7 +3336,7 @@ def get_lines(self, **kwargs): # pylint: disable=unused-argument :return: iterable[DocumentLine] :rtype: iterable[DocumentLine] """ - return _get_children(self, ["line"], True) + return _get_children(self, search_elements=["line"], cross_page=True) class ModelOperationInfo(object):