Under Build > Understanding, you can create, maintain and train intents and entities. This part provides an overview so you can easily work on how well your bot is understanding what users are asking from it.
Even though you can also create intents and entities directly in the turn editor from within your dialog, when you want to create a large number of them, it's often easier and faster to create them in Understanding.
The following elements are explained in this article:
Understanding consists of three parts:
- Left-hand side: lists of intents and entities. You can easily browse through either of these lists.
- Bottom left: Create a new intent or entity.
- Right-hand side: You can view, edit and train intents and entities here.
Intents
An intent is the goal that the chatbot user has when it starts chatting with the chatbot. It comes down to what they really mean, instead of what they actually type. There can be a big difference between the two.
For example:
Aiden: it's cold here.
Ricky gets up and closes the window.
Aiden never asked Ricky to close the window, but Ricky understood what he meant nonetheless.
In a customer service chatbot, intents are usually questions from customers that need an answer, problems that need to be solved or actions that can be carried out by a bot. Examples:
- What is the visitor's address?
- Show movie overview
- Solve problems with phone
Create a new intent
There are two ways to create a new intent:
1. Through the Intent editor
We will use ordering a pizza as the new intent:
- Under Build > Understanding, click on the Intents tab on the left-hand side.
- In the field Create new intent, enter the name of your intent (order_pizza) and click on the '+' sign to create the intent.
- In the field Add new utterance, add utterances to your intent followed by a click on the '+' sign. Utterances are sentences such as 'I would like a pizza with pineapple and mushrooms', 'can I order a pizza?' and 'pizza please'. Read more about utterances here.
- Click on Save to save these utterances.
- Click on Train.
2. Through the turn editor
Go to Build > Dialogs and then select an existing dialog or create a new one. Whichever startpoint you choose results in a screen where you see a block as shown below:
Click on the '+' sign to open the turn editor.
From the drop-down menu in the top right corner, select User. Under 'Enter intent', fill in the name of your intent.
Entities
An entity is a piece of information that the chatbot needs to answer the question. If you look at an intent as an action sentence, the entities provide specific information about this action.
For example:
Hi! I want to order one large pizza with mushrooms, pineapple and onions.
In this example the action is "order pizza", which is the goal of the user's question. "Mushrooms", "pineapple" and "onions" tell you more about the subject, which is the pizza itself. They also all belong to the same category: pizza toppings.
In chatbot terms:
- 'Order pizza' is the intent
- 'pizza toppings' is an entity
- 'mushrooms', 'pineapple' and onions are certain values of the entity 'pizza toppings'
Just as 'large' is the value of the entity 'pizza size' and 'one' is the value of the entity 'number of pizzas'.
Name entity | Description | Value |
pizza.quantity | Number of pizzas | a number |
pizza.size | Size of the pizza | small, medium, large |
pizza.topping | Toppings on the pizza | mushrooms, pineapple, onions, pepperoni, red pepper, ham |
You can organize your entities by formulating an entity as follows: <noun>.<attribute>. In <noun>, fill in the main subject of your intent, which in this case is 'pizza'. In <attribute>, fill in specific information about the main subject, so in this case size, the number of pizzas, toppings, etc.
Benefits of using entities
Chatbots can get utterances from entities and save them for later use. This is useful for:
- Personalization: For instance, you can ask the chatbot user for their name and use this during the conversation.
- Work preparation: You can let the chatbot ask for specific information that can be sent to live agents, so they can start the conversation with more context and details.
Create an entity
There are two ways to create an entity:
1. Through the turn editor
Follow these steps. Then, after filling in the intent name, the field Add entity will appear where you can now enter an entity.
2. From within an utterance
When you're marking your utterances and find that you don't have an appropriate entity yet, you can create one from within an utterance (so that you don't have to switch from intents to entities).
Step 1: In the utterance, mark the entity value for your new entity. In our case, we want to create a new entity 'pizza.size', so we mark 'medium'.
Step 2: In the Entity field, enter the name of your new entity.
Step 3: Click on Save examples to save your utterances.
Step 4: Click on Train. If you want to learn more about training your chatbot, read this article.
3. Through the entity editor
Let's make the entity: pizza.topping:
- Go to Build > Understanding and click on the Entity tab.
- Fill in the name of your entity, e.g. pizza.topping in the field Create new entity and click on the '+' sign.
- In the field Add new entity value, add a value for the entity. In this example the entities are the pizza toppings, so: mushrooms, pepperoni and pineapple. Next, click on the '+' sign.
Note: Entity values are not case sensitive.
Adding synonyms
There are many ways in which a chatbot user can formulate their question. In order to make sure that it grasps as many possibilities as possible, you can add synonyms to your entity values. For example, for the 'mushrooms' entity, you could add 'shii-take' and 'funghi' as a synonyms.
List of system.entities
The chatbot platform provides by default a certain list of system.entities, which can be used across the dialog:
{{system.year}} (2022 etc.) = year
{{system.month}} (1-12) = month
{{system.day}} (1-31) = date
{{system.day_of_week}} (1-7) = day of the week
{{system.hour}} (0-23) = hour
{{system.minute}} (0-59) = minute
{{system.second}} (0-59) = second
{{system.device}} (desktop, tablet, mobile) = the type of device used for the conversation
{{system.channel}} (livechat, whatsapp, facebook, twitter) = The channel type used in the conversation
{{system.starturl}} = The URL in which the conversation was initiated
Utterances
An utterance is everything a chatbot user says to the chatbot. The entire message is a chatbot user's utterance. In this article, we explain how to add an utterance to an intent.
Adding utterances to your intent
1. Through the intent editor
Click on an existing intent or create a new intent, after which you can add (and search for) utterances on the right-hand side:
2. Through the turn editor
Go to Build > Dialogs and then create a new dialog or select an existing one. Add a user turn or click on an existing one.
Click on the '+' sign to open the turn editor.
We would advise you to add around 5 to 15 utterances.
Displaying additional utterances
There's always one primary utterance; this is the one that will be shown in the user turn card in your dialog. Other than that, primary utterances behave exactly the same as additional utterances.
When you open a user turn that you created earlier, only the Primary utterance is displayed. To display the additional utterances that you already entered, first re-select the intent.
Note that in the user turn, only the five most recent utterances are displayed. If you want to see all utterances that you created for your intent, go to Understanding > Intents and look up your intent in the intent editor.
Marking utterances
To mark utterances with entity values:
1. Double click on the word you want to mark. The marked word is displayed in the Value field.
Tips for good utterances
In an ideal world, the best utterances are of course actual user utterance that you get from the user conversations with your chatbot, or from other user data collections that you might already have. But until then, here are some tips to create utterances with enough variety to propery train your chatbot.
-
Sentence length
Create utterances with different sentence lengths: from single words, to full sentences and everything in between.
I would like to order a pizza with mushrooms and pineappel
1 pizza with mushrooms and pineapple
Pizza
-
Synonyms
Use synonyms (different words that mean the same), and try to rephrase your sentences in different ways.
I feel like pizza tonight!
Do you sell pizza at your place?
Can I order a calzone?
I would like to buy a Napoletana
-
Entity placement
Vary the placement of entities within the sentence
One large pizza with mushrooms and onions for takeout.
1 take-away mushroom and onions pizza, large.
-
Typos, bad grammar & incomplete sentences
Use typos, bad grammar, incomplete sentences and punctuation to teach your chatbot the exceptions as well as well-formed sentences. Users will make mistakes too!
1 piza w. musrooms takeaway
plz order piza mushroom takeout, tnx.