Add language understanding
APPLIES TO: Composer v1.x and v2.x
Note
Language Understanding (LUIS) will be retired on 1 October 2025. Beginning 1 April 2023, you won't be able to create new LUIS resources. A newer version of language understanding is now available as part of Azure AI Language.
Conversational language understanding (CLU), a feature of Azure AI Language, is the updated version of LUIS. For more information about question-and-answer support in Composer, see Natural language processing.
This article shows how to integrate language understanding in your bot using the cloud-based service LUIS. LUIS lets your bots identify valuable information from user input by interpreting user needs (intents) and extracting key information (entities). Understanding user intent makes it possible for your bot to know how to respond with helpful information using language generation.
Prerequisites
- A basic bot built using Composer
- Knowledge of language understanding and events and triggers
Update the recognizer type to LUIS
Composer uses recognizers to interpret user input. A dialog can use only one type of recognizer, each of which are set independently from the other dialogs in your bot.
- Select the dialog that needs language understanding capabilities in the bot explorer.
- In the properties pane, go to Recognizer/Dispatch type and select Change. The Choose a recognizer type menu will appear.
- Select Default and then select Done to set the recognizer type to LUIS.
Add language understanding data and conditions
Select the desired dialog in the bot explorer. Select the three dots next to the dialog and then + Add new trigger.
On the Create a trigger screen:
- Select Intent recognized for the trigger type.
- Enter a name for the trigger, like Goodbye.
- Enter example phrases in the Trigger phrases field using the .lu file format.
- Bye. - Goodbye. - See you later. - Take it easy.
Here's an example of what your screen should look like:
After you select Submit, you'll see the trigger node created in the authoring canvas.
If you want to specify a threshold for a specific intent, set a condition for this intent in the Condition field on the properties pane on the right. An example condition can be
=#goodbye.score >=0.8
.You can add actions to execute when the trigger fires, for example, the Send a response action. Create a new action by selecting the plus (+) icon in the authoring canvas, then Send a response from the drop-down list.
Enter This is a greeting intent! in the response editor of the properties pane and press Enter.
Update LUIS keys
After you're done with all previous steps, you need to provide Composer with information from LUIS.
Select the error icon in the upper right corner of Composer. The number 2 is next to it, indicating that there are two errors.
These errors occur because you've yet to add the LUIS information Composer needs. After selecting the error icon, the Problems pane will appear on the bottom of the screen:
Select the
Settings
link in blue in either of the errors. Composer will switch to the Azure Language Understanding of the Configure your bot page.Select the Set up Language Understanding button. The Set up Language Understanding window will appear.
The following sections explain the different options for setting up language understanding. Below is a link to each setup option and when to choose each:
- Use existing resources: You already have existing Azure resources.
- Create and configure new Azure resources: You don't have existing Azure resources and need to create and configure new ones.
- Generate instructions for Azure administrator: You need an administrator to create Azure resources for you.
Use existing resources
Choose this option if you already have existing language understanding Azure resources for your bot.
Select Use existing resources and then select Next at the bottom of the window.
Now select the Azure directory, Azure subscription, and Language Understanding resource name.
Select Next on the bottom. Your Key and Region will appear on the next window.
Select Done.
Your bot is now ready to test.
Create and configure new Azure resources
Choose this option if you need to create and configure new Azure resources for language understanding.
Select Create and configure new Azure resources and then select Next at the bottom of the window.
Select the Azure directory and Azure subscription you want to use to create your resources.
Fill in the values for the following on the next window:
- Azure resource group: An existing Azure resource group, or you can create a new one (seen in the screenshot below).
- Region: A region from the drop-down list.
- Language Understanding resource name: The name of your language understanding resource.
Select the Next button. Blue text will appear on the bottom left of the window indicating that Azure is Creating resources.
Once your resource has been successfully created, Composer will display the Subscription, Resource Group, Region, and Resource name, as show in the screenshot below:
Select Done.
Your bot is now ready to test.
Generate instructions for Azure administrator
Choose this option if you need an administrator to create Azure resources for you.
Select Generate instructions for Azure administrator and then select Next at the bottom of the window.
Copy the instructions on the next window and send them to your Azure administrator. They'll create the resources you need to LUIS in your bot.
Select Okay.
Your administrator will send you a JSON with your bot's configuration information. On the Configure your bot page, toggle on the Advanced Settings View (json). Replace the existing JSON with the one supplied by your administrator.
Your bot is now ready to test.
Test
It's always a good idea to verify that your bot works correctly when you add new functionality. You can test your bot's new language understanding capabilities using the Emulator.
Select Start bot on the top right to start your bot's local runtime.
Once the bot is running, select Open Web Chat in the Local bot runtime manager.
When Web Chat pops open, send it messages using the various utterances you created to see if it executes your Intent recognized triggers.