Skip to content

Special Responses to Intents and FAQ

Dilyara Zharikova (Baymurzina) edited this page Nov 25, 2022 · 1 revision

Components to Specify Responses

There are two main ways to specify assistant's responses: intent-based responses and Frequently Asked Questions. Intent-based approach implies two separate components: Intent Catcher (multi-label classifier detecting given intents) and Intent Responder (skill with template-based responses to intents detected by Intent Catcher). The components are separate because detected intents can be also used by other skills.

Intent Catcher

Intent Catcher is a multi-label classifier that helps to detect custom intents of the user, for example, we provide pre-defined intents like: yes, no, what_is_your_name, lets_chat_about, etc. Intent Catcher can be built with any multi-label classification model. The main problem of this component usually is out-of-scope detection -- the classifier can return false positive intents when not trained properly. The current Transformers-based version of Intent Catcher requires training after adding new custom intents.

Intent Catcher utilizes two ways of intent detection: multi-label trainable classifier and matching with Regular Expressions (the full user utterance is compared with the given regular expressions).

Customization

  1. Specification of training examples for intent classifier. The text examples can be given in the following forms:
  • raw texts,
  • examples generated from regular expressions using the following features:
    • () to determine the considered sequence,
    • (bla|blabla) - vertical line to determine or symbol
    • (){0,1} to determine either presence or absence of the given in the brackets.

For example, from the regular expression (hi! |hello! ){0,1}how are you? two examples will be generated: hi! how are you? and hello! how are you?. One also may insert several examples (both texts or regular expressions) at once splitting them with a new line.

  1. Matching with Regular Expressions. One can provide regular expressions that will be used for re.match method with a user utterance to detect the considered intent.

For example, the intent how_are_you will be detected in a user utterance hi! how are you using a regular expression (hi! |hello! ){0,1}how are you?{0,1}. One also may insert several regular expressions at once splitting them by a new line.

Intent Responder

DFF Intent Responder Skill is a template-based skill for answering to the user's special requests (intents). DFF Intent Responder Skill contains responses to some intents from Intent Catcher (some intents are more general and do not require special responses but are used in other skills as a custom classification).

Frequently Asked Questions

Frequently Asked Questions is a common approach to specify assistant's responses to some user's requests. Despite the fact that Frequently Asked Questions Component is almost equal to pair of Intent Catcher and Intent Responder, we distinguish it for convenience -- Frequently Asked Questions Component accepts data in a common format of csv file with 2 columns containing user questions and system responses.