{{announcement.body}}
{{announcement.title}}

Making Sure Your Chatbot Can Get the Conversation Back on Track

DZone 's Guide to

Making Sure Your Chatbot Can Get the Conversation Back on Track

Int his article, take a look at how to make sure your chatbot can get conversation back on track in Teneo.

· AI Zone ·
Free Resource

A good dialog system is able to get the conversation back on track if the user makes an ambiguous request. In this walkthrough, we will look at the flow we built in create a custom order group and expand it to help users find the correct answer to their question. We will do this using flow links, which allow us to send the user to a flow meant to answer the question. In the Partial understanding: coffee flow we will first present users with likely options of what the question might have been, and allow users to give a clarifying response. You can read up on flow links on this page.

Before our changes, we would have a conversation like this:

User: coffees
Bot: I’m not sure what you wanted to ask about coffee. Could you please help clarify?

User: your selection
Bot: I’m sorry but I didn’t get that.

After our modifications, it will look more like this:

User: coffees
Bot: I understand you would like to talk about coffee. Can you be more specific? Did you want to order a coffee or see our selection of coffees?

User: your selection
Bot: We offer a variety of handcrafted coffee drinks – from espressos to macchiatos to flat whites and more.

User: espresso
Bot: You’re talking about coffee. Would you please tell me what you wanted exactly? Did you want to order a coffee or see our selection coffees?

User: order
Bot: Ok, what coffee would you like?

To achieve this, we will enhance the Partial understanding: coffee flow by following these steps:

  • Add an additional output to ask if the user wants to order a coffee or see the selection.
  • Add links to two flows:
    • User wants to order a coffee
    • User asks about coffees we order
  • Make sure we send the user to the correct flow depending on the user’s response (order or selection)

When we are finished, our flow will look like this:

Add a New Output

Let’s first expand the current prompt to offer the user several possibilities.

  1. Open the flow Partial understanding: coffee in edit mode.
  2. Select the output Respond to single synonym: coffee and add a new output node.
  3. Select the new transition and make sure it is set to Unconditional and Continues without input.
  4. Give the output node the response Did you want to order a coffee or see our selection of coffees? and rename it to Ask user what was meant.

Complete Flow Structure

  1. With the output ‘Ask user what was meant’ selected, add a flow node by clicking the Flow button in the Add Node section of the Ribbon. Note: don’t worry about the error message you see – it’s just a reminder to link the node to an actual flow. We will do this in later steps.
  2. With the output ‘Ask user what was meant’ still selected, add a second flow node.
  3. Make sure the output ‘Ask user what was meant’ is set to Not revisitable.
  4. Note: By setting to not revisitable it means: if the user decides not to follow up on any of the possibilities we offered, we assume that the user did not want to continue in those directions, or has rephrased their question in such a way as to go on to trigger the correct flow. Also, as this is a low ranking ‘catchall flow’ it is better to let it drop, rather than forcing the user to respond.
  5. Check the two new transitions and make sure they are set to Conditional and Gets input before continuing.

Complete the Flow Links and Logic

  1. Select the first new transition, name it Order and make it getting input before continuing and conditional. Paste the condition %ORDER.VB.SYN.
  2. Select the second new transition, call it Selection, make it get input before continuing and add the condition %SELECTION.NN.LEX.
  3. Select the flow node following the ‘Order’ transition and name it Go to order flow.
  4. Add the User wants to order a coffee flow from the Flow Link panel via the Browse button.
  5. Select the flow node following the ‘Selection’ transition and name it Go to selection flow.
  6. Add the User asks about coffees we offer flow via the Flow Link panel via the Browse button.
  7. Save and test in tryout.


Topics:
artificial intelligence ,chatbot development ,conversational ai ,conversational ai chatbot ,machine learning

Published at DZone with permission of Gareth Walters . See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}