diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/README.md b/sdk/formrecognizer/azure-ai-formrecognizer/README.md index 7383b824f05c..c38e74bd645d 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/README.md +++ b/sdk/formrecognizer/azure-ai-formrecognizer/README.md @@ -238,7 +238,8 @@ print("Last modified: {}".format(model.last_modified)) print("Recognized fields:") # looping through the submodels, which contains the fields they were trained on for submodel in model.models: - print("We have recognized the following fields: {}".format( + print("The submodel with form type '{}' has recognized the following fields: {}".format( + submodel.form_type, ", ".join([label for label in submodel.fields]) )) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_content_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_content_async.py index 81cfd68c5e1b..630a1bb62548 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_content_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_recognize_content_async.py @@ -68,8 +68,9 @@ async def recognize_content(self): )) # [END recognize_content_async] for line_idx, line in enumerate(content.lines): - print("Line # {} has text '{}' within bounding box '{}'".format( + print("Line # {} has word count '{}' and text '{}' within bounding box '{}'".format( line_idx, + len(line.words), line.text, format_bounding_box(line.bounding_box) )) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_with_labels_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_with_labels_async.py index 98667b40cd48..aa71a7c9050c 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_with_labels_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_with_labels_async.py @@ -57,7 +57,7 @@ async def train_model_with_labels(self): # looping through the submodels, which contains the fields they were trained on # The labels are based on the ones you gave the training document. for submodel in model.models: - print("...The submodel has accuracy '{}'".format(submodel.accuracy)) + print("...The submodel with form type {} has accuracy '{}'".format(submodel.form_type, submodel.accuracy)) for name, field in submodel.fields.items(): print("...The model found field '{}' to have name '{}' with an accuracy of {}".format( name, field.name, field.accuracy diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_without_labels_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_without_labels_async.py index 7d40e03eaf4e..1f28703a62b6 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_without_labels_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_train_model_without_labels_async.py @@ -54,6 +54,7 @@ async def train_model_without_labels(self): print("Recognized fields:") # Looping through the submodels, which contains the fields they were trained on for submodel in model.models: + print("...The submodel has form type '{}'".format(submodel.form_type)) for name, field in submodel.fields.items(): print("...The model found field '{}' to have label '{}'".format( name, field.label diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_content.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_content.py index 09f5838b6324..53860003bc4e 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_content.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_recognize_content.py @@ -60,8 +60,9 @@ def recognize_content(self): )) # [END recognize_content] for line_idx, line in enumerate(content.lines): - print("Line # {} has text '{}' within bounding box '{}'".format( + print("Line # {} has word count '{}' and text '{}' within bounding box '{}'".format( line_idx, + len(line.words), line.text, format_bounding_box(line.bounding_box) )) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_with_labels.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_with_labels.py index 49a1addd0e3f..b8bf50fbe915 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_with_labels.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_with_labels.py @@ -55,7 +55,7 @@ def train_model_with_labels(self): # looping through the submodels, which contains the fields they were trained on # The labels are based on the ones you gave the training document. for submodel in model.models: - print("...The submodel has accuracy '{}'".format(submodel.accuracy)) + print("...The submodel with form type {} has accuracy '{}'".format(submodel.form_type, submodel.accuracy)) for name, field in submodel.fields.items(): print("...The model found field '{}' to have name '{}' with an accuracy of {}".format( name, field.name, field.accuracy diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_without_labels.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_without_labels.py index 298491b6f945..9a0040309353 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_without_labels.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_train_model_without_labels.py @@ -52,6 +52,7 @@ def train_model_without_labels(self): print("Recognized fields:") # Looping through the submodels, which contains the fields they were trained on for submodel in model.models: + print("...The submodel has form type '{}'".format(submodel.form_type)) for name, field in submodel.fields.items(): print("...The model found field '{}' to have label '{}'".format( name, field.label