You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: learn-pr/wwl-data-ai/get-started-with-text-analysis-in-azure/includes/2-azure-language.md
+5-25Lines changed: 5 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,13 +52,8 @@ Key phrase extraction can provide some context to this review by extracting the
52
52
- waiter
53
53
54
54
In the classic Foundry portal, you can test out Azure Language's key phrase extraction feature in the Language Playground.
55
-
56
-
:::image
57
-
type: content
58
-
source: ../media/playground-key-phrases.png
59
-
alt-text: Screenshot of the Language playground's key phrase extraction capability.
60
-
lightbox: ../media/playground-key-phrases.png
61
-
:::
55
+
56
+

62
57
63
58
#### Entity recognition and linking
64
59
@@ -91,12 +86,7 @@ You can provide Azure Language with unstructured text and it returns a list of *
91
86
92
87
In the classic Foundry portal, you can test out Azure Language's named entity recognition feature in the Language Playground.
93
88
94
-
:::image
95
-
type: content
96
-
source: ../media/playground-named-entities.png
97
-
alt-text: Screenshot of the Language playground's named entity recognition capability.
98
-
lightbox: ../media/playground-named-entities.png
99
-
:::
89
+

100
90
101
91
Azure Language also supports **entity linking** to help disambiguate entities by linking to a specific reference. For recognized entities, the service returns a URL for a relevant *Wikipedia* article.
102
92
@@ -137,12 +127,7 @@ The service would provide sentence analysis for each of the sentences. Each sent
137
127
138
128
In classic Foundry portal, you can test out Azure Language's sentiment analysis capability in the Language Playground.
139
129
140
-
:::image
141
-
type: content
142
-
source: ../media/playground-sentiment.png
143
-
alt-text: Screenshot of the Language playground's sentiment capability.
144
-
lightbox: ../media/playground-sentiment.png
145
-
:::
130
+

146
131
147
132
#### Summarization
148
133
@@ -164,12 +149,7 @@ The individual experienced an exceptional dining experience at the Foundry diner
164
149
165
150
In classic Foundry portal, you can test out Azure Language's summarization capability in the Language Playground.
166
151
167
-
:::image
168
-
type: content
169
-
source: ../media/playground-summarize.png
170
-
alt-text: Screenshot of the Language playground's summarization capability.
171
-
lightbox: ../media/playground-summarize.png
172
-
:::
152
+

173
153
174
154
Next, let's learn how to get started with the Azure Language software development kit (SDK) to build a lightweight application.
Copy file name to clipboardExpand all lines: learn-pr/wwl-data-ai/get-started-with-text-analysis-in-azure/includes/3-language-sdk.md
+6-36Lines changed: 6 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,21 +8,11 @@
8
8
9
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
10
11
-
:::image
12
-
type: content
13
-
source: ../media/azure-portal-create-resource.png
14
-
alt-text: Screenshot of the Azure portal with the marketplace open to the Language resource.

17
12
18
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.
19
14
20
-
:::image
21
-
type: content
22
-
source: ../media/azure-portal-credentials.png
23
-
alt-text: Screenshot of a Language resource in the Azure portal with the key and endpoint page open.
24
-
lightbox: ../media/azure-portal-credentials.png
25
-
:::
15
+

26
16
27
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.

56
41
57
42
At the start of the application code, import the SDK.
58
43
@@ -61,32 +46,17 @@ from azure.ai.textanalytics import TextAnalyticsClient
61
46
from azure.core.credentials import AzureKeyCredential
62
47
```
63
48
64
-
:::image
65
-
type: content
66
-
source: ../media/python-sdk-client-example.png
67
-
alt-text: Screenshot of Visual Studio Code with a Python file open with a focus on the client object created.
68
-
lightbox: ../media/python-sdk-client-example.png
69
-
:::
49
+

70
50
71
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.
72
52
73
53
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.

81
56
82
57
We can display the results of the analysis by running the application code in the terminal with the command `python <file_name>.py`. When we run the app, it uses Azure Language in our Foundry resource to perform each of the tasks.
83
58
84
-
:::image
85
-
type: content
86
-
source: ../media/python-sdk-results.png
87
-
alt-text: Screenshot of Visual Studio Code with the terminal open with a focus on the results.
88
-
lightbox: ../media/python-sdk-results.png
89
-
:::
59
+

90
60
91
61
## Examples of code to use with the Azure Language Python SDK
To connect to the Azure Language MCP server, you need to configure your connection with your *Foundry resource name*. Once you've connected the MCP server to an agent as a tool, you can use prompts to instruct the agent to use the tool to analyze text. The ability to use Azure Language as a tool in an agent helps you build agentic solutions that make sense of text documents.
50
56
57
+

0 commit comments