Entities

Last Updated: 25.10.2019

Overview

Entities represent concepts that are often specific to a domain as a way of mapping natural language phrases to canonical phrases that capture their meaning. For example, for a skill that creates an incident in the Jira Service Desk, you might want an entity for Incident Statuses, and for a weather skill, you might want an entity for cities.

You can often have many ways to say the same thing. For this reason, each entity has a list of entries, where each entry contains a mapping between a group of synonyms and a reference value. For example, an incident status entity could have an entry with a reference value of “High” with synonyms of “Critical” and “Urgent”.

There are two types of entities available:

  • System entities, which cover common concepts, such as numbers and dates;

  • Developer-defined entities, which allow you to create your own entities for your domain;

When referring to an entity, prefix it with an entity., for example entity.incident_status.

How to use entities

Recognizing entities in the user's input helps you to detect more useful, targeted responses by entering into the right dialog node. For example, you might have an intent.create_incident intent. When a user makes a request that triggers the intent.create_incident intent, the assistant's response should reflect an understanding of status for the incident. You can add an entity.incident_status entity, and then use it to extract information from the user input about the status of the incident that should be used during the creation of a new incident.

How it works

Custom entities. At run time, your assistant recognizes terms in the user input that exactly match the values or synonyms that you defined for the entity as mentions of that entity.

For example, you have created the entity entity.incident-status with value High and synonyms Urgent and Critical, then if the user will write something like this "Create incident with status urgent" the system will analyze the text and determine the entity with the highest confidence. We have two skills: "Create new Incident" and "Get Weather". In this scenario, the skill "Create a new Incident" has condition entity.incident-status, that is why after the text analysis Hala will execute the skill "Create a new Incident" and not "Get Weather."

System entities. System entities that are prebuilt for you by Hala. They cover commonly used categories, such as numbers, dates, and times. They are available by default.

For example, in one of the skills, you have used the system entity entity.sys-date. If the user writes something like this, "I am going on a business trip tomorrow," the system will analyze the text and determine the entity with the highest confidence - entity.sys-date. We have two skills: "Book a trip" and "Get Weather." In this scenario, the skill "Book a trip" has a condition: entity.sys-date. That is why after the text analysis Hala will execute the skill "Book a trip" and not "Get Weather."

System entities

Hala has a number of pre-defined / system entities that describe common concepts, such as numbers, dates, etc.

The system entities have next prefix entity.sys-, you can not use this prefix to create custom entities.

Name

Description

Examples

entity.sys-person

The intent.sys-person extracts names from the user's input.

Andrew, Peter, Nikita

entity.sys-number

Extracts numbers mentioned from user examples as digits or written as numbers.

49, forty nine

entity.sys-percentage

Extracts amounts from user examples including the number and the % sign

25%, 5 percent

entity.sys-currency

Extracts currency values from user examples including the amount and the unit

30$, 20 cents

entity.sys-date

Extracts date mentions

Friday, today, 1st of November

entity.sys-time

Extracts time mentions

at 11, 12:30, from 7 pm

entity.sys-location

Extracts locations

Tallinn, Riga, Estonia

Adding entities

  • Go to the Section Entities on the Hala Platform and press New Entity

  • Change the default name of the entity and provide the values and synonyms

Train the entities

When you will add the values you would need to save the changes and then train Hala with your entities.

  • Click Save

  • Click Train Model

Modify the entities

  • Select the entity.

  • Select the values and change it.

  • Modify or delete the synonyms.

Delete the entities

  • Select the entity.

  • Click the delete icon.

  • Confirm the deletion.