Rasa 3.0 filling slots with forms using "from_text" - no entities

I am trying to replicate filling a form with “first_name” and “last_name” similar to the rasa2.0 version of https://github.com/RasaHQ/rasa-2.x-form-examples/tree/main/03-simple-form.

I cannot use an entity because differentiating between first_name and last_name is difficult.

When I try to run the bot in interactive mode I can trigger the form, but I cannot provide the user input for the first and last name, because the names are getting interpreted as intents.

Chat History

 #    Bot                                                       You       
───────────────────────────────────────────────────────────────────────────
 1    action_listen
───────────────────────────────────────────────────────────────────────────
 2                                                            give my name
                                                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 -> Miko
? Your NLU model classified 'Miko' with intent 'deny' and there are no entities, is this correct? No    
? What intent is it? (Use arrow keys)

domain.yml:

slots:
  first_name:
    type: text
    influence_conversation: true
    mappings:
    - type: from_text
      intent: request_names
      conditions:
      - active_loop: name_form
        requested_slot: first_name
  last_name:
    type: text
    influence_conversation: true
    mappings:
    - type: from_text
      intent: request_names
      conditions:
      - active_loop: name_form
        requested_slot: last_name

forms:
  name_form:
    required_slots:
    - first_name
    - last_name

rules.yml

- rule: Activate form
  steps:
  - intent: request_names
  - action: name_form
  - active_loop: name_form

- rule: Submit form
  condition: 
  - active_loop: name_form
  steps:
  - action: name_form
  - active_loop: null
  - slot_was_set: 
    - requested_slots: null
  - action: utter_submit
  - action: utter_slot_values

Any ideas on what is missing, so that the names get picked up? Do I need an “inform” intent?

Thanks for your help

from_text will still try to map the input to an intent, but the slot should be filled anyway

Unfortunately no slots are filled. See the example dialogue in rasa interactive below:

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

 #    Bot                                                       You        
───────────────────────────────────────────────────────────────────────────
 1    action_listen
───────────────────────────────────────────────────────────────────────────
 2                                                  i want to give my name
                                                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                                                                  Mickey
                                                       intent: affirm 0.66


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

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

 #    Bot                                                       You        
───────────────────────────────────────────────────────────────────────────
 1    action_listen
───────────────────────────────────────────────────────────────────────────
 2                                                  i want to give my name
                                                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                                                                  Mickey
                                                       intent: affirm 0.66
───────────────────────────────────────────────────────────────────────────
 5    utter_happy 0.32
      Great, carry on!


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 -> Mike
? Your NLU model classified 'Mike' with intent 'deny' and there are no entities, is this correct? Yes   
------
Chat History

 #    Bot                                                       You        
───────────────────────────────────────────────────────────────────────────
 1    action_listen
───────────────────────────────────────────────────────────────────────────
 2                                                  i want to give my name
                                                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                                                                  Mickey
                                                       intent: affirm 0.66
───────────────────────────────────────────────────────────────────────────
 5    utter_happy 0.32
      Great, carry on!
      action_listen 0.99
───────────────────────────────────────────────────────────────────────────
 6                                                                    Mike
                                                         intent: deny 0.75


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

------
? The bot wants to run 'action_unlikely_intent' to indicate that the last user message was unexpected a 
t this point in the conversation. Check out UnexpecTEDIntentPolicy (https://rasa.com/docs/rasa/policies 
#unexpected-intent-policy) to learn more. Is that correct? (Y/n)

Here is also my config.yml:

# The config recipe.
# https://rasa.com/docs/rasa/model-configuration/
recipe: default.v1

# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: en

pipeline:
# # No configuration for the NLU pipeline was provided. The following default pipeline was used to train your model.
# # If you'd like to customize it, uncomment and adjust the pipeline.
# # See https://rasa.com/docs/rasa/tuning-your-model for more information.
  - name: WhitespaceTokenizer
  - name: RegexFeaturizer
  - name: LexicalSyntacticFeaturizer
  - name: CountVectorsFeaturizer
    analyzer: char_wb
    min_ngram: 1
    max_ngram: 4
  - name: DIETClassifier
    epochs: 100
    constrain_similarities: true
  - name: EntitySynonymMapper
  - name: ResponseSelector
    epochs: 100
    constrain_similarities: true
  - name: FallbackClassifier
    threshold: 0.3
    ambiguity_threshold: 0.1



# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
# # No configuration for policies was provided. The following default policies were used to train your model.
# # If you'd like to customize them, uncomment and adjust the policies.
# # See https://rasa.com/docs/rasa/policies for more information.
  - name: MemoizationPolicy
  - name: RulePolicy
  - name: UnexpecTEDIntentPolicy
    max_history: 5
    epochs: 100
  - name: TEDPolicy
    max_history: 5
    epochs: 100
    constrain_similarities: true
 
```
Rasa version:
```
Rasa Version      :         3.0.9
Minimum Compatible Version: 3.0.0
Rasa SDK Version  :         3.0.6
Rasa X Version    :         None
Python Version    :         3.8.5
Operating System  :         Windows-10-10.0.19041-SP0
Python Path       :         D:\Anaconda\python.exe
(rasa3_n) 
```
```
Thanks for any useful hints.

Based on the info above, you should try spacy. See this blog post on entity recognition.

Without spacy, you would need lots of example utterances showing the entity extraction.

@stephens Thanks for your input. According to the title of this thread I want to do slot filling without entities because machine learning for distinguishing first and last names will be a big topic.

I am currently trying to find out, how Rasa 3.0 can just pick up the provided answers once the system has decided that we want to fill slots with information “from_text”. Unfortunately the “active loop” does not start to fill the slots.

I am still stuck on this issue, without any changes. I reinstalled rasa several times but this did not solve the issue. The active_loop starts, the question for the first slot is uttered, but nothing is filled into the slots. I would appreciate if anyone has references / tutorials for a simple rasa 3.x bot that is just filling a simple form with “from_text”.

Hi @newinmunich,

my files look exactly like yours and I have the same problem. I tried a lot and can’t resolve it by myself. Hope someone can help :frowning:

I have finally found the solution. It is in this official RASA tutorial that is unfortunately not linked in the RASA 3 playlist.

“Slots filled by Text | Rasa Tutorial” Slots filled by Text | Rasa Tutorial

@botsi155 This has worked for me.