Slot Types¶
Text Slot¶
-
text
¶
Use For: User preferences where you only care whether or not they’ve been specified.
Example: slots: cuisine: type: text
Description: rasa_core.slots.Slot
Results in the feature of the slot being set to1
if any value is set. Otherwise the feature will be set to0
(no value is set).
Boolean Slot¶
-
bool
¶
Use For: True or False
Example: slots: is_authenticated: type: bool
Description: Checks if slot is set and if True
Categorical Slot¶
-
categorical
¶
Use For: Slots which can take one of N values
Example: slots: risk_level: type: categorical values: - low - medium - high
Description: Creates a one-hot encoding describing which of the
values
matched.
Float Slot¶
-
float
¶
Use For: Continuous values
Example: slots: temperature: type: float min_value: -100.0 max_value: 100.0
Defaults: max_value=1.0
,min_value=0.0
Description: All values below
min_value
will be treated asmin_value
, the same happens for values abovemax_value
. Hence, ifmax_value
is set to1
, there is no difference between the slot values2
and3.5
in terms of featurization (e.g. both values will influence the dialogue in the same way and the model can not learn to differentiate between them).
List Slot¶
-
list
¶
Use For: Lists of values
Example: slots: shopping_items: type: list
Description: The feature of this slot is set to
1
if a value with a list is set, where the list is not empty. If no value is set, or the empty list is the set value, the feature will be0
. The length of the list stored in the slot does not influence the dialogue.
Unfeaturized Slot¶
-
unfeaturized
¶
Use For: Data you want to store which shouldn’t influence the dialogue flow
Example: slots: internal_user_id: type: unfeaturized
Description: There will not be any featurization of this slot, hence its value does not influence the dialogue flow and is ignored when predicting the next action the bot should run.
The Slot base class¶
Have questions or feedback?¶
We have a very active support community on Rasa Community Forum that is happy to help you with your questions. If you have any feedback for us or a specific suggestion for improving the docs, feel free to share it by creating an issue on Rasa Core GitHub repository.