0
votes

According to this documentation from Microsoft;
https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/troubleshooting

In order to change the default answer for your bot you should go to the "app service resource" > "Application settings" under "Settings" and then edit the value for the key "DefaultAnswer".

My resources for this project in Azure looks like this;
MyBot (Cognitive Services)
MyBot (App Service Plan)
MyBot (App Service)
mybot-randomstring (Search service)
mybot-bot (Web App Bot)
mybot-bot (App Service)

I go into the "MyBot" app-service and see that the key is already there and modified the default answer however even after retraining my KB in QnA-Maker it still responds with the default answer "No QnA Maker answers were found.".

I restarted the "MyBot" app-service and retrained and published the KB but I still get the default answer. If I look into the "mybot-bot" app-service there is no such key so guessing its the "MyBot" app-service I should change the value in.

Any ideas why it isn't working?

2
I used the same documentation and was able to successfully get the default answer changed. Just to double check, when you change the default answer, are you clicking on the 'Save' option and then 'Refresh' option at the top of the Application settings? I just went to my app service and edited the default answer and saved and refreshed. I went back to my QnA Maker and used the 'Test' option to check(did not even need to retrain my KB).ranusharao
Yeah I just went into the app-service and checked the default answer value and I even pressed "refresh" ("save" was greyed out so it was saved) and my custom answer was still there.CloudViking86

2 Answers

0
votes

I had the same issue and bypassed this by checking the answer score before sending the output activity. I took this one step further to call a separate Social Talk KB (using it at an Enterprise level) before using the default answer. Here is the code:

            // Apply confidence filter
            if (qnaResult[0].score > MINIMUM_SCORE) {
                outputActivity = MessageFactory.text(qnaAnswer);
            }
            else {
                // If low confidence, send to social talk
                var socialResult = await SocialTalkHelper.queryQnAService(query, oldState);
                if (socialResult[0].score > MINIMUM_SCORE) {
                    outputActivity = MessageFactory.text(socialResult[0].answer);
                }
                else {
                    // If low confidence for social talk, use default answer
                    outputActivity = MessageFactory.text(defaultAnswer);
                }
            }

defaultAnswer is my custom default answer string defined earlier in the code. Let me know if you have any trouble getting this to work.

0
votes

For some reason when I removed the "chitchat" I've added and only had my own Sharepoint document as the base of the KB I was able to test it and get my default answer.