Why you shoud consider disambiguation?

Sometimes the user question can be ambiguous.

Imagine that the user is asking

credit card

does this mean :

  • I lost my credit card?
  • I need a credit card?
  • or Whats the price of a credit card?

This is hard to tell, even for a human.
As humans, what we usually do in this kind of situations is that we ask a deambiguisation question in order to clarify the initial message.

Well, that's exactly what we want our bot to do as well with a new feature that we call disambiguation.

How does disambiguation work ?

From the user perspective, here is an example of what you can get before and after setting up the disambiguation algorithm.

and another example

Technically speaking, the deambiguisation, once activated on your bots get the N best intents and suggest them as options to the user. This way we can get the extra information needed to go ahead.
Below is a simplified diagram showing how it works behind the scenes.
Another use case where desambiguation is activated is when the confidence distance between the best intents is smaller than 5%.


Minimal distance

To define if there is an ambiguity or not, the algorithm will look at the distance between the intents, if this distance is closer than 5% confidence, the bot will activate the desambiguisation.

How can I activate disambiguation in my bots?

First, open your bot settings and make sure to have set the Snips NLU (2021) + exact match pipeline.
Then, click on "Disambiguation: Intents suggestions system" to activate the disambiguation


Note on the required pipelines

Disambiguation requires ou to use one of the following pipelines

  • Snips NLU(2021) + exact match
  • Snips NLU(2021)

From there you will find a bunch of options allowing you to customize the disambiguation.

A/ Intents suggestions system
This is a setting allowing you to turn on/off the disambiguation.

B/ Number of suggestions
You can decide the maximum number of suggestions the bot can shows to the user. This number can be set within the [2,10] range.

C/ Suggestions message
Before offering the intents suggestions, there is a text message indicating that the user clarification / confirmation is needed

D/ Wrong suggestions message
This message is simply one last button that can be added at the suggestions list, allowing the user to indicate that none of suggested intentions is matching his need. You will then have to handle this button with a dedicated behavior as the message defined in this field will be sent to your bot as a normal message.

Then, in your intents, pick the ones you want to see during the disambiguation and set a Suggestion label for each of them.
You can do it manually via the following modules:

  • Builder
  • Datasets > Intents
  • Datasets > QnA
from the Builderfrom the Builder

from the Builder

from Datasets > Intentsfrom Datasets > Intents

from Datasets > Intents

from Datasets > QnAfrom Datasets > QnA

from Datasets > QnA

This also works by exporting and importing your intents or QnA.

Some special cases to consider

  • If an ambiguity is found in a microbot, the suggestions from this microbot will be sent to the user, we are working on a future version where those suggestions will be pulled from all the microbots + the masterbot
  • The dismbiguation feature should be activated in the bot settings of the masterbot and the desired microbots. If you do not want the disambiquisation to suggest intents from one of the microbots, the best solution is to not activate the disambiguisation for this microbots.
  • The disambiguation needs algorithm to have intents with suggestion labels to work
    An advantage of this behavior is that you can decide wich intents can be shown or not by simply filling the suggestion label or not.
  • If a message has been define in your node.js code, the disambigation will give the priority to your custom code.
  • The disambiguation will not work if the bot hasn't find any relevant suggestions for the user request. This usually happens on out of scope questions.