Deploying support chatbot using azure microservices architecture

Oussama Brahem
Yuki azure bot
Published in
6 min readSep 21, 2020

Abstract

The recent advancement in information technologies, storage capacity and the emergence of cloud computing valorize the diffusion and exchange of information in several ways such social networks, forums etc.…. Which provide a tremendous amount of data. Thus, the analysis of this data aims to provide; useful insights, suggesting conclusions, and supporting decision-making. Consequently, handling this amount of data is a quite difficult task due to the limitation of the computational capacities. Therefore, parallel computing techniques are needful to deal with these issues. Therefore, a remarkable advancement in automation revealed recently which can be expressed by two major factors; powerful and cheaper hardware materials such sensors and processors and the most important is the decisions makers believe of it’s capabilities to improve businesses.

Conversational agent (chatbots): regarding the digital transformation of several companies, and due to the growth of employees and client’s numbers in the last years, a conversational agent was suggested to support and scale communication teams in their relations with customers and employees.

  1. Context

This wave of digitalizing aims to integrate AI solutions. Given that, the number of staff has grown exponentially in last years which is composed by clients, partners and employees. Consequently, the management of this number of staffs is not a simple task, several questions asked every day and the number of received emails is tremendous. So, an intelligent conversational assistant will be a support to overcome this situation.

1.1. Business Requirements:

- our customers are using Microsoft

- 70% of questions are about Microsoft solutions (email, calendar, …)

- IT support receiving several requests every day about different topics (such forgotten password).

- the average response time to respond customer service requests is 12 hours and 10 minutes.

2. Solution implemented

Therefore, to meet the needs of companies using Microsoft and handle these business constraints an Azure BOT framework reveals a relevant solution to deal with this problem.

2.1. Azure Bot Service Architecture:

Azure bot service allows us to develop intelligence, enterprise-grade bots that helps to enrich the customer experience while maintaining control of data. Our solution is built using these services:

QnA : QnA Maker is a cloud-based Natural Language Processing (NLP) service that easily creates a natural conversational layer over your data. It can be used to find the most appropriate answer for any given natural language input, from your custom knowledge base (KB) of information.

QnA steps

Once a QnA Maker knowledge base is published, a client application sends a question to your knowledge base endpoint and receives the results as a JSON response. A common client application for QnA Maker is a chat bot.

Qna Steps

Steps:

- The client application sends the user’s question (text in their own words), “How do I programmatically update my Knowledge Base?” to your knowledge base endpoint.

- QnA Maker uses the trained knowledge base to provide the correct answer and any follow-up prompts that can be used to refine the search for the best answer. QnA Maker returns a JSON-formatted response.

- The client application uses the JSON response to make decisions about how to continue the conversation. These decisions can include showing the top answer and presenting more choices to refine the search for the best answer.

Luis: Language Understanding (LUIS) is a cloud-based API service that applies custom machine-learning intelligence to a user’s conversational, natural language text to predict overall meaning, and pull out relevant, detailed information.

A client application for LUIS is any conversational application that communicates with a user in natural language to complete a task. Examples of client applications include social media apps, chat bots, and speech-enabled desktop applications.

LUIS steps : Once the LUIS app is published, a client application sends utterances (text) to the LUIS natural language processing endpoint API and receives the results as JSON responses. A common client application for LUIS is a chat bot.

Luis steps

The client application sends the user utterance (text in their own words), “I want to call my HR rep.” to the LUIS endpoint as an HTTP request.

LUIS enables you to craft your custom language models to add intelligence to your application. Machine learned language models take the user’s unstructured input text and returns a JSON-formatted response, with a top intent, HRcontact. The minimum JSON endpoint response contains the query utterance, and the top scoring intent. It can also extract data such as the Contact Type entity.

The client application uses the JSON response to make decisions about how to fulfill the user’s requests. These decisions can include decision tree in the bot framework code and calls to other services.

3. Implementation

The proposed solution to deal with our problematic is composed by 3 agents; to respond to users request in an effective way. The 3 agents are managed by LUIS which choose at each question asked which agent will respond to the question

LUIS classification

The figure 5 illustrate question classification using LUIS. However, LUIS is trained by questions to identify the most appropriate topic of each question.

Thus, at each question asked by user LUIS classify the question for example in the figure above the probability of belonging to the topic “pattern bot” is the highest, so the question will be assigned to pattern agent.

Besides, the corner stone of this solution are agents where each one has some featu to deal with the appropriate question. The 3 agents are discussed in details below:

  • QnA agent: respond to simple question by finding the most appropriate answer from the knowledge base.
Sample Qna questions

The figure above describes a sample of conversation deploying the QNA agent to respond to the question.

However, we have prepared a customized Knowledge base to train the QNA Agent, also we have fixed a threshold to 80% to verify that the agent is well trained and he can treat this type of questions

- Microsoft Tools Agent: is used to respond to question about Microsoft tools such (recent emails, calendar, …).

The example below illustrates a sample of conversation where the Ms Agent take in charge the conversation

Sample of MS agent question

As shown in figure above, the MS tools agent respond in this case. However, in order to access to Microsoft tools, the user must be logged in. In this example the user request for his recent emails and our agent respond by sending him the last 5 emails.

  • Pattern Agent: respond to complex tasks that needs a series of questions in order to identify the best solution, if the problem is known and there is a solution in our database the agent send the response to the customer. On the other hand, if no solution found we invite customer to upload a screenshot of the issue and invite him to add a new incident in our incident database.

The latter presented agents will be deployed with a request from LUIS which classify questions to choose the most fitted agent for each question.

The hole process is described in the figure below:

Yoori’s natural language processing architecture

3. conclusion

As illustrated above, by using different components of Microsoft azure we have implemented an IA agent who can respond to different uses case such as:

- open domain conversations: to respond to simple questions (chitchat mode)

- IT support Conversation: following up and support users to solve issues such changing password, fix access to SharePoint, problems with configurations etc.

- Microsoft office conversations: helping users to check automatically their email, booking a meeting room, planning meeting on outlook, etc.

With these three components we have covered our business needs.

however there are some improvements to setup such as auto-learning agent and attention mechanisms to cover more use cases and to ensure a fluid conversation with users.

--

--