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-text-analysis-azure/includes/2-azure-language.md
+7-9Lines changed: 7 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,13 +35,13 @@ First, we might want to extract the keywords and phrases used in some text, whic
35
35
36
36
For example, you might receive a review such as:
37
37
38
-
> "*I had a fantastic meal at the Foundry diner in Seattle on Saturday. The mushroom risotto was perfectly prepared, and really tasty. Our waiter, Pete, was friendly and efficient; and gave us a great recommendation for a dessert (strawberry cheesecake). I'd definitely recommend this place for a casual dinner.*"
38
+
> "*I had a fantastic meal at the diner in Seattle on Saturday. The mushroom risotto was perfectly prepared, and really tasty. Our waiter, Pete, was friendly and efficient; and gave us a great recommendation for a dessert (strawberry cheesecake). I'd definitely recommend this place for a casual dinner.*"
39
39
40
40
Key phrase extraction can provide some context to this review by extracting the following phrases:
41
41
- casual dinner
42
42
- dessert
43
43
- fantastic meal
44
-
-Foundry diner
44
+
- diner
45
45
- great recommendation
46
46
- mushroom risotto
47
47
- Pete
@@ -53,7 +53,7 @@ Key phrase extraction can provide some context to this review by extracting the
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
55
56
-

56
+
:::image type="content" source="../media/playground-key-phrases.png" alt-text="Screenshot of the Language playground's key phrase extraction capability." lightbox="../media/playground-key-phrases.png":::
57
57
58
58
#### Entity recognition and linking
59
59
@@ -80,8 +80,6 @@ You can provide Azure Language with unstructured text and it returns a list of *
In the classic Foundry portal, you can test out Azure Language's named entity recognition feature in the Language Playground.
@@ -109,7 +107,7 @@ Azure Language returns sentiment scores in three categories: positive, neutral,
109
107
110
108
We could analyze the sentiment of our restaurant review:
111
109
112
-
> "*I had a fantastic meal at the Foundry diner in Seattle on Saturday. The mushroom risotto was perfectly prepared, and really tasty. Our waiter, Pete, was friendly and efficient; and gave us a great recommendation for a dessert (strawberry cheesecake). I'd definitely recommend this place for a casual dinner.*"
110
+
> "*I had a fantastic meal at the diner in Seattle on Saturday. The mushroom risotto was perfectly prepared, and really tasty. Our waiter, Pete, was friendly and efficient; and gave us a great recommendation for a dessert (strawberry cheesecake). I'd definitely recommend this place for a casual dinner.*"
113
111
114
112
The sentiment score for the review might be:
115
113
@@ -135,17 +133,17 @@ With **text summarization**, we can generate both *extractive* summaries that in
135
133
136
134
Given the example text:
137
135
138
-
> "*I had a fantastic meal at the Foundry diner in Seattle on Saturday. The mushroom risotto was perfectly prepared, and really tasty. Our waiter, Pete, was friendly and efficient; and gave us a great recommendation for a dessert (strawberry cheesecake). I'd definitely recommend this place for a casual dinner.*"
136
+
> "*I had a fantastic meal at the diner in Seattle on Saturday. The mushroom risotto was perfectly prepared, and really tasty. Our waiter, Pete, was friendly and efficient; and gave us a great recommendation for a dessert (strawberry cheesecake). I'd definitely recommend this place for a casual dinner.*"
139
137
140
138
We could extract an:
141
139
142
140
**Extractive summary**
143
-
- (Rank score: 100%) I had a fantastic meal at the Foundry diner in Seattle on Saturday.
141
+
- (Rank score: 100%) I had a fantastic meal at the diner in Seattle on Saturday.
144
142
- (Rank score: 52%) The mushroom risotto was perfectly prepared, and really tasty.
145
143
- (Rank score: 63%) I'd definitely recommend this place for a casual dinner.
146
144
147
145
**Abstractive summary**
148
-
The individual experienced an exceptional dining experience at the Foundry diner in Seattle, highlighting the delectable mushroom risotto as a standout dish. They appreciated the friendly and efficient service provided by the waiter, Pete, who also offered a highly recommended dessert option—strawberry cheesecake. The overall ambiance and food quality were such that the diner was deemed suitable for a casual dinner. The positive review underscores the diner's ability to deliver a satisfying meal, paired with commendable customer service, making it a recommended destination for future dining in the area. The summary encapsulates the main points of enjoyment and recommendation without redundant details from the original document.
146
+
The individual experienced an exceptional dining experience at the diner in Seattle, highlighting the delectable mushroom risotto as a standout dish. They appreciated the friendly and efficient service provided by the waiter, Pete, who also offered a highly recommended dessert option—strawberry cheesecake. The overall ambiance and food quality were such that the diner was deemed suitable for a casual dinner. The positive review underscores the diner's ability to deliver a satisfying meal, paired with commendable customer service, making it a recommended destination for future dining in the area. The summary encapsulates the main points of enjoyment and recommendation without redundant details from the original document.
149
147
150
148
In classic Foundry portal, you can test out Azure Language's summarization capability in the Language Playground.
text ="I had a fantastic meal at the Foundry diner in Seattle on Saturday. The mushroom risotto was perfectly prepared, and really tasty. Our waiter, Pete, was friendly and efficient; and gave us a great recommendation for a dessert (strawberry cheesecake). I'd definitely recommend this place for a casual dinner."
81
+
text ="I had a fantastic meal at the diner in Seattle on Saturday. The mushroom risotto was perfectly prepared, and really tasty. Our waiter, Pete, was friendly and efficient; and gave us a great recommendation for a dessert (strawberry cheesecake). I'd definitely recommend this place for a casual dinner."
82
82
83
83
result = client.extract_key_phrases([text])[0]
84
84
@@ -90,7 +90,7 @@ for phrase in result.key_phrases:
90
90
#### Entity extraction
91
91
92
92
```python
93
-
text ="I had a fantastic meal at the Foundry diner in Seattle on Saturday. The mushroom risotto was perfectly prepared, and really tasty. Our waiter, Pete, was friendly and efficient; and gave us a great recommendation for a dessert (strawberry cheesecake). I'd definitely recommend this place for a casual dinner."
93
+
text ="I had a fantastic meal at the diner in Seattle on Saturday. The mushroom risotto was perfectly prepared, and really tasty. Our waiter, Pete, was friendly and efficient; and gave us a great recommendation for a dessert (strawberry cheesecake). I'd definitely recommend this place for a casual dinner."
94
94
95
95
result = client.recognize_entities([text])[0]
96
96
@@ -101,7 +101,7 @@ for entity in result.entities:
101
101
#### Sentiment analysis
102
102
103
103
```python
104
-
text ="I had a fantastic meal at the Foundry diner in Seattle on Saturday. The mushroom risotto was perfectly prepared, and really tasty. Our waiter, Pete, was friendly and efficient; and gave us a great recommendation for a dessert (strawberry cheesecake). I'd definitely recommend this place for a casual dinner."
104
+
text ="I had a fantastic meal at the diner in Seattle on Saturday. The mushroom risotto was perfectly prepared, and really tasty. Our waiter, Pete, was friendly and efficient; and gave us a great recommendation for a dessert (strawberry cheesecake). I'd definitely recommend this place for a casual dinner."
105
105
106
106
result = client.analyze_sentiment([text])[0]
107
107
@@ -117,7 +117,7 @@ In the Python SDK, **extractive summarization** is done as a long‑running acti
117
117
from azure.ai.textanalytics import ExtractiveSummaryAction
118
118
119
119
text = (
120
-
"I had a fantastic meal at the Foundry diner in Seattle on Saturday. The mushroom risotto was perfectly prepared, and really tasty. Our waiter, Pete, was friendly and efficient; and gave us a great recommendation for a dessert (strawberry cheesecake). I'd definitely recommend this place for a casual dinner."
120
+
"I had a fantastic meal at the diner in Seattle on Saturday. The mushroom risotto was perfectly prepared, and really tasty. Our waiter, Pete, was friendly and efficient; and gave us a great recommendation for a dessert (strawberry cheesecake). I'd definitely recommend this place for a casual dinner."
0 commit comments