0

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?

  • what mechanism have you incorporated to handle the cases where the user enters some input other than required slot value? – sid8491 Jun 24 '19 at 08:30
  • In dialogflow, we have "intentDetectionConfidence" parameter when we trigger an intent or when we are in slot filling. During slot filling, When we input some text which is not in any training phrase or entity/slot value this "intentDetectionConfidence" will be absent in fulfilment request. On the server, if we observe this we have written our custom logic to do some actions accordingly. – Vineel Kurma Jun 24 '19 at 17:12

1 Answers1

1

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!

Mathias Schrooten
  • 722
  • 2
  • 11
  • 20
  • 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. I have edited the post as well. – Vineel Kurma Jun 20 '19 at 16:31
  • Creating a new intent for each slot value might be very difficult as it will become difficult to bring closure to the initial intent. We also have two cases where ask users for vehicles information one when they are looking for new cars and other when they query about the trade in value. If I have separate intents for each slot it will be difficult to track the source intent. Also, is there a way to reply to such inputs and continue the flow? – Vineel Kurma Jun 20 '19 at 16:37
  • Well that is the difference between a good chatbot and a great one. If you want to have a great one you will have to handle each parameter you want to gather separately, meaning in different intents. You can just keep a session context with a lifecycle of 500. There you can store what the source intent is programmatically. I updated my answer to show you how to handle wrong input and continue the flow only when the user has answered correctly. – Mathias Schrooten Jun 20 '19 at 18:56
  • Thanks, Mathias, for your input. You just confirmed that we are on the right path. That's what exactly we are doing right now. But the only problem is that we have many flows and code is becoming very complex. Just wondering if we can leverage any Dialog flow in-built mechanism or some sort of ML model so that we can build the bot using these cutting edge ML model so that it becomes easy for us in future to replace it with the better models/mechanisms. – Vineel Kurma Jun 20 '19 at 21:22