Does Microsoft chatbot(Node.js) support multiple language in the single LUIS.AI application?

帅比萌擦擦* 提交于 2019-12-12 19:02:27

问题


I have a chatbot which is built in Microsoft bot framework with Node.js and I integrated this bot with a NLP framework called LUIS.AI intelligence to handle the user conversation based upnon their intents and entity. Here I need this bot to support multiple languages in the single LUIS application but it does not allow us to do so. Is there any hacky method to support multiple languages in a single LUIS application or in code level.?


回答1:


Code Level: You can create multiple LUIS applications and plug them into your LuisRecognizer using an ILuisModelMap. The keys are going to be your locales.

// Assuming you've already instantiated your bot, time to instantiate
// the LuisRecognizer with an ILuisModelMap.

var many_language_recognizer = new builder.LuisRecognizer({
  'en': englishModel || process.env.EN_LUIS,
  'es': spanishModel || process.env.ES_LUIS,
  'fr': frenchModel || process.env.FR_LUIS
});

bot.recognizer(many_language_recognizer);

You'll also want to use the SDK's localization capabilities to generate your prompts and messages.

LUIS Level: LUIS only supports one language per application, hence having to create more than one app.



来源:https://stackoverflow.com/questions/46243152/does-microsoft-chatbotnode-js-support-multiple-language-in-the-single-luis-ai

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!