Hi there,
Since I added some more retrieval intents and conditional responses, my bot crashes while action_listen
and the webchat window closes. I tried to change the policies, but I couldn’t fix it on my own. Can someone help, please?
I am using
Rasa Version : 2.8.1
Minimum Compatible Version: 2.8.0
Rasa SDK Version : 2.8.1
Rasa X Version : 0.39.3
Python Version : 3.8.0
The retrevial intents the create the problems are lexicon/xxx
. For them I have a rule:
- rule: Lexicon
steps:
- intent: lexicon
- action: utter_lexicon
- action: utter_lexicon/link_to_website
- action: utter_lexicon/back_to_happy_path
as well as stories:
#### LEXICON ####
- story: looking up a word
steps:
- intent: lexicon
- action: utter_lexicon
- action: utter_lexicon/link_to_website
- action: utter_lexicon/back_to_happy_path
#### BACK TO HAPPY PATH ####
- story: back to the happy path with own question
steps:
- action: utter_lexicon/back_to_happy_path
- intent: affirm
- action: utter_go_for_it
- story: lexicon_interactive_story_01
steps:
- intent: start
- action: utter_greet
- action: utter_inform_lovis
- action: utter_browse_or_ask
- intent: affirm
- action: utter_framing
- action: utter_lets_get_started
- intent: lexicon
- action: utter_lexicon
- action: utter_lexicon/link_to_website
- action: utter_lexicon/back_to_happy_path
- intent: deny
- action: utter_ok
- action: utter_come_back
- intent: thank+goodbye
- action: utter_thank_goodbye
- action: utter_ask_feedback
What happens is, that when the user askes a question recognized as intent: lexicon/xxx
the bot answers correctly with:
utter_lexicon
utter_lexicon/link_to_website
but then, instead of answering utter_lexicon/back_to_happy_path
it simply crashes. The error message I get is the following:
2022-05-18 09:04:51 DEBUG rasa.core.policies.memoization - Current tracker state:
[state 0] user intent: affirm | previous action name: utter_framing
[state 1] user intent: affirm | previous action name: utter_lets_get_started
[state 2] user intent: lexicon | previous action name: action_listen
[state 3] user intent: lexicon | previous action name: utter_lexicon
[state 4] user intent: lexicon | previous action name: utter_lexicon/link_to_website
2022-05-18 09:04:51 DEBUG rasa.core.policies.memoization - There is a memorised next action 'utter_lexicon/back_to_happy_path'
2022-05-18 09:04:51 DEBUG rasa.core.policies.rule_policy - Current tracker state:
[state 1] user intent: start | previous action name: action_listen
[state 2] user intent: start | previous action name: utter_greet
[state 3] user intent: start | previous action name: utter_inform_lovis
[state 4] user intent: start | previous action name: utter_browse_or_ask
[state 5] user intent: affirm | previous action name: action_listen
[state 6] user intent: affirm | previous action name: utter_framing
[state 7] user intent: affirm | previous action name: utter_lets_get_started
[state 8] user intent: lexicon | previous action name: action_listen
[state 9] user intent: lexicon | previous action name: utter_lexicon
[state 10] user intent: lexicon | previous action name: utter_lexicon/link_to_website
2022-05-18 09:04:51 DEBUG rasa.core.policies.rule_policy - There is a rule for the next action 'utter_lexicon/back_to_happy_path'.
2022-05-18 09:04:51 DEBUG rasa.core.policies.unexpected_intent_policy - Skipping predictions for UnexpecTEDIntentPolicy as either there is no event of type `UserUttered` or there is an event of type `ActionExecuted` after the last `UserUttered`.
2022-05-18 09:04:51 DEBUG rasa.core.policies.ted_policy - TED predicted 'utter_lexicon/back_to_happy_path' based on user intent.
2022-05-18 09:04:51 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_1_RulePolicy.
2022-05-18 09:04:51 DEBUG rasa.core.processor - Predicted next action 'utter_lexicon/back_to_happy_path' with confidence 1.00.
2022-05-18 09:04:51 DEBUG rasa.core.processor - Policy prediction ended with events '[]'.
2022-05-18 09:04:51 DEBUG rasa.core.processor - Action 'utter_lexicon/back_to_happy_path' ended with events '[BotUttered('Möchtest du mich noch was anderes fragen? Wie wär's mit ...', {"elements": null, "quick_replies": null, "buttons": [{"payload": "/masturbation_menstruation", "title": "Darf man w\u00e4hrend der Periode masturbieren? \ud83e\ude78"}, {"payload": "/mood_how", "title": "Wie komme ich in Stimmung? \ud83d\udca6"}, {"payload": "/masturbation_myth", "title": "Welche Mastrubationsmythen gibt es? \ud83d\udd2e"}, {"payload": "/masturbation_ban", "title": "Darf man Masturbation verbieten? \ud83d\udeab"}, {"payload": "/deny", "title": "nichts, danke!"}, {"payload": "/affirm", "title": "eine eigne Frage"}, {"payload": "/browse_more", "title": "weitere Fragen \ud83d\udc47 "}], "attachment": null, "image": null, "custom": null}, {"utter_action": "utter_lexicon/back_to_happy_path"}, 1652857491.234766)]'.
2022-05-18 09:04:51 DEBUG rasa.core.policies.memoization - Current tracker state:
[state 0] user intent: affirm | previous action name: utter_lets_get_started
[state 1] user intent: lexicon | previous action name: action_listen
[state 2] user intent: lexicon | previous action name: utter_lexicon
[state 3] user intent: lexicon | previous action name: utter_lexicon/link_to_website
[state 4] user intent: lexicon | previous action name: utter_lexicon/back_to_happy_path
2022-05-18 09:04:51 DEBUG rasa.core.policies.memoization - There is a memorised next action 'action_listen'
2022-05-18 09:04:51 DEBUG rasa.core.policies.rule_policy - Current tracker state:
[state 1] user intent: start | previous action name: action_listen
[state 2] user intent: start | previous action name: utter_greet
[state 3] user intent: start | previous action name: utter_inform_lovis
[state 4] user intent: start | previous action name: utter_browse_or_ask
[state 5] user intent: affirm | previous action name: action_listen
[state 6] user intent: affirm | previous action name: utter_framing
[state 7] user intent: affirm | previous action name: utter_lets_get_started
[state 8] user intent: lexicon | previous action name: action_listen
[state 9] user intent: lexicon | previous action name: utter_lexicon
[state 10] user intent: lexicon | previous action name: utter_lexicon/link_to_website
[state 11] user intent: lexicon | previous action name: utter_lexicon/back_to_happy_path
2022-05-18 09:04:51 DEBUG rasa.core.policies.rule_policy - There is a rule for the next action 'action_listen'.
2022-05-18 09:04:51 DEBUG rasa.core.policies.unexpected_intent_policy - Skipping predictions for UnexpecTEDIntentPolicy as either there is no event of type `UserUttered` or there is an event of type `ActionExecuted` after the last `UserUttered`.
2022-05-18 09:04:51 DEBUG rasa.core.policies.ted_policy - TED predicted 'action_listen' based on user intent.
2022-05-18 09:04:51 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_1_RulePolicy.
2022-05-18 09:04:51 DEBUG rasa.core.processor - Predicted next action 'action_listen' with confidence 1.00.
2022-05-18 09:04:51 DEBUG rasa.core.processor - Policy prediction ended with events '[]'.
2022-05-18 09:04:51 DEBUG rasa.core.processor - Action 'action_listen' ended with events '[]'.
2022-05-18 09:04:51 DEBUG rasa.core.tracker_store - Recreating tracker from sender id 'qda7gdnyO9zdLDRTAAAH'
2022-05-18 09:04:51 DEBUG rasa.core.tracker_store - Tracker with sender_id 'qda7gdnyO9zdLDRTAAAH' stored to database
2022-05-18 09:04:51 DEBUG rasa.core.lock_store - Deleted lock for conversation 'qda7gdnyO9zdLDRTAAAH'.
2022-05-18 09:05:05 DEBUG rasa.core.channels.socketio - User qda7gdnyO9zdLDRTAAAH disconnected from socketIO endpoint.
I read trough the forum and found a similar case, where increasing the epochs of the TEDPolicy
and replacing the MemoizationPolicy
with the AugmentedMemoizationPolicy
helped. But in my case it didn’t. Right now my config,yml
looks like this:
# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: de
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: "SpacyNLP"
model: "de_core_news_md"
case_sensitive: False
- name: WhitespaceTokenizer
intent_tokenization_flag: True
intent_split_symbol: "+"
- name: RegexFeaturizer
- name: LexicalSyntacticFeaturizer
- name: CountVectorsFeaturizer
- 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
retrieval_intent: chitchat
- name: ResponseSelector
epochs: 100
constrain_similarities: true
retrieval_intent: lexicon
- name: ResponseSelector
epochs: 100
constrain_similarities: true
retrieval_intent: sex
- name: ResponseSelector
epochs: 100
constrain_similarities: true
retrieval_intent: orgasm
- 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: AugmentedMemoizationPolicy
- name: RulePolicy
- name: UnexpecTEDIntentPolicy
max_history: 5
epochs: 200
- name: TEDPolicy
max_history: 5
epochs: 300
constrain_similarities: true
Thanks in advance for taking a look at it!
Ciao, Vio