Luis Api 'FewLabels' issue - botframework

I am developing bot using LUIS framework by Microsoft. I am able to create application, Intent and utterances but when I try to train and publish my bot I am getting following error.
{
modelId: 'some-model-id',
details: {
statusId: 1,
status: 'Fail',
exampleCount: 0,
failureReason: 'FewLabels'
}
}
Because of this I am not able to publish my LUIS application. I don't find much information about the cause and prevention of this issue in Microsoft documents.

Thanks to #Nicolas R.
This is because of zero utterances in one of the intent while training.
So if you are using Luis Api make sure that each intent atleast have one utterance.
FewLabels seems to be a wrong failure Reason though, it should be like NoUtterance or ZeroUtterance or a detailed message like Unable to train XYZ application because ABC intent have zero utterances

Related

Unable to assign LUIS az accounts to LUIS apps via REST

The luis resources that I created aren't showing up in the Luis portal (posted a question here) so decided to use the REST APIs to configure things manually. With the REST endpoints I was able to import apps. However, I wasn't able to add LU resource to the imported apps despite that the APIs return success.
Below is the call.
POST https://westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/<appid>/azureaccounts
{
"azureSubscriptionId": "<id>",
"resourceGroup": "<rg name>",
"accountName": "<resource name>"
}
returns 201 CREATED
{
"code": "Success",
"message": "Operation Successful"
}
However, a subsequent GET call returns empty result.
GET https://westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/<appid>/azureaccounts
tried the GET call a couple hours after and it is still returning empty result. What is going on?
It sounds like there's something wrong with your azure account and/or your luis.ai account. There are two places to raise support requests to handle these types of matters. First is uservoice on LUIS.ai:
While issues raised here are typically routed back to the bot framework support team, once there, they can be escalated.
Secondly, you can raise the issue in Azure:
You can follow this link HERE to get to that blade quickly.

Post message to MS Teams channel using Graph API

I'm trying to send a message to MS Teams using Graph API. I'm passing access token (AAD token) with it but still, it's giving me below error. I have given all the required permissions in Azure API permissions.
error:
{
"error": {
"code": "UnknownError",
"message": "",
"innerError": {
"request-id": "53a5aaff-3d39-42ce-bdc6-74d02a756be2",
"date": "2019-12-23T06:42:27"
}
}
}
API: https://graph.microsoft.com/beta/teams/{group-id-for-Teams}/channels/{channel-id}/messages/{message-id}/replies
Oh, if this is from a bot (not clear from the original question, but clarified in your later comment) then you don't need to use the Graph API at all - there's another way to send the message using the Bot Framework tools instead. You can do this either from within your bot, or from a different application altogether. I've got a few bots where the user schedules something, like when they want a message sent, where the bot saves it to a database and I have another application (mostly I use Azure Functions right now) to send the item on that schedule.
There are some important pieces of information you need to store though, which you can get any time the users sends your bot a message - it's the information you need to store so that you know how to connect directly to that user and that conversation. It's called Pro-active Messaging, and to see how to do this, see the answer I posted at Programmtically sending a message to a bot in Microsoft Teams
If you DON'T have any conversation history with the user ever (as in they have never spoken with your bot before, and you're trying to send the first message) then it gets more complicated... Let me know if that's the case though.
Sending message to a channel using graph api is a protected api and it needs access permission from Microsoft.
Access can be requested from Microsoft access reuqest form.
Once access is given from Microsoft add graph api in api permissions of your web app, and bingo you can get the response.

what is the best practice to review endpoint utterance in Luis dispatch model?

what is the best way to enhance a dispatch model in LUIS, as checking the dispatch app asked utterances "review endpoint utterances" and updating it does not affect the original apps I have from Luis or QnA, should i always update the other apps manually based on the received endpoint utterances or there is a better practice for improving a dispatch bot?
Good question. Updating Dispatch app directly on LUIS portal is not currently recommended as the utterances added directly will be overridden (removed) when Dispatch app is refreshed via the "dispatch refresh" CLI command. To add utterances shown in "Review Endpoint Utterances" to Dispatch, add them to a file (one line per utterance, one file per dispatch intent). Add the intent file to Dispatch as source, ie:
dispatch add -t file -f <> --intentName <>
If the utterances are never seen in the underlying LUIS app, add them directly to the app.
The Review Endpoint Utterances page shows you utterance by users and your tests as well, which you can quickly assign to intents to improve the model. To make changes to the model visible, you need to first Train then Publish

My intent is not matching with expected response

I'm using botkit with luis recognizer and below is the sample code:
bot.dialog('OnboardingDialog', (session) => {
....
....
}).triggerAction({ matches: 'OnboardingBook' })
I have defined onboarding intent in responses as below:
OnboardingBook:{buttonTitle:'',url:'',response:'new hire can be onboarded some extra stuff',title:'Onboarding book'}
CookBook: {buttonTitle:'',url:'',response:'this is about cookbook',title:'cook'}
Ideally, if I type onboarding in my chat bot, it should return response defined in Onboarding intent. But right now its giving me other intent answer. If i type, onboarding book its giving me cook book intent.
Please help me out why few intents are matching with other than expected. Is there any logic behind this? How to resolve this problem. Please help me out.
When you test your LUIS app in the LUIS portal do you get the correct intent? If so then perhaps you need to save and train, the publish your LUIS app again. If you do not get the correct result in the LUIS portal then you can click inspect and edit the top scoring intent (save + train then publish to push the change live).

'Oops. Something went wrong and we need to start over.' with Microsoft Bot Service with LUIS Template

I have created a Bot Service with LUIS template using Node.js, I have trained my luis model with our domain utterances and it was working fine. suddenly from a week time , Am facing weird behavior form the Bot Service, for any request the bot is replying as 'Oops. Something went wrong and we need to start over.' message. Could anyone encountered the similar issue and share your inputs to resolve.
Appreciate your help.
When a user query exceeds 500 character Luis gives an error. Check the user message how long it is and then test it in Luis portal. Or please check the subscription key which is used.

Resources