Using Machine Translation
DRUID virtual assistants equipped with SDL/Azure integration can seamlessly engage in conversations across multiple languages, eliminating the need for manual translation of data sources or conversational flows. This functionality is invaluable, especially when chatbots configured for one language encounter queries in other languages. While configuring chatbots for multiple languages within the DRUID platform is possible, it often entails additional effort. Integrating with SDL Machine Translation Cloud and/or Azure Translator unlocks real-time interpreter functionality, enabling DRUID to translate conversations in over 100 language combinations across various digital communication channels and devices. Additionally, the Live Chat component simplifies scenarios where human operators or virtual assistants offer customer support in multiple languages simultaneously.
By leveraging machine translation, manual authoring for each language defined on the bot is unnecessary. Bot authoring occurs in the default language, with machine translation seamlessly translating messages, buttons, and user input into the language detected. This allows chatbots authored and trained in one language, such as English, to serve users speaking other languages, such as German, French, or Chinese, depending on the available language set in the SDL Account / Azure Translator account.
Set up machine translation on the bot
To set up machine translation on your bot, access the bot settings (Details tab), navigate to the Languages section, and select Enable Machine Translation.
Choose either SDL Machine Translation or Azure Translator (Cognitive Services) based on your preference and provide the details specific to the chosen provider. For more information, see the subsequent sections.
Use SDL machine translation services
To use SDL machine translation, select SDL Machine Translation and enter the SDL Client Id and SDL Client Secret (the machine translation credentials associated to your SDL account).
Tap on the desired translation option: Conversation time or Authoring time. To learn the differences between the two options, see Conversation Time Translation versus Authoring Time Translation. Leave the Specific languages field empty and save the bot details. The automatic machine translation service will be activated.
Use Azure Translator machine translation services
To enable machine translation using Azure Translator, select Azure Translator (Cognitive Services) from the provider options. Then, provide the following details:
- Azure Translator region: This is the Resource Region you set when creating your Azure Translator project.
- Azure Translator key: This is the authentication key you receive after setting up your Azure Translator resource in the Azure portal.
You can enhance translation accuracy by using custom dictionaries—user-defined resources that specify how specific words, phrases, or terminology should be translated. These dictionaries override default translations and help ensure consistency with your organization’s domain-specific language or branding.
To use custom dictionaries, you must first publish the models associated with them in your Azure Translator project. For step-by-step instructions, see the Microsoft Custom Translator Quickstart guide. After publishing, copy the Category ID of each translation model.
In the Azure Translator custom dictionaries field, enter a JSON object that maps language pairs to their corresponding Category IDs:
- Each key in the JSON should be a language pair (source and target language codes) separated by a vertical bar (|).
- Each value should be the Category ID of the relevant translation model.
Custom translations between English (United States) and Spanish
{
"en-US|es": "12d31552-1815-483b-b75c-8f40e7484d13-SOCIETY",
"es|en-US": "12d31552-1815-483b-b75c-8f40e7484d13-HEALTHC"
}
Tap on the desired translation option: Conversation time or Authoring time.
Azure Translator for Conversation time translation
To use the Azure Translator for Conversation time translation, tap on Conversation time, leave the Specific languages field empty and click the Save button to save the bot details. The automatic machine translation service from Azure Translator will be activated.
If you use the Azure Translator services on premise in a container, select Use dedicated docker container and in the Container address field, enter the container's URL.
Azure Translator for Authoring time translation for DRUID hybrid deployments
Document Translation, a cloud-based feature of the Azure Translator service that is part of the Azure Cognitive Service is used for authoring time translation.
Prerequisites
- You have an active Azure account. If you don't have one, you can create a free account.
- You need to retrieve your Document Translation endpoint from the Azure portal. For information on how to retrieve the Document Translation endpoint, see Microsoft documentation.
To use the Azure Translator for Authoring time translation, tap on Authoring time and in the Document translator endpoint field, enter the custom domain endpoint of the Document Translation available in the Azure portal.
Azure Translator for Authoring time translation in DRUID on premise deployments
Prerequisites
- You have an active Azure account. If you don't have one, you can create a free account.
- You have an Azure Blob Storage account. Create containers in your Azure Blob Storage account as follows:
- Source container. This container is where DRUID uploads the files (authoring content) for translation.
- Container for translation. This container is where the Document Translation takes the files for translation.
- Target container. This container is where the Document Translation puts the translated files.
- Delete container. This container is where the translated files from the target container are put after deletion. After DRUID picks up the translated files, the target container is cleaned up and the files are moved to the delete container.
- You also need to create Shared Access Signature (SAS) tokens for the four containers you created in Azure Blob Storage. When generating the SAS token, make sure that:
- Your source container has designated read, add, create and write access.
- Your container for translation has read and list access.
- Your target container has designated write and list access.
- Your delete container has designated read, delete and list access.
- You need to retrieve your Document Translation endpoint from the Azure portal.
- Allow outbound calls from DRUID.Provisioning to the Azure Blob Storage and to the Document Translation endpoint.
For information on how to retrieve the Document Translation endpoint, see Microsoft documentation.
To use the Azure Translator for Authoring time translation in DRUID on premise deployments, tap on Authoring time and in the Document translator endpoint, enter the custom domain endpoint of the Document Translation available in the Azure portal.
Select Use dedicated docker container and set up all the fields described in the table below.
Field | Description |
---|---|
Private source container with SAS | The Shared Access Signature of the Source container in URI format. |
Private destination container with SAS | The Shared Access Signature of the Delete container in URI format. |
Public source container with SAS | The Shared Access Signature of the Container for translation in URI format. |
Public destination container with SAS | The Shared Access Signature of the Target container in URI format. |
Click the Save button to save the bot details. The automatic machine translation service from Azure Translator will be activated.
Conversation Time Translation versus Authoring Time Translation
By understanding the distinctions between Conversation Time Translation and Authoring Time Translation, users can effectively optimize translation costs and streamline bot localization efforts. Conversation Time Translation occurs during conversations when language changes are detected (the [[ChatUser]].Language is different from the bot authoring languages), while Authoring Time Translation enables bulk translation of bot flows during authoring, reducing translation expenses. Selecting both options allows dynamic switching between real-time machine translation and DRUID NLP based on language changes during conversations.
Imagine that you have a bot authored in various languages hosted in an online shop and you need the bot to be always active. Using the conversation time translation in this scenario leads to high costs for having the messages translated in real-time; for each message translation, the bot calls the SDL/Azure machine translation service. Translating the bot at authoring time is more cost-effective, enabling the bot to use DRUID NLP for the bot authoring languages instead of calling the SDL machine translation service.
Conversation Time Translation |
Authoring Time Translation (SDL only) |
|
---|---|---|
DRUID calls the Machine Translation Cloud service |
Every time a message is written in the chat |
When authoring the bot (flows configuration) |
Enables bot translation in bulk |
No |
Yes |
Translation Cost Structure |
Per message |
Per flow authored element |
Customize message(s) translation |
No |
Yes |
Voice bots using machine translation |
Yes |
Yes |
Enable language change detection
DRUID is equipped with the ability to detect language changes within conversations, ensuring seamless communication across languages. Language change detection occurs before triggering the "Intent not found" flow, covering scenarios where users input text in languages other than the default language of the bot. Note that.
Prerequisite
From the Solutions Library, import the Language detection flow solution template or define a flow for handling the cases when language change is detected in the conversation.
To enable language detection, follow these steps:
- Click the Dialogue management section and select the Language Changed flow to be triggered when language change is detected in the conversation. If you imported the Language detection flow solution template, from the Language Changed flow field, select Language change.
- Tap on Language detection. The Threshold field becomes editable.
- Set a value for the Threshold field (we recommend a threshold of 90). Once the threshold is reached, the selected "Language Changed Flow" will be triggered.
- Save the bot.
- [[ChatUser]].DetectedLanguage is different from the [[ChatUser]].Language.
- [[ChatUser]].DetectedLanguage.Score is higher than the threshold value specified in the NLP.Language.Detection.Threshold parameter.
- The last language change detection for the same new language identified was more than 15 minutes ago. (E.g., the current language is German and bot detects English; the users doesn’t want to switch to English because they only used a universal word like “laptop” or “mouse”; therefore, next time the bot will identify a language change intent to English and current language is still German, it will not trigger the Language Changed special flow again).
Use the user says feature to test the Predicted language and Confidence score of the predicted language. This is particularly useful for debugging purposes to ensure accurate language detection and flow triggering.