Forms does not fill list slot

ohhh, i think it’s wrong. thanks for being patient with me. ill change and get back again, if it works without any problem i will close this. thanks @nik202 you’re such a life saver!

@nik202, nope that did not help. I am having a conversation on rasa x and this is the story generated:

 steps:
  - intent: user_details
    entities:
    - cc_num: 34567
  - action: user_form
  - active_loop: user_form
  - slot_was_set:
    - cc_num:
      - 34567
  - intent: inform
    entities:
    - cc_type: individual
  - action: user_form
  - active_loop: null
  - slot_was_set:
    - cc_num:
      - ''
  - action: action_user_details

this is a story that rasa x has generated after i have changed the slot_was_set for cc_num (listslot) in manual story, deleted previous models and trained again and run rasa x post this.

@lis please read the documentation again and syntax :slight_smile:

1 Like

Yes @nik202, I have made the changes in my stories.yml file. Yet, when I check story generated in rasa x that is how it is getting generated. Like you mentioned, I made those changes, deleted the previous models, yet rasa x generated stories had different lines for a list slot. Let go of this, it skips filling the list slot still. Could you please let me know if you’ve seen this before, if so, how should I resolve this? Thanks :smile:

@lis I’d recommend first run on rasa open source and check it’s working or not, run and get back to me, then we will sort the rasa x issue.

@nik202, I have tried seeing this in ros as well. Still the same status. I’m running rasa interactive to have the conversation also.

- story: interactive_story_1

  steps:

  - intent: user_details

    entities:

    - cc_num: 34567

  - action: user_form

  - active_loop: user_form

  - slot_was_set:

    - cc_num:

      - 34567

  - slot_was_set:

    - requested_slot: cc_type

  - slot_was_set:

    - cc_num: []

  - slot_was_set:

    - cc_type: individual

  - slot_was_set:

    - requested_slot: null

  - active_loop: null

  - action: action_user_details

This is the story that is exported out of rasa interactive. If you see here as well, it runs a slot_was_set and sets the cc_num to null although this is not in my story path. This is exactly what I was describing previously as well. I don’t understand why this is happening. I don’t know why after requesting for one slot (cc_type) it goes and adjusts another slot (cc_num).

@Juste, anything that can be done here?

Sorry, I don’t mean to tag everyone here. I’m only trying to understand this and thus maybe @stephens could add to this also? Or anyone who has worked on this could add also?

Based on what I see in this thread.

I have a slot that is of type list. And this slot is required slot for a form. What I’m seeing is that forms does not request for list slot as empty list is still a list.

You say this but down below it’s clear that it’s not requesting the slot because the slot was filled before you enter the form by the cc_num entity.

Can you get user details for 23456? … Entities are extracted properly.

I’m confused about why you want to the slot filled by the entity but then don’t like that it is filled by then entity and not prompted for in the form? This is how Rasa is supposed to work.

Also, the influence_conversation should be false for your slots not true

Sorry @stephens, I was basically describing two flows.

My problem is:

User: Can you get user details for 23456, 34567, 4567? 
//form activation 
Bot: What kind of a user?  //sees that cc_num is filled so proceeds to ask for cc_type. so here the cc_num slot is 
                                          // actually filled. 
User: individual //sets the cc_type slot to individual and cc_num to [] after this step.

Thanks for the explanation. That makes sense.

I don’t think you’ll reliably get Rasa entity extraction to extract the list of numbers.

I would try duckling’s number extraction and would create a custom extract and possibly a validate action for the list field. The extract could parse the duckling structure that is returned.

I also recommend upgrading to 3.1.

Thank you very much @stephens. I’ll try this out! Will have to check if things break while upgrading. But sure, point noted :smile:

@stephens one other question:

my cc_num would still be a list slot right?

What I observed before:

  • cc_num is list type slot and
  • cc_type is text type slot.

I have two validate methods as a part of FormValidationAction for cc_num as well as cc_type. From the example conversation I showed in the previous comment, I can see that it runs validate_cc_num once the form is activated, and validate_cc_type as well as validate_cc_num after the user enters “individual”. So it sees that the user has not entered any value for the cc_num slot in the recent message that is “individual” it makes it into a empty list. Ideally form should have requested for cc_num as it is empty. But empty list is still a list, so form exists even without asking the cc_num again.

What I observe now:

Now, after your suggestion, I tried using duckling to extract numbers and used a custom extract to extract entity values from DucklingEntityClassifier and set slot value cc_num to the values extracted. I’m also checking if length of the entities extracted is not 0 before setting slot, if it is 0, I’m setting it to tracker.get_slot(“cc_num”). Now, the form still behaves like how I have explained in the previous comment. Any idea what is going wrong?

The slot type doesn’t matter since you’re not using it as a featurized slot. I would use custom.

Duckling doesn’t use any of the slot info. You can read about duckling use in Rasa here. You’ll want the number dimension to tell it to extract numbers. You’ll also rename cc_num to number as the docs show.

@stephens,

Thank you! I just checked that the number dimension in duckling is only for numbers and for alphanumeric (Ref: Duckling) cc_num is alphanumeric so I’m going back to using regex in rasa. My mistake that I did not tell this before, sorry!.

I’m able to get list of alphanumeric numbers under cc_num using regex this way. I’m not sure how reliable this can be, but for now, this works for any number of numbers given. I tried setting set_entities_as_slots config field to false and using the extract method in FormValidationAction to extract entities and set them to slots by myself. However, this still doesn’t resolve my problem. Would be very helpful if you could show me a small example of how to do this. Thanks in advance.

@nik202 still not able to resolve this. Kindly help me with this

@nik202 I checked this and it looks like it’s the yaml syntax for a list. So I think what I’m doing is right for slot_was_set for cc_num

@lis we can schedule the call if you would like to discuss it? Do let me know, please.

@nik202, can you send a dm please? I’m not able to find that option in your profile.

@lis there is no option of DM right now. When you online just tag me and then share me the email id.