问题
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