wolfias
(Wolfias)
August 13, 2021, 4:11am
1
HI,
I have a bot demo mainly for collecting answers from customer by means of form actions, and it can be activated by greet message from customer or injecting the exteral_user_info intent which passing on some user’s personal info like name, age…
The problem is the chitchat and faq doesn’t work when the conversion is triggered by injecting intent. But it’s ok whenI just send hello message to activate the form action by triggering the greet intent. Is there any difference between the 2 ways? All help and suggestions would really be appreiciated.
By the way, when activated by injecting intent, the bot works properly in every other aspects.
Rasa Version : 2.6.2
Minimum Compatible Version: 2.6.0
Rasa SDK Version : 2.6.0
Rasa X Version : 0.40.0
Python Version : 3.7.10
The story is like below:
stories:
- story: Activate wechat_random_questionnaire_form by greet
steps:
- intent: greet
- action: wechat_random_questionnaire_form
- active_loop: wechat_random_questionnaire_form
- story: Activate wechat_random_questionnaire_form by external_user_info
steps:
- intent: external_user_info
- action: wechat_random_questionnaire_form
- active_loop: wechat_random_questionnaire_form
the greet message screenshot:
the inject intent screenshot:
curl -X POST -i http://localhost:5005/conversations/5183406686aa489b843f9be1ee56577e/trigger_intent --data ‘{“name”: “external_user_info”,“entities”: {“customer_name”: “Mike”, “Mr_or_Ms”: “Mr”, “product_name”: “Phone”, “birth_year”: “1990”, “birth_month”: “3”, “birth_day”: “25”}}’
anca
(Anca Lita)
August 13, 2021, 8:40am
2
@wolfias If I read your example correctly, you’re asking why Rasa predicts action_listen
to the chitchat/bot_challenge intent in the case of intent injection instead of utter_chitchat
?
I would like to gather a bit more information - could you please share the full stories and rules files, to see how you handle the chitchat intent especially within the context of an active loop? Also please confirm if you’re using the ResponseSelector
in your NLU pipeline in your configuration file, as well as specifying RulePolicy
in your policies?
Another recommendation I have to make your stories more impact (more of a style advice) is to use OR statement for both intents in your form activation story.
wolfias
(Wolfias)
August 13, 2021, 9:06am
3
@anca Thanks for your reply. Your understanding is correct.
The bot configuraton as follow:
rules.yaml
version: "2.0"
rules:
- rule: Sad Path3 - chitchat
condition:
- active_loop: wechat_random_questionnaire_form
steps:
- intent: chitchat
- action: utter_chitchat
- action: wechat_random_questionnaire_form
- active_loop: wechat_random_questionnaire_form
- rule: Sad Path7 - didnt_catch
condition:
- active_loop: wechat_random_questionnaire_form
steps:
- intent: didnt_catch
- action: utter_didnt_catch
- action: wechat_random_questionnaire_form
- active_loop: wechat_random_questionnaire_form
- rule: Sad Path8 - faq
condition:
- active_loop: wechat_random_questionnaire_form
steps:
- intent: faq
- action: utter_faq
- action: wechat_random_questionnaire_form
- active_loop: wechat_random_questionnaire_form
- rule: Sad Path 12 - out_of_scope
condition:
- active_loop: wechat_random_questionnaire_form
steps:
- intent: out_of_scope
- action: utter_out_of_scope
- action: wechat_random_questionnaire_form
- active_loop: wechat_random_questionnaire_form
- rule: Submit wechat_random_questionnaire_form
condition:
- active_loop: wechat_random_questionnaire_form
steps:
- action: wechat_random_questionnaire_form
- active_loop: null
- action: utter_goodbye1
- action: utter_slots_value
- action: action_restart
- rule: ternminate session
condition:
- active_loop: wechat_random_questionnaire_form
steps:
- intent: external_terminate_session
- action: action_deactivate_loop
- active_loop: null
- action: utter_goodbye2
- action: utter_slots_value
- action: action_restart
- rule: Sad Path1 not oneself Form wechat_random_questionnaire_form
condition:
- active_loop: wechat_random_questionnaire_form
- slot_was_set:
- a_is_one_self: 否
steps:
- action: wechat_random_questionnaire_form
- active_loop: null
- action: utter_goodbye2
- action: utter_slots_value
- action: action_restart
- rule: Sad Path2 deny questionnaire Form wechat_random_questionnaire_form
condition:
- active_loop: wechat_random_questionnaire_form
- slot_was_set:
- b_accept_questionnaire: 拒绝回访
steps:
- action: wechat_random_questionnaire_form
- active_loop: null
- action: utter_goodbye2
- action: utter_slots_value
- action: action_restart
- rule: Sad Path4 deny identity_verification failed wechat_random_questionnaire_form
condition:
- active_loop: wechat_random_questionnaire_form
- slot_was_set:
- c_identity_verification: 未通过
steps:
- action: wechat_random_questionnaire_form
- active_loop: null
- action: utter_goodbye3
- action: utter_slots_value
- action: action_restart
- rule: Sad Path5 forgotten guide forgotten again wechat_random_questionnaire_form
condition:
- active_loop: wechat_random_questionnaire_form
- slot_was_set:
- e_fillout_guide_of_forgotten: 记不清
steps:
- action: wechat_random_questionnaire_form
- active_loop: null
- action: utter_goodbye4
- action: utter_slots_value
- action: action_restart
- rule: Sad Path6 no authorized again wechat_random_questionnaire_form
condition:
- active_loop: wechat_random_questionnaire_form
- slot_was_set:
- g_if_authorized: 否
steps:
- action: wechat_random_questionnaire_form
- active_loop: null
- action: utter_goodbye4
- action: utter_slots_value
- action: action_restart
- rule: Sad Path9 deny questionnaire Form wechat_random_questionnaire_form
condition:
- active_loop: wechat_random_questionnaire_form
- slot_was_set:
- b_accept_questionnaire: 不方便
steps:
- action: wechat_random_questionnaire_form
- active_loop: null
- action: utter_goodbye2
- action: utter_slots_value
- action: action_restart
- rule: Sad Path10 no authorized again wechat_random_questionnaire_form
condition:
- active_loop: wechat_random_questionnaire_form
- slot_was_set:
- branch: guangdong
- g_if_authorized: 是
steps:
- action: wechat_random_questionnaire_form
- active_loop: null
- action: utter_goodbye4
- action: utter_slots_value
- action: action_restart
- rule: Sad Path11 no authorized again wechat_random_questionnaire_form
condition:
- active_loop: wechat_random_questionnaire_form
- slot_was_set:
- branch: guangdong
- g_if_authorized: 否
steps:
- action: wechat_random_questionnaire_form
- active_loop: null
- action: utter_goodbye4
- action: utter_slots_value
- action: action_restart
stories.yml
# version: “2.0”
stories:
- story: Activate wechat_random_questionnaire_form by greet
steps:
- intent: greet
- action: wechat_random_questionnaire_form
- active_loop: wechat_random_questionnaire_form
- story: Activate wechat_random_questionnaire_form by external_user_info
steps:
- intent: external_user_info
- action: wechat_random_questionnaire_form
- active_loop: wechat_random_questionnaire_form
config.yml
# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: zh
pipeline:
#- name: WhitespaceTokenizer
- name: JiebaTokenizer
- 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
- name: ResponseSelector
epochs: 100
retrieval_intent: faq
- name: ResponseSelector
epochs: 100
retrieval_intent: chitchat
# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
- name: MemoizationPolicy
- name: TEDPolicy
max_history: 5
epochs: 100
constrain_similarities: true
- name: RulePolicy
rules.yml (4.3 KB) stories.yml (505 Bytes)
config.yml (891 Bytes)
wolfias
(Wolfias)
August 14, 2021, 12:35am
4
I tried this configuration on rasa2.8.2, the problem was the same as rasa2.6.2.
wolfias
(Wolfias)
August 14, 2021, 9:28am
5
I’ve found the cause of the problem. One slot which storing user info I set the ‘influence_conversation’ to ‘true’ and the inject intent request include this entity.
@anca Thanks a lot.
1 Like