nilimadesai
ServiceNow Employee
ServiceNow Employee

While Virtual Agent (VA) itself supported localization pre-Quebec within the bot, Quebec introduced multi-language support in NLU which further expanded VA's localization capabilities. This blog details best practices for localizing VA in Quebec and beyond.

Also refer to community article 'Guided Overview to Implementing Multilingual NLU Models in NOW platform' for guidance on implementing multilingual NLU in Quebec. In addition, we will also be publishing a playbook (with a link here once available), that helps customers implement multilingual NLU.  The Multilingual NLU playbook will contain all of this information cohesively in a single document. 

Basic Virtual Agent Localization concepts 

Virtual Agent supports localization via translation of bot responses and system messages using the Translated Text [sys_translated_text] and Message [sys_ui_message] tables to provide translations for Virtual Agent topics and accommodate users who speak different languages.  [ Details ] 

Further, language-specific NLU models can be used in Virtual Agent Designer for improved NLU model precision in different languages.  [ Overview ]  

Typically, when a VA Topic runs, the system automatically creates an English language record for virtual agent messages (that do not already exist) in sys_ui_message table. Such messages are identified by the message key itself, language field which is set to ‘en’ and application (non-scope one) field in this table which is set to ‘Virtual Agent’. Any supported non-english languages need to have a corresponding entry in this table for the message key with the language set to the language code and foreign language translation set in the message field.   

If you use multiple languages on your instance or plan to do so in the future, use localization methods in your Virtual Agent scripts to ensure that the content can be translated. Localization methods are designed to show the original text when no translation is found. These methods can be applied to your code before you have created translations. The gs.getMessage or gs.getMessageLang method checks the Message table for the translated version of the text in the language. Even if you don’t support multiple languages at the beginning, we recommend using these methods to be prepared for future translations. 

In addition, it is to be noted that for mapped NLU entity values, the foreign language specific label value on the Virtual Agent side that is stored in sys_ui_message table must match with the language specific NLU Model’s mapped entity label value. Once the VA topic and NLU Models are published, in case this value is updated after, in either the VA or NLU side, it should be synced so that VA can correctly match the NLU entity returned and skip the input control node as expected. 

Localize VA Topics using platform’s Localization Framework capabilities 

Instead of manually localizing messages generated by Virtual Agent in sys_ui_message table as detailed in previous section for each of the supported languages, starting with Quebec, we can use the platform’s localization framework capabilities to perform the translations by following the steps outlined here.  

Note: Below steps can also be applied for Catalog Item (sc_cat_item) records to perform the translations 

Prerequisites: 

Once the Localization Framework plugins are installed and configurations completed as per above community article, we can proceed as per below steps to localize individual virtual agent topics for each of the supported foreign languages.  

Steps to Localize VA Topics in Quebec:

  1.  Go to Artifact Configuration and open the ‘VA Topic’ record to make sure it is Active: https:// ://<INSTANCE NAME>..service-now.com/sn_lf_config_list.do?sysparm_query=&sysparm_view= 
  2. Go to Localization Framework/Settings page and make sure the intended languages are selected. Also make sure Export/Import and any other methods of performing the translations are made active.: https://< INSTANCE NAME>.service-now.com/sn_lf_setting_list.do?sysparm_query=&sysparm_view= 
  3. Go to sys_cs_topic (or sc_cat_item) table’s list view and open the VA Topic that needs localization: https://<INSTANCE NAME>.service-now.com/sys_cs_topic_list.do
  4. Click on Request Translation UI Action on the form and you should see a popup like the screen below NoteOnly languages available on the instance, activated in VA and in the Localization Settings page will be clickable in this popup 
  5. Select a language for the localization to trigger for the selected topic and click Submit. 
  6. Go to Localization/My Localization tasks and open the localization task just created 
  7.  Record should have an ‘Awaiting Translation’ state. Click on the Translate button to open the Fulfill Localization Task screen for the topic’s translation task record. 
  8. Below form is where the localization framework extracts all the needed translation data for the record for translated text, output messages, scripts, etc. which can then be translated to the selected language using the Localization Settings as configured in Step 3 above and saved to the appropriate tables  find_real_file.png
  9. We can use Export Source File to export the translated values to a CSV file for a linguist to review and once the CSV is reviewed and edited, the updated CSV can be used to load the translations using ‘Import Translated File’ so that the system saves the translations to the appropriate tables such as sys_translated_text, sys_ui_message etc. within the platform. 
  10. Machine Translate UI Action can be used to directly translate the data and insert/update the translated values into these table. 
  11. Once the Localization Task is published using the ‘Publish Translation’ UI Action on the form, the task’s state should change to ‘Closed Complete’ 

Steps to Localize VA Topics in Rome:

In Rome release, Localization of VA topics has been integrated right into VA Designer. Once the first 2 steps for Localization Framework settings are completed, VA Topics can be localized right from the VA Designer page under the Languages tab within each topic.

  1. Go to Artifact Configuration and open the ‘VA Topic’ record to make sure it is Active: https:// ://<INSTANCE NAME>..service-now.com/sn_lf_config_list.do?sysparm_query=&sysparm_view=
  2. Go to Localization Framework/Settings page and make sure the intended languages are selected. Also make sure Export/Import and any other methods of performing the translations are made active.: https://< INSTANCE NAME>.service-now.com/sn_lf_setting_list.do?sysparm_query=&sysparm_view=
  3. Users with Localization Requestor role can then request translations for each language from the Languages tab in VA Designer.
  4. Languages that are installed on the instance, but not selected under Localization Framework/Settings are indicated with the info icon similar to 'Spanish' in the example below. 
  5. Once the translation for the topic is requested, the state under Translated Content column switches to View and no new translation requests can be submitted until the previous one completes.
  6. Users with Localization Fulfiller role can open the tasks for requested translations and need to fulfill them. 
  7. Once translations are fulfilled and published, the translated values are available to end users when the topic runs. Publishing of the topic itself is not needed. 
  8. Translations can also be directly handled within VA Designer with the Localization Editor role. Users with this role can click the Edit option under Translated Content and configure the translations side by side for all activated languages. 

find_real_file.png 

 

Enable Target-Language NLU Models and link them to VA Topics 

  1.  Train, Test, and Publish target-language NLU models: Each of the target language models should be trained and published so that the changes are available from Virtual Agent and other applications 
  2. Review NLU intents mapping to Virtual Agent topics: 
    • For NLU intents to match with VA topics when the Virtual Agent runs, each VA topic that is discoverable by NLU (I.e., has its isDiscoverable attribute set to true in sy_cs_topic table), must be mapped to an appropriate NLU intent. 
    • This can be verified on the VA Designer side from the Properties and Languages tabs. It can also be verified in NLU Workbench by opening the NLU Model and viewing the Intent list. Mapped VA topics are listed under Mapped Objects column on this page.
    • Also note that there is a 1:1 relation between an NLU intent and VA topic, which means that once a VA topic is associated to a given NLU intent, that intent will no longer be available for selection under the Properties and Languages tab in VA Designer. Similarly, in NLU Workbench once a topic is mapped to an existing intent, it will no longer be available for selection for other NLU intents.  
  3. Enable Multi-Language NLU for each language: Once a multi-language target language NLU model is trained and published, the language can be activated for use in Virtual Agent by following steps below: 
    • Turn on supported foreign languages for Virtual Agent 
      • Go to Collaboration/Virtual Agent/General Settings module
      • Under VA NLU Languages set Enabled to true for the languages being activated find_real_file.png 

     5. Bind Multi-Language NLU to VA Topics: Similarly, once the multi-language NLU model is trained and published, its intents and entities need to be bound on VA side for each language by following steps below, so that they can be processed and discovered by NLU during runtime.  

Steps to bind MultiLanguage NLU Model, Intent, and Entities to VA Topics 

    • Go to Collaboration/Virtual Agent/Designer module
    • Open each of the topics that need to be bound to the associated foreign language NLU Model and intent
    • Go to Languages tab and pick the language to edit under Intent Mapping
    • This will make the language specific Model and Intent drop-downs visible
    • Set the Model and Intent controls to the language specific NLU model and intent
    • In case the topic has associated entitites that need to be bound for the intent, these need to be bound as well from this page under Entity mapping. find_real_file.png

Warning: Each Virtual Agent topic that has isDiscoverable attribute in sys_cs_topic turned on, must be mapped/bound to an NLU intent. 

 

Selectively Disable Multi-Language NLU for individual languages: Just like multi-language NLU can be activated as detailed in section 8.3 above, they can also be disabled by setting the ‘Enabled’ flag to False under General Settings/VA/NLU Languages for the desired language. Once disabled, the system will trigger keyword search in place of NLU for these languages.  

When disabling NLU for specific languages, following items need to be ensured: 

  • Make sure ‘com.glide.cs.nlu.keywords.enabled’ system property is set to True
  • VA Topic is not bound to an NLU intent
  • No intent is returned by NLU 
  • Each Virtual Agent topic that needs to be discovered, needs to have isDiscoverable attribute in sys_cs_topic turned on 
  • Keyword phrases are configured for the deactivated language in sys_cs_topic table’s key_phrases column 
  • Text indexing for sys_cs_topic table is turned on and under Show Configurations related link, under ‘Text Index Column Attribute Maps’ related list, ‘No Text Index’ attribute for columns: title, key_phrases,  is NOT turned on. In case it is, just delete this entry or set the attribute to False.  

 

1 Comment
Still Learning
Kilo Sage

Thank you so much for this article, it's really helpful.