0

I am making a complaint system in which after asking some sequential questions I ask the user to enter his complaint. Now users can enter any kind of sentence, with/without grammatical errors. I would like to store that complaint sentence as it is regardless of bad grammar. I am facing 2 problems here:

Problems (1) When a bad grammar sentence comes, it goes to the Fallback intent instead of the Webhook that I have attached with the intent. (2) If this complaint sentence contains some Training word of some other intent (e.g. 'Hello' of WelcomeIntent) then it goes to that intent regardless of the context value I have set to make sure it remains in this intent.

What I've tried so far (1) I tried making follow-up intents as well as keeping all intents at parent level. No such difference observed. (2) I deleted the default Fallback intent and created a custom Fallback intent for the complaint intent and attached a Webhook with it. So now when a user writes bad grammar in Complaint intent then it goes to its associated Fallback and activates the Webhook there. But it is not a good solution because Problem#2 still exists.

1 Answers1

0

You're on the right track. In order to catch unstructured responses, you will need to rely on a Fallback Intent. However, to pull off what you want, you will need to leverage Contexts.

Dialogflow will exclude Intents that have Incoming Contexts that differ from the Contexts that are currently active. Intents with no Incoming Context will always be evaluated, but only after any Intents that have valid active Incoming Contexts.

I'm assuming you're using fulfillment to capture all the information in the conversation. I would structure your Intents this way:

  • Have a Fallback Intent without any Contexts set (similar to the default one). You may or may not have it go to fulfillment, as you wish.
  • Have all the "sequential" questions share the same Incoming Context (let's call this question-context just for reference), and make sure you set (and keep resetting) the lifespan for this Context in each Outgoing Context (or in the Fulfillment for them).
  • When you ask for their complaint, clear this Context (set its lifespan to 0) and set a different Context (lets call it complaint-context).
  • Create another Fallback Intent with the complaint-context as the Incoming Context. Set the fulfillment for this, and it will send the text that it captures.
Prisoner
  • 49,922
  • 7
  • 53
  • 105