Question and answer pair concepts
A knowledge base consists of question and answer (QnA) pairs. Each pair has one answer and a pair contains all the information associated with that answer. An answer can loosely resemble a database row or a data structure instance.
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.
The required settings in a question-and-answer (QnA) pair are:
- a question - text of user query, used to QnA Maker's machine-learning, to align with text of user's question with different wording but the same answer
- the answer - the pair's answer is the response that's returned when a user query is matched with the associated question
Each pair is represented by an ID.
The optional settings for a pair include:
- Alternate forms of the question - this helps QnA Maker return the correct answer for a wider variety of question phrasings
- Metadata: Metadata are tags associated with a QnA pair and are represented as key-value pairs. Metadata tags are used to filter QnA pairs and limit the set over which query matching is performed.
- Multi-turn prompts, used to continue a multi-turn conversation
If you do not have pre-existing content to populate the knowledge base, you can add QnA pairs editorially in the QnA Maker portal. Learn how to update your knowledge base here.
Once a knowledge base is created, it is recommended that you make edits to the knowledge base text in the QnA Maker portal, rather than exporting and reimporting through local files. However, there may be times that you need to edit a knowledge base locally.
Export the knowledge base from the Settings page, then edit the knowledge base with Microsoft Excel. If you choose to use another application to edit your exported file, the application may introduce syntax errors because it is not fully TSV compliant. Microsoft Excel's TSV files generally don't introduce any formatting errors.
Once you are done with your edits, reimport the TSV file from the Settings page. This will completely replace the current knowledge base with the imported knowledge base.