I have two intents pizzaSelected and burgerSelected in both intents I am asking for required parameters
I have below entities
#pizza [pepperoni, farmhouse, country special, cheese]
#pizzaSize [small, medium, large]
#burger [veg, beef, ham]
#burgerToppings [onion, tomato, lettuce, pepper]
expected conversation
user: order 2 burgers
bot: which burger?
user: cheese
bot: sorry but we have veg, beef and ham burgers. please select one from this.
user: veg
bot: toppings?
user: tomato and lettuce
bot: you order for 2 veg burgers with tomato and lettuce toppings is placed.
actual conversation
user: order 2 burgers
bot: which burger?
user: cheese
bot: what size of pizza you want
as in actual conv when user says cheese which belongs to #pizza entity then it triggers the pizzaSelected intent instead of re-prompting the user for entering correct value.
Is there a way to handle this.
If you are not using custom fulfilment based logic for slot filing then your burger_type entity (or whichever name you might have used for entity) must have cheese as a valid value.
I would recommend to go to entities and check the values of entity which you are using to store type of burger. Even if you have only the correct values there try reordering them and then save. This will force the bot to retrain as this is a machine learning model sometimes it might get optimized for the wrong output, if that is the case for you then try retraining it.
Related
Let's imagine we are opening a restaurant. We use a chatbot to handle customer ordering.
Intent: #order
Entity: #food: burger, noodle, chicken #drinks: coke, water, wine #compliantItem: service, burger, chicken, noodle
Currently I put "I am thirsty, can I order a can of #drinks", and "I am hungry, can I order a #food" in the intent #order. Does any one know if this would confuse Watson?
I am wondering if this should be improved by
create a new entity called #menuItem and put 2 values food and drinks in it, while keeping entity #food and # drinks
create a new entity called #menuItem and put all values from #food and #drinks in it and remove entities #food and #drinks
maintain 2 intents: (1) #orderfood: put sample "I am hungry, can I order a #food" in the intent #orderfood and (2) #orderdrinks: put sample "I am thirsty, can I order a can of #drinks" in the intent #orderdrinks
Thanks a lot!
Your question is discussed in "How entity references are treated" in the IBM Watson Assistant documentation. You can reference entities as you did. It cancels out any specific examples.
I cannot comment on your intent definitions and improvements. It depends on your dialog flow and how the bot is used. It is learning from user input and how it is processed. If there is something wrong, you as admin can correct it and Watson Assistant would learn it.
How to handle multiple confirmation prompts:
use case, 1st prompt is to ask would you like to add more products?
if yes, should repeat the intent to take more products and quantity,
if no, should ask for confirmation- Shall I place an order? -> if yes, make an order, if no -> cancel
Short answer: use sessionAttributes
‐------------
Long answer with a tip:
If you must do it this way, you should probably use a single intent, but re-elicit the same slot multiple times.
You should probably also ask beforehand how many products they want to list, so you can ask for that many things before expecting to confirm instead of asking if they want to add another product every time.
Let's say you have a Pizza Ordering Bot. For toppings, it could be like this.
Bot: What topping would you like?
User: Cheese
Bot: Would you like another topping?
User: Yes
Bot: What topping would you like?
User: Peppers
Bot: Would you like another topping?
(...again and again, unnatural)
So that would be more natural if you changed to:
Bot: How many toppings would you like?
User: 3
Bot: OK, what is the first topping?
User: Cheese
Bot: Got it, what is the second topping?
(much shorter, more natural)
In both cases, you would have a single slot for toppings, and every time you collect 1 value, you would copy that value into the bot's sessionAttributes and erase the slot from the slots object that you return to the bot when you ElicitSlot for the same slot.
Then when the user confirms that they are finished giving you all of the "toppings" or products they want, then you can combine all of the previous values from your sessionAttributes and fulfill the intent.
We are trying to build a chatbot for vehicle dealerships. When a user asks for queries like "I am looking for ford 2017 models" etc we have some more slots to fill before we show the user final results. So to handle this we have created an intent with required parameters. We are also providing some custom UI buttons to help the user with the slot filling process. However some times users can choose to give their own input and some times users can enter text other than the slot value.
For example:
User: I am looking for ford latest models 2017 or afterwards.
Bot: Which model are you looking for: We display some options
User: escape
Bot: What is the price range you are looking for: We display some options
User: I looking for something which will suffice for a family of 4.
Here, in this case, the slot filling is broken as the user didn't give the expected slot/parameter. Also, it would be good user experience if we can somehow reply to such human nuances and continue with the slot filling.
EDIT:
We have already incorporated some mechanism during slot filling to handle the cases where the user enters some input other than required slot value. But sometimes this mechanism is not working and some times user might enter a statement which triggers new intent.
How can I handle such cases using dialogflow?
I would recommend not using Dialogflow's built-in slot filling. I've had this issue before and now I just create different intents for each 'variable' I want to gather from the user.
You could still use slot filling if you let the user know what format you're expecting them to answer in. The KLM chatbot does this perfectly, you should check that out.
UPDATE: Here's how you could handle input for different parameters. Whenever a user responds something you don't expect the 'question.invalidInput' will be triggered and there you can remind the user what format you're expecting.
Intent: question
Trainings phrase: 'May I enter?'
Output context: 'await_olderThan21'
Response: 'Are you older than 21?'
Intent: question.yes
Training phrase: 'yes'
Input context: 'await_olderThan21'
Output context: ''
Response: 'Yes, you may enter'
Intent: question.no
Training phrase: 'no'
Input context: 'await_olderThan21'
Output context: ''
Response: 'No, you may not.'
Intent: question.invalidInput
Training phrase: #sys.any
Input context: 'await_olderThan21'
Output context: 'await_olderThan21'
Response: 'Invalid answer. Please reply with yes or no.'
E.g.:
User: I am looking for ford latest models 2017 or afterwards.
Bot: Which model are you looking for: We display some options
User: escape
Bot: What is the price range you are looking for: We display some options
User: I looking for something which will suffice for a family of 4.
Bot *fallback*: Please enter the maximum amount you would like to spend on a car (in dollar)
This way the user knows how to respond and you will notice that you will experience less expected behaviours.
Always try to guide the user in your desired direction.
Hope this helps!
In Dialogflow for my Google Action, I have this automated expansion entity, called food, trained with some types of food included bananas and onions.
Then I have a composite entity called thing-to-buy structured like this:
#sys.number:number #food:food #sys.date:date
My intent has just one training phrase:
'four bananas tomorrow' auto-detected by dialogflow as thing-to-buy entity
In the simulator, when I say 'four bananas tommorrow' it obviously works well, getting the thing-to-buy as {date: 2019-02-26T12:00:00+01:00, food: bananas, number: 4}
It works also when I say another food present in the training phrases of the entity 'food', like 'onions'
'100 onions today' -> {"date":"2019-02-25T12:00:00+01:00","number":100,"food":"onions"}
But when I try with a food that's not present in the 'food' training phrases, it doesen't recognize it as a new one:
'4 carrots tomorrow' -> {}
Why is it so?
Is there a way I can achieve my goal of having my big 'thing-to-buy' entity?
Thanks!
As per my understanding, you don't have enough data to bot to be trained although the auto expansion is on. You will have to add more utterances/entity values and keep on trying for the bot to be trained.
Consider a scenario where user wants to order a meal :
User : I would like to order 1 burger 1 orange juice and one coffee
Bot : Would you like to have a veg burger or a non-veg one?
User: A veg burger
User: Sorry, I would like it to be non-veg
Bot: (Generally how would we handle this change of mind without having to start the conversation from scratch) ?
In this part where I've been implementing something like a bus ticket booking, this the bot seems to remember the previous order that is veg-burger or some how ends up falling on to default intent or fallback intent whichever is suitable. But I would like to know if there is a way for letting the bot know that the user has "Changed the mind" (Hopefully it is possible using or manipulating the context) and wants a non-veg burger now?
Can we work out an followup intent recognizing words like Sorry and then entity such as type i.e. non-veg here. What is the best practice? Because starting the conversation from scratch doesn't seem to be a good idea from UX point of view.
Good day TGW,
You have 2 options, either you split your intents into a search intent and book intent e.g. search.salad and buy.salad intents OR you have a confirmation step before you actually send to Fulfilment.
If you choose to split your intents into 2 then a similar flow should work for you:
If the food type is finite then create an entity with the options.
Add your search.salad intent that should have most of what the users will say to order a salad. Remember to incoporate the entity from step 1.
Add a followup intent to your search.salad Intent, and select custom from the options.
In this newly created followup Intent add the User says that you want to use to update the search, enable fulfilment and save.
NB: Ensure the newly created intent has an intent that ends with *-followup in the In-context and this same intent is in the Out-context of the search.salad intent. Dialogflow will automatically update the parameters for you based on what the user enters.
The second option is similar to this, you can add your confirmation step as a followup to the search.salad intent and enable fulfilment only on the confirmation intent.