Build a multilingual virtual assistant with Watson

Ronan Dalton
IBM Data Science in Practice
2 min readDec 1, 2020

Setting the scene

Picture this, you’ve built a first class virtual assistant with Watson Assistant and deployed the assistant to a web-app using the web chat integration. Conversations with the assistant are flowing nicely — end users are regularly using the assistant to address queries with great success! Indeed, such is the success of your assistant, that you’ve been asked to make the assistant available in a number of additional languages. You’re concerned — you built and trained your assistant in English. To build a new instance of the assistant in a new language requires language skills, new intents, entities etc. you essentially have to start from scratch again, right? Thankfully not! Integrating Watson’s Language Translator service with Watson Assistant allows a single assistant to address queries and serve replies in multiple languages without any additional training.

The approach

Using the web chat event system (remember our assistant is deployed online using the Watson Assistant web chat integration) and IBM Cloud Functions we can pre-process queries being sent to Watson Assistant and replies coming from Watson Assistant. The pre-processing here allows us make calls to the Language Translator service to ensure queries sent to Watson Assistant match the language your assistant has been trained to work with and replies from Watson are sent back to the end user in the same language used to ask the initial question.

The diagram below outlines the call sequence for each of the web chat events used to pre-process messages being sent to/from Watson Assistant.

Call sequence for the multilingual assistant

The solution

Sounds complicated? It really isn’t! I’ve created some sample code along with a detailed instructional video to allow you build a multilingual virtual assistant with Watson. You’ll find the sample code on my GitHub repository here. I’ve embedded the video below.

Multilingual virtual assistant with Watson

Conclusion

At this point I hope you’ve managed to follow my video and have a virtual assistant that can support additional languages. The process is quite straight forward and can easily be scaled to include additional languages. Indeed, the only limit on language support, is the set of languages supported by the Language Translator service.

Thanks for taking the time to follow along, hope you found this tutorial useful!

--

--