Set Slot with button in Rasa 2.x

Hey

I want to set a slot by using a button. For some reason, the slot never be filled. I’m using RASA 2.5.

domain.yml:

slots:
  datenschutzhinweis:
    type: text

  utter_askIfCustomerHappy:
  - text: "Are you happy with the product?"
    buttons:
    - title: "Yes, happy"
      payload: '/affirm{"customer_satisfaction":"yes"}'      
    - title: "No, unhappy"
      payload: '/denny{"customer_satisfaction":"no"}'

  utter_satisfaction:
    - text: "Thanks for your answer. You are {customer_satisfaction}!"

stories.yml

stories:

- story: happy path
  steps:
  - intent: greet
  - action: utter_greet
  - action: utter_askIfCustomerHappy
  - intent: affirm
  - action: utter_satisfaction

If I go the happy path, the response is: *Thanks for your answer. You are None!*

What am I doing wrong?

Hi @Chatbot_Ra ,

At first look, I can see slot customer_satisfaction is missing from domain.yml under slots key. I would recommend adding it and then testing on the command line using rasa shell --debug. If you still run into issues, could you please post the full debug log here?

I would also recommend adding responses key if that’s missing from your domain.yml. So everything would look like this:

slots:
  datenschutzhinweis:
       type: text
  customer_satisfaction:
       type: text

responses:
  utter_askIfCustomerHappy:
....
1 Like

Thank you very much. You spotted it right. However, this was just a simple mistake, when converting my problem into a rasa question. The solution was, that I have to define the steps in the rule-file. Otherwise the slot value is not saved properly. I find it rather confusing to distiguish between rules and stories. I have to get used to it. Did’t know that it can have this impact on slots

Hi, I have similar issue with 2.8.0. Code is too lengthy , can i send it via email. Do let me know your email @anca

@sharifm all comms should be on this forum so that other users can learn from the discussion. You could attach your files or describe your problem and if you’ve tried the solution already specified in this thread?

I got the issue and work around as well. Actually there are couple of issue (1) When you have button w/ title like “abc(some location name)” e.g. “NYSE(USA)” , i observed that in log that title is being parse and extracted as USA and couldn’t even extract the intent & entity from payload data , i don’t know why first of all it is parsing button title when payload is present with both “intent/{{“entity_name”:“value”}} info. i fixed that by removing () i.e. " NYSE USA”

(2) say you add an example for year as “FY-2020” in nlu.yml where entity is year, it does not understand this format, however when we add it as FY 2020 in example, it worked. While training it does provide below warning for FY-2020 example in nlu.yml. Isn’t that overfit user inputs or do we need to change something in config.yml may be policy to use any specific classifier that deals with this situation instead of DIET-Classifier?

c:\users\js\anaconda3\envs\nlu-bot\lib\site-packages\rasa\shared\utils\io.py:97: UserWarning: Misaligned entity annotation in message ‘2020-21’ with intent ‘inform’. Make sure the start and end values of entities ([(0, 4, ‘2020’)]) in the training data match the token boundaries ([(0, 7, ‘2020-21’)]). Common causes:

  1. entities include trailing whitespaces or punctuation
  2. the tokenizer gives an unexpected result, due to languages such as Chinese that don’t use whitespace for word separation More info at Training Data Format c:\users\js\anaconda3\envs\nlu-bot\lib\site-packages\rasa\shared\utils\io.py:97: UserWarning: Misaligned entity annotation in message ‘FY-3030’ with intent ‘inform’. Make sure the start and end values of entities ([(3, 7, ‘3030’)]) in the training data match the token boundaries ([(0, 7, ‘FY-3030’)]). Common causes:
  3. entities include trailing whitespaces or punctuation
  4. the tokenizer gives an unexpected result, due to languages such as Chinese that don’t use whitespace for word separation More info at Training Data Format