Providing conversation context to the NLU using microservices

Many thanks @lgrinberg for sharing your concept.

Your example is related to word with different meaning (e. g. last name vs. city). This is a good example where context matters, but there are so much more situation where context is key. Also words, which are not ambiguous, can have a different meaning depending on the context.

Let’s say we have a chatbot that talks about renting or buying real estate:

  1. Context: None / User message: “apartment”
    • Since we have no context, we basically do not know what the intent of the user is (even he may think it is clear, that he wants to buy an apartment)
  2. Context: Rental / User message: “apartment”
    • The user mentioned that he wants to rent real estate. Since we are in the rental context it is clear that he wants to rent an apartment (and not a house). The utterance “I want to rent an apartment” and the utterance “apartment” should match the same intent
  3. Context: Buy / User message: “apartment”
    • Another user is more interested in buying an apartment and mentioned that in the previous dialog. Now “apartment” should match the same intent as “I would like to buy an apartment”

Another great example is “yes” and “no”, which meaning depends fully on the context (“yes” can be equal to “yes, I want to rent a house” OR “yes, I want to sell my apartment”)

These examples show two things:

  • A single word can have different intents depending on the dialog context
  • The same utterances/samples can appear in multiple intents

Your approach is definitely a way to solve this problem with Rasa, but it gets extremely complex, if you have a lot of context information. It would be really great, if it would be possible to define a matching context for the defined intents (“Only match in the context…”). Some comercial NLU platforms like Dialogflow support this and it makes it super easy to configure the intents.

@Juste, @amn41 I am wondering about the opinion of the Rasa team. Is this something you guys see in a future release, or do you think it is not an important feature? Do you have any other suggestion on the context topic?

Many thanks to all of you!