Documente Academic
Documente Profesional
Documente Cultură
LICENSE THESIS
2017
FACULTY OF AUTOMATION AND COMPUTER SCIENCE
COMPUTER SCIENCE DEPARTMENT
Graduate: ____________________________
Supervisor: ____________________________
FACULTY OF AUTOMATION AND COMPUTER SCIENCE
COMPUTER SCIENCE DEPARTMENT
Declaraie pe proprie rspundere privind
autenticitatea lucrrii de licen
14.07.2017 _______________________________
Semntura
Table of Contents
1
4.2.3. LUIS ............................................................................................................ 29
4.2.4. Sentiment Analysis ...................................................................................... 31
Chapter 5. Detailed Design and Implementation .................................... 35
5.1. Architecture overview ........................................................................................ 35
5.2. Database modelling ............................................................................................ 36
5.3. Layered Architecture .......................................................................................... 40
5.3.1. Common Data Access Layer ....................................................................... 40
5.3.2. Business Layer common implementation detail .......................................... 41
5.3.3. Bot Application Architecture....................................................................... 42
5.3.4. Reports Web Application Architecture ....................................................... 43
5.4. Main technologies: an implementation perspective ........................................... 44
5.4.1. Bot framework dialog management ............................................................ 44
5.4.2. LUIS application implementation ............................................................... 46
5.4.3. Sentiment analysis use of scores ................................................................. 47
Chapter 6. Testing and Validation ............................................................ 49
6.1. V-Model .............................................................................................................. 49
6.2. Low-level testing ................................................................................................ 49
6.3. High-level testing................................................................................................ 51
Chapter 7. Users manual .......................................................................... 53
7.1. Installation Manual ............................................................................................. 53
7.1.1. Deployment Diagram .................................................................................. 53
7.1.2. Publishing the application ........................................................................... 54
7.2. User Manual........................................................................................................ 56
Chapter 8. Conclusions............................................................................... 57
8.1. Contributions ...................................................................................................... 57
8.1.1. Contextualization ......................................................................................... 57
8.1.2. Real-time decision making .......................................................................... 57
8.1.3. Natural language understanding improvement ............................................ 58
8.2. Achieved results.................................................................................................. 58
8.3. Future work ......................................................................................................... 59
Bibliography ................................................................................................ 60
2
Figure 1.1 Email trends of customers based on age group [6]................................ 4
Figure 1.2 24/7 People that responded to a survey concerning the 24/7 availability
of the technical support of companies [6] ........................................................................... 5
Figure 1.3 Unsatisfied customers regarding on-hold calls [7] ................................ 6
Figure 2.1 Example of communication of the user with the Technical Support
Chatbot ................................................................................................................................ 7
Figure 2.2 Overall sentiment score function of all conversations .......................... 8
Figure 3.1 A sample dialog with ELIZA [9]........................................................... 9
Figure 3.2 Relationships between classes of software-based dialog systems. [10]
........................................................................................................................................... 10
Figure 3.3 Bot Framework Architecture [11] ....................................................... 11
Figure 3.4 IBM Watson Workspace example [12] ............................................... 13
Figure 3.5 Mathematical representation of an Intent i [13] .................................. 14
Figure 3.6 Processing pipeline used for personal assistant dialog systems [13] .. 15
Figure 3.7 IBM Watsons process to derive a response from a question [14] ...... 16
Figure 3.8 ICE (Interactive Classification and Extraction): Tool at Microsoft
Research for interactive learning [13]............................................................................... 17
Figure 3.9 Actual conversation with Poncho the weather expert chatbot from
Facebook ........................................................................................................................... 19
Figure 4.1 Main Use Case Diagram ...................................................................... 23
Figure 4.2 Flow of events diagram of the Input requirement use case ............. 24
Figure 4.3 Example of an open incident created in ServiceNow ticketing system
[16] .................................................................................................................................... 25
Figure 4.4 Simple example of dialog hierarchy without IScorable [17]............... 27
Figure 4.5 Simple example of dialog hierarchy with IScorable [17] .................... 28
Figure 4.6 Utterances of a built-in intent Calendar.Add [18] ........................... 29
Figure 4.7 Prebuilt domains that can be added to a LUIS application [18] .......... 30
Figure 4.8 Basic example of results from the Microsoft Text Analytics Service [19]
........................................................................................................................................... 31
Figure 4.9 Manually plotted chart representing the user reply sentiment analysis of
conversation from Table 4.2 ............................................................................................. 32
Figure 4.10 Manually plotted chart representing the user reply sentiment analysis
of conversation from Table 4.3 ......................................................................................... 34
Figure 5.1 Overall architecture of the application, including external services ... 35
Figure 5.2 Initial Entities Database model ............................................................ 37
Figure 5.3 Intermediate form of the Entities Database model .............................. 38
Figure 5.4 Final form of the Entities Database model .......................................... 39
Figure 5.5 Data Access Layer Conceptual Architecture ....................................... 40
Figure 5.6 Communication between the Data Access Layer and Business Layer 40
Figure 5.7 BaseDomainService abstract class simple implementation ................ 41
Figure 5.8 Highlight of the UnitOfWork object inherited from the
BaseDomainService Class ................................................................................................ 41
Figure 5.9 Architecture of the Bot Application module ....................................... 42
Figure 5.10 Implementation detail of getting a Subscription Model in the form of a
TV Subscription Model..................................................................................................... 43
3
Figure 5.11 Conceptual architecture of the Reports Web Application ................. 43
Figure 5.12 Class Diagram of the Dialogs folder within the Presentation Layer . 44
Figure 5.13 An implementation of the Task GotChannel() method that represents
the process of the ScorableTVIssueDialog ....................................................................... 45
Figure 5.14 LUIS application list intents with the number of utterances for each
intent ................................................................................................................................. 46
Figure 5.15 Example of Luis intent identification in the context of
ScorableMakePayment Class ............................................................................................ 47
Figure 5.16 Scaling conversations to 100 replies (left) and to 20 replies (right).. 48
Figure 6.1 V-Model Validation Testing Model .................................................... 49
Figure 6.2 Real-time request information given by the Bot Framework Channel
Emulator............................................................................................................................ 50
Figure 6.3 Chart representing the number of requests per day made to the LUIS
application, shown in the LUIS Web interface ................................................................. 51
Figure 6.4 Sentiment Score function of all conversations .................................... 51
Figure 6.5 Sentiment Score function of specific intent conversations.................. 52
Figure 7.1 Deployment Diagram .......................................................................... 53
Figure 7.2 All resources of the Azure Portal Server [22] ..................................... 54
Figure 7.3 Homepage of the Bot Application endpoint URL [21] ....................... 55
Figure 7.4 Overview of the present channels on which the Technical Support
Chatbot is published [21] .................................................................................................. 55
4
Chapter 1
Chapter 1. Introduction
1.1. Project context
1
Chapter 1
Customer Support is a particular type of customer service provides the user the
information to make cost effective and correct use of the product. It may include the
following: installation, training, maintenance.
Automated Customer Service constitutes a form of customer service that
functions without the help of humans. In the majority of the cases, customer service is
provided by humans. Because of the need of automation and the possibility to solve it,
nowadays different automated means are implemented.
A primary example would be an Internet site, which has the advantage of 24-hours
a day service and is much more cost efficient than to have human customer service stay in
24-hours a day. Other automated means constitute touch-tone phone with a main menu
using the keypads as options (i.e. For English press 1).
1.1.4. Chatbots
A chatbot is a machine conversationial system which interacts with humans via
natural conversational language. Transcribed dialogue corpus has been used in software to
machine-learn conversational patterns to create a range of chatbots speaking various
languages including varieties of English, as well as French, Chinese and many other.
Chatbot technology integrates a language model and computational algorithms to
emulate informal chat communication between a human user and a computer using natural
language. The idea of chatbot systems originated in the Massachusetts Institute of
Technology (Weizenbaum 1966, 1967), where Weizenbaum implemented the ELIZA
chatbot to emulate a psychotherapist.
The generalization concept behind it was simple and founded on keyword
matching. The input was expected from a keyword in the past, but in the present,
different input method exists with the use of speech to text conversion.
2
Chapter 1
3
Chapter 1
Based on a study depicted in Figure 1.1, consumers under 24 use email 3.5 times
less frequently than other means of communication. For 25 44-year olds, its almost 2
times less.
These statistics prove that there is an ascendant trend of the messaging applications
which will further increase in the future. In order for companies to assure that they
understand the customer needs, they must try to satisfy this need on constant availability
over different instant messaging applications.
Another key argument sustaining this point is that smartphone functionality has
been greatly increased in the last years, together with greater internet coverage. This means
there are now 2.1 billion messaging application users.
4
Chapter 1
Figure 1.2 24/7 People that responded to a survey concerning the 24/7 availability
of the technical support of companies [6]
Furthermore, the same study, analyzed the answer of customers when they were
asked if a business should respond to them 24 hours a day, 7 days a week. As shown in
Figure 1.2, 50,6% agreed (on different levels) that a business should ensure this type of
support. There is a customer expectation for the instantaneity and convenience the
consumer experiences when talking with peers to also happen with the support provided
by companies.
5
Chapter 1
Other important statistics which is depicted in Figure 1.3, from another study show
that most customers get frustrated being connected to a phone or computer while waiting
for customer service help. This frustration is certainly understandable.
The findings in this report suggest that clients want to use texting for customer
service activities and are moving their business to companies that satisfy this need.
In conclusion, based on the statistics mentioned above, a comparison of the quality
of the service that can be obtained from a Technical Support Chatbot with other types of
human technical support can be drawn. This includes crowdsourced technical support or
even more precarious ways in which results can be extracted from data, like the user mainly
searching and filtering the information he needs.
An advantage over the crowdsourced technical support, by the use of natural
language processing, is that the user can state his information needs in a more accessible
way.
The biggest advantage over the other category, human technical support is cost
efficient support with ensured 24/7 availability. Another notable advantage is the
standardization of the messages. Throughout the responses of the Technical Support
Chatbot, all can be standardized by means required from the company. In order to achieve
this for human technical support, numerous costly trainings are needed.
Due to current resources and machine learning algorithms, chatbots require high
training time to develop a decent amount of accuracy on a relatively small domain. A
solution for this problem is to constrain that domain even further to a level that is still
relevant but minimizes training time and maximizes accuracy.
After the bot-human conversations, the results can be put to an emotional analysis
which classifies the given text, reply by reply, giving a polarity result (0% -negative
response, 100% - positive response). By using this, the efficiency can be verified and
adjustments of the current algorithm can be made in order to achieve a greater performance.
Although chat bots and emotional analysis are solutions to 2 different problems,
they compensate each other. The latter provides an end result that can prove the company
that may use this product that it satisfies the customer needs.
6
Chapter 2
Figure 2.1 Example of communication of the user with the Technical Support
Chatbot
The first and principal is the Bot Application which has the main objective as
interaction with the user, with an example illustrated in Figure 2.1. This includes the actual
communication with the user, the emotional analysis done behind, persisting information
into the database and interaction with the first layer of the human technical support team.
7
Chapter 2
8
Chapter 3
3.1.1. Background
Radziwill [10] highlights the history of chatbot technologies which is very vast and
dates back to 1960. Original systems like ELIZA [8], were built as a proof of concept to
pass the Turing Test (the computer system is put to a test by a human interrogator; in order
for the computer system to pass the Turing test, the human interrogator has to mark it as
intelligent as a human).
As depicted in Figure 3.1, ELIZA lacked such capabilities. It used keyword
matching and minimum context identification and it could not pass the Turing test. Even
9
Chapter 3
though it was very primitive, ELIZA constituted the base of the following chatbot systems
and was a great step in this domain.
In 1980 ALICE was developed [10]. This chatbot marked another great step, not
for its capabilities, but for providing a foundation for the Artificial Intelligence Markup
Language (AIML) which is used to declare rules for pattern-matching. AIML is based on
eXtensible Markup Language (XML) and it supports the majority of chatbot platforms used
today.
As depicted in Figure 3.2, chatbots are a sub-category of Dialog Systems and more
specifically of Conversational Agents. IVR systems constitute also Dialog Systems, but
they are not used as Conversational Agents in the majority of the use cases. An example of
IVR is typically used for Telephone Service Providers: For English Press 1. Furthermore,
Embodied Conversational Agents are virtual forms of entities that can exist in real life
(example: persons, animals, etc.) or imaginary (example: avatars, humanoid robots).
10
Chapter 3
autonomous Twitter accounts. This was unfortunately intended to artificially increase the
number of followers, resulting in the increase of certain social statuses which had a great
impact on the entire globe, eventually.
In the following sub-chapters, alternative technologies for building a Technical
Support Chatbot will be discussed. The respective technologies are Microsoft Cognitive
Services and IBM Watson. Although they have different structures, the analysis will be
done with respect to a concrete structure. An example, contained in the Input text
classification part is that IBM Watson does not have a separate service for this need. All is
done within a single API.
11
Chapter 3
12
Chapter 3
Although both technologies have a framework, the main difference is that IBM
Watson does not have very strict borders to separate the bot structure from the input
classification, while Microsoft goes with a more SaaS (Software as a Service) approach.
Workspace - as mentioned in the previous paragraph, all the information is placed
here. The brain of an IBM Watson chatbot is within the same place as the body. As
depicted in Figure 3.4, the Workspace can be accessed from a web interface with many
suggestions from IBM on how to model the present entities.
Dialog this concept is viewed as a service. Through it, a comprehensive platform
for conversation management can be built. What is done in the Microsoft Bot Framework
Dialog, IBM covers in the Dialog Flow.
Dialog Flow represents the management of a conversation with the help of decision
trees. Contextual conditions are implemented in nodes. Based on the user input,
classification is done by searching in the decision tree for a node that contains the condition
that is satisfied.
Further complexity can be built with the help of the decision tree algorithm, but
that will be later covered in the following sub-chapter, namely Input text classification.
13
Chapter 3
models as classifiers, but for further understandings, the key concepts have to be
explained.
14
Chapter 3
Figure 3.6 Processing pipeline used for personal assistant dialog systems [13]
In Figure 3.6 the process of classification of a user input (text or speech) on a
concrete example can be found. It shows how Intent detection is separated from the Entity
extraction (parallel) and how a function call can be made after classification. In that latter
function call response management is handled.
Moreover, Figure 3.6 presents a case study for digital assistants scheduler
functionality. Built-in intents can be observed (example ReadFromCalendar) which infer
the user intent. In parallel, entity extraction from the utterance substring is done,
identifying, in this case, mostly entities such as the date today or noon. After
extraction, through entity resolution, the entities are mapped to canonical forms such as:
2017-03-22.
15
Chapter 3
Figure 3.7 IBM Watsons process to derive a response from a question [14]
16
Chapter 3
bottlenecks to scaling applications like this. This technique is executed on the Intent
detector models previously mentioned.
Interactive Learning (IL) is a way of efficiently making classification models,
where classifier labeling, model building, and evaluation are done by a single developer.
Similar to active learning, IL is fit when unlabeled data is abundant but labeling is
expensive.
IL integrates active learning but extends it substantially. It requires a broad database
of unlabeled data instances, such as text of utterances. The database must contain positive
instances. This allows intent detectors to be built in advance of practical implementation,
at least for intents expressed at the first turn.
17
Chapter 3
(False) and green (True) bars indicate their suggested label by the model, which can be
changed by clicking.
The performance of the model is shown in the bottom panel, including confusion
matrices, precision-recall curves, and area under the curve (AUC) as a function of how
many labels have been entered. Features can be added and edited on the left.
The procedure starts by searching for data instances using textual search terms
based on their domain knowledge. The searches yield results are then labeled. Labels can
be positive, negatives, or a special dont know label.
After each label is entered, all the labels are randomly divided between a training
and test set. Afterwards, a model is built on the training set which is used in 3 ways.
First, all of the instances labeled so far can be displayed graphically, showing the
distribution of scores, giving an overview of performance.
Second, when searching for new instances, the model is used to propose labels.
This speeds up labeling and also gives an indication of the overall performance of the
model on unseen data.
Third, each time the model is rebuilt, it is applied to all of the unlabeled data, which
allows drawing samples of unlabeled instances at a particular score.
18
Chapter 3
Figure 3.9 Actual conversation with Poncho the weather expert chatbot from
Facebook
19
Chapter 3
20
Chapter 4
Table 4.1 summarizes all the users of the Technical Support Chatbot application
and provides a brief overview of their responsibilities and stakeholder placement.
The Normal User constitutes the application user with the lowest level of access.
In order to have the ability to add the Technical Support Chatbot in a channel of their
choice, they must be enrolled as customers. This has to be done without their explicit
21
Chapter 4
knowledge, in such a way that the chatbot is not publicly available in the specific channel
directory.
The responsibility of the Normal Users is to use the application with the specific
purpose of solving a problem they have with a product or service they are paying for.
The Technical Support Team Member is the application user which handles the
problem that cannot be solved by the Technical Support Chatbot.
When the chatbot does not have the necessary knowledge to find a solution to a
problem given by a Normal User, it forwards a ticket to an email address that represents
the whole Technical Support Team. The ticket is presented as an email. The subject of
the email contains the id of the conversation and the body would contain a short message,
together with the conversation logs.
The interaction of the Technical Support Team Member with the application is not
done via the instant messaging channel, nor via email. A ticketing platform should be
configured in such a way that whenever an email is sent to the Technical Support Team
email, a new ticket within the specific platform should be created.
The Administrator is the application user that has the responsibility of ensuring
that everything works in a correct manner. This type of user has the higher level of access,
including the server on which the application is deployed.
An important responsibility of the administrator within the first months of the
application usage is to improve performance. This can be done after the analysis of the
charts, by adding new utterances to the intents that lack performance.
22
Chapter 4
Figure 4.1 depicts the main use cases of the Technical Support Chatbot application,
highlighting the separation of the 3 actors within each different system.
23
Chapter 4
Figure 4.2 Flow of events diagram of the Input requirement use case
24
Chapter 4
Figure 4.2 provides a detailed overview of the single use case performed by the
Normal User. He is the only actor that interacts with the Chatbot application through the
specific channel interface. He has the option to write as text input a problem he has with a
paid service or product. He must provide objective information and try to respect the
requests provided as responses from the Technical Support Chatbot (example: I did not
understand that. Did the provided solution work? Please answer yes or no?).
Furthermore, after the user specifies the problem, the chatbot provides a possible
solution that has to be confirmed by the user. Based on this decision, the chatbot can
provide other similar solutions or end the communication. The action of forwarding the
problem to human technical support is included in the event A solution is provided in
order to set a clear separation between the Input problem use case and the Investigate
forwarded ticket use case.
- The Normal User shall be able to add the Technical Support Chatbot in the
messaging channel only if he is a customer
- The Normal User shall be able to input a specific requirement via text in the
instant messaging channel and he shall receive a response from the
Technical Support Chatbot that contains a solution
- The Technical Support Team Member should be able to investigate a ticket
forwarded from the chatbot, given correct metadata and conversation logs
- The Technical Support Chatbot Team Member should be able to view all
the necessary information about a user profile from the external Ticketing
Platform System
- The administrator of the application should be able to authenticate given he
provides correct credentials
- The Technical Support Chatbot administrator should be able to view overall
performance charts
- The application administrator should be able to view specific intent
performance charts
- The administrator should be able to add utterances in order to improve
performance
4.2.1. Motivation
This subchapter focuses on the motivation behind the decision of choosing a set of
technologies for developing the application.
Based on the functional analysis illustrated in the previous subchapter, and the
analysis of the studies documented in chapter 3. Bibliographic Research, the following
conclusions can be drawn.
Microsoft Cognitive Services focuses on a more basic level of natural language
understanding that lets the developer formulate the answers, while IBM Watson goes a step
higher to extract possible answers directly from the processed input text.
26
Chapter 4
In the following subchapters, all the chosen technologies from Microsoft Cognitive
Services will be described, highlighting the best approach to use them, considering the
most important problems that may be encountered.
27
Chapter 4
In Figure 4.3, Pretty [16] illustrates a simple dialog hierarchy in the domain of a
bank chatbot application. Within the BalanceDialog, the user can check the balance of
his current account or of a savings account. In the MakePayment dialog, the user can opt
to make a payment, provided he specifies the destination account and the amount.
Without the implementation of the IScorable interface, if the user asks to check
balance and changes his mind and wants to make a payment instead, he would have to
continue to the normal process which constitutes checking the current balance and then
returning to the Root Dialog. Only afterwards the user is able to issue an action of making
a payment.
In Figure 4.4, Pretty [16] the same simple dialog hierarchy is depicted, but with the
IScorable interface implemented. In comparison with the first approach, from Figure 4.3,
an obvious improvement in the loose coupling design principle can be identified.
With the IScorable approach, if the user issues a make payment action in the middle
of another action of checking balance, the current dialog is switched and the user can
execute the make payment action without going through the whole process.
When returning from the MakePayment dialog, the dialog is switched back to the
CheckBalance dialog. This is done with the help of the Dialog stack. When an interrupt
is initiated by the user input text, the current dialog CheckBalance is switched to
MakePayment dialog, meaning it goes to the top of the Dialog stack. At return, the
second dialog CheckBalance comes back to the top of the Dialog stack.
A key ability that Microsoft Bot Framework lacks is the poor support for easily
integrating a dependency injection container. The problem is that the dialog classes are
serializable and they cannot depend on instances of services that are not serializable.
28
Chapter 4
The solution is to use a static dependency injection container that provides static
instances of the services in the serializable Bot Framework dialogs. In this way, even
though the referenced services are not serializable, it manages to successfully solve the
problem.
4.2.3. LUIS
29
Chapter 4
Figure 4.7 Prebuilt domains that can be added to a LUIS application [18]
As depicted in Figure 4.6, LUIS offers the possibility to add an entire set of intents,
together with utterances in order to set up an application rapidly.
In the current domain of Technical Support Chatbots, the Utilities prebuilt
domain proved to be useful. It provides intents as Utilities.Confirm, Utilities.Cancel
which provide a greater performance rather than implementing these intents manually.
A very important aspect of the LUIS application constitutes the training. As
mentioned in chapter 3. Bibliographic research, LUIS makes use of interactive learning
which is a form of active learning. After adding new intents or utterances, the LUIS
application requires training. This results in a short down-time of the application and it
should not be done while the application is in production, but it should be scheduled, for
example once a month is a best practice recommendation.
30
Chapter 4
Figure 4.8 Basic example of results from the Microsoft Text Analytics Service
[19]
In Figure 4.8 the results of the Text Analytics Service are depicted on a default
example. It is used to extract information from an input text of any size. The text analysis
includes language detection, key phrases extraction and sentiment detection.
Of the provided results, only the sentiment score is relevant to the Technical
Support Chatbot application.
In order to achieve a high accuracy sentiment detection of the user input,
communication with the user within the technical support domain was analyzed. The
analysis included frequency, size and total number of input requests forms from a user,
such as replies and conversations.
31
Chapter 4
A clear advantage of extracting a sentiment score from each reply individually over
extracting the sentiment score from an entire conversation is the ability to monitor real-
time the emotional impact the chatbot responses has over the user.
Another advantage of this approach is the accuracy, but it comes with a cost.
Making a request to the Text Analytics Service each time the user sends a reply to the
Technical Support Chatbot may slow down the application.
Table 4.2 User reply sentiment analysis of a simple conversation in the technical
support domain
Sentiment score User reply text
98 Hello
31 I have a problem with the internet
2 My internet is not working
81 ok
58 I put it
48 now what?
81 ok
73 I'll wait
100 great
99 thank you
Table 4.2 depicts a simulation of a real-life scenario within the technical support
domain. A simple conversation was chosen in order to provide a base for constructing a
function of the sentiment score of a conversation.
Figure 4.9 Manually plotted chart representing the user reply sentiment analysis
of conversation from Table 4.2
32
Chapter 4
Table 4.3 User reply sentiment analysis of a conversation in the technical support
domain with 2 problems
Sentiment score User reply text
97 Hi
26 I have an internet problem
8 INTERNET IS DOWN
80 ok
100 Great. It's solved
70 I have another problem
35 HBO channel shows a black screen since Monday
98 Ok. I forgot that, thank you.
33
Chapter 4
Figure 4.10 Manually plotted chart representing the user reply sentiment analysis
of conversation from Table 4.3
In Figure 4.10 the sentiment score function of the conversation from Table 4.3 is
depicted. By analyzing points 3 and 7, the 2 problems can be clearly identified.
In order to provide a better accuracy of the sentiment analysis of replies, which
results eventually in a performance metric of the application, like the problem-solving
ratio, the decision of splitting conversations like the one depicted in Table 4.3 and Figure
4.10 in 2 has been made.
This is done with the help of LUIS and Bot Framework. If an intent from the
Issues sub-domain, such as InternetIssue or TVIssue, can be identified a second time
in a conversation, the Technical Support Chatbot creates a new conversation in the
background, without the user knowledge.
34
Chapter 5
35
Chapter 5
The Data Access Layer focus is obviously to separate the logic that retrieves the
data from the Entities Database and maps it to the entity model from the business logic
through Entity Framework.
In the following subchapters, each principal module will be further detailed,
together with the common architecture of the Bot Application and the Reports Web
Application, but not before presenting the database model of the main entities.
In the process of development, the database suffered two major changes which are
detailed below, including the database diagrams.
36
Chapter 5
In Figure 5.2 the initial form of the database is depicted, which had separate tables
for Subscription, TV Subscription, Internet Subscription and Phone Subscription, but did
not have the Payment table.
A key aspect in the initial database form was the decision of modelling a table for
each type of subclass subscription (internet, tv or phone).
When accessing the data in the Business Layer without a transitional mapping from
the Entity Framework models to Data Transfer Object (DTO) models and afterwards
Business Models, it is very difficult to use them in the Business Services. The actual
implementation of DTO models and separate Business Models and mapping between them
would have also been a difficult approach.
37
Chapter 5
In Figure 5.3 the addition of the Payment table is illustrated. This is the only
difference between the initial Entities Database Model and the intermediate form.
The Payment Table exists in the final form and makes an important subject in the
Input requirement use case, more specifically in the concrete cases of making a payment
or getting the latest invoice.
A second approach for solving the Subscription Table problem was found, that
constituted of eliminating the Subscription Table completely and adding the details
contained in this table (Name, Description and Price) to the Internet Subscription, TV
Subscription and Phone Subscription tables. The main disadvantage and reason for not
implementing this approach is that the many-to-many relationship between the
Subscription Table and the Equipment Table would have been very difficult to maintain.
38
Chapter 5
In Figure 5.4 the final form of the Entities Database model is depicted. The final
solution for the Subscription Table problem was solved by dropping the TV Subscription,
Internet Subscription and Phone Subscription Tables and moving all the fields from those
tables to a single Subscription Table. Furthermore, a Type field was added, which
represents the type of subscription (Internet, TV or Phone).
In this way, in the Business Layer, all the information from the Subscription Class
can be accessed, without having to manually map from two separate models in Entity
Framework to a single one in the Business Layer (example: number of minutes and
messages from the Phone Subscription Table and the price of this phone subscription taken
from the Subscription table).
By having all the information in one place, in the Business Layer, a Subscription
class can be accessed as a TV Subscription class with the help of an interface. This
implementation detail will be further discussed in the following subchapters.
39
Chapter 5
As previously mentioned, the 4-tier Architecture is implemented for both the Bot
Application and the Reports Web Application, with slight differences and similarities,
which will be highlighted in the following subchapters.
Figure 5.6 Communication between the Data Access Layer and Business Layer
40
Chapter 5
The mapping from the Entity Framework models to Business Domain Models was
implemented with the help of Domain Mapper. This design pattern is practically
implemented as a service and located in the Business Layer, but conceptually, it stays
between the limit of the Data Access Layer and the Business Layer.
41
Chapter 5
Although the Bot Application is built with the help of Microsoft Bot Framework,
which already has a certain structure, further enhancement of structuring classes was
achieved by applying the 4-tier Architecture, as illustrated in Figure 5.7.
42
Chapter 5
43
Chapter 5
As illustrated in Figure 5.8, the Reports Web application architecture is very similar
to the Bot Application architecture, mostly following the same structure within the
Business Layer. In the Presentation Layer though, the Reports Web Application has
obviously a very different approach from the Chatbot, exposing the charts in a web rich
user interface. This is achieved with the use of the ASP.NET MVC 5.0 Framework.
Figure 5.12 Class Diagram of the Dialogs folder within the Presentation Layer
44
Chapter 5
45
Chapter 5
Figure 5.14 LUIS application list intents with the number of utterances for each
intent
In Figure 5.14 all the intents used in the Technical Support Chatbot application are
illustrated, within the Web interface of the LUIS application. The intents were selected
mostly with respect to the single use case possible for the Normal User, with the most
important of them being: InternetIssue, TVIssue, MakePayment and GetPayment.
46
Chapter 5
Figure 5.15 depicts an example of how the integration of the LUIS intent
identification and Bot framework dialog management is implemented. All the other
important intents mentioned above are integrated in the same manner.
47
Chapter 5
example, given 3 empty spaces between 2 replies with sentiment scores of 20 and 60, the
5 empty spaces will be filled with: 30, 40 and 50.
Figure 5.16 Scaling conversations to 100 replies (left) and to 20 replies (right)
In Figure 5.16, a comparison of scaling to different number of replies is illustrated.
The readability of the right chart is clearly higher and that is due to 2 reasons. The first one
is regarding the limitations of the Google Charts library, which has obvious problems when
smoothing a curved function between 2 very close points. The second reason is that the
majority of the conversations within the Technical Support Chatbot context do not have
more than 20 replies. Therefore, scaling to 20 replies has been chosen. All the above-
mentioned steps are considered when scaling a single conversation.
The Sentiment Score function of all conversations uses the scaling of a single
conversation, for each conversation from the database, with the help of the weighted
average (weight = total number of conversations). The result is very similar to a function
representing a single conversation.
The first step of having the possibility to calculate the Sentiment Score function
of specific intent conversations, as presented in the Chapter 4. Analysis and Theoretical
Foundation, is to set a main intent from the most important ones (InternetIssue, TVIssue,
MakePayment and GetPayment) for each conversation and store it in the database. This
classification is done whenever a Scorable Class is reached. If the user opts, for example
to input a new requirement in the context of the same conversation and a new main intent
is identified, a new conversation is created in the back-end of the application, without the
user knowledge, in order to provide a better accuracy for the problem-solving ratio (1
problem solved per conversation).
48
Chapter 6
49
Chapter 6
Figure 6.2 Real-time request information given by the Bot Framework Channel
Emulator
As illustrated in Figure 6.2, a great help for testing purposes was the Bot Framework
Channel Emulator. The information provided by this emulator is given in real-time when
the bot application is running locally and it includes the status codes of the HTTP requests
to the external services from the application. Within this context, the connection to the
LUIS application and Text Analytics Service were tested successfully.
50
Chapter 6
Figure 6.3 Chart representing the number of requests per day made to the LUIS
application, shown in the LUIS Web interface
LUIS request handling can be depicted in Figure 6.3. A test was made by sending
a high number of requests to the LUIS application, which resulted in a success rate of
100%, although an increase of the response time was observed.
51
Chapter 6
The third area is the most crucial for testing represents the possible problem
solution. As it can be clearly identified an ascendant slope, it results that the user overall
satisfaction is increased after the interaction with the Technical Support Chatbot, meaning
it is a successful test.
52
Chapter 7
53
Chapter 7
In Figure 7,1 the deployment diagram is illustrated. Mainly, the Technical Support
Chatbot Solution is installed on an Azure Portal Server, but further details will be given in
the following subchapter which will provide all the necessary steps to publish both the
Reports Web Application and the Bot Application (note: the publication of the Data Access
Layer is not necessary because it is referenced in both previously mentioned applications).
The second step is to configure the Azure portal Server or any other server which
will provide a public endpoint for the Reports Web Application and the Bot Application.
The next step is to open the Technical Chatbot Support solution with Microsoft
Visual Studio and change the data connection strings.
Afterwards, the following operations should be done:
- Deploy the Entities Database to the Database Server (in this case, the local
Entities Database was deployed to the tsc-db-server under the name of tsc-
db).
- Deploy the Admin Database to the Database Server in the same manner (in
this case, id-db)
- Publish the Reports Web Application to the Reports Web App Service (in
this case, to the admin-reports2)
- Publish the Bot Application to the TechnicalSupportChatbot Web App
Service
54
Chapter 7
At this step, only the Reports Web Application should be working and should be
tested. For the Bot Application to work properly, publishing of the LUIS Application is
still needed and adding a new bot in the bot directory.
The following step is to import the LUIS Application from the LUIS Web Interface.
Figure 7.4 Overview of the present channels on which the Technical Support
Chatbot is published [21]
If added to Skype, the result should look exactly as depicted in Figure 7.4.
55
Chapter 7
After having installed all the software from the mentioned requirements, the user
can just search for the Technical Support Chatbot in the Skype Directory and add it as a
contact.
As a general rule, the user has to the application in an educated manner, without
spam or other intrusive ways. This means that the user should contact the Technical
Support Chatbot only when he has a problem or requirement that is relevant to the
Technical Support Chatbot.
56
Chapter 8
Chapter 8. Conclusions
This chapter contains a brief description of contributions, all the results obtained
during the development process of the Technical Support Chatbot relative to the objectives
that were presented initially in the second chapter of this document and finally, further
development points.
8.1. Contributions
This subchapter highlights the contributions added to an already existing plethora
of frameworks, algorithms and best practices within the domain of Technical Chatbot
Support or even to a higher domain of Chatbots.
8.1.1. Contextualization
The approach of the Technical Support Chatbot differs from the majority of chatbot
implementations with the advantage of storing much user information that can provide a
base for more contextual decision-making algorithms.
Whenever the chatbot is added to the channel of a user, it gets all the information
of the user from the database. In order for a user to be able to add the Technical Support
Chatbot to the Skype directory, he has to be a customer of the company that the chatbot
provides support for. In this way, the user information is added in the database when a new
user is registered and it is available right-away for the Technical Support Chatbot.
A possible reason for other chatbots not being able to implement such a
contextualized experience for users is the privacy policies from the majority of the instant
messaging channels. For chatbots that do not have such rich user information, a solution
may be to make use of a sign-in card and take profile information from a popular account
that most users have, like a Microsoft account.
Coming back to the Technical Support Chatbot easy contextualization, the user
information from the database includes, beside identification data, also other context
information such as the subscription for which the user is paying for.
In this way, the Technical Support Chatbot can provide uniquely modeled
responses to a user, not from a broad natural language perspective, but from the specificity
of the provided answers, meaning that the chatbot can satisfy the exact needs of the user.
57
Chapter 8
as an interrupt, drops all the other possible response modelling, formulates a default
response and forwards the problem to the human technical support.
58
Chapter 8
59
Bibliography
Bibliography
60
Bibliography
61