nlu.user_intents_checker

This file contains the main functions for checking the user intents.

Module Contents

Classes

UserIntentsChecker

Attributes

PATTERN_BASIC

PATTERN_DONT_CARE

PATTERN_QUESTION

PATTERN_DONT_LIKE

PATTERN_DONT_WANT

PATTERN_WATCHED

nlu.user_intents_checker.PATTERN_BASIC
nlu.user_intents_checker.PATTERN_DONT_CARE = ['anything', 'any', 'dont know', 'i do not care', 'i dont care', 'dont care', 'dontcare', 'it...
nlu.user_intents_checker.PATTERN_QUESTION = ['who', 'what', 'when', 'which', 'can', 'could', 'is', 'are']
nlu.user_intents_checker.PATTERN_DONT_LIKE = ['something else', 'anything else', 'dont like it', 'not this', 'another']
nlu.user_intents_checker.PATTERN_DONT_WANT = ['dont', 'not', 'nothing', 'wont', 'shouldnt', 'dont need', 'dont want', 'no', 'not']
nlu.user_intents_checker.PATTERN_WATCHED = ['watched', 'seen', 'yes', 'I have', 'yup', 'yea']
class nlu.user_intents_checker.UserIntentsChecker(config: Dict[str, Any])
is_dontcare(user_utterance: moviebot.core.utterance.utterance.UserUtterance) bool

Returns true if any keyword from dont care pattern is present.

TODO (Ivica Kostric): This can be partially merged with check_basic_intent. Regex can be dropped since we are only looking for complete tokens anyway.

Parameters:

utterance – A processed user utterance.

Returns:

True if the dont care pattern detected.

check_basic_intent(user_utterance: moviebot.core.utterance.utterance.UserUtterance, intent: moviebot.core.intents.user_intents.UserIntents) List[moviebot.dialogue_manager.dialogue_act.DialogueAct]

Given intent and a list of intent patterns checks if any token in user utterance match the pattern.

Parameters:
  • user_utterance – Class containing raw utterance and processed tokens.

  • intent – Intent for which to compare patterns.

Returns:

If pattern exists returns that intents dialogue act.

check_reveal_voluntary_intent(user_utterance: moviebot.core.utterance.utterance.UserUtterance) List[moviebot.dialogue_manager.dialogue_act.DialogueAct]

Finds any voluntary revealed information in utterance.

Parameters:

utterance – Processed user utterance.

Returns:

A list of dialogue acts with revealed information.

check_reveal_intent(user_utterance, last_agent_dact) List[moviebot.dialogue_manager.dialogue_act.DialogueAct]

Checks utterance for intent “reveal”.

This function is only called if the intent of agent is ELicit to see if user has answered the query.

Parameters:
  • utterance – Processed user utterance.

  • last_agent_dact – Last agent dialogue act.

Returns:

A list of dialogue acts.

check_reject_intent(user_utterance: moviebot.core.utterance.utterance.UserUtterance) List[moviebot.dialogue_manager.dialogue_act.DialogueAct]

Checks utterance for intent “reject”.

Parameters:

utterance – Processed user utterance.

Returns:

A list of dialogue acts.

check_inquire_intent(user_utterance: moviebot.core.utterance.utterance.UserUtterance) List[moviebot.dialogue_manager.dialogue_act.DialogueAct]

Checks utterance for intent “inquire”.

Parameters:

utterance – Processed user utterance.

Returns:

A list of dialogue acts.