Rasa will not save slot from entity of intent

Hi All, new to the rasa framework. I’ve been trying to make a simple bot that would simply recognize the intent of me providing my name and then rasa responding with a phrase including my name. The problem is that it does seem to recognize the intent but if the name I give it is not included in one of the examples then the response just includes none instead of my name (meaning the slot is empty). I thought its because of the lack of examples but I added more than 20. It would only fill that slot if the name provided was one of the names provided in the examples.

Furthermore, I can’t seem to use rules. I was under the assumption that on a technical level I can just use rules for one-off questions such as providing the name and the bot responding hello, name. I can only get responses if it was a story.

rules.yml:


# ask name confirmation
- rule: ask name confirmation
  steps:
  - intent: inform_name
  - action: utter_greet_with_name

# respond with name
- rule: respond with name
  steps:
  - action: utter_respond_with_name

# respond without name
- rule: respond without name
  condition:
  - slot_was_set:
      - name: null
  steps:
  - action: utter_respond_without_name

nlu.yml:

- intent: inform_name
  examples: |
    - I'm [Sarah](name).
    - Hi, my name is [Chris](name).
    - You can call me [Alex](name).

stories.yml:

stories:

- story: path 1
  steps:
  - intent: greet
  - action: utter_greet
  - intent: inform_name
  - action: utter_greet_with_name
  - intent: ask_name
  - action: utter_respond_with_name

- story: path 2
  steps:
  - intent: greet
  - action: utter_greet
  - intent: ask_name
  - action: utter_respond_without_name

part of domain.yml

entities:
  - name

# Define the 'name' slot with the 'from_text' mapping
slots:
  name:
    type: text
    influence_conversation: true
    mappings:
      - type: from_entity
        entity: name

Thank you!

Screen Shot 2023-03-01 at 5.27.06 PM

Hi there,

the issue you’re having is that the NLU is not able to correctly pick up the name entity from the provided text. It is able to correctly classify that input text falls into inform_name intent but it is not able to pick it up.

Here you have a few possible routes to take. You can add more name examples inside of the inform_name intent or you could add a regex featurizer (Components) in combination with a name lookup table (NLU Training Data). The Regex featurizer + lookup table approach requires fewer examples in the intent itself.

Try it for yourself and see what works better for your use case.

Regards, Nikola