deeppavlov.skills.pattern_matching_skill

class deeppavlov.skills.pattern_matching_skill.pattern_matching_skill.PatternMatchingSkill(responses: List[str], patterns: Optional[List[str]] = None, regex: bool = False, ignore_case: bool = True)[source]

Skill, matches utterances to patterns, returns predefined answers.

Allows to create skills as pre-defined responses for a user’s input containing specific keywords or regular expressions. Every skill returns response and confidence.

Parameters
  • responses – List of str responses from which response will be randomly selected.

  • patterns – List of str patterns for utterance matching. Patterns may be all plain texts or all regexps.

  • regex – Turns on regular expressions matching mode.

  • ignore_case – Turns on utterances case ignoring.

responses

List of str responses from which response will be randomly selected.

patterns

List of str patterns for utterance matching. Patterns may be all plain texts or all regexps.

regex

Turns on regular expressions matching mode.

ignore_case

Turns on utterances case ignoring.