diff --git a/notebooks/management.ipynb b/notebooks/management.ipynb index 3345527..f40a0ea 100644 --- a/notebooks/management.ipynb +++ b/notebooks/management.ipynb @@ -4,14 +4,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Manage Analyzers in Your Resource" + "# Managing Analyzers in Your Resource" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "This notebook demo how to create a simple analyzer and manage its lifecycle." + "This notebook demonstrates how to create a simple analyzer and manage its lifecycle." ] }, { @@ -19,8 +19,8 @@ "metadata": {}, "source": [ "## Prerequisites\n", - "1. Ensure Azure AI service is configured following [steps](../README.md#configure-azure-ai-service-resource)\n", - "2. Install the required packages to run the sample." + "1. Ensure your Azure AI service is configured following the [configuration steps](../README.md#configure-azure-ai-service-resource).\n", + "2. Install the required packages to run this sample." ] }, { @@ -36,16 +36,18 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Create Azure AI Content Understanding Client\n", + "## Create the Azure AI Content Understanding Client\n", "\n", - "> 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", + "> 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", + "\n", + "> Fill the constants **AZURE_AI_ENDPOINT**, **AZURE_AI_API_VERSION**, and **AZURE_AI_API_KEY** with your Azure AI Service details.\n", "\n", "> ⚠️ Important:\n", - "You must update the code below to match your Azure authentication method.\n", + "Update the code below to match your Azure authentication method.\n", "Look for the `# IMPORTANT` comments and modify those sections accordingly.\n", - "If you skip this step, the sample may not run correctly.\n", + "If you skip this step, the sample might not run correctly.\n", "\n", - "> ⚠️ 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." + "> ⚠️ Note: Using a subscription key works, but using Azure Active Directory (AAD) token-based authentication is more secure and highly recommended for production environments." ] }, { @@ -65,13 +67,13 @@ "load_dotenv(find_dotenv())\n", "logging.basicConfig(level=logging.INFO)\n", "\n", - "# For authentication, you can use either token-based auth or subscription key, and only one of them is required\n", + "# For authentication, you can use either token-based auth or subscription key. Use only one of these methods.\n", "AZURE_AI_ENDPOINT = os.getenv(\"AZURE_AI_ENDPOINT\")\n", - "# IMPORTANT: Replace with your actual subscription key or set up in \".env\" file if not using token auth\n", + "# IMPORTANT: Replace with your actual subscription key or set it in your \".env\" file if not using token auth\n", "AZURE_AI_API_KEY = os.getenv(\"AZURE_AI_API_KEY\")\n", "AZURE_AI_API_VERSION = os.getenv(\"AZURE_AI_API_VERSION\", \"2025-05-01-preview\")\n", "\n", - "# Add the parent directory to the path to use shared modules \n", + "# Add the parent directory to the system path to use shared modules\n", "parent_dir = Path(Path.cwd()).parent\n", "sys.path.append(str(parent_dir))\n", "from python.content_understanding_client import AzureContentUnderstandingClient\n", @@ -84,9 +86,9 @@ " api_version=AZURE_AI_API_VERSION,\n", " # IMPORTANT: Comment out token_provider if using subscription key\n", " token_provider=token_provider,\n", - " # IMPORTANT: Uncomment this if using subscription key\n", + " # IMPORTANT: Uncomment this line if using subscription key\n", " # subscription_key=AZURE_AI_API_KEY,\n", - " 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", + " x_ms_useragent=\"azure-ai-content-understanding-python/analyzer_management\", # This header is used for sample usage telemetry. Comment out this line if you want to opt out.\n", ")" ] }, @@ -94,8 +96,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Create a simple analyzer\n", - "We first create an analyzer from a template to extract invoice fields." + "## Create a Simple Analyzer\n", + "First, we create an analyzer from a template to extract invoice fields." ] }, { @@ -119,14 +121,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## List all analyzers created in your resource" + "## List All Analyzers in Your Resource" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "After the analyzer is successfully created, we can use it to analyze our input files." + "After successfully creating an analyzer, you can list all analyzers available in your resource." ] }, { @@ -137,17 +139,17 @@ "source": [ "response = client.get_all_analyzers()\n", "print(f\"Number of analyzers in your resource: {len(response['value'])}\")\n", - "print(f\"The first 3 analyzer details: {json.dumps(response['value'][:3], indent=2)}\")\n", - "print(f\"The last analyzer details: {json.dumps(response['value'][:-1], indent=2)}\")" + "print(f\"Details of the first 3 analyzers: {json.dumps(response['value'][:3], indent=2)}\")\n", + "print(f\"Details of all analyzers except the last one: {json.dumps(response['value'][:-1], indent=2)}\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Get analyzer details with id\n", + "## Get Analyzer Details by ID\n", "\n", - "Remember the analyzer id when you create it. You can use the id to look up detail analyzer definitions afterwards." + "Keep track of the analyzer ID when you create it. Use the ID to retrieve detailed analyzer definitions later." ] }, { @@ -164,8 +166,8 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Delete Analyzer\n", - "If you don't need an analyzer anymore, delete it with its id." + "## Delete an Analyzer\n", + "If you no longer need an analyzer, delete it using its ID." ] }, { @@ -199,4 +201,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file