888-682-5765 info@totalsol.com

Conversational chatbots with Azure have revolutionized the way businesses engage with their customers and users. Thus, advancements in natural language processing and artificial intelligence have paved the way for intelligent chatbots to streamline routine tasks and processes. These include processing orders, scheduling appointments, and responding to customer queries and interactions. These services have an immediate response time, are scalable, and are highly available. They also provide personal interaction over navigating lengthy documentation and waiting on human agents.

In this article, we will explore how to utilize the Language and AI Bot services within Microsoft Azure to build a sample chatbot that responds to natural language. We will be implementing a simple bot for handling an FAQ. Moreover, Keep in mind that you can apply these steps and extend them to a variety of use cases. Our chatbot will use Azure AI-Language services to understand, process, and respond to text inputs.

What is Azure AI Language?

Azure AI-Language is a set of natural language processing services provided by Microsoft Azure for understanding and analyzing text. The question-answering feature exhibits the latest question-and-answer capabilities from Azure. Furthermore, We will utilize this feature to create a system that generates automated responses to questions submitted by users.

We will be using Azure AI-Language Studio to create our chatbot project and train its knowledge base. Before diving into the Language Studio, we will need to have an Azure Language resource available for the chatbot to use.

Step 1: Set up Azure Language resource

1. Sign into the Azure Portal: Sign into the Azure Portal at https://portal.azure.com/ with your Azure login credentials.

2. Create a resource with the Language service: At the Azure Portal, select “Create a resource.” Then search for “Language service” in the Marketplace. On the Language service result, click the “Create” drop-down menu and select “Language service.”

Language Service in the Azure Marketplace
Figure 1 – Language Service in the Azure Marketplace

3. Select additional features: Select the “Custom question answering” custom feature and then click “Continue to create your resource.”

Language Service Additional Features
Figure 2 – Language Service Additional Features

4. Provide the Basics for your resource: On the Create Language interface, provide the basics for your resource, such as the Subscription, Resource group, Region, Name, and Pricing tier.

Figure 3 – Language Service Basics Configuration

5. Review and Create your resource: Proceed to the “Review + create” tab, ensure your configurations are correct, and create your resource. Give a few moments for the resource to be deployed and it will become available in the resource group that was selected.

Step 2: Create your project in Language Studio

1. Get started on Language Studio: Navigate to the Azure AI-Language Studio at https://language.cognitive.azure.com/ and then select the Language resource you created.

Figure 4 – Selecting an Azure Language Resource

2. Create your Custom question-answering project: Click the “Create new” drop-down menu and then select “Custom question answering.”

Figure 5 – Creating a project in Language Studio

3. Choose language settings: Determine whether the language for a project in this resource should be selected when the project is created, or if the same language should be used for all projects.

Figure 6 – Language settings for resource

4. Enter basic information: Enter basic information about the project, such as Name, Description, and the default answer when no answer is returned.

5. Review and finish: Review your configurations and then select “Create project”.

Step 3: Create your question-answering knowledge base

1. Add a source for your question-answering project: Once your project is created, you will be able to select a source for the knowledge base of your Azure chatbot’s responses. Click the “Add source” drop-down to see the available options: URLs, Files, or Chitchat.

In this example, we will be providing a URL to Microsoft’s Azure free account FAQ (https://azure.microsoft.com/en-us/free/free-account-faq). Click “Add URL” and then provide a name for the URL source and the URL itself.

Figure 7 – Adding a New Source for the Knowledge Base

2. Review the knowledge base: After a few moments, the source will become available in the “Manage sources” interface. Click on the source to view the knowledge base. From this interface, you can view and then edit the generated question-answer pairs, provide alternate questions, and follow-up prompts, and also create any metadata tags.

Figure 8 – Reviewing and editing the Knowledge Base

3. Test the knowledge base: Underneath the “Question answer pairs” tab, click the second icon (shaped like a beaker) to open the Test interface. Here, you can type and submit questions. Then review the responses generated by the project.

Figure 9 – Testing the Knowledge Base

4. Deploy the knowledge base: On the left menu, click the “Deploy knowledge base” icon, then click the “Deploy” button. Once the knowledge base is deployed, you will be redirected to an interface where you can view the status of the knowledge base and create a bot.

Step 4: Create a bot with Azure AI Bot Service

1. Create a bot for the knowledge base: From the knowledge base status interface, click the “Create a bot” button.

2. Provide the Basics for your resource: As with the Language service, provide the basics for your resource, such as the Subscription, Resource group, Resource group location, Bot handle, and Pricing tier.

3. Provide the Web App configuration for your resource: Provide the Web App configuration values for your resource, such as the app name and SDK language. You will need to provide an App Service Plan as well as a Language Resource Key that can be found in the Keys and Endpoints of the Language resource.

4. Review and Create your resource: Proceed to the “Review + Create” tab and create the bot resource. Please wait a few moments while the resource deploys. It will become available in the selected resource group.

5. Use your bot: Navigate to the bot resource you created to view additional details about the bot. When scrolling down on the page, it displays three buttons for actions using your bot:

o Download bot source code: Start by downloading the source code of the bot to build and manage the bot with the Bot Framework.

o Test in Web Chat: Use the Web Chat tool to test your chatbot.

o Connect to channels: Then connect the bot to channels to allow users to use it through a web browser, Teams, email, and more.

With that, your chatbot is ready to use and trained with the knowledge base you provided. The steps outlined here present a general overview of how to build a chatbot using Azure Language and AI Bot services. However, the specific implementation might vary based on your use case, business needs, and platform preferences.