Is there a way to change the default slot value from None to something else?

Hi, I would like to show a zero length string “” whenever a slot value is not set, instead of None. Is it possible?

Yes, you can define an initial value in the domain, for example:

slots:
  myslot:
    counter: '0'
    type: unfeaturized

Just be careful with the text type, the policy just sees a 1 or 0 depending if the slot is set or not.

1 Like

Be careful, when using FormActions. It considers a slot as set, if the value is not None. So the FormActions wont be useable any more, if you set default values to all slots.

To show custom strings in the template messages, look here

1 Like

I tried this and it didn’t work. I got this error while training:

TypeError: __init__() got an unexpected keyword argument 'counter'

I made a mistake while modifying the code for the publication.

slots:
  counter:
    initial_value: '0'
    type: unfeaturized

Thank you. However, my slot remains “None” when starting the form instead of having the initial_value