Skip to content

Commit 0f6e65c

Browse files
Merge pull request #53527 from sherzyang/main
Update module.
2 parents f371a2e + a80c66b commit 0f6e65c

6 files changed

Lines changed: 16 additions & 24 deletions

File tree

learn-pr/wwl-data-ai/get-started-text-analysis-azure/6-knowledge-check.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ quiz:
2323
- content: "Entity detection"
2424
isCorrect: false
2525
explanation: "Incorrect. Entity detection identifies specific types of entity in the document, not the main talking points."
26-
- content: "You use Azure Language to perform sentiment analysis on a sentence. The confidence scores 0.04 positive, 0.36 neutral, and 0.60 negative are returned. What do these confidence scores indicate about the sentence sentiment?"
26+
- content: "You use Azure Language to perform sentiment analysis on a sentence. The sentiment scores returned are: 0.04 positive, 0.36 neutral, and 0.60 negative. What do these scores indicate about the sentence sentiment?"
2727
choices:
2828
- content: "The document is positive."
2929
isCorrect: false
30-
explanation: "Incorrect. The sentiment is most likely the type with the highest confidence score."
30+
explanation: "Incorrect. The sentiment is most likely the type with the highest sentiment score."
3131
- content: "The document is neutral."
3232
isCorrect: false
33-
explanation: "Incorrect. The sentiment is most likely the type with the highest confidence score."
33+
explanation: "Incorrect. The sentiment is most likely the type with the highest sentiment score."
3434
- content: "The document is negative."
3535
isCorrect: true
36-
explanation: "Correct. The sentiment is most likely the type with the highest confidence score, in this case 0.60 negative."
36+
explanation: "Correct. The sentiment is most likely the type with the highest sentiment score, in this case 0.60 negative."
3737
- content: "What is the purpose of the client object in the Azure Language SDK?"
3838
choices:
3939
- content: "It stores the application's user interface settings."

learn-pr/wwl-data-ai/get-started-text-analysis-azure/includes/3-language-sdk.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,18 @@
66

77
::: zone pivot="text"
88

9-
A Foundry resource and project is sufficient for using Azure Language in Foundry portal, but you will need an additional *Language resource* to use the Azure Language SDK. You can create a Language resource in the Azure portal, or programmatically in a command line interface (CLI).
10-
11-
:::image type="content" source="../media/azure-portal-create-resource.png" alt-text="Screenshot of the Azure portal with the marketplace open to the Language resource." lightbox="../media/azure-portal-create-resource.png":::
12-
13-
When you create a Language resource, Azure creates an *endpoint* for Azure Language. The endpoint is the address to a specific cloud service or model. We can find the Language service endpoint and key in the Azure portal.
14-
15-
:::image type="content" source="../media/azure-portal-credentials.png" alt-text="Screenshot of a Language resource in the Azure portal with the key and endpoint page open." lightbox="../media/azure-portal-credentials.png":::
16-
17-
When you run your application code, your application sends a request, or call, to the endpoint. The call can be sent using the REST API or SDK. The service returns a response, such as key phrases detected, in a format known as JSON.
9+
The **Azure Language SDK** is a client library that makes it easy for developers to add natural language processing (NLP) features—such as sentiment analysis, entity recognition, key phrase extraction, language detection, and text summarization—to their applications without having to call REST APIs directly. You would use the SDK when writing applications in *Python*, *JavaScript*, *C#*, or *Java*.
1810

1911
>[!NOTE]
20-
>You can review foundational material on applications and using endpoints in: [Get started with AI in Azure](/training/modules/get-started-with-ai-in-azure/5-endpoints?pivots=text?azure-portal=true).
12+
>An *API* (Application Programming Interface) is a set of rules and endpoints that allows one software application to communicate with and use the functionality or data of another application. A client library is a set of ready made code that developers can use in their application to easily talk to a service or API. You can review foundational material on applications and using endpoints in: [Get started with AI in Azure](/training/modules/get-started-with-ai-in-azure/5-endpoints?pivots=text?azure-portal=true).
2113
22-
The **Azure Language SDK** is a set of programming libraries that let your application talk to Azure’s Language Services. You would use the SDK when writing applications in **Python**, **JavaScript**, **C#**, or **Java**.
14+
![Screenshot of the Foundry portal home page with the key and endpoint location visible.](../media/endpoint-key-example.png)
2315

24-
## Use the Azure Language Python SDK
16+
To use the Azure Language SDK, you need to have a *Foundry resource*. When you create a Foundry resource, Azure creates an *endpoint*. You can find your resource endpoint and key in the *new* Foundry portal's home page. When you run your application code, your application sends a request, or call, to the endpoint. The call can be sent using the REST API or SDK. The service returns a response, such as key phrases detected, in a format known as JSON.
2517

26-
Let's see how you can use the Azure Language Python SDK to build an application that analyzes a document.
18+
## Use the Azure Language Python SDK
2719

28-
To use the Azure Language Python SDK, you need to have compatible version of Python and the Azure Language Python SDK installed.
20+
Let's see how you can use the Azure Language Python SDK to build an application that analyzes a document. To use the Azure Language Python SDK, you need to have compatible version of Python and the Azure Language Python SDK installed.
2921

3022
Application code is written in *code editors*, such as Visual Studio Code. A code editor’s *terminal* is a built‑in command‑line window inside the editor where you can run commands without leaving your development environment.
3123

@@ -48,7 +40,7 @@ from azure.core.credentials import AzureKeyCredential
4840

4941
:::image type="content" source="../media/python-sdk-client-example.png" alt-text="Screenshot of Visual Studio Code with a Python file open with a focus on the client object created." lightbox="../media/python-sdk-client-example.png":::
5042

51-
Then we use our Language resource endpoint and key to create an authenticated **client object**, the tool your code uses to communicate with a service. The client object knows the service's endpoint, carries credentials (like keys or tokens), exposes methods (for example: `analyze_sentiment()`), and handles sending requests and receiving responses under the hood.
43+
Then we use our Foundry resource endpoint and key to create an authenticated **client object**, the tool your code uses to communicate with a service. The client object knows the service's endpoint, carries credentials (like keys or tokens), exposes methods (for example: `analyze_sentiment()`), and handles sending requests and receiving responses under the hood.
5244

5345
We use the client's methods to call Azure Language functions. For example, we can extract key phrases with `client.extract_key_phrases()`, recognize entities with the function `client.recognize_entities()`, and analyze sentiment with `client.analyze_sentiment()`. To generate a summary, we need to use an asynchronous technique to begin the summarization task and retrieve the results.
5446

@@ -69,8 +61,8 @@ from azure.core.credentials import AzureKeyCredential
6961
from azure.ai.textanalytics import TextAnalyticsClient
7062

7163
# Create a client
72-
endpoint = os.environ["AZURE_LANGUAGE_ENDPOINT"]
73-
key = os.environ["AZURE_LANGUAGE_KEY"]
64+
endpoint = os.environ["FOUNDRY_ENDPOINT"]
65+
key = os.environ["FOUNDRY_KEY"]
7466

7567
client = TextAnalyticsClient(endpoint=endpoint, credential=AzureKeyCredential(key))
7668
```

learn-pr/wwl-data-ai/get-started-text-analysis-azure/includes/7-summary.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ This module explains how AI applications and agents can interpret written inform
1010

1111
Throughout the module, you explored how to integrate Azure Language directly into your own applications using the Azure Language SDK, enabling programmatic access to these text analysis features. You also learned how to extend AI agents with Azure Language capabilities by connecting them to the Azure Language MCP server, allowing agents to perform language tasks as part of their automated workflows.
1212

13+
::: zone-end
14+
1315
Use the links below to learn more:
1416

1517
- [View the Azure Text Analytics client library](/python/api/overview/azure/ai-textanalytics-readme)
16-
- [Read about about Azure Language in Foundry Tools](/azure/ai-services/language-service/overview)
17-
18-
::: zone-end
18+
- [Read about about Azure Language in Foundry Tools](/azure/ai-services/language-service/overview)
Binary file not shown.
Binary file not shown.
360 KB
Loading

0 commit comments

Comments
 (0)