Adding Entities

Updated 4 months ago by Matthew Clementson

Entities

Entities represent a logical group of things (pizza toppings, days of a week, type of dogs, etc) that you want the bot to detect during a conversation. This can be an important task especially if you are trying to build some custom logic that relies on getting access to this type of data.

For example, when you order a pizza, you can pick your topping from a number of different types: mushrooms, pepperoni, cheese etc. Mushrooms, pepperoni and cheese are part of a common set, or common entity you can call 'Toppings'. Entities are used in Hu:toma so you can instruct the bot to detect specific attributes from a conversation and pass those value to you at one point (this is done through an intent which will be explained later). In the case of pizza example, it means that at one point you will be able to know the type of pizza the user wants and can write some code that issues the actual order to a backend.

Custom Entities

Custom entities are entities you can build. Lets try, for example, to build a pizza 'Topping' entity:

  • Create a new bot as described in the Creating a bot section.
  • Once you reach the training UI, you should see an 'entities' menu on the left side of your console
Extended_bot

Click that link and you will see a form where to create your 'topping' entity. Give your entity a name and click the 'Create Entity' button

Extended_bot
  • Now enter the type of toppings you want to add to the entity in the textbox below the "Value" section. Once you are done click the Save button
Extended_bot

Your entity is now completed. In the Intent section, we will explain how you can use it

System Entities

System entities are like a custom entity you build, but supported out of the box so you don’t have to waste time building it yourself. The system entities supported right now are

  • @sys.places: this include places, town, cities etc.
  • @sys.person: famous people
  • @sys.group: organization or known group
  • @sys.date: matches a date.
  • @sys.time: matched time
  • @sys.percent: percentage
  • @sys.number: cardinal numbers such as ten, two.
  • @sys.ordinal: ordinal numbers such as 1, 2 etc.
  • @sys.any: matches any non-empty input

Both system and custom entities on its own are not very useful. But when added to an intent they make your life way easier when you need to custom build business logic. Go ahead now and read about Intents in this section


How did we do?