From 195e60871182fa8700346b5225e741dbcb4ca6be Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Tue, 14 Jul 2020 17:48:04 -0700 Subject: [PATCH 1/6] add type to FormField --- .../azure/ai/formrecognizer/__init__.py | 2 ++ .../azure/ai/formrecognizer/_models.py | 27 ++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/__init__.py b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/__init__.py index 81f78c10f742..bca982f60763 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/__init__.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/__init__.py @@ -31,6 +31,7 @@ CustomFormModel, CustomFormSubmodel, CustomFormModelField, + FieldValueType ) @@ -59,6 +60,7 @@ 'CustomFormModel', 'CustomFormSubmodel', 'CustomFormModelField', + 'FieldValueType' ] __VERSION__ = VERSION 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 1a8fa595e169..a3e91d5905e8 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -75,6 +75,20 @@ def get_field_value(field, value, read_result): # pylint: disable=too-many-retu return None +class FieldValueType(str, Enum): + """Semantic data type of the field value. + """ + + STRING = "string" + DATE = "date" + TIME = "time" + PHONE_NUMBER = "phoneNumber" + NUMBER = "number" + INTEGER = "integer" + ARRAY = "array" + OBJECT = "object" + + class LengthUnit(str, Enum): """The unit used by the width, height and bounding box properties. For images, the unit is "pixel". For PDF, the unit is "inch". @@ -188,14 +202,16 @@ def __repr__(self): class FormField(object): """Represents a field recognized in an input form. + :ivar type: The type of the value found on FormField. Possible types include: 'string', + 'date', 'time', 'phoneNumber', 'number', 'integer', 'object', or 'array'. + :vartype type: str or ~azure.ai.formrecognizer.FieldValueType :ivar ~azure.ai.formrecognizer.FieldData label_data: Contains the text, bounding box, and field elements for the field label. :ivar ~azure.ai.formrecognizer.FieldData value_data: Contains the text, bounding box, and field elements for the field value. :ivar str name: The unique name of the field or label. :ivar value: - The value for the recognized field. Possible types include: 'string', - 'date', 'time', 'phoneNumber', 'number', 'integer', 'object', or 'array'. + The value for the recognized field. :vartype value: str, int, float, :class:`~datetime.date`, :class:`~datetime.time`, :class:`~azure.ai.formrecognizer.FormField`, or list[:class:`~azure.ai.formrecognizer.FormField`] :ivar float confidence: @@ -203,6 +219,7 @@ class FormField(object): """ def __init__(self, **kwargs): + self.type = kwargs.get("type", None) self.label_data = kwargs.get("label_data", None) self.value_data = kwargs.get("value_data", None) self.name = kwargs.get("name", None) @@ -212,6 +229,7 @@ def __init__(self, **kwargs): @classmethod def _from_generated(cls, field, value, read_result): return cls( + type=value.type, label_data=FieldData._from_generated(field, read_result), value_data=FieldData._from_generated(value, read_result), value=get_field_value(field, value, read_result), @@ -222,6 +240,7 @@ def _from_generated(cls, field, value, read_result): @classmethod def _from_generated_unlabeled(cls, field, idx, page, read_result): return cls( + type="string", # unlabeled only returns string label_data=FieldData._from_generated_unlabeled(field.key, page, read_result), value_data=FieldData._from_generated_unlabeled(field.value, page, read_result), value=field.value.text, @@ -230,8 +249,8 @@ def _from_generated_unlabeled(cls, field, idx, page, read_result): ) def __repr__(self): - return "FormField(label_data={}, value_data={}, name={}, value={}, confidence={})".format( - repr(self.label_data), repr(self.value_data), self.name, repr(self.value), self.confidence + return "FormField(type={}, label_data={}, value_data={}, name={}, value={}, confidence={})".format( + self.type, repr(self.label_data), repr(self.value_data), self.name, repr(self.value), self.confidence )[:1024] From 2a1a7c9d1cd30e049eb268b939915c65d84fa7ae Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Wed, 15 Jul 2020 14:26:29 -0700 Subject: [PATCH 2/6] tests --- .../azure/ai/formrecognizer/_models.py | 2 +- .../azure-ai-formrecognizer/tests/test_repr.py | 14 +++++++------- .../azure-ai-formrecognizer/tests/testcase.py | 14 ++++++++------ 3 files changed, 16 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 a3e91d5905e8..7a9c8ef47572 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -229,7 +229,7 @@ def __init__(self, **kwargs): @classmethod def _from_generated(cls, field, value, read_result): return cls( - type=value.type, + type=value.type if value else None, label_data=FieldData._from_generated(field, read_result), value_data=FieldData._from_generated(value, read_result), value=get_field_value(field, value, read_result), diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_repr.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_repr.py index cc3c914e33b8..c826f7ad901c 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_repr.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_repr.py @@ -59,23 +59,23 @@ def form_table(form_table_cell): return model, model_repr @pytest.fixture -def field_text(bounding_box, form_word, form_line): +def field_data(bounding_box, form_word, form_line): model = _models.FieldData(page_number=1, text="This is text.", bounding_box=bounding_box[0], field_elements=[form_word[0], form_line[0]]) model_repr = "FieldData(page_number=1, text=This is text., bounding_box={}, field_elements=[{}, {}])".format(bounding_box[1], form_word[1], form_line[1])[:1024] assert repr(model) == model_repr return model, model_repr @pytest.fixture -def form_field_two(field_text): - model = _models.FormField(label_data=field_text[0], value_data=field_text[0], name="form_field_two", value="value", confidence=0) - model_repr = "FormField(label_data={}, value_data={}, name=form_field_two, value='value', confidence=0)".format(field_text[1], field_text[1])[:1024] +def form_field_two(field_data): + model = _models.FormField(type="string", label_data=field_data[0], value_data=field_data[0], name="form_field_two", value="value", confidence=0) + model_repr = "FormField(type=string, label_data={}, value_data={}, name=form_field_two, value='value', confidence=0)".format(field_data[1], field_data[1])[:1024] assert repr(model) == model_repr return model, model_repr @pytest.fixture -def form_field_one(field_text, form_field_two): - model = _models.FormField(label_data=field_text[0], value_data=field_text[0], name="form_field_one", value=form_field_two[0], confidence=1.0) - model_repr = "FormField(label_data={}, value_data={}, name=form_field_one, value={}, confidence=1.0)".format(field_text[1], field_text[1], form_field_two[1])[:1024] +def form_field_one(field_data, form_field_two): + model = _models.FormField(type="string", label_data=field_data[0], value_data=field_data[0], name="form_field_one", value=form_field_two[0], confidence=1.0) + model_repr = "FormField(type=string, label_data={}, value_data={}, name=form_field_one, value={}, confidence=1.0)".format(field_data[1], field_data[1], form_field_two[1])[:1024] assert repr(model) == model_repr return model, model_repr diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py index 07d0c137f3d9..2ebd00f2426b 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py @@ -200,7 +200,7 @@ def assertBoundingBoxTransformCorrect(self, box, actual): self.assertEqual(box[3].x, actual[6]) self.assertEqual(box[3].y, actual[7]) - def assertTextContentTransformCorrect(self, field_elements, actual_elements, read_result): + def assertFieldElementsTransFormCorrect(self, field_elements, actual_elements, read_result): if field_elements is None and actual_elements is None: return for receipt, actual in zip(field_elements, actual_elements): @@ -222,6 +222,7 @@ def assertLabeledFormFieldDictTransformCorrect(self, form_fields, actual_fields, self.assertBoundingBoxTransformCorrect(b[label].value_data.bounding_box, a.bounding_box) self.assertEqual(a.text, b[label].value_data.text) field_type = a.type + self.assertEqual(field_type, b[label].type) if field_type == "string": self.assertEqual(b[label].value, a.value_string) if field_type == "number": @@ -235,7 +236,7 @@ def assertLabeledFormFieldDictTransformCorrect(self, form_fields, actual_fields, if field_type == "time": self.assertEqual(b[label].value, a.value_time) if read_results: - self.assertTextContentTransformCorrect( + self.assertFieldElementsTransFormCorrect( b[label].value_data.field_elements, a.elements, read_results @@ -249,7 +250,7 @@ def assertUnlabeledFormFieldDictTransformCorrect(self, form_fields, actual_field self.assertEqual(a.key.text, form_fields["field-"+str(idx)].label_data.text) self.assertBoundingBoxTransformCorrect(form_fields["field-"+str(idx)].label_data.bounding_box, a.key.bounding_box) if read_results: - self.assertTextContentTransformCorrect( + self.assertFieldElementsTransFormCorrect( form_fields["field-"+str(idx)].label_data.field_elements, a.key.elements, read_results @@ -257,7 +258,7 @@ def assertUnlabeledFormFieldDictTransformCorrect(self, form_fields, actual_field self.assertEqual(a.value.text, form_fields["field-" + str(idx)].value_data.text) self.assertBoundingBoxTransformCorrect(form_fields["field-" + str(idx)].value_data.bounding_box, a.value.bounding_box) if read_results: - self.assertTextContentTransformCorrect( + self.assertFieldElementsTransFormCorrect( form_fields["field-"+str(idx)].value_data.field_elements, a.value.elements, read_results @@ -267,6 +268,7 @@ def assertFormFieldTransformCorrect(self, receipt_field, actual_field, read_resu if actual_field is None: return field_type = actual_field.type + self.assertEqual(field_type, receipt_field.type) if field_type == "string": self.assertEqual(receipt_field.value, actual_field.value_string) if field_type == "number": @@ -284,7 +286,7 @@ def assertFormFieldTransformCorrect(self, receipt_field, actual_field, read_resu self.assertEqual(receipt_field.value_data.text, actual_field.text) self.assertEqual(receipt_field.confidence, actual_field.confidence if actual_field.confidence is not None else 1.0) if read_results: - self.assertTextContentTransformCorrect( + self.assertFieldElementsTransFormCorrect( receipt_field.value_data.field_elements, actual_field.elements, read_results @@ -314,7 +316,7 @@ def assertTablesTransformCorrect(self, layout, actual_layout, read_results=None, self.assertEqual(cell.is_header, actual_cell.is_header if actual_cell.is_header is not None else False) self.assertEqual(cell.is_footer, actual_cell.is_footer if actual_cell.is_footer is not None else False) self.assertBoundingBoxTransformCorrect(cell.bounding_box, actual_cell.bounding_box) - self.assertTextContentTransformCorrect(cell.field_elements, actual_cell.elements, read_results) + self.assertFieldElementsTransFormCorrect(cell.field_elements, actual_cell.elements, read_results) def assertReceiptItemsHasValues(self, items, page_number, include_field_elements): for item in items: From 5cb38712673aa9a76235112317e8cd7a5389fe36 Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Wed, 15 Jul 2020 14:49:00 -0700 Subject: [PATCH 3/6] changelog --- sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md index 504b516b5b63..96019966b6ef 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/CHANGELOG.md @@ -6,6 +6,10 @@ - Values are now capitalized for enums `FormContentType`, `LengthUnit`, `TrainingStatus`, and `CustomFormModelStatus` +**New features** + +- `FormField` now has attribute `type` which contains the semantic data type of the field value + ## 1.0.0b4 (2020-07-07) **Breaking Changes** From a887326deeff2b1c73e55fb00a08c5238c5bc11f Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Thu, 16 Jul 2020 17:00:31 -0700 Subject: [PATCH 4/6] update tests --- .../tests/test_receipt.py | 4 ++-- .../tests/test_receipt_async.py | 4 ++-- .../tests/test_receipt_from_url.py | 4 ++-- .../tests/test_receipt_from_url_async.py | 4 ++-- .../azure-ai-formrecognizer/tests/testcase.py | 18 +++++++++++------- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py index a252d85d6d1d..8c14a8f120f8 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt.py @@ -310,10 +310,10 @@ def test_receipt_jpg_include_field_elements(self, client): for field, value in receipt.__dict__.items(): if field not in ["receipt_items", "page_range", "pages", "fields", "form_type"]: form_field = getattr(receipt, field) - self.assertTextContentHasValues(form_field.value_data.field_elements, receipt.page_range.first_page_number) + self.assertFieldElementsHasValues(form_field.value_data.field_elements, receipt.page_range.first_page_number) for field, value in receipt.fields.items(): - self.assertTextContentHasValues(value.value_data.field_elements, receipt.page_range.first_page_number) + self.assertFieldElementsHasValues(value.value_data.field_elements, receipt.page_range.first_page_number) @GlobalFormRecognizerAccountPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py index fd3009303dce..4b9cfc8a98dc 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_async.py @@ -321,10 +321,10 @@ async def test_receipt_jpg_include_field_elements(self, client): for field, value in receipt.__dict__.items(): if field not in ["receipt_items", "page_range", "pages", "fields", "form_type"]: form_field = getattr(receipt, field) - self.assertTextContentHasValues(form_field.value_data.field_elements, receipt.page_range.first_page_number) + self.assertFieldElementsHasValues(form_field.value_data.field_elements, receipt.page_range.first_page_number) for field, value in receipt.fields.items(): - self.assertTextContentHasValues(value.value_data.field_elements, receipt.page_range.first_page_number) + self.assertFieldElementsHasValues(value.value_data.field_elements, receipt.page_range.first_page_number) @GlobalFormRecognizerAccountPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py index add6887ce04e..fe67c03087de 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url.py @@ -201,10 +201,10 @@ def test_receipt_url_include_field_elements(self, client): for field, value in receipt.__dict__.items(): if field not in ["receipt_items", "page_range", "pages", "fields", "form_type"]: field = getattr(receipt, field) - self.assertTextContentHasValues(field.value_data.field_elements, receipt.page_range.first_page_number) + self.assertFieldElementsHasValues(field.value_data.field_elements, receipt.page_range.first_page_number) for field, value in receipt.fields.items(): - self.assertTextContentHasValues(value.value_data.field_elements, receipt.page_range.first_page_number) + self.assertFieldElementsHasValues(value.value_data.field_elements, receipt.page_range.first_page_number) @GlobalFormRecognizerAccountPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py index 259e8c67a14e..8c5e549386a6 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_receipt_from_url_async.py @@ -218,10 +218,10 @@ async def test_receipt_url_include_field_elements(self, client): for field, value in receipt.__dict__.items(): if field not in ["page_range", "pages", "fields", "form_type"]: field = getattr(receipt, field) - self.assertTextContentHasValues(field.value_data.field_elements, receipt.page_range.first_page_number) + self.assertFieldElementsHasValues(field.value_data.field_elements, receipt.page_range.first_page_number) for field, value in receipt.fields.items(): - self.assertTextContentHasValues(value.value_data.field_elements, receipt.page_range.first_page_number) + self.assertFieldElementsHasValues(value.value_data.field_elements, receipt.page_range.first_page_number) @GlobalFormRecognizerAccountPreparer() @GlobalClientPreparer() diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py index 2ebd00f2426b..0e2d35c0d2cc 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py @@ -320,24 +320,28 @@ def assertTablesTransformCorrect(self, layout, actual_layout, read_results=None, def assertReceiptItemsHasValues(self, items, page_number, include_field_elements): for item in items: + self.assertEqual(item.type, "object") self.assertBoundingBoxHasPoints(item.value.get("Name").value_data.bounding_box) self.assertIsNotNone(item.value.get("Name").confidence) self.assertIsNotNone(item.value.get("Name").value_data.text) + self.assertIsNotNone(item.value.get("Name").type) self.assertBoundingBoxHasPoints(item.value.get("Quantity").value_data.bounding_box) self.assertIsNotNone(item.value.get("Quantity").confidence) self.assertIsNotNone(item.value.get("Quantity").value_data.text) + self.assertIsNotNone(item.value.get("Quantity").type) self.assertBoundingBoxHasPoints(item.value.get("TotalPrice").value_data.bounding_box) self.assertIsNotNone(item.value.get("TotalPrice").confidence) self.assertIsNotNone(item.value.get("TotalPrice").value_data.text) + self.assertIsNotNone(item.value.get("TotalPrice").type) if include_field_elements: - self.assertTextContentHasValues(item.value.get("Name").value_data.field_elements, page_number) - self.assertTextContentHasValues(item.value.get("Name").value_data.field_elements, page_number) - self.assertTextContentHasValues(item.value.get("Name").value_data.field_elements, page_number) + self.assertFieldElementsHasValues(item.value.get("Name").value_data.field_elements, page_number) + self.assertFieldElementsHasValues(item.value.get("Quantity").value_data.field_elements, page_number) + self.assertFieldElementsHasValues(item.value.get("TotalPrice").value_data.field_elements, page_number) else: self.assertIsNone(item.value.get("Name").value_data.field_elements) - self.assertIsNone(item.value.get("Name").value_data.field_elements) - self.assertIsNone(item.value.get("Name").value_data.field_elements) + self.assertIsNone(item.value.get("Quantity").value_data.field_elements) + self.assertIsNone(item.value.get("TotalPrice").value_data.field_elements) def assertBoundingBoxHasPoints(self, box): if box is None: @@ -378,7 +382,7 @@ def assertFormPagesHasValues(self, pages): self.assertIsNotNone(cell.row_span) self.assertIsNotNone(cell.column_span) self.assertBoundingBoxHasPoints(cell.bounding_box) - self.assertTextContentHasValues(cell.field_elements, page.page_number) + self.assertFieldElementsHasValues(cell.field_elements, page.page_number) def assertFormWordHasValues(self, word, page_number): self.assertIsNotNone(word.confidence) @@ -386,7 +390,7 @@ def assertFormWordHasValues(self, word, page_number): self.assertBoundingBoxHasPoints(word.bounding_box) self.assertEqual(word.page_number, page_number) - def assertTextContentHasValues(self, elements, page_number): + def assertFieldElementsHasValues(self, elements, page_number): if elements is None: return for word in elements: From b6e2c939e41d37acfb851662a18a1f3c9745d48a Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Fri, 17 Jul 2020 09:41:05 -0700 Subject: [PATCH 5/6] fix test --- .../azure-ai-formrecognizer/tests/test_mgmt.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt.py b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt.py index 1f10a73a4342..400ef0368d40 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt.py @@ -163,8 +163,7 @@ def test_get_form_recognizer_client(self, resource_group, location, form_recogni @GlobalFormRecognizerAccountPreparer() def test_api_version_form_training_client(self, resource_group, location, form_recognizer_account, form_recognizer_account_key): - transport = RequestsTransport() with self.assertRaises(ValueError): - ftc = FormTrainingClient(endpoint=form_recognizer_account, credential=AzureKeyCredential(form_recognizer_account_key), transport=transport, api_version="2.1") + ftc = FormTrainingClient(endpoint=form_recognizer_account, credential=AzureKeyCredential(form_recognizer_account_key), api_version="2.1") - ftc = FormTrainingClient(endpoint=form_recognizer_account, credential=AzureKeyCredential(form_recognizer_account_key), transport=transport, api_version="2.0") + ftc = FormTrainingClient(endpoint=form_recognizer_account, credential=AzureKeyCredential(form_recognizer_account_key), api_version="2.0") From 3c9bcc827a2d1a666eedbb8955ddd0436f8a15ee Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Mon, 20 Jul 2020 12:12:35 -0700 Subject: [PATCH 6/6] update docstring --- .../azure/ai/formrecognizer/_models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 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 916722a34a02..95d0fbe2e17c 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py @@ -202,7 +202,7 @@ def __repr__(self): class FormField(object): """Represents a field recognized in an input form. - :ivar type: The type of the value found on FormField. Possible types include: 'string', + :ivar type: The type of `value` found on FormField. Possible types include: 'string', 'date', 'time', 'phoneNumber', 'number', 'integer', 'object', or 'array'. :vartype type: str or ~azure.ai.formrecognizer.FieldValueType :ivar ~azure.ai.formrecognizer.FieldData label_data: @@ -211,7 +211,7 @@ class FormField(object): Contains the text, bounding box, and field elements for the field value. :ivar str name: The unique name of the field or label. :ivar value: - The value for the recognized field. + The value for the recognized field. Its semantic data type is described by `type`. :vartype value: str, int, float, :class:`~datetime.date`, :class:`~datetime.time`, :class:`~azure.ai.formrecognizer.FormField`, or list[:class:`~azure.ai.formrecognizer.FormField`] :ivar float confidence: