QnA Maker Reference

Azure QnA Maker is a cloud-based service that uses machine learning to build a sophisticated question-and-answer knowledge base from your product or service content.

Key Concepts

Knowledge Base

A knowledge base is a collection of question-and-answer pairs. QnA Maker can extract structured and unstructured content from various sources to create a knowledge base. Supported sources include:

Question-Answer Pairs

Each item in the knowledge base is a question-and-answer pair. You can define multiple ways to ask the same question to improve the accuracy of responses. Each pair can also have optional metadata for filtering and routing.

Active Learning

QnA Maker uses active learning to suggest potential improvements to your knowledge base. This helps you maintain a high-quality and accurate set of answers.

APIs and SDKs

QnA Maker provides robust APIs and SDKs to integrate its functionality into your applications. The primary APIs include:

REST API Endpoints

Some common REST API endpoints include:

Example: Querying for an Answer

Here's a conceptual example of how you might query QnA Maker using its REST API:


POST https://{your-endpoint-hostname}/qnamaker/v5.0/knowledgebases/{knowledgeBaseId}/query
Content-Type: application/json
{
    "question": "What is Azure?",
    "top": 3,
    "scoreThreshold": 0.2,
    "context": {
        "promptSuggestions": true,
        "િસ્: [optional_previous_turn_context]
    }
}
            

Important Note

QnA Maker is transitioning to Azure Cognitive Service for Language's Custom question answering feature. While QnA Maker is still supported, we recommend exploring the new capabilities within the Azure AI Language service for future development.

Learn about Custom question answering

Getting Started

To get started with QnA Maker:

  1. Create a QnA Maker Resource: In the Azure portal, create a QnA Maker resource and associate it with an Azure Cognitive Search resource.
  2. Create a Knowledge Base: Use the QnA Maker portal or the REST API to create your first knowledge base from your content sources.
  3. Test and Publish: Test your knowledge base to ensure accuracy and then publish it to make it available for consumption.
  4. Integrate: Integrate the published knowledge base into your applications using the SDKs or REST APIs.

Resources