Slots not getting filled when entity and slots have different names

Hi All,

I am trying to extract slot values. But in my case I have given different name for entity and slots so that’s why it’s not getting extracted I think. How can I achieve this.

Below is my nlu.md file code snippet:

## intent:data_text

- [2](count)

- [23](count)

- [4](count)

- [Pune](place)

- [Mumabi](place)

- [Banglore](place)

My story.md file code snippet:

## happy path
* greet
  - utter_ask_count_value
* data_text{"count":"4"}
  - utter_count_value

## sad path
* mood_unhappy
  - utter_ask_city_name
* data_text{"city":"Pune"}
  - slot{"city":"Pune"}
  - utter_city_name

My domain.yml file code snippet:

intents:
  - greet
  - goodbye
  - affirm
  - deny
  - mood_great
  - mood_unhappy
  - data_text


actions:
- utter_greet
- utter_cheer_up
- utter_did_that_help
- utter_happy
- utter_goodbye
- utter_ask_count_value
- utter_count_value
- utter_ask_city_name
- utter_city_name

entities:
- count
- place

slots:
  count:
    type: text
  city:
    type: text


templates:
  utter_greet:
  - text: "Hey! How are you?"

  utter_cheer_up:
  - text: "Here is something to cheer you up:"
    image: "https://i.imgur.com/nGF1K8f.jpg"

  utter_did_that_help:
  - text: "Did that help you?"

  utter_happy:
  - text: "Great carry on!"

  utter_goodbye:
  - text: "Bye"

  utter_ask_count_value:
  - text: "Provide count value"

  utter_count_value:
  - text: "Count is {count}"

  utter_ask_city_name:
  - text: "Provide city name"

  utter_city_name:
  - text: "City is {city}"

For count value bot is able to extract values but for place it’s not getting extracted.

slot{} method I am trying to use but not working…

1 Like

yes, the slot only gets filled automatically if it has the same name as the entity. If you want to do the same for a different entity name, you can use a custom aciton, or probably the easiest is to use a form.

Okay thanks Alan :blush:.

Hi Alan,

I understood that slots won’t get automatically filled until and unless we don’t give same name. But for slots with different name and entities there is one method slot{} that we can use right for slot setting?

What exactly is the use of slot{} method in stories??