Entity in template displays [none] when the slot value is empty

In the utter action template, we can compose the response message with the collected entity value concatnated. However sometimes the entity value is empty. Instead of displaying a ‘none’ to user, can it be replaced with blank? How can it be configured this dynamically? Thanks,

Maybe you can create two different story, one displaying the template when the slot is set, and one displaying an another message when the slot isn’t.

A second solution would be to use a custom action where you can do a if/else

Thank you @huberrom! I am trying out the custom action route. I am more curious on the first approach because it is used in more occasions. When I create two different story, in this case two stories with the same user intent, the model get confused in predicting which story it belongs and next action. How to get around that? The 2nd question is how to specify the slot condition in story?

The stories shouldn’t be confused unless your slot is unfeaturized. I don’t know how your story looks like, but it should look like this :

# story1
...
* inform{"people": "3"}
- action_book_table
...
# story2
* inform{"people": "9"}
- action_explain_table_limit

In this example, taken from the doc (Using Slots) the next action will be “action_book_table” if the user say that they are going to be 3, and “action_explain_table_limit” if he says they are 9. In the same way, you can do something like this :

# story1
...
* inform{"people": "3"}
- action_book_table
...
# story2
* inform
- action_no_information

In the first story, the bot has the information about the number of people, and in the second it doesn’t, so the next action will be different. For a slot to impact your story, it needs to not be unfeaturized :

slots:
  name:
    type: float

You can find the list of slot types here : Slot Types

1 Like

thank you @huberrom. Onto the types of slot value, is unfeaturized for values that does not have custom coding or something else? I would like to understand why we have another type in addition to the standard python data types.

Unfeaturized is just for values that do not affect the story.

Usually you can do a kind of if/else in your story (if (story 1) people is 3 then action_book_table, else (story2) …), but if your slot is unfeaturized, the story won’t change depending on this slot.

I do not know if it’s clear but it’s the main idea