Ala Garali
Ala Garali

Reputation: 11

How to detect more than one intent with IBM Watson Assistant?

Can the IBM Watson Conversation / Assistant service detect more than one intention in a single sentence?

Example of input:

play music and turn on the light

  1. Intent 1 is #Turn_on
  2. Intent 2 is #Play

==> the answer must be simultaneous for both intents: Music played and light turned on

If so, how can I do that?

Upvotes: 0

Views: 1144

Answers (3)

Sandy Venkat
Sandy Venkat

Reputation: 41

IS this disambiguation feature available in non production environments, on Beta?

Upvotes: 0

Simon O'Doherty
Simon O'Doherty

Reputation: 9359

While @data_henrik is correct in how to get the other intents, it doesn't mean that the second question is related.

Take the following example graph, where we map the intents versus confidence that comes back:

enter image description here

Here you can clearly see that there are two intents in the persons question.

Now look at this one:

enter image description here

You can clearly see that there is only one intent.

So how do you solve this? There are a couple of ways.

  1. You can check if the first and second intent fall within a certain percentage of each other. This is the easiest to detect, but tricker to code to select two different intents. It can get messy, and you will sometimes get false positives.

  2. At the application layer you can do a K-Means on the intent result. K-Means will allow you to group intents by buckets, so you create two buckets (K=2), and if there is more than one in the first bucket, you have a compound question. I wrote about this and a sample on my site.

  3. There is a new feature you can play with in Beta called "Disambiguation". This allows you to flag intent nodes with a question to ask to get it. Then if two questions are found it will say "Did you mean? ...." and the user can select.

Upvotes: 1

data_henrik
data_henrik

Reputation: 17118

Yes, Watson Assistant returns all detected intents with their associated confidence. See here for the API definition. In the response returned by Watson Assistant is n array of intents recognized in the user input, sorted in descending order of confidence.

The documents have an example on how to deal with multiple intents and their confidence. Be also aware of a setting alternate_intents to allow even more intents with lower confidence to be returned.

Upvotes: 2

Related Questions