1

I'm using GCP's Dialogflow as an SMS chatbot and users often text keywords over exact sentences/questions. This causes the intent the bot responds with to be close to what the user wants but not always the exact response because of overlapping keywords in the training phrases.

Dialogflow returns an intent that is equal to or above the ML Classification Threshold with the most confident intent, but I'd like to the pool of intents that could relate to a question so that if a user responds

"That's not what I'm looking for"

the followup intent says

"Would any of the following help you instead? [insert pool of related intents here]."

If anyone has a way to do this with the Dialogflow API or through fulfillment, let me know. Otherwise any ideas/concepts of creating this myself are welcome!

cparry
  • 11
  • 1

1 Answers1

0

To do this, you can use fulfillment to store the intent ID in a parameter of the context for the initial intent that Dialogflow returns. This way when the user responds:

"That's not what I'm looking for"

You can match the intent, and retrieve the name/ID of the previous intent from the context. Through fulfillment you can then use the ID of the previous intent to access a list of related intents (e.g. a dictionary) that you have preset in the fulfillment logic.

fishcakes
  • 528
  • 6
  • 12
  • So the problem with making my own dictionary is that I would have to pull my own keywords out to think of the related intents it would map to. Since my project is large and has +300 intents this would be a mess of a task when DialogFlow already has the tech to do this in the background...I just need access to it. – cparry Jan 30 '20 at 16:13
  • 1
    This is one of the drawbacks of using API-only access to an ML system - you won't get the entire output of the classifier. In this case you are only getting a single, highest-rated intent and, without a change from Dialogflow, you aren't able to access other, less highly rated intents. You can, perhaps, adopt a naming scheme which would reflect how your intents are related to each to each other (perhaps a common prefix). Then, you can take the predicted intent name and compile a list of related intents based off that name alone. – Levko Ivanchuk Jan 31 '20 at 09:48