How can i make multi language rasa chatbot having at least two languages?
Asked Answered
B

1

7

i want to make a rasa based chatbot with at least two languages or multi lingual chatbot. Can anybody tell me possible way of making it.

Burschenschaft answered 20/9, 2019 at 12:53 Comment(0)
F
5

Nice question. (And this is something I'm working on too.)

The good thing about the embedding intent classifier is that it doesn't have any assumptions about what language it works on. So, in theory, it should work with every language.

There are 2 approaches that you can use to support multi-language intents.
1. make separate intents for them (e.g. hello_en, hello_xx, for hello spoken in 2 languages)
2. create a language detector and handle them all in custom action

If you're using default utter_ methods, method 1 may make more sense becuase you can just use hello_en as intent name and utter_hello_en to get back the response.
Method 2 makes more sense when you actually have multiple variables that you want to use to generate your response (and of course, you handle them in custom actions).

All in all, you can implement multi-language chatbots in rasa!

Edit:
What you want is a custom language detector that finds out which language you're using. You can include the language-detector as a custom component in the beginning of your pipeline and make it fill a language slot. Then, you can use this slot value as input in your custom actions and respond accordingly.

Flagler answered 20/9, 2019 at 13:39 Comment(3)
could you explain your second method bro.........actually i do not want to create different training data for different language.Burschenschaft
Could you please explain this answer in detail or provide video or else a blog post to get more details ?Iman
Solution 2 meant: You need to use googletrans library to translate what user inputted and detect the language -> then translate it to your language model(english as example) -> then take it by using rasa core to find the utter_which match with the message already translate => after got the result you can translate the result into the language which you detected by googletrans(above), finally rasa will reply with the language which you inputted. @RaghavSharmaRoque

© 2022 - 2024 — McMap. All rights reserved.