Slot value vs. None - impact on Keras Policy

I have a model that has a categorical slot:

  account_type:
    type: categorical
    values:
    - pro
    - basic

Initially, the value is None and sometimes it stays None and sometimes I set it to pro or basic. It is important in predicting dialog behavior. Does it impact Keras Policy’s predictive capability if I keep it like this vs. create another explicit category:

  account_type:
    type: categorical
    values:
    - pro
    - basic
    - noaccount
    initial_value: noaccount

Are those two scenarios the same?

from my understanding, they are different.

based on your example, you have 3 categories [pro, basic, noaccount] :

  • when the slot is not set, the one-hot encoded representation for this would be set to [0, 0, 0].

  • If you have initial_value as noaccount: it would carry a representation of [0, 0, 1]

  • when it gets a different value of slot for example basic it will then set it to [0, 1, 0]

  • when it gets another value of slot for example pro it will then set it to [1, 0, 0]

thus all of the slots can influence predictions in predicting different actions, but that also completely depends on how you write your stories.

Thanks @kavan. In my scenario, noaccount is the same as uninitialized/None. So in the case where there are just two categorical values (pro, basic), I think it would look like:

uninitialized (slot=None): [0, 0] pro: [1, 0] basic: [0,1]

Which seems pretty much the same as the 3 value version (let’s say ‘uninitialized’ was a category value)? uninitialized: [0, 0, 1] pro: [1, 0, 0] basic: [0, 1, 0]

Keras will treat them differently in that the featurization will only see if the slot was set or not; if you need to handle noaccount differently, I’d suggest keeping those categories as in your example, as I don’t know a good way of checking if the value is not set in a story; however checking for a given value is pretty well-defined.

i.e. I’m not sure a story like this would work:

## possibly problematic story
* greet
 - action_fetch_profile
 - slot{"account_type": "None"}
 - utter_some_noaccount_response

However, something like this would work (see here for more details):

## more well-defined behavior, since the slot takes on a value, just a null-y value you decide on
* greet
 - action_fetch_profile
 - slot{"account_type": "noaccount"}
 - utter_some_noaccount_response

It’s worth a try though, I’m curious to see if above would work.