Pipeline for outgoing messages

Hello Rasa team,

I was thinking about how to implement a translator in Rasa. That can recognize the incoming text, translate it into the model language and return the translated response to the user. So I had a look at the custom components for the NLU Pipeline. I think that is the right place to add the language recognition and translate the text, so the model will understand it. The next step is to translate the response into the same language, but I couldn’t find a good solution. Creating a custom action for every response and calling a translate function is too much I think. Then I came with the idea that an pipeline before the output channel will be the best solution. There you can access all data like in a action and in addition the response.

I came up with several ideas, how this could be useful:

  • translate the response into users language
  • saving the whole record in different datastores
  • further analysis between ingoing and outgoing messages, maybe add a self train algorithm
  • adding emoticons depending on sentiment in all responses, not just the predefined in the domain.yml
  • delay responses
  • provide intent, confidence, entities, slots in the response object

Maybe you will find more situations where this can be useful :slight_smile:

1 Like

What do you mean by adding a pipeline at the end?

Adding a response pipeline to the agent, that is processed before the Output Channels. A quick example: You got an sentiment analyser in the NLU Pipeline. If an emoji should be added at the end of every respone, depending on the sentiment, a custom action is required for every response. It would be easier with a pipeline, that handles this for every response.

1 Like

Hello @RGK

Cool ideas, I was also working on something similar and found this awesome blog.

Hi,any workaround for this?

I have built a custom NLU Component for Translating each and every non-english message. However, how do I make sure RASA utters the message in the original language?

Basically, how do I transform/apply rules on responses before sending back?

Hello @bhavikyjain ,

Yes, We have made something similar and the custom outgoing NLP is a bit tough side as you need to customize the core part of RASA rather than the NLP part.

Here is a demo of the video showing the POC we did with Mood BOT.