An integrated search solution leveraging Azure Cognitive Search and QnA Maker to provide instant answers to common questions. Learn more about the repo in this blog post.
This solution accelerator leverages the power of Azure Cognitive Search together with QnA Maker to find answers to your questions in a similar way to how Bing and Google suggest relevant answers to queries.
Ordinarily, Azure Cognitive Search returns the most relevant documents for your search query but together with QnA Maker integration, it can not only find the most relevant documents but also pull questions and answers out of the document and suggest the most relevant answers. During Cognitive Search data ingestion, a custom skill sends the document to QnA Maker for processing.
Please note that not all documents support the question/answer format required by QnA Maker. By default, the logic in the Search service indexer also ingests only the following file types: .pdf,.docx,.doc,.xlsx,.xls,.html,.rtf,.txt,.tsv
. You can change this by modifying the indexedFileNameExtensions
property in the Indexer.json.
This solution accelerator contains the following artifacts:
You can view a live demo of this repo at the following link:
https://qna-ui-i3iohrgwgujpo.azurewebsites.net/
The services and components needed for the solution are packaged in the repo's ARM template. Click the Deploy to Azure button to get started:
If you want to use the latest version of QnA Maker: QnA Maker managed (currently in public preview) which includes new features such as precise answering, click the Deploy to Azure button given below:
The following resources will be deployed:
The deployment may take several minutes. Once the deployment finishes, navigate over to the Outputs tab:
Copy the value of the HTTP Trigger. You'll use this value in the next step.
Open up a new browser tab and paste the URL into the browser. This will run for about a minute and then you'll see a message indicating success or failure.
Navigate to the storage account in the resource group you just created. Find the container named qna-container
and upload your documents into the container.
Sample documents are available in the SampleDocuments folder.
NOTE: if you would prefer to pull data from a different, pre-existing blob storage account, you may instead change the data source in your Search service to point to a container in a different blob storage account. Just change the connection string and container name in the data source in the Search service.
As part of the ARM template, a UI is deployed to https://{prefix}-ui-{randomString}.azurewebsites.net
similar to the screenshot below. Keep in mind it will take a few minutes for the documents to become available in the search index after adding them to storage.
NOTE: At this point, you should consider adding authentication to the web app in the Azure portal to secure your data.
The UI is a React-based Web App available in the SearchUI
folder. Navigate to SearchUI/README.md for more details on the web app.
How is this solution utilizing QnaMaker different from the new semantic search functionality in Cognitive Search?
The semantic search question answering does have a functional overlap with this solution accelerator using QnA Maker. Here's what you need to know.
However, the two options are not mutually exclusive and can be used together. The recommendation to customers is to use the QnA Maker solution for the head queries (high precision, curated), and fallback to the semantic search QnA when there is no good match in QnA Maker. Specifically:
This repo has been tested with document sets as big as 2,000 documents. If you have a larger dataset or run into any issues with this repo, please open an issue and we will get back to you.