Multi-lingual Bot Framework V4
Projects ·Check the code
Motivation
The goal of this project was to make it easier on the users of Bot framework to support multiple languages in any bot without the need of creating train data for each language they support, even more they don’t need to know the language itself. Now the bot can support multiple languages Machine translation will automatically detect user language or the developer will give the language to the translator User messages will be translated to the app’s (QnA or Luis) language App output will be then translated back to user’s language. Also the developer can easily define a mapping for specific vocab, this mapping will be used to customize machine translation system output based on the alignment information.
Technical Details
Locale Converter
Middleware added to support conversion between date and time Supports multiple locales including
- All English locales
- French locales
- Deutsch locales
- Chinese locales
Getting User Language
You can use Microsoft translator detect Api to automatically get user language.
The developer can define function to get user language and to check if the user changed his language.
\newline
Snippet link
To User Language
The developer can set a flag toUserLanguage in the translation Middleware to translate to user language captured from the user at the start of the conversation.
Sample Live Usage
Conclusion
During this work, I was able to learn more about chat bots, Luis, Qna and bot framework in depth. Contributing to an open source project gave me more knowledge in the process of a public professional code style, commenting and documentation.
Sample Code
References
- (Bot Framework V4 documentation Multi-lingual)[https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-how-to-translation?view=azure-bot-service-4.0&tabs=csrefs%2Ccssetuptranslate%2Ccshelp%2Ccstranslateback%2Ccschangelanguage%2Ccslanguageluis%2Ccsbypass%2Ccstranslation]