botframework-components icon indicating copy to clipboard operation
botframework-components copied to clipboard

[MCS-DE-GO] LUIS Prediction Parameters

Open goergenj opened this issue 3 years ago • 7 comments

From the Logs we can see that the Composer-integrated Bot runtime set two query parameters with every LUIS Prediction call:

https://.cognitiveservices.azure.com:443//luis/prediction/v3.0/apps//slots/production/predict?verbose=False&log=True&show-all-intents=False

I could not find how to set these parameters in the Bot settings within Composer.

Please provide guidance on how this can be configured with Composer.

@joaollq @goergenj @garypretty

goergenj avatar Jun 22 '21 13:06 goergenj

See also: https://github.com/microsoft/BotFramework-Composer/issues/3317

goergenj avatar Jun 22 '21 14:06 goergenj

Hi @goergenj,

I've taken a look at the above. The query parameters verbose, log, and show-all-intents are controlled by the optional predictionOptions object specified on the LUIS adaptive recognizer JSON. You can find the schema definition for the options here: https://github.com/microsoft/botbuilder-dotnet/blob/ee4f5f074302af9c24d498025c45a6ae809ef1eb/libraries/Microsoft.Bot.Builder.AI.LUIS/Schemas/Microsoft.LuisRecognizer.schema#L83-L114

The mapping of the properties is as follows:

includeInstanceData (default: false) -> verbose log (default: true) -> log includeAllIntents (default: false) -> show-all-intents

It should be possible to manually update the recognizer JSON in your bot project to override these as necessary. Since they use adaptive expressions, you could also bind these to set values in your appsettings.json.

That said, this obviously requires updating the recognizer JSON files manually, which is not ideal for users looking to do this directly through Composer. @garypretty @cwhitten can you provide guidance on whether it is possible to set these recognizer options through Composer directly for adaptive dialogs?

GitHub
Welcome to the Bot Framework SDK for .NET repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using .NET. - microsoft/botbui...

peterinnesmsft avatar Jun 23 '21 20:06 peterinnesmsft

@peterinnesmsft Thanks for the information.

@garypretty @cwhitten Is it possible to add the "preditionoptions" into the appsettings of the Bot in Composer:

"luis": { "name": "Botname", "defaultLanguage": "de-de", "authoringEndpoint": "https://xx-authoring.cognitiveservices.azure.com/", "endpoint": "https://xx.cognitiveservices.azure.com/", "authoringRegion": "westeurope", "environment": "local", "authoringKey": "xxx", "endpointKey": "xxx" "predictionOptions": { "properties": { "includeAllIntents": true, "log": true, "slot": "production" } } },

@joaollq

goergenj avatar Jun 24 '21 10:06 goergenj

So the recognizer JSON could be changed to use expressions to point to appsettings. Then the default appsettings in the adaptive generator would include them. What would the appropriate defaults be?

@benbrown The default appsettings could be changed immediately. The recognizer JSON could be changed as able later?

tracyboehrer avatar Jun 24 '21 14:06 tracyboehrer

@cwhitten @tracyboehrer @benbrown @garypretty Could we setup an alignment call next week to discuss how this can be implemented? We need this urgently in our customer project and will eventually write a customization. If we sync on this quickly maybe we can join forces and push this back via a pull request or you can provide the updated version.

goergenj avatar Jun 25 '21 14:06 goergenj

The following comment expresses a gap in the SDK to enable and support this: https://github.com/microsoft/botframework-components/issues/1015#issuecomment-831736740

After this is fixed, yes Composer can author to the format.

cwhitten avatar Jun 25 '21 16:06 cwhitten

@cwhitten FYI, for our customer implementation we implemented this as a wrapper to the SDK to enable the "log" and "staging" slot settings. If it bridges the time for fixing it in the SDK, we can provide a pull-request for this if needed. Doing it properly in the SDK would be the better solution however.

@joaollq

goergenj avatar Jun 28 '21 13:06 goergenj