If you are starting to learn about chatbots, chances are you’ve come across the terms entities, intents, and utterances. I’m going to share with you what entities are in detail and how it can be used to make your chatbot better.
When you build a chatbot, you will come across a lot of different terms like intent, entities, and utterances that you’ll need to be familiar with so that you can design and architect for your bot in the best way possible from the get go.
Arguably, the most important part of deconstructing unstructured, natural language conversation from a chatbot is providing the right response in the right context. And entities are the holy grail of being able to figure that out.
In this post, you’ll learn the conversation components, how they are extracted, what they are, and how they fit together. Lastly, I’m going to talk all about chatbot entities, how to design/architect entities, and how to construct them.
What is a chatbot entity?
Chatbot entities represent data and are used to provide personalized and accurate responses to the chatbot user. Entities can be fields, data, or text describing a time, place, person, item, and number. The primary purpose of an entity is to give the service or application that is resolving what the user is typing into the chatbot with a predictable way to extract information from it. It can secondarily be used to boost the prediction of the intent or other entities.
What’s the difference between a chatbot entity versus a chatbot intent?
When compared to an intent, an entity represents a data concept inside a dialogue that you want to be extracted. Within an utterance, an entity is generally not required whereas an intent is required.
How do chatbot entities work?
After a user types an utterance into a chatbot, the next thing that will happen is that a service or application will try to predict the type of data that is being requested within the entity knowledge repository.
Most chatbots will be able to answer questions or task requests by taking the utterance, connecting it to both an intent and entity (which is optional), and allow the chatbot to provide information based on the skills within it or search within the knowledge base.
Other Chatbot Terms Defined
The three most common terms that are used to talk about chatbot design and architecture for deconstructing a conversation are utterances, intents, and entities.
An utterance is anything a user can say which can be a full sentence, a phrase, or just a word. When designing an utterance, you’ll need to ensure you anticipate a broad set of utterances from your users.
An intent is what the user is what the intended action/response is with their utterance. The intention of the user can be thought of as the user’s purpose, mission, or intention. For a more general way of thinking of it, imagine the intent is the verb or action of what the user is intending for the chatbot to do.
An entity represents a data, term, objects that are relevant to specific intents and provide a specific context for an intent. They are often referred to as slots and can be generalized as nouns. The entities are important in determining what the intent of the user is.
Entities Working with Utterances and Intents
In order for you to understand this more clearly, imagine that you have a chatbot that helps employees. This chatbot can help them with laptops, human resources questions, and questions about their role.
For this example, here are the multitude of utterances that could be included with the same “intent” of getting help.
- help me with my laptop
- help me with changing my name
- help me with how to find documentation for my job
Notice how each of the utterances are very similar in those scenarios above. Expanding on that example, here’s some other ways the utterances can be morphed, but with different verbs.
- i have a problem with my laptop
- i have a problem finding documentation
- i have an issue with my name
- terrible issue with you
In this scenario, we know that the intent in each of these as a whole can be seen as a problem the employee needs help with. However, each scenario has a different workflow, workstream, or knowledge base that would help answer those questions.
One way to design the chatbot so that it routes to the right action is to create an intent called “problem” because you are identifying that they are having a problem with something. You can see how often people are coming with problems (versus information seeking or task based request).
You can then design entities for each of the various scenarios like laptop help, human resources help, role documentation help, and bot help to further define the intent.
Entity Types
Entities are data buckets and categories that contain phrases and words that have related characteristics.
Different platforms and services have different methods of categorizing types of entities. But generally, they are similar even though the vernacular within the platforms may not be.
Here are the most common entity types for chatbots:
- simple and contextual entities
- composite entities
- entity roles
- entity lists (also known as developer entities)
- regular expressions
- pre-built models
- named and system entities
- session entities
Simple and Contextual Entities
Simple and contextual entities teach your NLU model is for data that does not contain any other data item, is a single concept, does not have prebuilt entity or formats (like zip code or phone number), and is not a well formatted expression.
Composite Entities
A composite entity is when you have two entities that are related, but you need to capture them together so that you can streamline the chat conversation journey for the user so as not to have to clarify the intent with multiple streams of questions. An example of this can be when you have a regional location and are trying to match up a municipal location within the same utterance.
Entity Roles
An entity role can be used to extract information that is related to one another in the context of the utterance and need to be grouped and processed as a unit of information. Example of entity roles are away/from, from/to, start/end.
Entity Lists and Developer Entities
You’ll see this listed either as entity list or developer entities, but they mean the same thing.
An entity list is an exact text match to the words in an utterance. This can include a company’s product or service line to identify key pieces of information. This will require normalization of the synonyms for each of these entities. List entity is a good choice when the data values are known and the text is an exact match.
Developer entities are data groupings of common types of data that are created and customized to the use of the company sponsoring the bot. This includes a brands line of products and services names.
Regular Expressions
These are scenarios where standardized data will be pulled from an utterance. Using the service and product line example, these could be the code values for each of these items in the bill.
Prebuilt Models
Prebuilt entity models can be added to an app or service to speed up intent prediction and extract the context within the utterance. With a pre-built model, you do not need to add prebuilt entities because the entity should generally be detected automatically.
Named entities and System Entities
Named and system entities are data groupings of common types of end user text dialogue. System entities include things like date and time, numbers, geography, language.
SEssion Entities
Session entities are specific in identifying specific conversation level dialogue. For example, within a full dialogue stack of trying to reserve a concert ticket for a seat at a venue, time-sensitive tickets may only be made available when that user is trying to reserve the ticket.
Designing for Entities
A good intent and entity design will ensure that you allow for changes of your entity over time and also use child entities with constraints and descriptors. Designing for being able to break down and decompose will allow your application or service to get a high confidence in entity resolution from the user utterance.
Generally, when building a bot, entities are optional pieces to help extract the context of the user. However, entities are important in narrowing down the focus of what the user was wanting. While not required in the utterance from the user or bot design from the developers, it is immensely helpful determine what the user’s intent for the utterance was.
Entities within a chatbot are essential in ensuring that the chatbot user is getting the result or action they needed from the message.
Summary About Chatbot Entities
Chatbot entities help in the natural language processing of converting a user’s speech and text from being unstructured data to being able to be extracted, potentially modeled, and then being able to be executed on in order to being able to provide the user’s expected response.
Chatbots are hot topics in today’s technology world. I hope this article provides you some insight on the language being used as chatbots become part of the mainstream in our daily lives.
Other Chatbot Posts You Might Like
- Understanding Chatbot Intents
- Small Talk Dataset for Chatbots
- Chatbot Development Lifecycle
- Chatbot Sentiment Analysis Overview
- Chatbot and Conversational Agent – What’s the difference?
- Architecture of a Chatbot