Skip to content

Commit c43055c

Browse files
improve description
1 parent 7c314fd commit c43055c

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

notebooks/content_understanding_pro_mode.ipynb

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Conduct complex analysis by Pro Mode\n",
7+
"# Conduct complex analysis with Pro mode\n",
88
"\n",
99
"> #################################################################################\n",
1010
">\n",
11-
"> Note: Currently this feature is exclusively available for `document` data. \n",
12-
"> Current supported file types: pdf, tiff, jpg, jpeg, png, bmp, heif\n",
11+
"> **Note:** Pro mode is currently available only for `document` data. \n",
12+
"> Supported file types: pdf, tiff, jpg, jpeg, png, bmp, heif\n",
1313
">\n",
1414
"> #################################################################################\n",
1515
"\n",
1616
"This notebook demonstrates how to use **Pro mode** in Azure AI Content Understanding to enhance your analyzer with multiple inputs and optional reference data. Pro mode is designed for advanced use cases, particularly those requiring multi-step reasoning, and complex decision-making (for instance, identifying inconsistencies, drawing inferences, and making sophisticated decisions). The pro mode allows input from multiple content files and includes the option to provide reference data at analyzer creation time.\n",
1717
"\n",
18-
"In this notebook, we will demonstrate how you can create an analyzer with reference data and analyze your files using Pro mode.\n",
18+
"In this walkthrough, you'll learn how to:\n",
19+
"1. Create an analyzer with reference data.\n",
20+
"2. Analyze your files using Pro mode.\n",
1921
"\n",
2022
"For more details on Pro mode, see the [Azure AI Content Understanding: Standard and Pro Modes](https://learn.microsoft.com/en-us/azure/ai-services/content-understanding/concepts/standard-pro-modes) documentation."
2123
]
@@ -26,9 +28,9 @@
2628
"source": [
2729
"## Prerequisites\n",
2830
"1. Ensure Azure AI service is configured following [steps](../README.md#configure-azure-ai-service-resource)\n",
29-
"1. If using reference documents, please set up `REFERENCE_DOC_SAS_URL` and `REFERENCE_DOC_PATH` in `.env` file. Can see similar steps in [Set labeled data](../docs/set_env_for_labeled_data.md) for the reference.\n",
30-
" - `REFERENCE_DOC_SAS_URL`: SAS URL of the Azure blob container. \n",
31-
" - `REFERENCE_DOC_PATH`: The designated folder path under the Azure blob container. \n",
31+
"1. If using reference documents, please set up `REFERENCE_DOC_SAS_URL` and `REFERENCE_DOC_PATH` in `.env` file. You can refer to similar steps in [Set labeled data](../docs/set_env_for_labeled_data.md).\n",
32+
" - `REFERENCE_DOC_SAS_URL`: SAS URL for your Azure Blob container. \n",
33+
" - `REFERENCE_DOC_PATH`: Folder path within the container for reference docs. \n",
3234
"1. Install the required packages to run the sample."
3335
]
3436
},
@@ -45,10 +47,10 @@
4547
"cell_type": "markdown",
4648
"metadata": {},
4749
"source": [
48-
"## Analyzer template and local files\n",
49-
"- `analyzer_template`: In this sample we define an analyzer template for invoice contract verification.\n",
50-
"- `input_docs`: We can have multiple input document files in one folder or designate a single document file location \n",
51-
"- `reference_docs`: During analyzer creation, we can provide documents that can aid in providing context that references the service at inference time. We will get ocr results for these files if needed, generate a reference jsonl file, and upload these files to a designated Azure blob storage.\n",
50+
"## Analyzer template and local files setup\n",
51+
"- **analyzer_template**: In this sample we define an analyzer template for invoice contract verification.\n",
52+
"- **input_docs**: We can have multiple input document files in one folder or designate a single document file location \n",
53+
"- **reference_dos**: During analyzer creation, we can provide documents that can aid in providing context that references the service at inference time. We will get ocr results for these files if needed, generate a reference jsonl file, and upload these files to a designated Azure blob storage.\n",
5254
"\n",
5355
"> For example, if you're looking to analyze invoices to ensure they're consistent with a contractual agreement, you can supply the invoice and other relevant documents (for example, a purchase order) as inputs, and supply the contract files as reference data. The service applies reasoning to validate the input documents according to your schema, which might be to identify discrepancies to flag for further review."
5456
]
@@ -59,6 +61,7 @@
5961
"metadata": {},
6062
"outputs": [],
6163
"source": [
64+
"# Define paths for analyzer template, input documents, and reference documents\n",
6265
"analyzer_template = \"../analyzer_templates/invoice_contract_verification_pro_mode.json\"\n",
6366
"input_docs = \"../data/invoice_contract_verification/input_docs\"\n",
6467
"reference_docs = \"../data/invoice_contract_verification/reference_docs/\""
@@ -126,7 +129,10 @@
126129
"metadata": {},
127130
"source": [
128131
"## Prepare reference data\n",
129-
"In this step, we will use Azure AI service to get ocr results for the reference document files if needed, generate a reference jsonl file, and upload these files to a designated Azure blob storage.\n",
132+
"In this step, we will \n",
133+
"- Use Azure AI service to Extract OCR results from reference documents (if needed).\n",
134+
"- Generate a reference `.jsonl` file.\n",
135+
"- Upload these files to the designated Azure blob storage.\n",
130136
"\n",
131137
"We use **REFERENCE_DOC_SAS_URL** and **REFERENCE_DOC_PATH** that's set in the prerequisite step."
132138
]
@@ -137,6 +143,7 @@
137143
"metadata": {},
138144
"outputs": [],
139145
"source": [
146+
"# Load reference storage configuration from environment\n",
140147
"REFERENCE_DOC_SAS_URL = os.getenv(\"REFERENCE_DOC_SAS_URL\")\n",
141148
"REFERENCE_DOC_PATH = os.getenv(\"REFERENCE_DOC_PATH\")\n",
142149
"\n",
@@ -147,7 +154,7 @@
147154
"cell_type": "markdown",
148155
"metadata": {},
149156
"source": [
150-
"## Create analyzer with defined schema for Pro Mode\n",
157+
"## Create analyzer with defined schema for Pro mode\n",
151158
"Before creating the custom fields analyzer, you should fill the constant ANALYZER_ID with a business-related name. Here we randomly generate a name for demo purpose.\n",
152159
"\n",
153160
"We use **REFERENCE_DOC_SAS_URL** and **REFERENCE_DOC_PATH** that's set up in `.env` file and used in the previous step."

0 commit comments

Comments
 (0)