Редагувати

Поділитися через


Change default answer for a QnA Maker resource

The default answer for a knowledge base is meant to be returned when an answer is not found. If you are using a client application, such as the Azure AI Bot Service, it may also have a separate default answer, indicating no answer met the score threshold.

Note

The QnA Maker service is being retired on the 31st of March, 2025. A newer version of the question and answering capability is now available as part of Azure AI Language. For question answering capabilities within the Language Service, see question answering. Starting 1st October, 2022 you won’t be able to create new QnA Maker resources. For information on migrating existing QnA Maker knowledge bases to question answering, consult the migration guide.

Types of default answer

There are two types of default answer in your knowledge base. It is important to understand how and when each is returned from a prediction query:

Types of default answers Description of answer
KB answer when no answer is determined No good match found in KB. - When the GenerateAnswer API finds no matching answer to the question, the DefaultAnswer setting of the App service is returned. All knowledge bases in the same QnA Maker resource share the same default answer text.
You can manage the setting in the Azure portal, via the App service, or with the REST APIs for getting or updating the setting.
Follow-up prompt instruction text When using a follow-up prompt in a conversation flow, you may not need an answer in the QnA pair because you want the user to select from the follow-up prompts. In this case, set specific text by setting the default answer text, which is returned with each prediction for follow-up prompts. The text is meant to display as instructional text to the selection of follow-up prompts. An example for this default answer text is Please select from the following choices. This configuration is explained in the next few sections of this document. Can also set as part of knowledge base definition of defaultAnswerUsedForExtraction using REST API.

Client application integration

For a client application, such as a bot with the Azure AI Bot Service, you can choose from the common following scenarios:

  • Use the knowledge base's setting
  • Use different text in the client application to distinguish when an answer is returned but doesn't meet the score threshold. This text can either be static text stored in code, or can be stored in the client application's settings list.

Set follow-up prompt's default answer when you create knowledge base

When you create a new knowledge base, the default answer text is one of the settings. If you choose not to set it during the creation process, you can change it later with the following procedure.

Change follow-up prompt's default answer in QnA Maker portal

The knowledge base default answer is returned when no answer is returned from the QnA Maker service.

  1. Sign in to the QnA Maker portal and select your knowledge base from the list.

  2. Select Settings from the navigation bar.

  3. Change the value of Default answer text in the Manage knowledge base section.

    Screenshot of QnA Maker portal, Settings page, with default answer textbox highlighted.

  4. Select Save and train to save the change.

Next steps