Empowering patients and healthcare organizations through Azure AI Services
The session “Empowering patients and healthcare organizations through Azure AI Services” presented at the Boston Healthcare User Group.
In this article, you will learn how to author a custom scenario in Azure Health Bot. You will create a mental health bot that assess the severity of depression using the PHQ-9 questionnaire.
You will learn how to:
To complete the exercise, you will need:
Sign in to Azure Health Bot management portal and in the Scenarios tab, select Create new scenario.
In the New scenario window, enter the following information:
Once the scenario is created, you will be redirected to the Designer visual interface. You will build your scenario using the available conversational, flow control and advanced functionality elements in the top menu.
Select the Prompt control and drag it onto the canvas. Fill out the required properties:
['Yes', 'No']
Then, drag a Branch element onto the canvas and enter the following command: ${start_phq9}.entity == "Yes"
Connect the output port of the Prompt control to the input port of the Branch element.
Drag a Statement block and enter Thanks. Goodbye!
in the Display text field. Connect the left output node (No) of the Branch element to the input node of the Statement block.
Add a Statement block and add this text in the Display text field: Over the last **2 weeks**, how often have you been bothered by any of the following problems?
. Connect the right node (Yes) of the Branch element to the input node of the new Statement block.
Select the Action element and drag it to the canvas. Add the following script which creates an array of the 9 questions and the 4 possible answers and initializes the question index and score. We will then use the q_index
variable to display each question of the questions array.
|
|
Connect the two new nodes.
Then, add a Prompt element in your scenario. Use the following properties:
${questions}[${q_index}]
${answers}
Drag a second Action element onto the canvas and add the following code (which increases by 1 the question index and calculates the current score):
|
|
Use a Branch element to check whether we have reached the last question. Use the following command:
|
|
Connect the elements as shown in the image. This way you will create a loop using the last 3 blocks.
Then, use an Action element to calculate the total score and the depression severity.
|
|
Connect the right node (Yes) of the previous Branch element to the input node of the Action element.
Lastly, add a Statement element to display the result to the end-user. Use the following text: "Depression Severity: " + ${severity}
Click Save and use the Run button to test your scenario.
Let’s close the Designer and return to the health bot management portal. Click on the webchat icon and type begin phq9_scenario (where phq9_scenario is the ID of our new scenario) to trigger the mental health scenario.
The next step is to create a language model which understands end user’s intention and triggers the relevant scenario. For example, you can use a language model to trigger the PHQ-9 scenario when a user types “I want to start the PHQ-9 questionnaire”.
There are different types of language models. In this article, I will show you how to create a simple RegEx language model to understand when a user is asking to start the PHQ-9 questionnaire.
/phq-9/
would match the utterance “I want to start the phq-9 questionnaire”.In the management portal, navigate to Language > Models > New.
In the New model window, fill out the following properties:
/phq-9|depressed/
Open the webchat and type “I want to take the phq-9 questionnaire” to test the language model. This should trigger the phq9_scenario that we created.
Type “I feel depressed”. This will trigger the triage and symptom checking scenario instead of the mental health scenario.
Language models work in parallel. When an end user’s utterance is received, it is evaluated by all the language models. The language model with the highest confidence score wins and triggers the relevant scenario. Learn more about Language models in Azure Health Bot.
You can explore further Azure Health Bot’s language model by creating a LUIS model.
If you have finished exploring Azure Health Bot, you can delete your health bot instance and associated resources.
The session “Empowering patients and healthcare organizations through Azure AI Services” presented at the Boston Healthcare User Group.
In this article, you will build your first intelligent, AI-powered, medical chatbot using Azure Health Bot.
The session “Using scenarios and language understanding in Azure Health Bot” with Einat Gruda Idelovitch, Foteini Savvidou and Nihal Dias.
In this tutorial, you will create a classification model for chronic kidney disease prediction in Azure Machine Learning Designer.