Extend your healthcare agent service with Question Answering
Question answering provides cloud-based Natural Language Processing (NLP) that allows you to create a natural conversational layer over your data. It's used to find the most appropriate answer for any input from your custom knowledge base (KB) of information.
Question answering is commonly used to build conversational client applications, which include social media applications, chat bots, and speech-enabled desktop applications.
When creating a Question Answering model, you'll need a Cognitive Service for Language account. For more info on how to connect your Question Answering resource to the healthcare agent service, you can read more here
Important
This tutorial gives you a high level overview on how to create your first Question Answering project. For a full and extended tutorial you can find more info here
Create your first Question Answering project
Sign in to the Language Studio with your Azure credentials.
Go to Understand questions and conversational language tab and select Open custom question answering.
Choose a language resource. You can select an existing Azure subscription or create a free account and then refresh. After creating select the Language resource.
- Select Connect to Azure Search
- The knowledge base created from your content is stored in an Azure Search index in your Azure subscription, Create Azure Search.
Return to the Understand questions and conversational language tab. You may need to refresh this page to register the change to your resource.
Select Create a new project.
Choose the option I want to set the language for all projects created in this resource, select English and hit Next.
Enter the project name of
Covid-19
, a description ofMy first question answering project
, and leave the default answer with a setting ofNo answer found
.Review your choices and select Create project.
From the Manage sources page, select Add source > URLS.
Select Add URL :
https://www.cdc.gov/coronavirus/2019-ncov/vaccines/faq.html
.
The extraction process takes a few moments to read the document and identify questions and answers.
After successfully adding the source, you can then edit the source contents to add more custom question answer sets.
Test your project
Select the link to your source, this opens the edit knowledge base page.
Select Test from the menu bar and Enter the question
What are the risks to getting a booster?
An answer will be generated based on the question answer pairs that were automatically identified and extracted from your source URL:
If you check the box to include a short answer response you will also see a precise answer, if available, along with the answer passage in the test pane when you ask a question.
Select Inspect to examine the response in more detail. The test window is used to test your changes to your project before deploying your project.
From the Inspect interface, you can see the level of confidence that this response answers the question and directly edit a given question and answer response pair.
Deploy your project
- Select the Deploy knowledge base icon to enter the deploy knowledge base menu.
When you deploy a project, the contents of your project move from the test index to a prod index in Azure Search.
Select Deploy and then when prompted select Deploy again.
Your project is now successfully deployed. You can use the endpoint to answer questions in your own custom application to answer or in a bot.
Select Get prediction URL save the Prediction URL
Go to your healthcare agent service
Go to Language -> Models -> Add New Language Model¨
Select the Question Answering method
- Copy all the Prediction URL parameters.
- Method: Question Answering
- Endpoint: The endpoint of your instance
- Subscription: Your Subscription Key
- Project Name: The name of your Question Answer Project
- Deployment Name: The name of your deployment
- Api Version: The Api version of your deployment.
Validate question answering settings.
Enter intent mapping ->
covid
with/builtin/questionAnswering
and hit CreateSee your new Question answering model on Language Models page.
- Test your chat – ask the one of the questions from your Knowledge Base like:
If we need a booster, are the vaccines working?