Here is 4 questions you should ask yourself while designing your entities
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.
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.
Avoid using only one item per entity
As we have seen some bots have issues with this kind of entites, it is not possible to use single item entities.
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.
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 4 months ago