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: articles/ai-services/language-service/conversational-language-understanding/concepts/best-practices.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,15 +25,15 @@ Schema is the definition of your intents and entities. There are different appro
25
25
26
26
You can typically think of actions and queries as _intents_, while the information required to fulfill those queries are _entities_.
27
27
28
-
For example, assume that you want your customers to cancel subscriptions for various products that you offer through your chatbot. You can create a _cancel_ intent with various examples like _"Cancel the Contoso service"_ or _"Stop charging me for the Fabrikam subscription."_ The user's intent here is to _cancel_, and the _Contoso service_ or _Fabrikam subscription_ are the subscriptions they want to cancel.
28
+
For example, assume that you want your customers to cancel subscriptions for various products that you offer through your chatbot. You can create a _cancel_ intent with various examples like "Cancel the Contoso service" or "Stop charging me for the Fabrikam subscription." The user's intent here is to _cancel_, and the _Contoso service_ or _Fabrikam subscription_ are the subscriptions they want to cancel.
29
29
30
30
To proceed, you create an entity for _subscriptions_. Then you can model your entire project to capture actions as intents and use entities to fill in those actions. This approach allows you to cancel anything you define as an entity, such as other products. You can then have intents for signing up, renewing, and upgrading that all make use of the _subscriptions_ and other entities.
31
31
32
32
The preceding schema design makes it easy for you to extend existing capabilities (canceling, upgrading, or signing up) to new targets by creating a new entity.
33
33
34
34
Another approach is to model the _information_ as intents and the _actions_ as entities. Let's take the same example of allowing your customers to cancel subscriptions through your chatbot.
35
35
36
-
You can create an intent for each subscription available, such as _Contoso_, with utterances like _"Cancel Contoso"_, _"Stop charging me for Contoso services"_, and _"Cancel the Contoso subscription."_ You then create an entity to capture the _cancel_ action. You can define different entities for each action or consolidate actions as one entity with a list component to differentiate between actions with different keys.
36
+
You can create an intent for each subscription available, such as _Contoso_, with utterances like "Cancel Contoso," "Stop charging me for Contoso services", and "Cancel the Contoso subscription." You then create an entity to capture the _cancel_ action. You can define different entities for each action or consolidate actions as one entity with a list component to differentiate between actions with different keys.
37
37
38
38
This schema design makes it easy for you to extend new actions to existing targets by adding new action entities or entity components.
39
39
@@ -64,16 +64,16 @@ If you see too many false positives, such as out-of-context utterances being mar
64
64
* Non-machine-learned entity components, like lists and regex, are by definition not contextual. If you see list or regex entities in unintended places, try labeling the list synonyms as the machine-learned component.
65
65
* For entities, you can use learned component as the Required component, to restrict when a composed entity should fire.
66
66
67
-
For example, suppose you have an entity called *ticket quantity* that attempts to extract the number of tickets you want to reserve for booking flights, for utterances such as *"Book two tickets tomorrow to Cairo."*
67
+
For example, suppose you have an entity called **Ticket Quantity** that attempts to extract the number of tickets you want to reserve for booking flights, for utterances such as "Book two tickets tomorrow to Cairo."
68
68
69
-
Typically, you add a prebuilt component for `Quantity.Number` that already extracts all numbers in utterances. However, if your entity was only defined with the prebuilt component, it also extracts other numbers as part of the *ticket quantity* entity, such as _"Book two tickets tomorrow to Cairo at 3 PM."_
69
+
Typically, you add a prebuilt component for `Quantity.Number` that already extracts all numbers in utterances. However, if your entity was only defined with the prebuilt component, it also extracts other numbers as part of the **Ticket Quantity** entity, such as "Book two tickets tomorrow to Cairo at 3 PM."
70
70
71
-
To resolve this issue, you label a learned component in your training data for all the numbers that are meant to be a *ticket quantity*. The entity now has two components:
71
+
To resolve this issue, you label a learned component in your training data for all the numbers that are meant to be a ticket quantity. The entity now has two components:
72
72
73
73
* The prebuilt component that can interpret all numbers.
74
-
* The learned component that predicts where *ticket quantity* is located in a sentence.
74
+
* The learned component that predicts where the ticket quantity is located in a sentence.
75
75
76
-
If you require the learned component, make sure that *ticket quantity* is only returned when the learned component predicts it in the right context. If you also require the prebuilt component, you can then guarantee that the returned *ticket quantity* entity is both a number and in the correct position.
76
+
If you require the learned component, make sure that **Ticket Quantity** is only returned when the learned component predicts it in the right context. If you also require the prebuilt component, you can then guarantee that the returned **Ticket Quantity** entity is both a number and in the correct position.
77
77
78
78
## Address model inconsistencies
79
79
@@ -117,9 +117,9 @@ Customers can use the LoraNorm recipe version if the model is being incorrectly
117
117
118
118
| Text | Predicted intent | Confidence score |
119
119
|----|----|----|
120
-
| _"Who built the Eiffel Tower?"_ | `Sports` | 1.00 |
121
-
| _"Do I look good to you today?"_ | `QueryWeather` | 1.00 |
122
-
| _"I hope you have a good evening."_ | `Alarm` | 1.00 |
120
+
| "Who built the Eiffel Tower?" | `Sports` | 1.00 |
121
+
| "Do I look good to you today?" | `QueryWeather` | 1.00 |
122
+
| "I hope you have a good evening." | `Alarm` | 1.00 |
123
123
124
124
To address this scenario, use the `2023-04-15` configuration version that normalizes confidence scores. The confidence threshold project setting can then be adjusted to achieve the desired result.
125
125
@@ -247,9 +247,9 @@ Customers can use the new recipe version `2024-06-01-preview` if the model has p
247
247
248
248
| Text | Predicted intent | Confidence score |
249
249
|----|----|----|
250
-
|_"Who built the Eiffel Tower?"_|`Sports`| 0.90 |
251
-
|_"Do I look good to you today?"_|`QueryWeather`| 1.00 |
252
-
|_"I hope you have a good evening."_|`Alarm`| 0.80 |
250
+
| "Who built the Eiffel Tower?" |`Sports`| 0.90 |
251
+
| "Do I look good to you today?" |`QueryWeather`| 1.00 |
252
+
| "I hope you have a good evening." |`Alarm`| 0.80 |
253
253
254
254
To address this scenario, use the `2024-06-01-preview` configuration version that's built specifically to address this issue while also maintaining reasonably good quality on `InDomain` utterances.
0 commit comments