Hi, I am working on a FAQ type of a bot. I have 3 applications for my domain and there are more than 15 FAQs where the questions are same across the three applications, but the answers(utterances only) will be different per application. So, I defined Entity:“app”, Slot:“app”, type :text. I have written a custom action as below for each Q:
class Actionnewconsumer(Action):
def name(self):
return "action_newconsumer_byapp"
def run(self, dispatcher, tracker, domain):
appl = tracker.get_slot('appl')
if appl == 'A':
dispatcher.utter_template('utter_newconsumer_A', tracker)
elif appl == 'B':
dispatcher.utter_template('utter_newconsumer_B', tracker)
else:
dispatcher.utter_template('utter_cantunderstand', tracker)
return []
Also, defined a custom action to reset slot. class ActionResetSlotapp(Action):
def name(self):
return "action_reset_slot"
def run(self, dispatcher, tracker, domain):
return [SlotSet("appl", None)]
My stories are as below:(this is just for one Q(new consumer). There are stories like this for all 15 Qs for the same A and B applications)
NewConsumer story1
- New_Consumer
- utter_ask_newconsumer_byapp
- enter_data{“appl”: B"}
- action_newconsumer_byapp
- action_reset_slot
- utter_did_that_help
NewConsumer story2
- New_Consumer{“appl”: “A”}
- action_newconsumer_byapp
- action_reset_slot
- utter_did_that_help
So, basically, if a user specifies the appl in the Q itself, it should directly give the answer- which works perfect. Now, if the user doesnt specify the application, it asks the application- which is also as expected. But after the appl is specified, for the first time it answers correctly, the second time, it takes the correct entity value(A or B), but identifies intent as “enter_data” and hence replies for any of the 15 Qs where this slot is being used.
My config is as below:
language: en_core_web_sm pipeline: supervised_embeddings policies:
- name: AugmentedMemoizationPolicy max_history: 5
- name: KerasPolicy max_history: 5
- name: MappingPolicy
- name: FallbackPolicy nlu_threshold: 0.3 core_threshold: 0.3 fallback_action_name: action_default_fallback
I also tried increasing the augmentation factor upto 250 and changing to Memoization policy as well, but this part fails to work correctly. Sorry for the super-long Q.
Thanks!