Hi
I am facing what, I think, is a common issue when starting with Rasa.
Let’s say I have a bot that can handle two use cases:
- It can display the current weather in a particular city
- It can display the population of a particular city.
Stories could look like this, respectively:
# Ask weather
* ask_weather{"GPE": "Paris"}
- utter_on_it
- do_weather_api
# Ask population
* ask_population{"GPE": "Paris"}
- utter_on_it
- do_cityinfo_api
For cases where the user doesn’t specify the city:
# Ask weather but no location
* ask_weather
- utter_ask_location
* inform_about_location{"GPE": "Paris"}
- utter_on_it
- do_weather_api
# Ask population but no location
* ask_population
- utter_ask_location
* inform_about_location{"GPE": "Paris"}
- utter_on_it
- do_cityinfo_api
On the NLU side, the inform_about_location
could be triggered by somewhat specific utterances such as “oh sorry, Paris” or even “in Paris”.
Very often however, the user is going to reply with a single-word “sentence” such as “Paris”. Here, on the NLU side, the answer “Paris” is going to be detected by ner_spacy
but the intent is going to be null
- I don’t think training the NLU model to link a big list of cities to the inform_about_location
intent is such a good idea (I might be wrong here).
However, the intent is clear when you look both at the context (position in the story) and the extracted entity: if the GPE
entity is extracted by ner_spacy
after utter_ask_location
, the intent is probably to inform about the location.
My question is: how can I “materialize” this in Rasa? What I want is something like this…
# Ask weather but no location
* ask_weather
- utter_ask_location
* null{"GPE": "Paris"}
- utter_on_it
- do_weather_api
# Ask population but no location
* ask_population
- utter_ask_location
* null{"GPE": "Paris"}
- utter_on_it
- do_cityinfo_api
…where actions are triggered only depending on context and entities detected by pre-trained models.
This problem has already been mentioned: here and here for example, but this doesn’t help me.
Thank you very much! Rasa is awesome
Anthony