Managing Patterns

To optimize accuracy and recognition of the NLP interpreter, you can create patterns for names for tasks and task fields. While using synonyms is great for words used in the name, sometimes, users may refer to a task using slang, metaphors, or other idiomatic expressions. For example, a task name might be Get Current Weather, but the user inputs, what’s happening with today’s rain situation. In this case, none of the words used in the task name are used, yet the input has the same meaning as Get Current Weather. In these cases, using patterns can help to improve NLP interpreter accuracy.

When the NLP interpreter matches a synonym to one task or field, and a pattern to a different task or field, the pattern match is prioritized and used for positive recognition over the synonym match.

Field Patterns – Add or edit task field patterns, for example, Date, Location, or Name as user input. This option is available only if the bot has one or more action, alert or information tasks.

Task Patterns (this option has been merged with Intent Patterns post v6.40 release) – Add or edit patterns for any bot tasks, for example, Get Weather.

Adding Patterns for Intents

You can define a pattern as a sentence that represents the task but does not actually contain any of the words in the name of the task. Also, you can define where words should be ignored by the NLP interpreter to improve accuracy for recognizing the correct task.

For example, you can build a pattern like find* testable* value to recognize in the user input a sequence of words in order where the word find is followed by any number of words, followed by the word testable, and again followed by any number of words, which are finally followed by the word value. For this pattern, the user input can be Find me any testable integers corresponding to the value, which would match the pattern.

In the Intents Patterns section, you can view, add, and delete patterns for dialog tasks.To add an intent pattern

On the Patterns page, click the Intent Patterns tab,

Click an intent name to enter the patterns for it.

In the Type and Enter to add patterns field, enter one or more sentence patterns, and press ENTER between patterns.

You can reorder, edit or delete patterns using the appropriate icons.

Adding Patterns for Entities

In the Entity Patterns section, you can view, add, and delete patterns for dialog task Entity node names.

To add an entity pattern

On the Patterns page, click the Entity Patterns tab,

Click an entity name to enter the patterns for it.

In the Type and Enter to add patterns field, enter one or more sentence patterns, and press ENTER between patterns.

You can reorder, edit or delete patterns using the appropriate icons.

Adding Patterns for Fields

You can view, add, and delete patterns for task fields in the Field Patterns tab.

Note: This option is available only if the bot has one or more action, alert or information tasks.

To add a field pattern

On the Patterns page, click the Field tab,

Click a field name to enter the patterns for it.

In the Type and Enter to add patterns field, enter one or more sentence patterns, and press ENTER between patterns.