It serves as a repository of information that enables customers or employees to find answers to their questions seamlessly. With AI-102, designing and implementing a Microsoft Azure AI Solution, it has become easier! Let’s dive deep and further discuss.
Why use Microsoft Azure AI for a Knowledge Base
Azure AI is a comprehensive suite of services that offer diverse capabilities from machine learning to natural language understanding. Microsoft’s Azure AI offers QnA Maker, which enables one to build, train and publish a simple question and answer bot based on FAQ URLs, structured documents, and product manuals.
Publishing a precise, comprehensive, and interactive knowledge base using Microsoft Azure AI comes with numerous benefits that include:
- Source agnostic: Azure AI can source from various locations, including SharePoint, and a webpage.
- Perceptive & Progressive: The QnA Maker enriches its knowledge base by learning from user interactions.
- Natural Language Processing: Microsoft Azure AI interprets user input delivered in a natural conversational manner.
- Formatting: Allows for rich content, including images and hyperlinks.
- Inclusive: Azure AI supports multiple languages.
- Scalable: Efficiently built to grow with the demands of your organization.
Steps to Publish a Knowledge Base using Azure AI
There are essentially four simple steps to follow through this process. Let’s see these steps below.
Step 1: Create a QnA Maker Resource in Azure
You start by creating a new resource using Azure’s portal. To do this:
- Navigate to the Azure portal at https://portal.azure.com/
- Click “Create a resource”.
- Find “QnA Maker” and select “Create”.
- Fill the necessary details and click the “review + create” button.
Step 2: Create a Knowledge Base
Next, you need to create a knowledge base. Here’s how:
- Navigate to QnA Maker Portal at https://www.qnamaker.ai/
- Go to “My Knowledge bases”
- Click on “Create a new knowledge base”.
- Skip to step 2 to learn how to connect QnA service to your KB.
- Fill out the necessary details, click “Create”.
Step 3: Populate the Knowledge Base
Our next step is to include content in our knowledge base. Here’s how:
- Add URLs, files, or sharepoint sites that you want to extract QA content from.
- Click on “Create your KB”.
Step 4: Test and Publish your Knowledge Base
Finally, you make your knowledge base live by publishing it:
- Once creation is complete, review the questions and answers provided. Edit, delete and move as necessary.
- Test your knowledge base by typing a question in the test window.
- Publish your knowledge base to make it live.
Once published, you can utilize the generated endpoint data, which includes knowledge base ID, hostname, and endpoint key to create a bot using the Azure Bot Service.
Using Published Knowledge Base
On successfully publishing your Knowledge Base, you will be provided with a POST request endpoint and a unique endpoint key. You can implement these in your application to enable users’ FAQ interactions.
Here is an example of how to make POST requests to your published knowledge base using Python:
import requests
import json
headers = {
‘Authorization’: ‘EndpointKey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx’,
‘Content-Type’: ‘application/json’
}
data = {
‘question’: ‘
}
response = requests.post(‘https://xxxxxx.azurewebsites.net/qnamaker/knowledgebases/xxxxxxxx-xxxx-xxx-xxxx-xxxxxxxxxxxx/generateAnswer’, headers=headers, json=data)
JSON_object = json.loads(response.content)
The above code allows your application to interact with your Azure QnA Maker generated knowledge base by sending a user’s question as POST data and receiving a JSON response containing the answer.
Microsoft Azure AI allows you to publish a knowledge base that interacts with users in a conversational manner, learns with time and can be integrated with numerous platforms. More comprehensive lessons on this topic can be found in AI-102 Designing and Implementing a Microsoft Azure AI Solution. Explore the potentials of Microsoft Azure AI for your knowledge base and transform your customer and employee support services.
Practice Test
True or False: The knowledge base in QnA Maker can include data from multiple sources, like websites, PDFs, and doc files.
- True
- False
Answer: True
Explanation: QnA Maker sources can be diverse, including websites, PDF files, and docs. This tool extracts question-answer pairs from these sources to build the knowledge base.
Which of the following is NOT a step in publishing a knowledge base in QnA Maker?
- a) Testing the knowledge base
- b) Training the bot
- c) Publishing the bot
- d) Developing a core message
Answer: d) Developing a core message
Explanation: Developing a core message is part of strategy design, not a step in publishing a knowledge base. The essential steps to publish a knowledge base include testing, training, and publishing the bot.
True or False: A published QnA Maker knowledge base gets updated automatically when you make changes to the source documentation.
- True
- False
Answer: False
Explanation: Any changes made to the source documentation do not automatically update the published knowledge base. You must manually train and republish the knowledge base to reflect changes.
In which of the following situations would you need to publish your knowledge base?
- a) After changes have been made and saved in your knowledge base.
- b) After the initial creation of your knowledge base.
- c) Whenever you want to make your knowledge base available for your chatbot.
- d) All of the above
Answer: d) All of the above
Explanation: Knowledge bases must be published after their initial creation, after any changes, and whenever they’re to be made available to a chatbot.
You can use ____________ to export your knowledge base to LUIS.
- a) QnA Maker REST APIs
- b) Azure portal
- c) Microsoft Power Automate
- d) Azure Cognitive Services
Answer: a) QnA Maker REST APIs
Explanation: You can use QnA Maker REST APIs to export your knowledge base to LUIS.
True or False: A published knowledge base in QnA Maker supports multi-turn conversation.
- True
- False
Answer: True
Explanation: QnA Maker supports multi-turn conversations in its knowledge base for an interactive conversation experience.
What must be done before a knowledge base can be published?
- a) Testing the knowledge base
- b) Training the knowledge base
- c) Both a and b
- d) Creating a support ticket
Answer: c) Both a and b
Explanation: Before publishing a knowledge base, it must be tested and trained to ensure accuracy and optimal performance.
True or False: Once published, a knowledge base cannot be unpublished or deleted.
- True
- False
Answer: False
Explanation: A published knowledge base can be unpublished or deleted at the user’s discretion.
Which service needs to be provisioned before publishing a knowledge base on QnA Maker?
- a) Azure Bot Service
- b) Azure Cognitive Service
- c) Azure Logic Apps Service
- d) Azure machine learning service
Answer: b) Azure Cognitive Service
Explanation: The Azure Cognitive service needs to be provisioned before publishing a knowledge base on QnA Maker, as it underpins the QnA Maker service.
True or False: You can’t have two QnA Maker services with the same resource name in different regions.
- True
- False
Answer: True
Explanation: Azure does not allow two resources to share the same name even if they are in different regions.
When would you use a staging Knowledge base in QnA Maker?
- a) When testing new features before applying to the live knowledge base.
- b) When answers in the knowledge base contain PII data.
- c) When you want to calculate the usage of your knowledge base.
- d) All of the above.
Answer: a) When testing new features before applying to the live knowledge base.
Explanation: A staging Knowledge base is used to test new features and experiences before making them live on the main knowledge base. This ensures the main application is not impacted during testing.
Interview Questions
What is a Microsoft Azure AI knowledge base?
A Microsoft Azure AI knowledge base is a repository of information that includes QnA pairs, URLs, documents, editorial content, and so forth. It’s used by the QnA Maker to extract question and answer pairs.
What is the piece of software responsible for creating, updating, and accessing the knowledge base in Microsoft Azure AI?
The QnA Maker portal is the software application responsible for creating, updating, and accessing the knowledge base in Microsoft Azure AI.
What is the maximum total content size per knowledge base in Microsoft Azure AI?
The maximum total content size per knowledge base in Microsoft Azure AI should not exceed 20MB for each individual indexing operation.
Can the content in a QnA Maker knowledge base be updated automatically from the source?
No, the content in a QnA Maker knowledge base should be updated manually. It doesn’t offer automatic updates from the source.
Which formats are supported for documents uploaded to the QnA Maker knowledge base?
The QnA Maker knowledge base supports .tsv, .pdf, .txt, .docx, .xlsx file formats.
What is the process to update an existing knowledge base in Microsoft Azure AI?
An existing Azure AI knowledge base can be updated using the QnA Maker portal. This involves going to the settings of the knowledge base, making needed changes, and then selecting ‘Save and train’ button for the changes to take effect.
Is it possible to have multiple knowledge bases in Microsoft Azure AI?
Yes, It is possible to have multiple knowledge bases in Microsoft Azure AI, depending on the needs and the complexity of your project.
Can I link multiple data sources when building a knowledge base in Azure AI?
Yes, while creating the knowledge base in Azure AI, you can provide URLs, upload files, or input shared content to link multiple data sources.
What are the necessary permissions for a user to publish a knowledge base in Microsoft Azure AI?
The user needs the Contributor role to publish a knowledge base in Microsoft Azure AI.
What is the purpose of a chit-chat dataset in a knowledge base?
Chit-chat dataset in knowledge base is designed to answer non-specific queries commonly used in a conversational system. It offers a variety of responses to common phrases like “hello”, “thank you”, etc.
What is the effect of the ‘Save and Train’ button in the QnA Maker portal?
The ‘Save and Train’ button in QnA Maker portal saves the changes made to the knowledge base and re-trains the system to incorporate these changes.
How often can a knowledge base in Azure AI be updated?
A knowledge base in Azure AI can be updated as often as necessary, there is no specific limitation.
What happens once the knowledge base is published in Azure AI?
Once the knowledge base is published in Azure AI, the knowledge base’s content is ‘frozen’ and will be used as is by the client application.
How to delete a knowledge base in Microsoft Azure AI?
To delete a knowledge base in Microsoft Azure AI, you must go to the ‘My knowledge bases’ page in the QnA Maker portal, select the knowledge base to be deleted and then select ‘Delete’ from the toolbar.
Does Azure AI support feedback loop for continuous improvement of knowledge base?
Yes, Azure AI service provides an endpoint to receive active learning feedback, which allows the QnA maker to learn and improve over time based on user feedback.