QnA with Azure Cognitive Search
Published Feb 02 2021 11:59 PM 7,795 Views
Microsoft

 

QnA + Azure Cognitive Search enables instant answers over your search resultsNow, you do not need to spend time looking through your pile of documents to find the exact answer to your queryThere will be an instant answer coming up for the user query from the most relevant documents present in your system.  A solution where you can ingest your pile of documents and query over them to get the answer as well as related relevant documents to get more information. 

 

This solution accelerator enables automatic bulk ingestion of documents for QnA processing via a Cognitive Search custom skill.  The sample UI showcases the combined experience of instant answers to your questions as well as the list of relevant documents.  Finally, the solution is easily deployed using a simple Deploy button, which sets up all necessary services in your Azure subscription

 

B1.PNG

 

Benefits: 

  • Converged search experience powering instant answer and relevant documents. 
  • Search using natural language queries. 
  • One-click deployment. 
  • Saves end user time during search.  
  • Flexibility to enhance and edit instant answers. 

 

The solution combines the power of both Azure Cognitive Search and QnA Maker to extract question-answer pairs from your documents before storing them in the index. Once you deploy the solution, you get a single endpoint where for each end user query both the services will be called in parallel and you will get a combined result with an instant answer powered by QnA Maker along with the relevant documents coming from Azure Cognitive Search.  Checkout the Cognitive Search Question Answering Solution Accelerator (github.com) 

 

 

Architecture 

A1.PNG

 

This solution accelerator contains the following artifacts: 

  • ARM template to set up the solution. 
  • Custom skill in Azure Cognitive Search, which ingests the data into QnA Maker. 
  • User interface to view the results. 

 

Live Demo Link:  

You can view a live demo of this repo at the following link: https://aka.ms/qnaWithAzureSearchDemo 

 

File Type Supported:  

Currently instant answers will only be available for the file types supported by QnA MakerBy default, the logic in the Azure Cognitive 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. 

 

Tutorial: 

NOTE: You need to have a GitHub account and Azure subscription to try out this solution.  

 

Resource creation and deployment: 

  • Click here to Deploy to Azure. 
  • This will take you to the create blade where all the information will be pre-filled, as shown below. Click Review+ Create button to proceed. T1.PNG

 

  • Your deployment process will take 4-5 minutes to complete. Once completed you will land up on the following page: T2.PNG

 

  • Click on Deployment details to check all the resources that have been created.  T8.PNG

 

Initialization: 

  • To initialize the solution, click on the Outputs” button on the left. Copy the http trigger to initialize accelerator" value. Open a new browser tab and paste this URL into the browser. This will run for about a minute, and then you'll see a message indicating success or failure.T4.PNG 
  • If the initialization is successful, then following message will appear: T5.PNG
  • Once the resources are initialized, you can access the portal through the UI portal link value in the Output tab.  T6.PNG

Upload Documents:  

  • You can upload the documents one by one through the UI portal, by going to the Upload tab. 

        T7.PNG

  • You can also upload the documents in bulk, through a container.  
    • Go to your storage account.  T3.PNG
    • Click on Containers and select qna-container to upload the documents in bulk.  T9.PNGT10.PNG
    • Use the Upload tab and select the multiple files you want to ingest. It will take some time to index the documents and to extract the Question Answer pairs out of the documents. T11.PNG 

 

Question Answer Enhancement:  

  • Once the ingestion is complete, you can view all the Question Answer pairs extracted from the documents by clicking on Knowledge Base. T12.PNG
  • Play with your knowledge base!,  You can also test for different queries using the Test Pane. Once you are satisfied with the experience, click on Save and Train and then Publish the changes to get these changes reflected on your main portal. T13.PNG

This solution has been specifically created for our customers to address the long-term standing ask to retrieve an instant answer from the relevant document. This solution currently covers the basic functionality, and we will keep adding more features based on user interaction and customer’s feedback.  Please feel free to drop us a mail at search-qna-solution@microsoft.com to provide your valuable feedback. 

 

 

Useful Links:

3 Comments
Copper Contributor

There are a few gaps with Q&A at the moment which I hope the product team addresses.

 

The first is the inability to associate metadata with the content as it's being ingested from a file or URL source.  For example, if you upload a PDF, it would be useful to be able to provide key-value pairs which are automatically set as metadata on the resultant index from that source.  At current, the process requires re-processing each item in the index and evaluating the source and then assigning metadata to the item.  This functionality already exists on the API as long as you are starting from a QnADTO object rather than a file.  A simple example is that you may want to associate a version identifier to a document that is ingested so that each Q&A entry has a version metadata tag associated.

 

The second is to "downgrade" a response.  Currently, you can kind of "promote" a response by adding an alternate phrasing to respond to a broader set of vocabularies, but there's no way to make a Q&A item less relevant.

 

It's a great service, but still has room for growth.

Microsoft

@CharlieDigital, this is brilliant feedback. We will put this in our backlog.

Copper Contributor

We just tried this and "Deploy to Azure" deploys the app succesfully but the applications doesn't run after the deployment. Is this example still relavent ?

Please suggest.

azure_error.PNG

Co-Authors
Version history
Last update:
‎Jul 18 2023 09:37 AM
Updated by: