Bot Framework v4 QnA Maker bot sample. This sample shows how to integrate Multiturn and Active learning in a QnA Maker bot with Python. Click here to know more about using follow-up prompts to create multiturn conversation. To know more about how to enable and use active learning, click here.
This bot has been created using Bot Framework, it shows how to create a bot that uses the QnA Maker Cognitive AI service.
The QnA Maker Service enables you to build, train and publish a simple question and answer bot based on FAQ URLs, structured documents or editorial content in minutes. In this sample, we demonstrate how to use the QnA Maker service to answer questions based on a FAQ text file used as input.
The QnA Maker Service enables you to build, train and publish a simple question and answer bot based on FAQ URLs, structured documents or editorial content in minutes. In this sample, we demonstrate how to use the Active Learning to generate suggestions for knowledge base.
This samples requires prerequisites in order to run.
This bot uses QnA Maker Service, an AI based cognitive service, to implement simple Question and Answer conversational patterns.
- QnA knowledge base setup and application configuration steps can be found here.
- Note that these instructions are for a different sample, but still apply to this sample. Namely: Create a QnA service, and import 'cognitiveModels/smartLightFAQ.tsv' to a knowledgebase
- The knowledgebase 'Deployment Details' will show something like:
POST /knowledgebases/04e394a2-7d8a-4a56-9344-db13fb1d9d79/generateAnswer Host: https://servicename.azurewebsites.net/qnamaker Authorization: EndpointKey bc3fbc8e-f461-66b1-8c58-4d6799320f9c Content-Type: application/json {"question":"<Your question>"}
- QNA_KNOWLEDGEBASE_ID is '04e394a2-7d8a-4a56-9344-db13fb1d9d79'
- QNA_ENDPOINT_KEY is 'bc3fbc8e-f461-66b1-8c58-4d6799320f9c'
- QNA_ENDPOINT_HOST is 'https://servicename.azurewebsites.net/qnamaker'
- Enable Active Learning on your QnA service.
- Clone the repository
git clone https://github.com/Microsoft/botbuilder-samples.git
- Bring up a terminal, navigate to
botbuilder-samples\samples\python\11.qnamaker
folder - Activate your desired virtual environment
- In the terminal, type
pip install -r requirements.txt
- Update
QNA_KNOWLEDGEBASE_ID
,QNA_ENDPOINT_KEY
, andQNA_ENDPOINT_HOST
inconfig.py
- Run your bot with
python app.py
Bot Framework Emulator is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel.
- Install the latest Bot Framework Emulator from here
- Launch Bot Framework Emulator
- File -> Open Bot
- Enter a Bot URL of
http://localhost:3978/api/messages
See Deploy your bot for instructions.
The deployment process assumes you have an account on Microsoft Azure and are able to log into the Microsoft Azure Portal.
If you are new to Microsoft Azure, please refer to Getting started with Azure for guidance on how to get started on Azure.
- Manage QnA Maker resources
- Use follow-up prompts to create multiple turns of a conversation
- Quickstart: Create, train, and publish your QnA Maker knowledge base
- Active learning Documentation
- Bot Framework Documentation
- Bot Basics
- Azure Bot Service Introduction
- Azure Bot Service Documentation
- msbot CLI
- Azure Portal