An entity is the information that your bot extracts from a particular utterance conforming to an intent.
Eg- Let My name is John Doe belong to an intent called introduction. For your bot to understand and extract the name John Doe from the sentence, you need to define an entity which does so. You can name the entity whatever you wish, but it is best to name it as something pertaining to what it extracts. In our example, we can call our entity name.
Entities can be re-used between different intents, to extract different things. So the best principle would be to make an entity that extracts only type of data and use it across different intents. Therefore, in our above example, say Book a flight on Emirates belongs to the intent booking, then the same entity, name, can be used to extract the flight name emirates.
You need to keep in mind two things before you go on defining entities -
Adding pre-built entities
Pre-built entities are, as the name suggests, pre-built i.e. they are already configured to extract a particular type of data across the intent they are added to. An example can be the entity number that extracts numbers from the intent it is assigned to. The numbers can be either in numeric or alphabetical like 10 or ten.
For a full list of all pre-built entities, you can visit [Pre-built Entities List][1].
To add pre-built entities,
entities tab.Add pre-built entities and select the entity you want to add to the model and hit save.Adding Custom Entities Custom Entities are of 4 types,
name in the examples above is a simple entity.Defining Simple Entities
entities tab.Add Custom EntitiesSave.All other type of entities can be added in the same way by just changing the Entity Type to one of the above types. In hierarchical and composite entity types, you'll also need to give the children names along with the parent entity name. Defining List entities is a little different than the rest.
Defining List Entities
After you follow the above steps to create a List Entity by putting th Entity Type as List, you'll be directed to the details page of the entity you just defined.
You can also import entire lists by using an array of JSON Objects, of the form:
[
{
"canonicalForm": "Hey",
"list": [
"Howdy",
"Hi"
]
},
.
.
.
]
Associating an entity with an intent
Pre-built and list entities already have a set of values defined which can be extracted from all utterences, however, Simple, Hierarchical and Composite utterances need to be trained to pick up values.
This can be done by
intents tab and choose the intent you'd like to add the entity to.My name is John Doe as an utterance.john doe in the above example.Name will be the entity selected in the above example.