Introduction

The Machine Learning page is where KLoBot’s brain lives. This is where a user can control KLoBot’s language understanding process through managing the intents, utterances, phrases and patterns.

The Machine Learning page goes hand-in-hand with the Skill Builder. When a user creates a skill in the skill builder and the chat bot has difficulty in understanding or predicting intents, this is where the Machine Learning tool can come in handy.

Common Terminologies

Phrases

A collection of words that derive a concept. It helps KLoBot generalize and understand a word as an entity.

Intents

The task or action that represents a skill. This is the goal derived from a user’s utterance.

Entities

The data that is assigned or labeled to a word in an utterance.

Patterns

Used to improve KLoBot’s prediction accuracy. If there are multiple utterances that are similar with each other, a pattern should be created.

Allows the user to test an utterance and determine the prediction score. This helps the user determine if the utterance entered is predicted accurately by KLoBot.

This page allows the user to drag the skills in order in reference with the utterance tested.

Features

  1. Test Example – An input field that contains the utterance to test.
  2. Start Testing – Initiates the utterance testing. It returns the skill list pertaining to the utterance tested.
  3. Train – Trains the utterance tested with the first skill in the skill list.
  4. Skill List – Contains a list of skills pertaining to the utterance. Users can drag and rearrange the skills in order.
  5. Skill Name – Contains the skill name pertaining to the utterance tested.
  6. Intent – Contains the intent of the skill.
  7. Score – Contains the prediction score of the skill based on utterance tested.
  8. Edit Skill – Redirects the user to the edit the skill.

The phrases page contains a list of words or synonyms that are related to the same context.

Phrases page allows KLoBot to predict and generalize certain words that mean the same thing.

Phrases are used by entities in utterances to boost the significance of the words such as Location.

Features

  1. Search Phrases – Allows the user to search and filter out phrases.
  2. Create New – Allows the user to create a new Phrase.
    1. Global – A selector that allows the user to set a Phrase to Global. The global feature allows the phrase to be accessible across the whole application.
    2. Phrase List Feature Name – Contains the name of the Phrase context.
    3. Value – A textbox that allows users to enter all the possible synonyms or words that correlate to the Phrase context.
    4. Save Changes – Saves all the changes made in the Phrase.
    5. Close – Discards the changes made in the Phrase.
  3. Phrase List – Contains a list of all the phrases added in the application.
  4. Phrase Name – Contains the name of the phrase. It opens a modal containing all the synonyms or words pertaining to the phrase.
    NOTE: The global icon’s color changes if a phrase is set to global.
  5. Feature Values – Contains the number of words assigned to a Phrase. The icon is a button that contains all the words pertaining to the phrase.
  6. Used By – Contains a list of entities and intents using the phrase.
    NOTE: Users can assign a phrase to an intent or entity via the Intents and Entities page.
  7. Actions – Contains the edit and delete phrases. The edit icon opens the modal to edit the phrase and the delete icon deletes the whole phrase.

The intents page contains a collection of all intents trained from the skill builder.

Users can assign a phrase or multiple phrases to an intent.

Features

  1. Search Intent or Skill name – Allows the user to search and filter out intents or skills.
  2. Intent name – Contains the name of the intent. Users can view a list of utterances assigned to the intent through clicking the intent name or the icon.
  3. Skill name – Contains the skill name assigned to the intent. It redirects the user to the skill builder page for the selected skill.
  4. Phrases – Shows a list of phrases assigned to the intent. Users can add or edit the phrases assigned to the intent.
    • Edit – Opens the Manage Phrase window where a user can add or edit phrases assigned to the intent.
    • Select Phrase – Contains a list of phrases that a user can add to an intent.
  5. Actions – Contains the delete intent action. It allows the user to delete the intent and train the chat bot.

The entities page contains a collection of all the entities assigned to utterances and skills.

Users can track and view all the utterances that are using the entity.

To improve the probability that KLoBot predicts entities correctly, users can utilize the entities page and assign phrases.

Features

  1. Search Entity – Allows the user to search and filter entities.
  2. Entity Name – Contains the name of the entity. It opens a modal that shows a list of utterances using the entity.
    NOTE: The global icon’s color changes if a phrase is set to global.
  • Example – Shows an utterance that has an assigned entity. Users can also hover on the entity highlighted.
  • Skill Name – Contains a list of skills that have an assigned entity. It is a hyperlink that redirects the user to the skill builder.
  • Phrases – Contains a list of phrases assigned to the entity. Users can add or edit phrases to an entity.
    • Edit – A component that allows a user to add or edit a phrase to an entity.
    • Select Phrase – A list of all phrases that a user can add to an entity.
  • Action – Allows the user to delete and train the entity.

The patterns page contains all the patterns trained and created from the skill builder pages.

The patterns page allows the user to view all the patterns assigned to a skill or intent. Users can track patterns assigned to a skill.

Features

  1. Search Pattern – Allows the user to search and filter patterns.
  2. Pattern – Contains all the patterns. It includes the pattern entity.
  3. Intent – Contains a list of intents where the pattern was created or used.
  4. Skill Name – Contains a list of skill names where the pattern is being used.
  5. Action – Allows the user to delete and train the pattern.

The questions page allows the user to catch and review utterances assigned to an intent that the chat bot is unsure of or has a low prediction score.

This page shows a list of utterances with a low prediction score that needs validation from the user.

Once the user has validated that the utterances showed in the page indeed has a correlation to the intent predicted, the user can train the chat bot and improve prediction score.

Features

  1. Filter by – Allows the user to filter out a list of utterance by Skill name and intent.
  2. Example Columns – A column showing all the utterances that the Machine Learning returns from the “Filter by” that the chat bot is unsure of.
    NOTE: The user needs to validate if the utterances are indeed correlated to the Skill name.
  3. Intent Ranking – Shows a list of intents with the prediction score correlated to the utterance from the “Filter by” section.
    To catch utterances that the chat bot is unsure of, users can reassign intents to the utterance example by selecting from the dropdown list and retraining.
  4. Action – Contains the train example and the remove example actions.

When to use a phrase list?

In some cases where there are similar words that mean the same context such as the verb “Get”, a user can create a phrase list containing other synonyms for the word “Get” such as “Find”, “Search” or “Retrieve” to enhance the quality of KLoBot’s language understanding.

How to create a phrase and assign to an intent?

1. Navigate to the Machine Learning page and then go to the Phrases section. Click create new, it will open the Phrase list feature modal where you can add the Context and the synonyms.

2. Enter the phrase name or context of the phrase in the text field.

In this example, we are going to make a phrase list for “Hello” which will contain various utterances or words pertaining to the word “Hello”.

3. In the Value section, enter all the synonyms to the context “Hello” in the text field and click the + button or just hit the enter key.

Save all the changes made.

4. To assign the phrase list we just created to an Intent, navigate to the Intents page and search for the intent to assign the phrase list.

In this example, we would assign the “Hello” phrase list to the greeting skill. Open the dropdown menu and select “hello” phrase list.

Save all the changes.

5. To test the phrase list, go to the Live Testing page and enter an utterance from the phrase list.

Enter the utterance in the Test Example field.

In this example, we used the utterance “bonjour” from the phrase list and predicted the “Greeting” skill with a high prediction score.

How to create a phrase and assign to an entity?

1. In this use case, we would want KLoBot to predict and understand location names from the phrase list and then assign the phrase list to an Entity.

Navigate to the Phrases page and click Create New.

2. Enter the Phrase list name and the value. In this example, we entered “Location” for phrase list name and various location type data in the value section.

Save the changes.

3. Once the phrase list has been created, navigate to the Entities page. Search for location type entities that you want to assign the phrase list to.

In this example, we want to assign the phrase list we created to a location entity {general.location}.

NOTE: We can see that this entity is used by utterances in skills “Shearman Search” and “Personal Assistant”. Since these skills expect a location, the values that we entered in the Phrase List would be easily predicted by KLoBot once we assign the Phrase to the entity {general.location}.

4. Click Add New and select Location from the dropdown box. Save all the changes.

5. To test, select a skill that uses entity {general.location}. In this example, we will test the “Shearman Search” via the skill builder page.

Click Test and enter an utterance.

NOTE: Make sure to tweak the utterance to test by replacing the entities to a different location.

Notice how the utterance we used is not trained in the examples list and KLoBot still picked up the entity “New York” from the utterance “get New York partners working in litigation”.

This is where the Phrase list come into play. It allows KLoBot to predict certain words from the Phrase list assigned to an entity.

This makes it efficient for the user to avoid entering various location names manually via the Train section