Office365-Azure AI Hybrid: Add Multilingual AI extensions to Bots and Apps

Posted by

Most of the global teams are spread out in many countries. That’s adds a very interesting aspect to all our bots/app

Most of the global teams are spread out in many countries. That’s adds a very interesting aspect to all our bots/app implementations which need multilingual support

In this blog, we will look how to use Azure AI which can provide multilingual support for apps and bots. This will be useful in many scenarios, some of which are:

  1. Language agnostic bots that works across multiple regions
  2. Language agnostic app that works based on the user locale
  3. Language independent resource support on web app
  4. Business requirement which require support for real time language translation

Architecture

The architecture for this implementation is simple. Here is one of the example architectures but could be derived to any preferred ones.

Since it is beneficial to make it as real time as possible, create an Azure Function or like host the multilingual conversion using a HTTP call. And we will need the Azure AI Text Analytics endpoint for the conversion.

Implementation

For this example, we will use an Azure Function bot service which provides us with the input from the user. Here is link to the Git repo with the Bot Service code. More details about the code and snippets are provided below.

1. Firstly, we will need to intialize the text conversion class with the API key of the Text Analytics service.

2. Before the conversion, we need to first determine the locale of the text provided. In this case, the bot is hosted across many regions, so we mayn’t know where the request is coming from.

3. After the locale is determined, we can call the Text Conversion endpoint to convert the text into the required language. In this case, it is going to be English.

4. This text can then be used by the bots to determine the intents for further processing or the app for its business logic

Conclusion

In this blog we saw we could use the Azure AI to get the text converted in the destination language type. For this blog, I am converting them to English but could be converted to any language of choice. After the target language is acquired we could use it as needed.

Happy Coding!!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s