Sometimes users communicate using incomplete inputs making it harder to interpret what they want. To be able to get that humanlike answer the bot needs to learn how to ask for more information to be able to understand what the user wants. Here is how you teach it to do so in Teneo Studio.
In Teneo we might expect ambiguous inputs mentioning one of our relevant products, such as coffee or flat white. We would have the same trouble understanding if someone spoke to us this way. Do they want to order? Do they want the calorie count? Something else?
By following this guide you can create a flow with a syntax trigger to deal with these kinds of inputs. You will also create a custom order group to hold the flow’s trigger and others like it. You will order the group just before the class intents because you don’t want this specialized situation to be second-guessed by machine learning when you already know that it’s ambiguous.
This is the first part of solving the problem of recognizing ambiguity without over-triggering. After working through this how-to, we suggest to have a look at how to Handle Ambiguous Inputs to give a satisfying resolution to the problem.
Before our implementation, we have a conversation that looks something like this:
Bot: I’m sorry but I didn’t get that.
Bot: I’m not sure I know what you mean?
Bot: Can you help me understand that?
These kinds of responses do not result in a satisfying user experience. But after we are finished, we will have responses that add more direction to the conversation:
Bot: I understand you would like to talk about coffee. Can you be more specific?
User: what are the coffees you have
Bot: We offer a variety of handcrafted coffee drinks – from espressos to macchiatos to flat whites and more.
In the first part of the exercise we will create an order group called Project – Less Exact for syntax triggers responding to ambiguous inputs. In the second part we will create a flow to respond to ambiguous mentions of the word coffee or any of its synonyms.
Create a Custom Order Group
Since you’ve based this solution on the template solution with the Teneo Dialogue Resources, you will notice that you already have a set of order groups in your solution. After we are finished defining our custom order group, the ordering will look like this.
Create the Order Group
First we will create the group:
- Open your solution and navigate to the home tab.
- Click Intent Triggers in the Ordering section of the Ribbon to open trigger order.
- In the Intent Trigger Ordering window, navigate to the Groups tab.
- In the Groups, tab click Add to add a new group (it appears at the bottom of the list of groups).
Adjust the Group Ordering
Our group was added at the bottom of the ordering, but we want it to be up higher. In these steps we will move our group to a more optimal location in the ordering.
- Select the new order group (it will have a default name like Order Group 1) and while selected, copy this name
Project - Less Exactinto the name field in the Properties bar to the right.
- With the order group still selected, click the Up arrow in the Ribbon to move the group just above the group of Class Triggers.
- Save and close the ordering window.
Create a Flow for Partial Understanding
In this section, we will create a flow for partial understanding. It will use a syntax trigger ordered into the Project – Less Exact group that we just created. When we are finished our flow should look like this:
Create the Flow Structure
Open your solution and navigate to the home tab.
- Create a new flow like this: click the arrow below the Flow button in the New section of the Ribbon and choose Flow – with Syntax Trigger.
- Give the flow and the syntax trigger the name
Partial understanding: coffee.
- Select the Output node and paste the response
I understand you would like to talk about coffee.
Can you be more specific?.
- Add a few more output variations to make your bot look smarter:
I'm not sure what you wanted to ask about coffee.
Could you please help clarify?
You're talking about coffee.
Would you please tell me what you wanted exactly?
- Give the output node the name
Respond to single synonym: coffee.
Generate the Syntax Trigger Condition
Select the trigger and make sure the Condition and Examples panels are visible.
- Position the cursor in the positive examples field and paste in this set of examples
cappuccino coffee espresso
- In the Condition panel click the Now button to generate the condition. It should come out as
Additional Trigger Adjustments
Now we want to make sure our syntax trigger is ordered into the correct order group, and that it only responds to inputs containing no ambiguous words. If a longer input containing the word coffee is seen, we’ll prefer the class triggers to handle it, in case there is some significance to the additional words that they know about.
For example, if a user says “order espresso” we can expect the class triggers to interpret it properly. But “espresso” as a statement by itself would be something for this flow to respond to.
- In the Examples panel select the Order Group we created in the above steps: Project – Less Exact.
- Toggle the switch at the bottom of the Condition panel from Allowing unlimited unused words to Limiting unused words to and be sure it is set to the value 0.
- Save your flow.
Try It Out!
That’s it! Now go ahead and give it a try in try out!
Because you’ve assigned your syntax trigger to a different order group, there will be a message at the bottom of the tryout panel that says ‘A reload of the engine is required to apply your recent changes’. Click Reload now before you start testing.
Bot: I’m not sure what you wanted to ask about coffee. Could you please help clarify?
After completing your flow to respond to partial understanding, we recommend that you visit the how-to Handle Ambiguous Inputs. There you will learn how to refine flows like this to determine exactly what the user meant, then linking to the correct flows.