Search code examples
node.jsbotframeworkazure-cognitive-servicesazure-language-understanding

How to enable active learning for LUIS app - botvuilder SDK JavaScript V4


I am trying to enable the active learning for our LUIS app connected to a chatbot.

According to LUIS docs, I found out that we should add log=true to LUIS endpoint URL.

For that, the botbuilder SDK offers the LuisRecognizer class that allows us create a Luis Instance fort the bot.

I checked out the botbuilder SDK V4 for JavaScript and I did not find how the add log=true to the endpoint URL!

const dispatchRecognizer = new LuisRecognizer(
  {
    applicationId: luisConfig.appId,
    endpointKey: luisConfig.subscriptionKey,
    endpoint: luisConfig.getEndpoint()
  },
  {
    staging: true
    includeAllIntents: true,
    includeInstanceData: true
  },
  true
);

Is there a wait to resolve the issue this or to pass the luis URL directly to the class constructor?

Thanks,


Solution

  • You can see here that it's part of LuisPredictionOptions:

    export interface LuisPredictionOptions extends LuisModels.PredictionResolveOptionalParams {
        bingSpellCheckSubscriptionKey?: string;
        includeAllIntents?: boolean;
        includeInstanceData?: boolean;
        log?: boolean; // SET TO TRUE
        spellCheck?: boolean;
        staging?: boolean;
        timezoneOffset?: number;
        telemetryClient?: BotTelemetryClient;
        logPersonalInformation?: boolean;
    }
    

    You're already passing in LuisPredictionOptions, you just need to edit it so you're doing it like this:

    const dispatchRecognizer = new LuisRecognizer(
      {
        applicationId: luisConfig.appId,
        endpointKey: luisConfig.subscriptionKey,
        endpoint: luisConfig.getEndpoint()
      },
      {
        log: true,
        staging: true
        includeAllIntents: true,
        includeInstanceData: true
      },
      true
    );