General about Response Selection depth and Multiple Intents

Our team is working on developing a realistic conversational chatbot with Rasa and we’ve explored retrieval intents and multi-intents as methods to generate appropriate responses. I have two questions about these two methodologies:

  1. Is it possible to have embedded intents in the Retrieval Intent classification? For example, a user input of weather is nice could be classified as introduction/chitchat/weather.

  2. Could retrieval intent / response selection possibly be connected with multi-intent classification? For example, a user input of Weather is nice. Do you like movies? could be classified as chitchat/weather + chitchat/movies

Hi @steinnhauser, good questions! I’ll try to answer with regards to the current state of Rasa but bear in mind that this is an open-source project, so you might be able to achieve more by changing the code :wink:

  1. Multi-level intent hierarchy isn’t currently supported. This is partly because the current retrieval intents aren’t meant to create real intent hierarchy – while they enable more granular choice of response, Rasa Core doesn’t take the subintent (the response key) into account when making further predictions (hence your stories/rules will look like chitchat > utter_chitchat, i.e. omitting the subintents).

  2. I believe this is currently possible, though it’s one of the edge cases that aren’t properly documented. The syntax would be chitchat/weather+movies. Under the hood, intent splitting works like this: Intents weather and weather+movies are treated as separate intents. (Hence, for an intent like chitchat/weather+movies you’ll need to define a separate response.) However, the weather+movies gets split into multiple words and since it has a shared word with the weather intent, DIET should learn that the intents are somewhat similar. And in the case of response keys, ResponseSelector should learn this too, since it uses DIET internally. Hence, I think that you should be safe to combine multi-intent with retrieval intents. Of course, bearing in mind the pitfalls of the multi-intent approach: The model needs enough data to learn the similarity between intents, and the model can’t predict any intent combination that it hasn’t seen during training.

Let me know how it goes, I’m really curious. Your work could also help us improve the docs :slight_smile:

1 Like

Thanks for your response! The second seems to be possible, though navigating how it can be done is tricky. I’ve managed it with the following configuration:

Domain:

intents:
 - chitchat

responses:
 utter_chitchat/weather+movies
  - text: Weather is nice indeed. Yes movies are great.

with rules:

rules:
 - rule: chitchatting
  steps:
   - intent: chitchat
   - action: utter_chitchat

and nlu:

nlu:
- intent: chitchat/weather+movies
  examples: |
    - Weather is nice. Do you like movies?

I think the main confusion for me came from the way multi-intents are declared, and how this should be extended using sub-intents. With a normal multi-intent, one would typically need to declare the combination intent1+intent2 in the intents: section of domain, but the ResponseSelector class seems to pick up on these combinations without needing implicit declaration.

I’m glad that you’ve managed to make it work; the example looks very sensible to me. And yes, I agree that finding out how it should be done isn’t the easiest…

As for listing intents in the domain: Strictly speaking, that’s only needed for Rasa Core. Rasa NLU doesn’t need all the intents listed because it infers them from the NLU training examples. And when it comes to retrieval intents, there’s no need to list the various response key cases (e.g. weather, movies, etc.) in the domain, since the keys don’t matter at all to Rasa Core (I hope this is reasonably clear from the docs) – hence, no need to list multiple response keys (e.g. weather+movies) in the domain either.

1 Like

Oh good, weather+movies does not need to be listed in the domain. I think what lead me to believe so was the following warning from the interpreter:

UserWarning: Interpreter parsed an intent 'weather+movies' 
which is not defined in the domain. Please make sure all 
intents are listed in the domain.
  More info at https://rasa.com/docs/rasa/domain

seems this warning is just from rasa core, and that multi-intent classification is working well. Project structure is much cleaner now, thanks! :confetti_ball:

1 Like