Hello @nik202 ,
Please help me here, I am having this issue: my idea is this.
I have questions and answers for two types of people
Doctors:
- the replies for these people are more complex
NotDoctors
- the replies are simple and for normal people
I want to build the bot in such a way that it asks with two buttons, if you are a doctor then it shows the complex answers, if you are not a doctor, it shows simple faq answers.
This is how I have been trying to do below. Where could I be missing it.
when I run the bot I get the error below, its not picking the answers in the right way, it seems like its guessing or something.
Error:
Bot loaded. Type a message and press enter (use '/stop' to exit):
Your input -> hello
Hello, how can I help you today?
? Hey! How are you? Are you a qualified Medical Personell? 1: Yes. (doctor{"doctor":true})
Your input -> what is covid?
2021-09-24 17:34:24 ERROR rasa.core.actions.action - Couldn't create message for response 'utter_notdoctor/what_is_covid'.
Your input -> how is it spread?
2021-09-24 17:34:33 ERROR rasa.core.actions.action - Couldn't create message for response 'utter_doctor/covid_spread'.
Your input ->
Rasa Version
(rasaenv) Drs-MacBook-Pro:Trial-Ground drjamesmugume$ rasa --version
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.7.5
Operating System : Darwin-19.6.0-x86_64-i386-64bit
Python Path : /opt/anaconda3/envs/rasaenv/bin/python
(rasaenv) Drs-MacBook-Pro:Trial-Ground drjamesmugume$
NLU for Doctors
version: "2.0"
nlu:
- intent: doctor/what_is_covid
examples: |
- what is covid
- what's corona
- tell me about corona virus
- corona?
- covid-19?
- define corona
- what is covid19
- intent: doctor/covid_spread
examples: |
- how does it spread?
- how does covid spread.
- does it spread by air?
- how can one contract it?
- what means does it spread?
- how do people get infected?
- intent: doctor/symptoms_covid
examples: |
- what are the symptoms?
- symptoms of covid?
- is temperature a symptom?
- what are the signs of covid?
- covid signs and symptoms
- what should I look out for.
- how do I know someone has covid?
- intent: doctor/covid_vaccine
examples: |
- what is the cure?
- does it have a vaccine?
- can it be vaccinated against?
- what vaccine should I use for covid?
NLU for non doctors
version: "2.0"
nlu:
- intent: notdoctor/what_is_covid
examples: |
- what is covid
- what's corona
- tell me about corona virus
- corona?
- covid-19?
- define corona
- what is covid19
- what is covid?
- intent: notdoctor/covid_spread
examples: |
- how does it spread?
- how does covid spread.
- does it spread by air?
- how can one contract it?
- what means does it spread?
- how do people get infected?
- intent: notdoctor/symptoms_covid
examples: |
- what are the symptoms?
- symptoms of covid?
- is temperature a symptom?
- what are the signs of covid?
- covid signs and symptoms
- what should I look out for.
- how do I know someone has covid?
- intent: notdoctor/covid_vaccine
examples: |
- what is the cure?
- does it have a vaccine?
- can it be vaccinated against?
- what vaccine should I use for covid?
Config
# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: en
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: WhitespaceTokenizer
- 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: doctor
constrain_similarities: true
- name: ResponseSelector
epochs: 100
retrieval_intent: notdoctor
constrain_similarities: true
- name: FallbackClassifier
threshold: 0.35
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: MemoizationPolicy
- name: RulePolicy
- name: UnexpecTEDIntentPolicy
max_history: 8
epochs: 100
- name: TEDPolicy
max_history: 5
epochs: 100
constrain_similarities: true
Rules
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: ask doctor questions
steps:
- intent: doctor
- action: utter_doctor
- rule: ask doctor questions
steps:
- intent: notdoctor
- action: utter_notdoctor
Domain:
version: '2.0'
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: false
intents:
- greet
- goodbye
- notdoctor:
is_retrieval_intent: true
- doctor:
is_retrieval_intent: true
- stop
- inform_doctor
- affirm
- deny
- mood_great
- mood_unhappy
- bot_challenge
entities:
- doctor
slots:
doctor:
type: bool
influence_conversation: true
responses:
utter_greet:
- text: Hello, how can I help you today?
utter_ask_if_doctor:
- buttons:
- payload: doctor{{"doctor":true}}
title: Yes.
- payload: notdoctor{{"doctor":false}}
title: No.
text: Hey! How are you? Are you a qualified Medical Personell?
utter_cheer_up:
- image: https://i.imgur.com/nGF1K8f.jpg
text: 'Here is something to cheer you up:'
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_doctor/what_is_covid:
- condition:
- type: slot
name: doctor
value: true
text: This is the answer for the doctors.
utter_doctor/covid_spread:
- condition:
- type: slot
name: doctor
value: true
text: Covid_spred for doctors.
utter_doctor/symptoms_covid:
- condition:
- type: slot
name: doctor
value: true
text: symptoms_covid for doctors.
utter_doctor/covid_vaccine:
- condition:
- type: slot
name: doctor
value: true
text: covid_vaccine for doctors.
utter_notdoctor/what_is_covid:
- condition:
- type: slot
name: doctor
value: false
text: This is the answer for the not_doctors.
utter_notdoctor/covid_spread:
- condition:
- type: slot
name: doctor
value: false
text: Covid_spred for not_doctors.
utter_notdoctor/symptoms_covid:
- condition:
- type: slot
name: doctor
value: false
text: symptoms_covid for not_doctors.
utter_notdoctor/covid_vaccine:
- condition:
- type: slot
name: doctor
value: false
text: covid_vaccine for not_doctors.
actions:
- utter_ask_if_doctor
- utter_doctor
- utter_goodbye
- utter_greet
- utter_notdoctor
Stories
version: "2.0"
stories:
- story: doctor path
steps:
- intent: greet
- action: utter_greet
- action: utter_ask_if_doctor
- slot_was_set:
- doctor: true
- intent: doctor
- action: utter_doctor
- intent: goodbye
- action: utter_goodbye
- story: not doctor path
steps:
- intent: greet
- action: utter_greet
- action: utter_ask_if_doctor
- slot_was_set:
- doctor: false
- intent: notdoctor
- action: utter_notdoctor
- intent: goodbye
- action: utter_goodbye
- story: interactive_story_1
steps:
- intent: greet
- action: utter_greet
- action: utter_ask_if_doctor
- intent: doctor
entities:
- doctor: true
- slot_was_set:
- doctor: true
- action: utter_doctor
- intent: doctor
- action: utter_doctor
- intent: goodbye
- action: utter_goodbye
- story: interactive_story_1
steps:
- intent: greet
- action: utter_greet
- action: utter_ask_if_doctor
- intent: notdoctor
entities:
- doctor: false
- slot_was_set:
- doctor: false
- action: utter_notdoctor
- intent: notdoctor
- action: utter_notdoctor
- intent: notdoctor
- action: utter_notdoctor
- intent: goodbye
- action: utter_goodbye