简体   繁体   中英

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?

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.

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:

在此处输入图片说明

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

Now look at this one:

在此处输入图片说明

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.

在Beta的非生产环境中是否可以使用此消歧功能?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM