Form stopped working after migrating to 3.0 - rasa-2.x-form-examples

Hello,

I was using rasa-2.x-form-examples as example for forms.

I migrated to rasa 3.0 and it just stopped working!

Hey! How are you?
Your input ->  give names
What is your first name?
Your input ->  Hasan
Your input ->

With rasa 2.8.6 it was just fine.

Any idea what went wrong? I have only changed slots as required:

slots:
  first_name:
    type: text
    mappings:
    - type: from_entity
      entity: entity_name
    influence_conversation: false
  last_name:
    type: text
    mappings:
    - type: from_entity
      entity: entity_name
    influence_conversation: false

Thanks!

I also changed the slot mappings as follow:

slots:
  first_name:
    type: text
    mappings:
    - type: from_text
      intent: None
    influence_conversation: false
  last_name:
    type: text
    mappings:
    - type: from_text
      intent: None
    influence_conversation: false

According to the RASA 3.0 docs:

The from_text mapping will use the text of the last user utterance to fill the slot slot_name . If intent_name is None , the slot will be filled regardless of intent name.

But here is the output of interactive mode:

1    action_listen
────────────────────────────────────────────────────
 2                                       give names
                         intent: request_names 1.00


Current slots:
        first_name: None, last_name: None, requested_slot: None, session_started_metadata: None

------
? The bot wants to run 'name_form', correct? Yes
------
Chat History

 #    Bot                                                       You
───────────────────────────────────────────────────────────────────────────
 1    action_listen
───────────────────────────────────────────────────────────────────────────
 2                                                              give names
                                                intent: request_names 1.00
───────────────────────────────────────────────────────────────────────────
 3    name_form 1.00
      active_loop{"name": "name_form"}
      slot{"requested_slot": "first_name"}
      What is your first name?


Current slots:
        first_name: None, last_name: None, requested_slot: first_name, session_started_metadata: None

------
? The bot wants to run 'action_listen', correct? Yes
? Your input -> Hasan
? Your NLU model classified 'Hasan' with intent 'mood_unhappy' and there are no entities, is this correct? Yes
------
Chat History

 #    Bot                                                       You
───────────────────────────────────────────────────────────────────────────
 1    action_listen
───────────────────────────────────────────────────────────────────────────
 2                                                              give names
                                                intent: request_names 1.00
───────────────────────────────────────────────────────────────────────────
 3    name_form 1.00
      active_loop{"name": "name_form"}
      slot{"requested_slot": "first_name"}
      What is your first name?
      action_listen 1.00
───────────────────────────────────────────────────────────────────────────
 4                                                                   Hasan
                                                 intent: mood_unhappy 0.75


Current slots:
        first_name: None, last_name: None, requested_slot: first_name, session_started_metadata: None

------
? The bot wants to run 'name_form', correct? (Y/n)

As you can see first_name slot is not filled?

Thanks allot!

Hello,

It is getting even more strange!

I have changed the slots mapping (though I think the first version was just following the documentation).

So I changed as follow:

slots:
  first_name:
    type: text
    influence_conversation: false
    mappings:
    - type: from_text
      conditions:
      - active_loop: name_form
      requested_slot: first_name
  last_name:
    type: text
    influence_conversation: false
    mappings:
    - type: from_text
      conditions:
      - active_loop: name_form
      requested_slot: last_name

Now both slots get filled with the same value:

1    action_listen
───────────────────────────────────────────────────────────────────────────
 2                                                              give names
                                                intent: request_names 1.00
───────────────────────────────────────────────────────────────────────────
 3    name_form 1.00
      active_loop{"name": "name_form"}
      slot{"requested_slot": "first_name"}
      What is your first name?


Current slots:
        first_name: None, last_name: None, requested_slot: first_name, session_started_metadata: None

------
? The bot wants to run 'action_listen', correct? Yes
? Your input -> Hasan
? Your NLU model classified 'Hasan' with intent 'mood_unhappy' and there are no entities, is this correct? Yes
------
Chat History

 #    Bot                                                       You
───────────────────────────────────────────────────────────────────────────
 1    action_listen
───────────────────────────────────────────────────────────────────────────
 2                                                              give names
                                                intent: request_names 1.00
───────────────────────────────────────────────────────────────────────────
 3    name_form 1.00
      active_loop{"name": "name_form"}
      slot{"requested_slot": "first_name"}
      What is your first name?
      action_listen 1.00
───────────────────────────────────────────────────────────────────────────
 4                                                                   Hasan
                                                 intent: mood_unhappy 0.75
───────────────────────────────────────────────────────────────────────────
 5    slot{"first_name": "Hasan"}
      slot{"last_name": "Hasan"}


Current slots:
        first_name: Hasan, last_name: Hasan, requested_slot: first_name, session_started_metadata: None

------
? The bot wants to run 'name_form', correct? (Y/n)

Any idea what I am doing wrong?

1 Like

Try modifying this to

      conditions:
      - active_loop: name_form
        requested_slot: last_name # indent an extra level here

Same for first_name.

1 Like

Hello,

Thank you very much. This seems to be working now as expected. I assume that it is a good idea if RASA update the samples, and ideally if there is hint during training that something not good in the coditions.

Thank you very much.

1 Like