1. Home
  2. Kore.ai Conversational Platform
  3. Bot Builder Tool
  4. Natural Language Processing (NLP) Optimization
  5. Managing Patterns

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.

To learn more about best practices and tips for optimizing NLP, see the Natural Language Processing Guide.

Navigating to the Patterns Tab

  1. Open the bot for which you want to add patterns.
  2. Hover over the side navigation panel and then click Natural Language.
  3. Click the Patterns tab.
  4. On the Patterns page, click one of the following tabs:
    1. Task Patterns – Add or edit patterns for any bot tasks, for example, Get Weather.
    2. Field Patterns – Add or edit task field patterns, for example, Date, Location, or Name as user input.
    3. Intent Patterns – Add or edit patterns for dialog task User Intent nodes.
    4. Entity Patterns – Add or edit patterns for dialog task Entity nodes.

Adding Patterns for Tasks

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.

To add a task pattern

  1. On the Patterns page, click the Task Patterns tab,
  2. Click a task name to enter the patterns for it.
  3. In the Type and Enter to add patterns field, Enter the sentence pattern, for example, tell me when the closed opportunity is lost for the Opportunity Closed Lost task and click enter.

The Successfully added pattern message is displayed at the top of the page. The previous illustration shows an example of the Task Patterns tab.

To remove a task pattern

  • Click the task that you want to delete a pattern from, and then click Delete for the pattern that you want to delete.

The Pattern deleted successfully message is displayed at the top of the page.

Adding Patterns for Fields

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

To add a field pattern

  1. On the Patterns page, click the Field tab,
  2. Click a field name to enter the patterns for it.
  3. In the Type and Enter to add patterns field, enter one or more sentence pattern, and press ENTER between patterns.

The Added a field pattern successfully message is displayed at the top of the page.

The following illustration is an example of adding a field pattern.

To remove a field pattern

  • Click the field that you want to delete a pattern from, and then click the X next to the pattern that you want to delete.

The Pattern deleted successfully message is displayed at the top of the page.

Adding Patterns for Intents

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

To add an intent pattern

  1. On the Patterns page, click the Intent tab,
  2. Click an intent name to enter the patterns for it.
  3. In the Type and Enter to add patterns field, enter one or more sentence pattern, and press ENTER between patterns.

To remove an intent pattern

  • On the Natural Language tab, in the Patterns section, on the Intent Patterns tab, and then click the X to the right of the pattern that you want to delete.

The following illustration is an example of adding an intent pattern.

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

  1. On the Patterns page, click the Entity tab,
  2. Click an intent name to enter the patterns for it.
  3. In the Type and Enter to add patterns field, enter one or more sentence pattern, and press ENTER between patterns.

To remove an entity pattern

  • On the Natural Language tab, in the Patterns section, on the Entity Patterns tab, and then click the X to the right of the pattern that you want to delete.

The following illustration is an example of adding an entity pattern.

Next Steps

Sometimes users may query a bot about subjects not related to a task, for example, What is your Name? where do you live? You can anticipate user questions and provide standard responses when a bot query is recognized. For more information, see Managing Standard Responses.

Was this article helpful to you? Yes No 1