Add a new LUIS intent

One of the biggest advantages with LUIS^Teneo is the use of its classifier. This page will describes how to use an intent created and trained in LUIS on Teneo.

We'll start with a simple flow to handle the following conversation:

User: What can I get for 20 dollars?
Bot: 10 cups of coffee

To achieve this we will do the following:

  • Create an intent in LUIS.
  • Create a class in Teneo.
  • Create a folder in which we can store our flow.
  • Create a new Teneo flow.
  • Add an answer text.
  • Save and test our flow.

The result will look like this: Final_form_of_flow

Create a new LUIS intent

We will start off by creating a LUIS intent inside our application which will be used by our Teneo solution.

You will need to do the following:

  1. While inside your LUIS application, create a new intent by pressing 'create'.
  2. Give your intent the name: WHAT_CAN_I_GET_FOR_20_DOLLARS.
  3. Add the following examples:
    • What can I get for 20 dollars?
    • What can I buy with 20 dollars?
    • What are you willing to give me for 20 dollars?
    • What can I purchase for 20 dollars?
    • I have 20 dollars, what can I buy?
    • What can I get for twenty dollars?
    • Buy for 20 dollars
    • Afford with 20 dollars
    • What can I afford with 20 dollars?
    • What can I buy for twenty dollars?
  4. Press the 'Train' button located at the top right corner. This will train the intent and score the examples.
  5. Once the training is done press 'Publish' at the top right corner. This so Teneo can retrieve it.

Create the same intent in Teneo

Now its time to create the same intent we did for LUIS in the previous step but inside Teneo.

  1. We'll start of by selecting the 'Class Manager' icon in the 'Solution' group in the Ribbon. This will open a new window for the 'Class Manager'.
  2. Select the 'Add Class' button located in the 'Classes' group in the Ribbon.
  3. Give your class the same name as your LUIS intent: WHAT_CAN_I_GET_FOR_20_DOLLARS.
  4. Next, right-click the empty area in the learning example area and paste the inputs (alternatively, you can add them one by one)..
    What can I get for 20 dollars?
    What can I buy with 20 dollars?
    What are you willing to give me for 20 dollars?
    What can I purchase for 20 dollars?
    I have 20 dollars, what can I buy?
    What can I get for twenty dollars?
    Buy for 20 dollars
    Afford with 20 dollars
    What can I afford with 20 dollars?
    What can I buy for twenty dollars?
  5. Finally press the 'Save' button and close the 'Class Manager' page.

Create a 'Flows' folder

Flows are stored in folders. In the 'Explore' section on the left you see a number of folders with flows that came out of the box. These flows make sure your bot will understand and respond to greetings, meta-requests (e.g. Can you repeat that?), feedback (e.g. You are great) and conversational small talk (e.g. How are you?). By that way, since you are the owner of this solution, you can change the answers in these flows if you wish.

We will want to store our flows in a separate folder, so let's create that first.

  1. Make sure none of the folders on the left are selected, by clicking in the white area below the folders in the 'Explore' section.
  2. Click the 'Folder' icon in the 'New' group in the Ribbon.
  3. Give your folder a name, for example Flows and hit Enter.

You can add as many folders and subfolders as you like and you can structure them any way you like. This is particularly handy for bots that handle multiple domains.

Create your first flow

Now that we have a folder in which we can store our work, we can create our first flow:

  1. Select the folder where you want to store your flow.
  2. Click the 'Flow' button in the 'New' group in the Ribbon. A new window will open, the flow window.
  3. Enter the name of the flow in the Name field, e.g. What can I get for 20 dollars?.
  4. Click on the left pointing arrow in the top left corner of the window. This takes you to the flow editor.

As you can see, flows are represented graphically in Teneo. Simple flows just contain a trigger that recognizes the user's intent (the blue box at the top) and an output that contains the bot's answer (the purple box at the bottom). More complex flows contain more elements like multiple triggers, scripts, different outputs etc. We're going to start with a simple flow, so you will only need to populate the trigger and the output that you see in the flow graph.

Create a Teneo flow

Now it's time to create a flow in Teneo where we can use our previous created LUIS intent. To do that we'll need to do the following:

Naming the Trigger

  1. Select the trigger.
  2. It's good practice to give flow elements a name, so let's give the trigger a name like I got 20 dollars.

Adding a Class Match Requirement

It's time to create your own match requirement for Classes and paste in the LUIS intent you created from the previous step.

  1. Select the Trigger, this will open up the trigger configuration panel to the right.
  2. Scroll down to 'Match Requirements' and press add.
  3. Select 'Class' and paste WHAT_CAN_I_GET_FOR_20_DOLLARS.

Adding an Answer Text

Next, we'll need to set the bot's answer in the flow.

  1. Click the purple box that is marked Output (the Output node).
  2. Make sure that the 'Answers' button on the right side of your window is highlighted.
  3. In the text box paste in the following: 10 cups of coffee.
  4. Give the output the same name.
  5. Hit 'Save'.

Test your flow

Now it's time to test your work inside Teneo Studio.

  1. Minimize or close the flow you just created.
  2. If the 'Try out' panel is not visible, make it appear by clicking the 'Try out' button on the right side of the window.
  3. Because you have just saved your flow with new training examples, Teneo needs to analyze the example inputs to learn from them. While that is happening a notification 'Model training started' is shown. Once the notification says, 'Model training completed', you can test if your newly added flow works. In this case, you can test your flow by asking the following examples:
    • What can I afford with 20 dollars?
    • Purchase with 20 dollars?

As you can see, both inputs will trigger your flow. Teneo not only recognizes the exact learning examples you entered but also different variations that express a similar intent.

What's next?

Now that we have created our first flow, let's continue with, How to use LUIS entities.

Was this page helpful?