The Teneo QnA Maker connector allows Teneo and Microsoft developers to connect a QnA Maker knowledge base with a Teneo solution. Teneo developers leveraging QnA Maker, which is part of the Azure Cognitive Services, will benefit from Microsoft’s state-of-the-art toolkit, which will allow them to develop a bot based on existing data in just minutes. In Microsoft’s own words, developers will be able to build, train, and publish sophisticated bots using FAQ pages, support websites, product manuals, SharePoint documents, or editorial content through an easy-to-use UI or via REST APIs.
At the same time, other related, more complex use cases can be built in Teneo, using Studio’s intuitive graphical UI and powerful flow builder, with support for 86 languages, multi-turn dialogues, context, custom channel behaviors, custom entities, sentiment analysis, and much more.
In this guide, we will explain how to get started in QnA Maker and seamlessly use a trained QnA Maker knowledge base within Studio.
The Teneo QnA Maker connector is made up of:
In order to use this solution, you will need a Azure subscription. Create a free account before you begin. You will also need a QnA Maker resource, created in the Azure portal. You will need to download and import the solution and download the QnA Maker knowledge base. See instructions on how to do this here.
The following table lists and describes the contents of the solution.
|MS QnA Maker||Folder||This is a folder containing the main flow that handles questions about the QnA Maker knowledge base.|
|MS QnA Maker Connector Flow||Flow||This flow retrieves the use-case-related question, stores it, and passes it to the QnA Maker integration, then extracts the response and passes it back to the user.|
|qnaMakerQuestion||Flow variable||This flow variable stores the user question to be passed on to the integration.|
|qnaMakerAnswer||Flow variable||This flow variable stores the response from the published QnA Maker knowledge base.|
|qnaMakerApiSubscriptionKey||Global variable||This global variable contains the QnA Maker Authorization Endpoint key, used as a header by the integration.|
|qnaMakerKbEndpoint||Global variable||This global variable contains the endpoint URL for the QnA Maker trained and published knowledge base, used as a header by the integration.|
|Follow up of flow||Scripted Context||This global scripted context allows for a very seamless implementation of follow-up questions, like 'Who did Elvis marry?' followed by a related questions like 'When did he marry?'.|
|QnA Maker Integration||Integration||The QnA Maker integration calls the QnA Maker API, passing the user request and retrieving the response, which is stored in a string variable for easy access within the flows.|
For this example, the knowledge base we will be using is an FAQ about Elvis Presley. The following instructions detail how to access and set up the knowledge base.
If you don’t have an Azure Cognitive Services subscription, go to Cognitive services and sign up for free. You can use the free tier to do everything that is included in this guide.
Before you can create any QnA Maker knowledge bases, you must first set up a QnA Maker service or resource in Azure. You will only need to do this once.
The next step will be connecting your QnA Maker service or resource to a new QnA Maker knowledge base.
Once your knowledge base has been created, navigate to the 'Settings' section of your knowledge base:
If you would like to create a different knowledge base from a website or by adding specific data files, feel free to replace this file with the new one.
You should be redirected to the 'Edit' section in your knowledge base and you should have a total of 27 QnAs about Elvis in your knowledge base at this point.
Go to the 'Publish' section at the top and click on 'Publish':
You should now see a message saying that the knowledge base has been published successfully, as well as a text field showing deployment details for a sample HTTP request in Postman and Curl. Under the 'Curl' tab, please copy the following information and store it somewhere, as you will need it later:
Now it is time to work on the solution inside Teneo in order to connect it to your Microsoft QnA maker.
Once your pre-built solution has been imported, please add your Lexical Resources (SOLUTION → Resources → Lexical), and then navigate to Globals and map the above values to these two Global Variables:
|Variable Name||Example Value||Description|
|qnaMakerApiSubscriptionKey||kyhakr01eo2qxxxxx6p13h2y7ojm66||Authorization Endpoint key|
As an alternative to populating those Global Variables, you could also add those two parameters as input parameters in Try Out as in the following picture:
Your 'MS QnA Maker Connector Flow' will handle the extraction of the information and the connection with the integration. It will also allow you to provide different fallbacks if the user question is not found in the QnA Maker knowledge base or if the Global configuration has not been set up. The main trigger of your flow is based on Elvis-related keywords. Please remember to adapt your condition if your knowledge base is different.
The following dialogue was created via QnA Maker, published as a knowledge base and available within Studio in less than 30 minutes, after extracting the information from Graceland’s FAQ page about Elvis: https://www.graceland.com/elvis-faq
User: When was Elvis born?
Bot: Elvis was born on January 8, 1935.
User: When did he die?
Bot: Elvis Presley passed away due to heart failure August 16, 1977, at Graceland in Memphis, Tennessee. He was 42 years old.
User: What was his first performance?
Bot: He first performed at Overton Park Shell on July 30, 1954.
User: And his first movie?
Bot: 'Love Me Tender' (1957) was Elvis' first movie.
User: How many movies did Elvis make?
Bot: Elvis made 31 feature films and 2 concert documentaries.
Please make sure that the solution you are importing this solution into does not have any Global Scripts at Pre-processing level. If it does, please make a backup of these scripts and add them back to your solution after the import.
Was this page helpful?