|
| 1 | +::: zone pivot="video" |
| 2 | + |
| 3 | +>[!VIDEO https://learn-video.azurefd.net/vod/player?id=628555cd-1ff5-4da4-a32c-e77f65af9e4d] |
| 4 | +
|
| 5 | +::: zone-end |
| 6 | + |
| 7 | +::: zone pivot="text" |
| 8 | + |
| 9 | +**Microsoft Foundry** is the platform for building AI apps and agents on Azure. **Azure Language in Foundry tools** is a natural language processing service in Foundry that is built in models for common text analysis tasks. Azure Language can perform advanced NLP over unstructured text. |
| 10 | + |
| 11 | +Core text analysis tasks Azure Language supports include: |
| 12 | + |
| 13 | +- **Key phrase extraction** lists the main concepts from unstructured text. |
| 14 | +- **Named entity recognition** identifies people, places, events, and more. This feature can also be customized to extract custom categories. |
| 15 | +- **Entity linking** identifies known entities together with a link to Wikipedia. |
| 16 | +- **Sentiment analysis and opinion mining** identifies whether text is positive or negative. |
| 17 | +- **Summarization** summarizes text by identifying the most important information. |
| 18 | +- **Personal identifying information (PII) detection** identifies personally sensitive information, including personal health information (PHI). |
| 19 | +- **Language detection** evaluates text and detects the language and dialect. |
| 20 | + |
| 21 | +## Get started with text analysis in Foundry portal |
| 22 | + |
| 23 | +To test out Azure Language features in the Foundry portal, you need to create a *Foundry resource* and *Foundry project*. |
| 24 | + |
| 25 | +> [!NOTE] |
| 26 | +> The Foundry portal has a *classic* user interface (UI) and a *new* UI. |
| 27 | +
|
| 28 | +A Foundry resource and project is sufficient for testing Azure Language capabilities in the *classic* Foundry portal **Language Playground**. The Language Playground is a built‑in workspace in the *classic* portal that lets you use natural language models directly in the browser. |
| 29 | + |
| 30 | +Let’s explore some text analysis tasks in the classic Foundry portal. |
| 31 | + |
| 32 | +#### Key phrase extraction |
| 33 | + |
| 34 | +First, we might want to extract the keywords and phrases used in some text, which can be helpful in processes like indexing and searching for relevant documents. **Key phrase extraction** identifies the main points from text. |
| 35 | + |
| 36 | +For example, you might receive a review such as: |
| 37 | + |
| 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 | +
|
| 40 | +Key phrase extraction can provide some context to this review by extracting the following phrases: |
| 41 | +- casual dinner |
| 42 | +- dessert |
| 43 | +- fantastic meal |
| 44 | +- diner |
| 45 | +- great recommendation |
| 46 | +- mushroom risotto |
| 47 | +- Pete |
| 48 | +- place |
| 49 | +- Saturday |
| 50 | +- Seattle |
| 51 | +- strawberry cheesecake |
| 52 | +- waiter |
| 53 | + |
| 54 | +In the classic Foundry portal, you can test out Azure Language's key phrase extraction feature in the Language Playground. |
| 55 | + |
| 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 | + |
| 58 | +#### Entity recognition and linking |
| 59 | + |
| 60 | +Additionally, we might want to use **named entity recognition** to find people, places, dates, and other specific entities mentioned in the text. |
| 61 | + |
| 62 | +You can provide Azure Language with unstructured text and it returns a list of *entities* in the text that it recognizes. An entity is an item of a particular type or a category; and in some cases, subtype, for example: |
| 63 | + |
| 64 | +|Type|SubType|Example| |
| 65 | +|---|---|---| |
| 66 | +|Person||"Bill Gates", "John"| |
| 67 | +|Location||"Paris", "New York"| |
| 68 | +|Organization||"Microsoft"| |
| 69 | +|Quantity|Number|"6" or "six"| |
| 70 | +|Quantity|Percentage|"25%" or "fifty percent"| |
| 71 | +|Quantity|Ordinal|"1st" or "first"| |
| 72 | +|Quantity|Age|"90 day old" or "30 years old"| |
| 73 | +|Quantity|Currency|"10.99"| |
| 74 | +|Quantity|Dimension|"10 miles", "40 cm"| |
| 75 | +|Quantity|Temperature|"45 degrees"| |
| 76 | +|DateTime||"6:30PM February 4, 2012"| |
| 77 | +|DateTime|Date|"May 2nd, 2017" or "05/02/2017"| |
| 78 | +|DateTime|Time|"8am" or "8:00"| |
| 79 | +|DateTime|DateRange|"May 2nd to May 5th"| |
| 80 | +|DateTime|TimeRange|"6pm to 7pm"| |
| 81 | +|DateTime|Duration|"1 minute and 45 seconds"| |
| 82 | +|DateTime|Set|"every Tuesday"| |
| 83 | +|US-based Phone Number||"(312) 555-0176"| |
| 84 | + |
| 85 | +In the classic Foundry portal, you can test out Azure Language's named entity recognition feature in the Language Playground. |
| 86 | + |
| 87 | +:::image type="content" source="../media/playground-named-entities.png" alt-text="Screenshot of the Language playground's named entity recognition capability." lightbox="../media/playground-named-entities.png"::: |
| 88 | + |
| 89 | +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. |
| 90 | + |
| 91 | +For example, suppose you use Azure Language to detect entities in the following restaurant review extract: |
| 92 | + |
| 93 | +> "*I ate at the restaurant in Seattle last week.*" |
| 94 | +
|
| 95 | +|Entity|Type|SubType|Wikipedia URL| |
| 96 | +|---|---|---|---| |
| 97 | +|Seattle|Location||https://en.wikipedia.org/wiki/Seattle| |
| 98 | +|last week|DateTime|DateRange|| |
| 99 | + |
| 100 | +#### Sentiment analysis and opinion mining |
| 101 | + |
| 102 | +We can also use **sentiment analysis** to classify a document as positive, negative, or negative, with an overall rating for the document as well as a sentence-by-sentence breakdown. |
| 103 | + |
| 104 | +The text analytics capabilities in Azure Language can evaluate text and return sentiment scores and labels for each sentence. This capability is useful for detecting positive and negative sentiment in social media, customer reviews, discussion forums and more. |
| 105 | + |
| 106 | +Azure Language returns sentiment scores in three categories: positive, neutral, and negative. In each of the categories, a score between 0 and 1 is provided. Scores indicate how likely the provided text is a particular sentiment. Azure Language returns both an overall document sentiment, and a sentence-by-sentence breakdown. |
| 107 | + |
| 108 | +We could analyze the sentiment of our restaurant review: |
| 109 | + |
| 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.*" |
| 111 | +
|
| 112 | +The sentiment score for the review might be: |
| 113 | + |
| 114 | +- Document sentiment: positive |
| 115 | + - Positive score: 0.99 |
| 116 | + - Neutral score: 0.01 |
| 117 | + - Negative score: 0.00 |
| 118 | + |
| 119 | +- Sentence 1 sentiment: positive |
| 120 | + - Positive score: 0.98 |
| 121 | + - Neutral score: 0.02 |
| 122 | + - Negative score: 0.00 |
| 123 | + |
| 124 | +The service would provide sentence analysis for each of the sentences. Each sentence analysis could have a different score breakdown. |
| 125 | + |
| 126 | +In classic Foundry portal, you can test out Azure Language's sentiment analysis capability in the Language Playground. |
| 127 | + |
| 128 | +:::image type="content" source="../media/playground-sentiment.png" alt-text="Screenshot of the Language playground's sentiment capability." lightbox="../media/playground-sentiment.png"::: |
| 129 | + |
| 130 | +#### Summarization |
| 131 | + |
| 132 | +With **text summarization**, we can generate both *extractive* summaries that include only the most relevant sentences and *abstractive* summaries that create an overall description of the key points of the document. |
| 133 | + |
| 134 | +Given the example text: |
| 135 | + |
| 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.*" |
| 137 | +
|
| 138 | +We could extract an: |
| 139 | + |
| 140 | +**Extractive summary** |
| 141 | +- (Rank score: 100%) I had a fantastic meal at the diner in Seattle on Saturday. |
| 142 | +- (Rank score: 52%) The mushroom risotto was perfectly prepared, and really tasty. |
| 143 | +- (Rank score: 63%) I'd definitely recommend this place for a casual dinner. |
| 144 | + |
| 145 | +**Abstractive summary** |
| 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. |
| 147 | + |
| 148 | +In classic Foundry portal, you can test out Azure Language's summarization capability in the Language Playground. |
| 149 | + |
| 150 | +:::image type="content" source="../media/playground-summarize.png" alt-text="Screenshot of the Language playground's summarization capability." lightbox="../media/playground-summarize.png"::: |
| 151 | + |
| 152 | +Next, let's learn how to get started with the Azure Language software development kit (SDK) to build a lightweight application. |
| 153 | + |
| 154 | +::: zone-end |
0 commit comments