I've been cooking for awhile now on a proposal for how to handle non-linear dialog. Right now our slot filling allows linear dialog. But take for instance an insurance chatbot, with a non-linear dialog, or tree based dialog: (italics are the bot, bold is the user)
Are you trying to update an existing policy or create a new one?
I need a new policy
Great, are you looking for an auto, home, or rental policy?
It's for my car
Can you tell me the VIN number of your car?
It's for my home or I just rented a new apartment
What is the property address of the home you are trying to insure?
I'm trying to update an existing policy
If you have your policy number, can I have it. Or we can look it up.
1123345908
Okay, let me look up that policy.
sorry, I don't know it
Please provide your first and last name.
To handle situations like this as well as #192 I would like to propose two new concepts: Modifier Intents and Follow-Up Intents.
Modifier Intents
The main purpose of modifier intents is to handle slot prompt responses. In the example above, when the bot asked the user whether or not they were trying to find an old policy or create a new one the user response could have been any of the following (and then some):
I need to create a new policy.
new
old
it's an existing one
I already have a policy
I need a home owners policy
These could possibly be trained as entities, but that doesn't feel right. They are intents, but not a high level intent like looking up a policy. These are intents meant for modifying a slot value: modifier intents.
Even our common pizza shop example has use for modifier intents. Let's say you offer both sandwiches and pizza, which have very similar toppings. Right now when the bot prompts for What toppings would you like on your pizza? and the user replies with hame and pepperoni that response has to be trained. And training it on both the orderSandwhich and orderPizza intents means that you can randomly be yanked from one intent to another. This is the case in #193 but if there was a modifier intent for the toppings slot, then it could be handled in a better way.
Given that we don't want modifier intents to factor into he main intent recognition of the bot the question is: where do they belong? The idea that I am proposing is that they belong to a separate model for the agent which contains all of the modifier intents. They belong to the agent, because they are operating at the same level as entities and often will be paired with entities. Here are a few facts about modifier intents:
They have slots, but their slots can't be required/have prompts.
They don't have any fulfillment.
They can't be accessed outside of a slot prompt.
By themselves they perform no actions. The actions that they perform are specified as part of the scenario where they are being used.
For a given slot the modifier intents can perform multiple actions:
SET - this action allows the user to set the slot value to a value determiner in the UI. It does not pull anything from the entities.
UNSET - this action allows the user to unset a particular slot value.
ADD - This action takes the entities from the modifier intent and adds them to the slot.
REMOVE - This action takes the entities from the modifier intent and removes them from the slot if they are present.
Affirmation/Negation are good examples of the SET action. Replying with just cheese is a good example of an ADD action for filling a pizza topping slot. And I didn't want pepperoni is a good example of a REMOVE action for the pizza topping slot.
This probably means that we've got a new threshold to consider: the modifier threshold. This is how high the confidence has to be in a modifier intent for us to use it. It may be possible to share it with the domain/intent thresholds. Have to think more on that.
Here is a proposal for the UI for modifier Intents, both defining them and using them in scenarios.
To address the needs of #192 I am thinking that there is a 5th kind of action, not directly tied to a modifier intent, but rather just a wildcard. Were almost any reply is taken as the value of that slot. Perhaps there is a way to combine that with the modifier thresholds to allow breakout.
Response Intents
The second piece to non-linear dialog is being able to take a slot value or response and moving the conversation in a particular direction with it. That is where response intents come in. Calling them intents feels a little bit wrong, but I haven't thought too much on the verbiage.
A response intent is a bit different in that it has no user examples. Just slots, prompts, modifier intents, and responses. And they are directly tied to the response of another intent.
For example main intent in the example above could be called insurancePolicyStart and it has a slot called policyAge which can be set to either new or old. Right now the user could use the agent response to generate the replied above:
{{if eq(slots.policyAge.value 'new')}}Great, are you looking for an auto, home, or rental policy?{{/if}}
{{if eq(slots.policyAge.value 'old')}}If you have your policy number, can I have it. Or we can look it up.{{/if}}
and given how we handle dialog we would reply with the correct one because one of them would be an empty string.
So response intents are tied to these. For example in the case where policyAge is new, we could select the newPolicy response intent. This would automatically dump the user directly into that intent. That intent has a slow for policyType and based on the value of that slot we would guide the user to a new intent. until the reach the end...
Granted that there is certainly value in responses being able to be linked to any intent. allowing conversations to converge from multiple starting places. Maybe I need a better name for this. still WIP.
WORK IN PROGRESS
I've been cooking for awhile now on a proposal for how to handle non-linear dialog. Right now our slot filling allows linear dialog. But take for instance an insurance chatbot, with a non-linear dialog, or tree based dialog: (italics are the bot, bold is the user)
To handle situations like this as well as #192 I would like to propose two new concepts: Modifier Intents and Follow-Up Intents.
Modifier Intents
The main purpose of modifier intents is to handle slot prompt responses. In the example above, when the bot asked the user whether or not they were trying to find an old policy or create a new one the user response could have been any of the following (and then some):
These could possibly be trained as entities, but that doesn't feel right. They are intents, but not a high level intent like looking up a policy. These are intents meant for modifying a slot value: modifier intents.
Even our common pizza shop example has use for modifier intents. Let's say you offer both sandwiches and pizza, which have very similar toppings. Right now when the bot prompts for What toppings would you like on your pizza? and the user replies with hame and pepperoni that response has to be trained. And training it on both the
orderSandwhich
andorderPizza
intents means that you can randomly be yanked from one intent to another. This is the case in #193 but if there was a modifier intent for the toppings slot, then it could be handled in a better way.Given that we don't want modifier intents to factor into he main intent recognition of the bot the question is: where do they belong? The idea that I am proposing is that they belong to a separate model for the agent which contains all of the modifier intents. They belong to the agent, because they are operating at the same level as entities and often will be paired with entities. Here are a few facts about modifier intents:
For a given slot the modifier intents can perform multiple actions:
Affirmation/Negation are good examples of the SET action. Replying with
just cheese
is a good example of an ADD action for filling a pizza topping slot. AndI didn't want pepperoni
is a good example of a REMOVE action for the pizza topping slot.This probably means that we've got a new threshold to consider: the modifier threshold. This is how high the confidence has to be in a modifier intent for us to use it. It may be possible to share it with the domain/intent thresholds. Have to think more on that.
Here is a proposal for the UI for modifier Intents, both defining them and using them in scenarios.
To address the needs of #192 I am thinking that there is a 5th kind of action, not directly tied to a modifier intent, but rather just a wildcard. Were almost any reply is taken as the value of that slot. Perhaps there is a way to combine that with the modifier thresholds to allow breakout.
Response Intents
The second piece to non-linear dialog is being able to take a slot value or response and moving the conversation in a particular direction with it. That is where response intents come in. Calling them intents feels a little bit wrong, but I haven't thought too much on the verbiage.
A response intent is a bit different in that it has no user examples. Just slots, prompts, modifier intents, and responses. And they are directly tied to the response of another intent.
For example main intent in the example above could be called
insurancePolicyStart
and it has a slot calledpolicyAge
which can be set to either new or old. Right now the user could use the agent response to generate the replied above:and given how we handle dialog we would reply with the correct one because one of them would be an empty string.
So response intents are tied to these. For example in the case where policyAge is new, we could select the
newPolicy
response intent. This would automatically dump the user directly into that intent. That intent has a slow forpolicyType
and based on the value of that slot we would guide the user to a new intent. until the reach the end...Granted that there is certainly value in responses being able to be linked to any intent. allowing conversations to converge from multiple starting places. Maybe I need a better name for this. still WIP.