Multiple language

How one model can handle multiple language(fr,en,…) ?

1 Like

One solution is having the conversation start with the bot asking you to choose a language via buttons. The choice gets saved in a slot called language.

In the same intent, you put multiple languages as examples. And all your responses should be custom actions, in which you dispatch a message according to tracker.get_slot('language').

I’m building a bot that speaks 5 languages and it works great.

I speak 4 of them and i am still confused as ever!! why would you want that for a bot?

you can deploy two containers with different models and use a routing engine to see the prediction for a given language. try tools like lang detect to route

@ChrisRahme I am not sure if intent predictions would work very well if you mix two languages in the same intent. it might work for some but i dont think that’s a good idea

It’s working great for me.

But indeed, it would be better to use your solution if the person has the resources (which they probably do if they want a bot in production).

Another pro of my solution is that the bot could understand a person that mixes up the languages, which is very common in my country. Whether it is one language per message or multiple languages in the same message.

interesting, what are the languages you are working with?

infact if the word used for the intent is more less the same in the different languages, i suppose it could work with DIET. I wondering though how your embeddings would fit for words that are likely out of context.

1 Like

Actually all the languages used are quite different (except English and French sometimes), and it still works well. Sure, I would love to have a better confidence, but I think that’s mostly because some intents look like each other rather than having multiple languages. Not sure though.

Also, using Tensorboard, I have a 0.8-0.9 intent accuracy, but a low entity accuracy of 0.6-0.7, which does not matter that much anyway since most entities/slots will be entered via buttons.

The languages the bot understands are English, French, Arabic, Armenian, and Arabic written with Latin letters.

You can see an example here.


I knew that solution , but i’am using Rocket Chat

Can i use Google translator for that? = for every output-channel(message)

Sorry, I’m not sure I understand. What do you want to use it for?

Rasa is an open source , i can make some changes in the code source (dipatcher), that will allow me to translate every output from the chatbot(chatbot response)

Oh so you want to translate the chatbot’s message and not the user’s. Yeah you can do that.

I suggest you to read this before using it though. You can surely use other translation services which are free, but I doubt they would be as good as Google’s.

Another downside of translating the output from the chatbot vs dispatching it after checking a slot is that you will not have full control over the output. What if a certain translation is wrong?

i want to translate the output depend on input language Both ,

Yes I understand. You will need to create a language detector before translating as well.

1 Like

Yes, I think I can make a change to the Rasa_SDK dispatcher ? do you agree

I think so

1 Like

let us solve this problem , But how can i force the client to chose a language , maybe Rules …!! what do you think !!

Are you sure !!!

How ? Routing Engine

You can make it the first thing the chatbot asks