Search code examples
c#azure-cognitive-servicesazure-language-understanding

LUIS returning only one intent


I am working on a small project with LUIS integration. I am using the using Microsoft.Bot.Builder.Luis namespace for communication with the api. i was inspecting all intents i got back but since last week i only get back one intent per luis-call. Is there any (by me) unseen change to the verbose mode i did not get? Is there a way to still call for all intentresults or giving the luismodel some kind of settings on its way to the server?

i did not change any settings on luis.ai and i was wondering why this happens. Thanks in advance!

meq


Solution

  • This worked for me. In the LuisRecognizer constructor there is an optional parameter with a flag called IncludeAllIntents. Just set it to true and add it to the constructor.

        var luisApplication = new LuisApplication(
            configuration["LuisAppId"],
            configuration["LuisAPIKey"],
            "https://" + configuration["LuisAPIHostName"]);
    
        var predictionOptions = new LuisPredictionOptions();
            predictionOptions.IncludeAllIntents = true;
    
        _recognizer = new LuisRecognizer(luisApplication, predictionOptions);