Skip to content

Commit b1f1b8c

Browse files
Review main-notebooks/management.ipynb [Checked] (#57)
1 parent 29db1c7 commit b1f1b8c

File tree

1 file changed

+26
-24
lines changed

1 file changed

+26
-24
lines changed

notebooks/management.ipynb

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Manage Analyzers in Your Resource"
7+
"# Managing Analyzers in Your Resource"
88
]
99
},
1010
{
1111
"cell_type": "markdown",
1212
"metadata": {},
1313
"source": [
14-
"This notebook demo how to create a simple analyzer and manage its lifecycle."
14+
"This notebook demonstrates how to create a simple analyzer and manage its lifecycle."
1515
]
1616
},
1717
{
1818
"cell_type": "markdown",
1919
"metadata": {},
2020
"source": [
2121
"## Prerequisites\n",
22-
"1. Ensure Azure AI service is configured following [steps](../README.md#configure-azure-ai-service-resource)\n",
23-
"2. Install the required packages to run the sample."
22+
"1. Ensure your Azure AI service is configured following the [configuration steps](../README.md#configure-azure-ai-service-resource).\n",
23+
"2. Install the required packages to run this sample."
2424
]
2525
},
2626
{
@@ -36,16 +36,18 @@
3636
"cell_type": "markdown",
3737
"metadata": {},
3838
"source": [
39-
"## Create Azure AI Content Understanding Client\n",
39+
"## Create the Azure AI Content Understanding Client\n",
4040
"\n",
41-
"> The [AzureContentUnderstandingClient](../python/content_understanding_client.py) is a utility class containing functions to interact with the Content Understanding API. Before the official release of the Content Understanding SDK, it can be regarded as a lightweight SDK. Fill the constant **AZURE_AI_ENDPOINT**, **AZURE_AI_API_VERSION**, **AZURE_AI_API_KEY** with the information from your Azure AI Service.\n",
41+
"> The [AzureContentUnderstandingClient](../python/content_understanding_client.py) is a utility class that provides functions to interact with the Content Understanding API. Before the official release of the Content Understanding SDK, this client serves as a lightweight SDK.\n",
42+
"\n",
43+
"> Fill the constants **AZURE_AI_ENDPOINT**, **AZURE_AI_API_VERSION**, and **AZURE_AI_API_KEY** with your Azure AI Service details.\n",
4244
"\n",
4345
"> ⚠️ Important:\n",
44-
"You must update the code below to match your Azure authentication method.\n",
46+
"Update the code below to match your Azure authentication method.\n",
4547
"Look for the `# IMPORTANT` comments and modify those sections accordingly.\n",
46-
"If you skip this step, the sample may not run correctly.\n",
48+
"If you skip this step, the sample might not run correctly.\n",
4749
"\n",
48-
"> ⚠️ Note: Using a subscription key works, but using a token provider with Azure Active Directory (AAD) is much safer and is highly recommended for production environments."
50+
"> ⚠️ Note: Using a subscription key works, but using Azure Active Directory (AAD) token-based authentication is more secure and highly recommended for production environments."
4951
]
5052
},
5153
{
@@ -65,13 +67,13 @@
6567
"load_dotenv(find_dotenv())\n",
6668
"logging.basicConfig(level=logging.INFO)\n",
6769
"\n",
68-
"# For authentication, you can use either token-based auth or subscription key, and only one of them is required\n",
70+
"# For authentication, you can use either token-based auth or subscription key. Use only one of these methods.\n",
6971
"AZURE_AI_ENDPOINT = os.getenv(\"AZURE_AI_ENDPOINT\")\n",
70-
"# IMPORTANT: Replace with your actual subscription key or set up in \".env\" file if not using token auth\n",
72+
"# IMPORTANT: Replace with your actual subscription key or set it in your \".env\" file if not using token auth\n",
7173
"AZURE_AI_API_KEY = os.getenv(\"AZURE_AI_API_KEY\")\n",
7274
"AZURE_AI_API_VERSION = os.getenv(\"AZURE_AI_API_VERSION\", \"2025-05-01-preview\")\n",
7375
"\n",
74-
"# Add the parent directory to the path to use shared modules \n",
76+
"# Add the parent directory to the system path to use shared modules\n",
7577
"parent_dir = Path(Path.cwd()).parent\n",
7678
"sys.path.append(str(parent_dir))\n",
7779
"from python.content_understanding_client import AzureContentUnderstandingClient\n",
@@ -84,18 +86,18 @@
8486
" api_version=AZURE_AI_API_VERSION,\n",
8587
" # IMPORTANT: Comment out token_provider if using subscription key\n",
8688
" token_provider=token_provider,\n",
87-
" # IMPORTANT: Uncomment this if using subscription key\n",
89+
" # IMPORTANT: Uncomment this line if using subscription key\n",
8890
" # subscription_key=AZURE_AI_API_KEY,\n",
89-
" x_ms_useragent=\"azure-ai-content-understanding-python/analyzer_management\", # This header is used for sample usage telemetry, please comment out this line if you want to opt out.\n",
91+
" x_ms_useragent=\"azure-ai-content-understanding-python/analyzer_management\", # This header is used for sample usage telemetry. Please comment out this line if you want to opt out.\n",
9092
")"
9193
]
9294
},
9395
{
9496
"cell_type": "markdown",
9597
"metadata": {},
9698
"source": [
97-
"## Create a simple analyzer\n",
98-
"We first create an analyzer from a template to extract invoice fields."
99+
"## Create a Simple Analyzer\n",
100+
"First, we create an analyzer from a template to extract invoice fields."
99101
]
100102
},
101103
{
@@ -119,14 +121,14 @@
119121
"cell_type": "markdown",
120122
"metadata": {},
121123
"source": [
122-
"## List all analyzers created in your resource"
124+
"## List All Analyzers in Your Resource"
123125
]
124126
},
125127
{
126128
"cell_type": "markdown",
127129
"metadata": {},
128130
"source": [
129-
"After the analyzer is successfully created, we can use it to analyze our input files."
131+
"After successfully creating an analyzer, you can use it to analyze our input files. You can also list all analyzers available in your resource."
130132
]
131133
},
132134
{
@@ -137,17 +139,17 @@
137139
"source": [
138140
"response = client.get_all_analyzers()\n",
139141
"print(f\"Number of analyzers in your resource: {len(response['value'])}\")\n",
140-
"print(f\"The first 3 analyzer details: {json.dumps(response['value'][:3], indent=2)}\")\n",
141-
"print(f\"The last analyzer details: {json.dumps(response['value'][:-1], indent=2)}\")"
142+
"print(f\"Details of the first 3 analyzers: {json.dumps(response['value'][:3], indent=2)}\")\n",
143+
"print(f\"Details of the last analyzer: {json.dumps(response['value'][-1], indent=2)}\")"
142144
]
143145
},
144146
{
145147
"cell_type": "markdown",
146148
"metadata": {},
147149
"source": [
148-
"## Get analyzer details with id\n",
150+
"## Get Analyzer Details by ID\n",
149151
"\n",
150-
"Remember the analyzer id when you create it. You can use the id to look up detail analyzer definitions afterwards."
152+
"Keep track of the analyzer ID when you create it. Use the ID to retrieve detailed analyzer definitions later."
151153
]
152154
},
153155
{
@@ -164,8 +166,8 @@
164166
"cell_type": "markdown",
165167
"metadata": {},
166168
"source": [
167-
"## Delete Analyzer\n",
168-
"If you don't need an analyzer anymore, delete it with its id."
169+
"## Delete an Analyzer\n",
170+
"If you no longer need an analyzer, delete it using its ID."
169171
]
170172
},
171173
{

0 commit comments

Comments
 (0)