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.