4

I just started working with Rasa NLU and I have some problem understanding the usage of categorical slots with same values. I have 3 different types of risk, each a categorical slot with values: low, medium and high.

How can the bot differentiate between the three risks and understand which slot to be filled up, given the intent is same for each. Or do I need to use different intents for each?

Right now what I see is (I removed unrelated logs):

How tired are you?
1: low (low)
2: medium (medium)
3: high (high)
medium
DEBUG:rasa_core.processor:Received user message 'medium' with intent '{'name': 'inform', 'confidence': 0.88372623999657118}' and entities  '[{'start': 0, 'end': 6, 'value': 'medium', 'entity': 'fatigue', 'extractor': 'ner_crf'}]'
DEBUG:rasa_core.processor:Current slot values: 
    fatigue: medium
    injury: None
    stress: None
How stressed are you?
1: low (low)
2: medium (medium)
3: high (high)
low
DEBUG:rasa_core.processor:Received user message 'low' with intent '{'name': 'inform', 'confidence': 0.88762049990079372}' and entities  '[{'start': 0, 'end': 3, 'value': 'low', 'entity': 'fatigue', 'extractor': 'ner_crf'}]'
DEBUG:rasa_core.processor:Current slot values: 
    fatigue: low
    injury: None
    stress: None

All the user replies have the intent inform. An example story is:

* _greet[]
 - utter_ask_fatigue
* _inform[fatigue=low]
 - utter_ask_injury
* _inform[injury=medium]
 - utter_ask_stress
* _inform[stress=low]
 - utter_on_it
 - action_reply
Anakin
  • 1,889
  • 1
  • 13
  • 27
  • did u got an answer for this? I am also facing the same issue – Arti Berde Feb 25 '18 at 10:45
  • No unfortunately I have not. I had to use different intents for each case. – Anakin Mar 01 '18 at 19:50
  • Hi, can you put your domain.yml plz? I think you need to put 3 different slots, since you have fatigue, stress and injuries, and I only see the entity "fatigue" on your 2 first questions. Each entity could be 1 of the 3 proposed values. – Alexandre Mar 02 '18 at 16:51
  • Sorry, I do not have the exact project files anymore. But each of fatigue, stress and injury was defined as a categorical slot like slots: fatigue: type: categorical values: - low - medium - high – Anakin Mar 06 '18 at 14:36

1 Answers1

2

you can do it with one entity and four slots

the entity may be defined as type "info", with text values (i.e. low, medium, high).

The four slots: the first one is "info", which will auto filled by recognized entity "info" defined previously. The other three would be "fatigue", "stress" and "injury", which can be filled by bot actions such as action_fill_fatigue, action_fill_stress and action_fill_injury.

an example story will make it clear:

* _greet[]
 - utter_ask_fatigue
* _inform[info=low]
 - action_fill_fatigue
 - utter_ask_injury
* _inform[info=medium]
 - action_fill_injury
 - utter_ask_stress
* _inform[info=low]
 - action_fill_stress
 - utter_on_it
 - action_reply