Hi everyone,
Recently we have a problem with our formactions. This problem seems to appear in all forms and we have tried it out on the “good mood” bot of the build-in rasa example. We added a small form here and the problem appears as well.
Problem description: Form execution rejected if slot is not extracted. (TED policy takes over)
Assumed behavior: Form repeats asking for slot.
Used Files: Domain.yml
version: "2.0"
intents:
- greet
- goodbye
- affirm
- deny
- mood_great
- mood_unhappy
- bot_challenge
entities:
- name
- weekday
slots:
name:
type: text
influence_conversation: true
weekday:
type: text
influence_conversation: true
responses:
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_iamabot:
- text: "I am a bot, powered by Rasa."
utter_ask_test_form_name:
- text: Whats your name?
utter_ask_weekday:
- text: Which weekday is it?
forms:
test_form:
required_slots:
name:
- type: from_text
weekday:
- type: from_entity
entity: weekday
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: true
Stories.yml
version: "2.0"
stories:
- story: happy path
steps:
- intent: greet
- action: utter_greet
- intent: mood_great
- action: test_form
- active_loop: test_form
- active_loop: null
- action: utter_happy
- story: sad path 1
steps:
- intent: greet
- action: utter_greet
- intent: mood_unhappy
- action: utter_cheer_up
- action: utter_did_that_help
- intent: affirm
- action: utter_happy
- story: sad path 2
steps:
- intent: greet
- action: utter_greet
- intent: mood_unhappy
- action: utter_cheer_up
- action: utter_did_that_help
- intent: deny
- action: utter_goodbye
Rules.yml
version: "2.0"
rules:
- rule: Say goodbye anytime the user says goodbye
steps:
- intent: goodbye
- action: utter_goodbye
- rule: Say 'I am a bot' anytime the user challenges
steps:
- intent: bot_challenge
- action: utter_iamabot
- rule: Activate form
steps:
- intent: mood_great
- action: test_form
- active_loop: test_form
- rule: Submit form
condition:
# Condition that form is active.
- active_loop: test_form
steps:
# Form is deactivated
- action: test_form
- active_loop: null
- slot_was_set:
- requested_slot: null
# The actions we want to run when the form is submitted.
- action: utter_happy
nlu.yml
version: "2.0"
nlu:
- intent: greet
examples: |
- hey
- hello
- hi
- hello there
- good morning
- good evening
- moin
- hey there
- let's go
- hey dude
- goodmorning
- goodevening
- good afternoon
- intent: goodbye
examples: |
- good afternoon
- cu
- good by
- cee you later
- good night
- bye
- goodbye
- have a nice day
- see you around
- bye bye
- see you later
- intent: affirm
examples: |
- yes
- y
- indeed
- of course
- that sounds good
- correct
- intent: deny
examples: |
- no
- n
- never
- I don't think so
- don't like that
- no way
- not really
- intent: mood_great
examples: |
- perfect
- great
- amazing
- feeling like a king
- wonderful
- I am feeling very good
- I am great
- I am amazing
- I am going to save the world
- super stoked
- extremely good
- so so perfect
- so good
- so perfect
- at [Saturday](weekday)
- at [Monday](weekday)
- at [Friday](weekday)
- at [Sunday](weekday)
- at [Tuesday](weekday)
- at [Wednesday](weekday)
- at [Thursday](weekday)
- intent: mood_unhappy
examples: |
- my day was horrible
- I am sad
- I don't feel very well
- I am disappointed
- super sad
- I'm so sad
- sad
- very sad
- unhappy
- not good
- not very good
- extremly sad
- so saad
- so sad
- intent: bot_challenge
examples: |
- are you a bot?
- are you a human?
- am I talking to a bot?
- am I talking to a human?
config.yml/credential.yml/endpoints.yml stay default
Output: If the entities are given correctly in the dialog, everything goes fine (formaction gets activated, rulepolicy gets us through the form and the form gets deactivated correctly)
If the entities are missing in the user input (for example saying hello instead of giving the weekday) the following output is generated:
Which weekday is it?
Your input -> hello
rasa.core.processor - Received user message 'hello' with intent '{'id': 286870438279032377, 'name': 'greet', 'confidence': 0.9999989867210388}' and entities '[]'
rasa.core.policies.rule_policy - There is no applicable rule.
rasa.core.policies.rule_policy - Predicted loop 'test_form'.
rasa.core.policies.ensemble - Made prediction using user intent.
rasa.core.policies.ensemble - Added `DefinePrevUserUtteredFeaturization(False)` event.
rasa.core.policies.ensemble - Predicted next action using policy_2_RulePolicy.
rasa.core.processor - Predicted next action 'test_form' with confidence 1.00.
rasa.core.actions.forms - Validating user input 'UserUttered(text: hello, intent: greet, use_text_for_featurization: False)'.
rasa.core.actions.forms - Trying to extract requested slot 'weekday' ...
rasa.core.actions.forms - Got mapping '{'type': 'from_entity', 'entity': 'weekday'}'
rasa.core.actions.forms - Failed to extract requested slot 'weekday'
rasa.core.actions.forms - Validating extracted slots: {}
rasa.core.policies.rule_policy - There is no applicable rule.
rasa.core.policies.ensemble - Execution of 'test_form' was rejected. Setting its confidence to 0.0 in all predictions.
rasa.core.policies.ensemble - Made prediction using user intent.
rasa.core.policies.ensemble - Added `DefinePrevUserUtteredFeaturization(False)` event.
rasa.core.policies.ensemble - Predicted next action using policy_1_TEDPolicy.
rasa.core.processor - Predicted next action 'utter_greet' with confidence 0.98.
Most likely there is a misunderstanding on our side but shouldn’t this input lead to repeated question “Which weekday is it?”
Thank you in advance! Your help is appreciated