Intents usually correspond to the actions your application can execute for the user. Suppose you’re designing a weather bot. In that case, you might have intents like “CheckWeather”, “CheckTemperature”, and “CheckHumidity”. These are the tasks the weather bot is capable of doing.
Utterances, on the other hand, are specific phrases or sentences that users may say or write to express what they want to do. For instance, for the “CheckWeather” intent, utterances might include “What’s the weather like today?” or “Will it be sunny tomorrow?”
How to Create Intents and Add Utterances
To create an intent in LUIS:
- Sign in to the LUIS portal (www.luis.ai).
- Select your Application.
- Navigate to the “Intents” page and click on the “Create” button.
- Enter a name for your intent, for example, “CheckWeather”.
- Click done.
You’ll now see your newly created intent appear on the intent page.
The next step is to add utterances to your intent:
- Go back to your “Intents” page and click on the intent for which you want to add utterances.
- You’ll see a text box that says “Type an example utterance”. Enter an utterance here, like “What’s the weather today?”
- Press Enter
- Repeat steps 2 and 3 for each utterance you want to add
It’s recommended that you add as many varying utterances as possible for each intent. This approach allows the LUIS app to understand a broad range of phrases that users may use, increasing the application’s usability and accuracy.
Common Considerations
- Ensure your utterances cover a broad range of ways users might express their intentions.
- Use name and phrase entities in utterances to extract specific data points from the user input.
- Learn from user interactions with the AI application. Regularly review and add new utterances based on user conversations and interactions.
- Be mindful of the cardinality of intents and utterances. Having a large number of poorly differentiated intents or too few diverse utterances can negatively impact the efficiency and accuracy of your AI model.
Example: The Weather Bot
Let’s suppose we have a weather bot with the following intents: “CheckWeather” and “CheckTemperature”.
Here is what the intents paired with some possible utterances might look like:
Intent | Utterances |
---|---|
CheckWeather | “What’s the weather today?” |
“Tell me about tomorrow’s weather” | |
CheckTemperature | “How hot is it outside?” |
“What’s the temperature?” | |
“Will I need a warm jacket for the temperature?” |
With this setup, the AI can respond to user input based on the identified intent and extract specific data from the provided utterances.
In conclusion, intents and utterances are the pillars of LUIS app, directly affecting the app’s ability to understand and serve the user. Taking your time to create thoughtful, diverse, and user-centered intents and utterances will contribute significantly to building an efficient AI application on the Microsoft Azure platform.
Practice Test
True/False: An intent in Azure’s Language Understanding (LUIS) service represents a task or action the user wants to perform.
- True
Answer:True
Explanation: Intents in LUIS are used to categorize a user’s intention based on their input.
What is an utterance in the context of creating intents for Azure’s Language Understanding (LUIS) service?
- A) A specific action the model should perform
- B) A specific speech sound or group of speech sounds
- C) A detailed description of a user’s intention
- D) A user’s input that the model uses for prediction
Answer: D) A user’s input that the model uses for prediction
Explanation: Utterances are inputs from the user that the model uses to make predictions.
True/False: It’s good practice to add as many utterances as possible to each intent to improve the model’s performance.
- False
Answer: False
Explanation: While it’s helpful to add various utterances for each intent, too many can confuse the model, leading it to inaccurately predict intents for certain utterances. It’s better to add a balanced and representative sample of utterances.
In the context of Azure’s Language Understanding (LUIS) service, what does it mean to label an entity in an utterance?
- A) To point out a syntax error
- B) To identify and mark a specific data point in an utterance
- C) To categorize an utterance in a predefined group
- D) To mark the utterance as spam or irrelevant
Answer: B) To identify and mark a specific data point in an utterance
Explanation: In LUIS, labeling an entity in an utterance means to identify and mark a specific data point in the utterance that you want the model to recognize.
True/False: In Azure’s LUIS service, you can import a prebuilt intent.
- True
Answer: True
Explanation: LUIS provides prebuilt intents that you can import into your application.
Single/Multiple Select: Which operations can be performed on an intent in Azure’s LUIS? Select all correct answers.
- A) Add an intent
- B) Rename an intent
- C) Delete an intent
- D) Add an utterance to an intent
- E) Delete an utterance from an intent
Answer: A, B, C, D, E
Explanation: Both intents and utterances in LUIS are fully manageable, allowing users to add, rename or delete them as necessary.
True/False: It’s not necessary to train the model after adding new intents and utterances.
- False
Answer: False
Explanation: After making changes such as adding new intents or utterances, it’s necessary to retrain the model to learn from these updates.
True/False: All utterances must be labeled with an entity.
- False
Answer: False
Explanation: Although labeling entities within utterances can enhance prediction accuracy, not all utterances must be labeled with an entity.
What is the maximum number of intents you can create in a single LUIS app?
- A) 100
- B) 300
- C) 500
- D) There is no limit
Answer: C) 500
Explanation: The limit is 500 user-defined intents per app, including the “None” intent.
True/False: Utterances cannot contain multiple entities.
- False
Answer: False
Explanation: A single utterance can contain multiple entities. However, it should be noted that it’s crucial to accurately label these entities to ensure prediction accuracy.
Interview Questions
What is an intent in the context of a Microsoft Azure AI Solution?
An intent represents an action the user wants to perform. It is a purpose or goal expressed in the user’s utterance.
What is an utterance in the context of a Microsoft Azure AI Solution?
An utterance is the user’s spoken or typed input phrase. It would be the user’s statement or command that the system must analyze to determine user equipment.
How can you create an intent in a Microsoft Azure AI Solution?
To create an intent, navigate to the build section of the AI solution, click on the ‘+’ button next to Intents in the left-hand menu, and enter the name of the new intent.
How do you add utterances to an intent in a Microsoft Azure AI Solution?
After an intent has been created, you add utterances by going to the intent details page, typing the utterance into the textbox, and then selecting ‘Enter’.
What is the purpose of adding utterances to an intent?
Adding utterances to an intent allows the AI solution to recognize when the user wants to accomplish that specific intent. It also helps in training the machine learning model to understand the variations of user inputs related to a particular intent.
Are there any restrictions on the number of intents that can be created in a Microsoft Azure AI Solution?
No, there are no restrictions on the number of intents that can be created. However, it is advised to create only necessary intents for better performance and avoid overfitting.
What happens if two or more utterances are too similar across different intents?
If two or more utterances are too similar across different intents, it may confuse the AI model, causing it to misinterpret the user’s intent leading to inaccurate predictions.
Can the name of an intent be changed after it’s created?
Yes, the name of an intent can be changed after it’s created. This can be done in the intent details page of the AI solution.
Can the order of intents impact the prediction accuracy?
No, the order of intents does not impact the prediction accuracy of the Microsoft Azure AI Solution.
What happens if you do not add any utterances to an intent in a Microsoft Azure AI Solution?
An intent without utterances won’t train accurately as there’s no data for the machine learning model to interpret or analyze. This leads to inaccurate predictions.
Can you delete an intent in an Microsoft Azure AI Solution?
Yes, you can delete an intent. It requires you to navigate to the intent’s settings page and click on the delete button.
How many utterances are required for an intent in a Microsoft Azure AI Solution?
While there is no set number, it is suggested to provide at least 10-20 utterances per intent. The more diverse utterances provided, the better the intent can understand the variations of the user’s input.
How does the addition of utterances improve the accuracy of the machine learning model in Microsoft Azure AI Solution?
Adding diverse utterances helps the model learn all possible ways a user can express the intent, leading to more accurate detection.
How are entities within utterances used in Microsoft Azure AI Solution?
Entities are used within utterances to identify and capture useful data from a user’s utterance. They serve as input parameters to perform a specific task.
How often should you retrain your model after adding or modifying intents and utterances?
It is recommended to retrain your model every time you add or modify intents and utterances. This ensures the model includes the latest information and improves its performance.