Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Intents Detection #623

Open
harshitazilen opened this issue Jul 11, 2018 · 6 comments
Open

Multiple Intents Detection #623

harshitazilen opened this issue Jul 11, 2018 · 6 comments

Comments

@harshitazilen
Copy link

Hi, I am working on a contextual chatbot. I need to use intent based on current context of user.

For ex: User's input is relevant with Intent1 and Intent2. Based on current context I would like to respond user either for Intent1 or Intent2.

Currently Snips detects only single intent with the highest probability.

Is there any way to see top most intents ?

@adrienball
Copy link
Contributor

Hey @harshitazilen ,
It is indeed not possible at the moment to get the top most intents, but we may add an API for that in the future.
In your use case, if Intent1 and Intent2 are close semantically, perhaps you could merge them into a single intent and respond to the user according to current context.

Cheers
Adrien

@harshitazilen
Copy link
Author

harshitazilen commented Jul 11, 2018

Thanks @adrienball for your response.

I am trying to implement a follow up intent feature. where Intent2 & Intent3 are similar but For a user input:

If previously bot detected Intent1 , then it must detect Intent 2.
If previously bot did not detect Intent1, it should detect intent 3.

I believe above can not be achieved by merging intents. Probably waiting for API may be a good option. I will make separate NLU engine specially for Intent2 (followup intents).

@lucasvercelot
Copy link

Hello 👋 ,

I'm also very interested in an API to have an intents list.

Sometimes, two intents can be close (~5% probability score difference) and that would be great to have the power to handle ambiguous situations like that.

We could just set an ambiguity threshold and then compare the difference in probability score for the two top intents, for example.

That would be great ! :)

@adrienball
Copy link
Contributor

Thanks for the feedback, I'm adding this to our roadmap.
We'll try to implement it when we have a bit of time.

@Rushin95
Copy link

Rushin95 commented Sep 5, 2018

@harshitazilen I wrote the following function to get multiple intents from the snips module.

_def get_n_intents(my_nlu_engine, my_text, my_intent_list, no_of_intents):
    result = []
    temp_intent_list = my_intent_list
    for i in range(no_of_intents):
        parsing = my_nlu_engine.parse(text = my_text,
                                      intents = temp_intent_list)
        if parsing["intent"] is None:
            break
        result.append(parsing["intent"])
        temp_intent_list.remove(parsing["intent"]["intentName"])
    return result_

Like a temporary workaround.

@dipanjannag
Copy link

dipanjannag commented Dec 3, 2018

@adrienball I was working on this feature because I needed multiple intent for one of my project and I can throw a pull request for this. Just wanted to clarify, if a list of intents should be returned with corresponding probabilities. Should the None intents be skipped, in return value?
Instead giving a list of non-null intents, even when their corresponding probabilities add up to number <<1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants