Chat Bots on Azure #
Working with Microsoft QnA Maker + Bot Framework #
By Kyle Mitofsky, Principle Developer at Vermont Department of Health #
@KyleMitBTVRecording - 7/16/20 #
Overview #
- Acknowledgements
- Chat Bot Demo
- Technologies
- Training
- Pricing
- Lessons Learned
- Azure Demo
- Resources
Acknowledgements #
- Maintenance & Operations (MO) Team
- John Mathias
- Katie Jones
- Sandra LeBlanc
- John Hanning
- Grace Demler
- VDH Communications Team
- Sharon Muellers
- Christie Vallencourt
- Amelia Ray
- ADS Partners
- Josiah Raiche
- Timothy Hannett
- MS Partners
- Mike Hacker
- Russ Williams
Chat Bot Demo #
Demo Sites #
- BOT - https://apps-test.health.vermont.gov/COVID/
- FAQ - https://apps-test.health.vermont.gov/COVID/faq/
Technology Stack #
- QnA Maker
- Bot Framework
- Eleventy
- Markdown 🎉
QnA Maker #
- Knowledge Base
- Rich Text Editor (finally)
- As of Build 2020
QnA Maker GUI #
QnA Maker Data #
{
"id": 4534,
"answer": "**What are the symptoms of COVID-19?**\n\nPeople with COVID-19 have had a wide range of symptoms reported – ranging from mild symptoms to severe illness. Symptoms may appear 2 to 14 days after exposure to the virus. ...",
"source": "KB-COVID",
"questions": [
"What are the symptoms of COVID-19?",
"How can I tell if I have Covid-19?",
"what symptoms should I look for",
],
"metadata": [
{"name": "category","value": "symptoms and sickness"},
{"name": "subcategory","value": "symptoms"},
],
}
Qna Maker API #
- Look at in Postman
- Import Collection
- Only way to modify "Alterations"
Bot Framework #
Create a bot with the ability to speak, listen, understand, and learn from your users with Azure Cognitive Services.
Bot Channels #
- Web Chat
- Slack
- MS Teams
- Twilio / SMS
- Alexa
- ...
Bot Framework Web Chat #
- Change colors
- Change sizes
- Update/replace CSS styles
- Listen to events
- Interact with hosting webpage
- Plus React
- Custom render activities
- Custom render attachments
- Add new UI components
- Recompose the whole UI
FAQ Site #
Eleventy #
- Static Site Generator
- Live Data over API
Structured Data #
{
"@context": "https://schema.org",
"@type": "FAQPage",
"mainEntity": [
{
"@type": "Question",
"name": " What are the symptoms of COVID-19?",
"acceptedAnswer": {
"@type": "Answer",
"text": "People with COVID-19 have had a wide range of symptoms reported – ranging from mild symptoms to severe illness. Symptoms may appear 2 to 14 days after exposure to the virus. Not everyone infected with the COVID-19 virus has symptoms. People with these symptoms may have COVID-19:"
}
}
]
}
Triage & Training #
- Triage (labor hours)
- Training Opportunity - Query should have matched to better Answer
- Missing FAQ - Answer doesn't yet exist in knowledge base
- Training
- Alternative Phrases - question level
- Alterations - word level
Application Insights #
traces | where message contains "GenerateAnswer" | extend input = tostring(customDimensions.Question), answer = tostring(customDimensions.Answer), scoreInt = toint(round(todouble(customDimensions.Score))), convoId = substring(itemId, 0, 7)
Pricing #
Service | Test | Prod | Total |
---|---|---|---|
Azure Cognitive Search | F - $0/mo | B - $75/mo | $75/mo |
App Services Plan | D1 - $9.50/mo | S1 - $73/mo | $82/mo |
Cognitive Services | F0 - $0/mo | S0 - $10/mo | $10/mo |
Bot Services | F0 - $0/mo | S1 - $.50/1k msg | $6/mo |
Total | $9/mo | $164/mo | $174/mo |
Lessons Learned #
Lesson #1 #
Plan a lot of time for training
Lesson #2 #
Get content authors involved early
Tips & Tricks #
Tip #1 #
Problem: Multi-authoring editing is still difficult
Solution: Use MS Teams / IM to manage authoring
Tip #2 #
Problem: Question order isn't deterministic
Solution: Repeat question wording in answer
Tip #3 #
Problem: IDs are lossy during publish
Solution: Use API and lots of logic
Demo #
- Create Knowledge Base - https://www.qnamaker.ai/
- Add chitchat + question
- Test / Train
- Publish
- Create Bot
- Embed Bot
Resources #
VDH Dev Links #
Chat Bot Presentation ⭐ <-- you are here #
Covid Bot Repo #
VermontDepartmentofHealth.github.io/covid-bot/
Community Resources #
- Microsoft - Chatbot Starter - https://microsoft.github.io/slg-covid-bot/
- QnA Maker - https://www.qnamaker.ai/
- Azure Bot Service - https://azure.microsoft.com/en-us/services/bot-service/