Uttter message not triggers when slot is null

Hi all!

I have a problem with my stories. I have two dialog ways. First if slot has values second if not. My training examples for this case (I have a lot of it and show 2 for example):

Location absent search 1

  • my_location_search{“loc_search_type”: “benefits”, “loc_search_value”: “my location”}
    • slot{“loc_search_type”: “benefits”}
    • slot{“loc_search_value”: “my location”}
    • slot{“my_location”: null}
    • utter_show_my_location_absent
    • utter_ask_location
  • set_location{“my_location”: “london”}
    • slot{“my_location”: “london”}
    • action_my_location_search`

Location search 1

  • my_location_search{“loc_search_type”: “benefits”, “loc_search_value”: “london”}
    • slot{“loc_search_type”: “benefits”}
    • slot{“loc_search_value”: “my location”}
    • slot{“my_location”: “london”}
    • action_my_location_search `

Bot ignores “Locations absent” and choose “Location search”. Why it happens ?

I have a few questions:

  1. Are you aware that the value you write for your slots in your stories don’t affect the way your stories get trained?
  2. In your first story, what is setting my_location to null? Please read about it here to get a better idea (Stories).
  3. Do you have a slot called my_location at all?
  4. Where is it ignoring “locations absent” and choosing “locations search”?

Hi @msamogh, thanks for your answer!

  1. Mmm, sorry I do not understand what you mean

  2. I only need to check if value in my_location is absent than call utter message, if value is present - do action

  3. Yes, I declare it in my domain.yml. It has categorical type:
    my_location:
    type: categorical values:

    • london
    • minsk
    • krakow
  4. If my_location is null it need to trigger utter_show_my_location_absent, but it runs action_my_location_search

A preliminary question before I get to the actual answer: Do you have a slot named loc_search_value? If so, of what type is it?

I think the answer to point 1 will help you figure this out, so I will answer just that. When you are writing stories, the value you write in your slots don’t matter unless the slot type is categorical and all the values you are writing in your stories belongs to one of the possible values.

To elaborate on what I mean, it doesn’t matter if your slot takes on a value of “london” or “bangkok” as long if your slot value is of type text, because its featurization depends only on whether or not it’s filled, and not on what is inside it. So you cannot use it to act as a branching logic that goes into different paths depending on the slot value.

Hope that is the issue, and that is the answer you were looking for.

1 Like

Oh, I see. My loc_search_value was text. I changed it to categorical and looks like it helped. Thank you so much!