Smartly.AI

Designing Entities

Here is 4 questions you should ask yourself while designing your entities

1) Am I reinventing the wheel?

We already provide system entities for numbers, time, date, prices ect.
Check them out (and use them) before reinventing the wheel.

📘

Don't use numbers in your items

Using numbers in your entity may result in conflicts between the official system entity and your own custom entity. If you absolutely need to use numbers, you can use a combination of custom and system entity in your intents.

2) Do I have enough items in my entity?

As the entity extraction engine is also using a neural network, you should make sure to provide it enough data to perform.

📘

5 items per entity

We recommend you to use at least 5 unique items per entity.
On top of that figure, synonyms are a bonus.

3) Is the length of my items ok?

An entity is something you want to capture, so relative to the rest of the phrase it should not be dominant.

📘

5 words per item

In our experience, you may want to keep your entities and synonyms shorter than 5 words to avoid the model to diverge and over capture.

4) Am I leveraging enough synonyms?

For each reference value of your entity, consider synonyms, they will improve the accurcy of the entity extraction as well as the natural language feeling of your conversation.

Here's an example.

movies:
  Star Wars:
    - Darth Vader
    - Dark Vador
    - Anakin
    - Luke
    - Skywalker
    - Guerre des Etoiles
  Star Trek:
    - Spoke
    - Jean-Luc Picard
    - Wesley
    - Entreprise

With the above "movies" entity:

  • if the user inputs either "Star Wars", "Darth Vader" or "Guerre des Etoiles" then "Star Wars" will be returned
  • if the user inputs either "Star Trek", "Spoke" or "Entreprise" then "Star Trek" is returned.

Updated 11 months ago

Designing Entities


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.