What is the conceptual relation between Entities and Slots?

Hi @kralikX, welcome to the forum!

Maybe it will help if I give a quick explantation of entities and slots.

Entities are any values that can be extracted from a user message. For example in the message: “I am Joe”, “Joe” could be the value of an entity called “name”. Or in the message: “I am happy” - “happy” could be the value of an entity called “mood”. (See: Domain)

Entities are extracted via NLU components e.g. SpacyFeaturizer, DIETClassifier or RegexEntityExtractor. (See: Components)

Extracted entities are saved on the conversation tracker and can influence the future direction of the conversation. (See: Stories)

Entity roles and groups allow for more complex splitting or grouping of similar or related entities. For example a the same entity, e.g. City, can have different roles in a sentence, e.g. departure or destination, however they are still conceptually the same entity. (See: NLU Training Data)

Slots are a separate but related concept. Slots represent data we want to store and then use again later. Slots can be filled information provided by the user but also from things like API or database calls. (See: Domain)

The setting of slot values is also stored in the tracker and can influence the future direction of the conversation. (See: Stories)

A slot can be filled using a custom action (See: Custom Actions) which can use arbitrary programming code and calculate the slot value any way it pleases.

A slot can also be filled following entity extraction. One way is slot auto-fill (See: Domain) where if an entity and slot have the same name the slot will be automatically filled when the entity is extracted.

Another way is though the use of forms (See: Forms). Forms are a collection of slots that you can fill from extracted entities from within a conversational “loop”. When the form loop is active extracted entities will be put into the slots that reference them.

I hope this makes the relationship between entities and slots clearer. Let me know if anything is still unclear or you have any other questions.

8 Likes