Chatbot Design Techniques Survey
Chatbot Design Techniques Survey
Abstract—Human-Computer Speech is gaining momentum as selected works are compared with those used in Loebner-Prize
a technique of computer interaction. There has been a recent Chatbots. The findings are discussed and conclusions are
upsurge in speech based search engines and assistants such as drawn at the end.
Siri, Google Chrome and Cortana. Natural Language Processing
(NLP) techniques such as NLTK for Python can be applied to II. BACKGROUND
analyse speech, and intelligent responses can be found by
designing an engine to provide appropriate human like A. Human-Computer Speech interaction
responses. This type of programme is called a Chatbot, which is Speech recognition is one of the most natural and sought
the focus of this study. This paper presents a survey on the after techniques in computer and networked device interaction
techniques used to design Chatbots and a comparison is made has only recently become possible (last two decades) with the
between different design techniques from nine carefully selected advent of fast computing.
papers according to the main methods adopted. These papers are
representative of the significant improvements in Chatbots in the Speech is a sophisticated signal and happens at different
last decade. The paper discusses the similarities and differences levels: “semantic, linguistic, articulatory, and acoustic” [3].
in the techniques and examines in particular the Loebner prize- Speech is considered as the most natural among the aspects of
winning Chatbots. human communication, owing to copious information
implicitly existing beyond the meaning of the spoken words.
Keywords—AIML; Chatbot; Loebner Prize; NLP; NLTK; SQL; One of the speech information extraction stages is converting
Turing Test speech to text via Automatic Speech Recognition (ASR) and
mining speech information [4]; then, the resulting text can be
I. INTRODUCTION
treated to extract the meaning of the words.
Speech is one of the most powerful forms of
communication between humans; hence, it is the researchers‟ Speech recognition is widely accepted as the future of
ambition in the human computer interaction research field to interaction with computers and mobile applications; there is
improve speech interaction between the human and the no need to use traditional input devices such as the mouse,
computer in order to simulate human-human speech keyboard or touch sensitive screen and is especially useful for
interaction. Speech interaction with modern networked users who do not have the ability to use these traditional
computing devices has received increasing interest in the past devices [5]. It can help disabled people with paralysis, for
few years with contributions from Google, Android and IOS. example, to interact with modern devices easily by voice only
Because they are more natural than graphic-based interfaces, without moving their hands.
spoken dialogue systems are beginning to form the primary B. Natural Language Toolkit (NLTK)
interaction method with a machine [1]. Therefore, speech
In order to deal with and manipulate the text resulting from
interaction will play a significant role in humanising machines
speech recognition and speech to text conversion, specific
in the near future [2].
toolkits are needed to organise the text into sentences then
Much research work has focussed on improving split them into words, to facilitate semantic and meaning
recognition rates of the human voice and the technology is extraction. One of these toolkits is the widely used NLTK
now approaching viability for speech based human computer which is a free plugin for Python.
interaction. Speech Interaction splits into more than one area
The Natural Language ToolKit (NLTK) is a set of
including: speech recognition, speech parsing, NLP (Natural
modules, tutorials and exercises which are open source and
Language Processing), keyword identification, Chabot
cover Natural Language Processing symbolically and
design/personality, artificial intelligence etc. Chatbot is a
statistically. NLTK was developed at the University of
computer program that have the ability to hold a conversation
Pennsylvania in 2001allowing computational linguistics with
with human using Natural Language Speech.
three educational applications in mind: projects, assignments
In this paper, a survey of Chatbot design techniques in and demonstrations [6] [7]. It can be found within the Python
speech conversation between the human and the computer is Libraries for Graph manipulation GPL open license. NLTK is
presented. Nine studies that made identifiable contributions in used to split words in a string of text and separate the text into
Chatbot design in the last ten years are selected and then, parts of speech by tagging word labels according to their
reviewed. The different techniques used for Chatbots in the positions and functions in the sentence. The resulting tagged
72 | P a g e
[Link]
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 6, No. 7, 2015
73 | P a g e
[Link]
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 6, No. 7, 2015
8) Ontologies: they are also named semantic networks the Chatbot in this range [16]. According to this judgement,
and are a set of concepts that are interconnected relationally the more human Chatbot is the winner.
and hierarchically. The aim of using ontologies in a Chatbot No Chatbot has ever achieved the golden medal and
is to compute the relation between these concepts, such as passed the test to win the Loebner Prize. However, some
synonyms, hyponyms and other relations which are natural Chatbots have scored as highly as 3 out of the 12 judges
language concept names. The interconnection between these believing they were human. There is a winning bot every year
concepts can be represented in a graph enabling the computer and there is a list of Chatbots called Loebner Prized Chatbots.
to search by using particular rules for reasoning [13]. This list commences from 1991 to the current date.
E. Loebner Prize and Turing Test c) Prized Chatbots and Their Design Techniques
a) Turing Test Although no Chatbot has won the Loebner Prize yet, there
is a winning Chatbot each year and the standard of entry
In the field of Artificial Intelligence, Turing was the first to continues to improve with time. Table 1 shows the prized
pose the question, “Can a machine think?” [14], where Chatbots as the name of the programmer, the programme
thinking is defined as the ability held by humans. According to name, the year they won, and the techniques used to design
this question and this definition, Turing suggests the and programme them.
“imitation game” as a method to directly avoid the question
and to specify a measurement of achievement for researchers F. AIML
in Artificial Intelligence [15] if the machine appears to be To build a Chatbot, a flexible, easy to understand and
human. The imitation game can be played between three universal language is needed. AIML, a derivative of XML is
people: (A) which is a man, (B) which is a woman, and (C) one of the widely used approaches that satisfies the
which is the interrogator and can be either a man or a woman. requirements. AIML represents the knowledge put into
The aim of the interrogator here is to determine who the Chatbots and is based on the software technology developed
woman is and who the man is (A and B). The interrogator for A.L.I.C.E. (the Artificial Linguistic Internet Computer
knows the two as labels X and Y and has to decide at the end Entity). It has the ability to characterise the type of data object
of the game either “X is B and Y is A” or “X is A and Y is B”. (AIML objects) and describe partial conductance of the
The interrogator also has the right to direct questions to A and programmes that it processes. These objects consist of two
B. Turing then questions what will happen if A is replaced units: topics and categories; the data contained in these
with a machine; can the interrogator differentiate between the categories is either parsed or unparsed [19].
two? The original question “Can machines think?” can then be
replaced by this question [14]. In this imitation game, the The purpose of the AIML language is to simplify the job of
Chatbot represents the machine and it tries to mislead the conversational modelling, in relation to a “stimulus-response”
interrogator to think that it is the human or the designers try to process. It is also a mark-up language based on XML and
programme it to do so [16]. depends on tags which are the identifiers that make snippets of
codes to send commands into the Chatbot. The data object
b) Loebner Prize class is defined in AIML as an AIML object, and the
In 1990 an agreement was held between Hugh Loebner responsibility of these objects is modelling conversational
and The Cambridge Centre for Behavioural Studies to patterns. This means that each AIML object is the language
establish a competition based on implementing the Turing tag that associates with a language command. The general
Test. A Gold Medal and $100,000 have been offered by Hugh structure of AIML objects is put forward by [20]:
Loebner as a Grand Prize for the first computer that makes
responses which cannot be distinguished from humans‟. A <command> List of parameters </command>
bronze medal and an annual prize of $2000 are still pledged in The most important object among the AIML objects is
every annual contest for the computer which seems to be more category, pattern, and template. The task of the category tag is
human in relation to the other competitors, regardless of how defining the knowledge unit of the conversation. The pattern
good it is absolutely [15]. It is the first known competition that tag identifies the input from the user and the task of template
represents a Turing test formal instantiation [13]. The tag is to respond to the specific user input [20]; these are the
competition has been run from 1991 annually with slight most frequent tags and the bases to design AIML Chatbots
changes made to the original conditions over the years. The with an intelligent response to natural language speech
important thing in this competition is to design a Chatbot that conversations. The structure of category, pattern, and template
has the ability to drive a conversation. During the chat session, object is shown below:
the interrogator tries to guess whether they are talking to a <category>
programme or a human. After a ten-minute conversation <pattern> User Input</pattern>
between the judge and a Chatbot on one side and the judge <template>
and a confederate independently on the other side, the judge Corresponding Response to input
has to nominate which one was the human. The scale of non-
</template>
human to human is from 1 to 4 and the judge must evaluate
</category>
74 | P a g e
[Link]
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 6, No. 7, 2015
1994 TIPS Thomas Whalen A personal history model database like the system with pattern matching.
2012 Chip Vivant Mohan Embar Responses using unformatted chat script and AI, and ontology.
Matching of words or phrase patterns for Chatbots with The most familiar RDB language is SQL (Structured Query
keywords needs to be as accurate as possible. The pattern Language), which can be used for this purpose.
matching for language „query‟ for AIML is simpler than for
example SQL. However, this does not mean that AIML is a SQL or MYSQL has gained a high recognition in RDB
simple question and answer database. It depends on more than because it is the high-level language for nonprocedural data.
one matching category because it uses a recursive tag like Query blocks nesting to arbitrary depths is one of the most
<srai> [19]. It is important to give a variety of responses from interesting features of it, and the SQL query can be divided
the knowledge base to achieve the highest number of possible into five basic kinds of nesting. Algorithms are developed to
matches. change queries that include these basic nesting types into
"semantically equivalent queries". Semantically equivalent
G. SQL series are adjustable to achieve effective processing via
A Relational Data Base (RDB) is one of the techniques existing query processing subsystems. SQL as a data language
recently used to build Chatbot knowledge bases. The is implemented in ZETA; also as a calculus-based and block-
technique has been used to build a database for a Chatbot, i.e. structured language, it is implemented in System R,
to enable the Chatbot to remember previous conversations and ORACLE, as well as SEQUEL[21]. Some researchers, as seen
to make the conversation more continuous and meaningful. in the next sections, have recently used SQL to generate a
75 | P a g e
[Link]
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 6, No. 7, 2015
database that saves the conversation history in order to make a or any other text or speech response. Fig. 4 shows a brief
search for any word or phrase match easier. This technique diagram of the third stage.
gives continuity and accuracy to the dialogue because it
enables the dialogue system to retrieve some previous Conversation Chatbot Response (Speech or
information history. Keywords action)
III. SPEECH ANALYSIS AND RESPONSE Fig. 4. The Stage of Response and Action Taking
Speech analysis can be divided into three stages: (i) voice a) Main Parameters
recognition and conversion to text, (ii) text processing, and
Conversation techniques between a human and a computer
(iii) response and action taking. These stages are explained as
can be either chatting by typing text or speech dialogue using
follows:
the voice. The processing of the information in both
Firstly, speaker independent speech passes through a techniques is the same after converting speech to text in the
microphone to a digital signal processing package built in the case of speech dialogue. A diagram showing the main steps of
computer to convert it into a stream of pulses that contain analysis and processing required to perform human computer
speech information. Specific instructions can be used to read conversation is shown in Fig. 5.
input speech then to convert it into text. This stage provides
The main parameters which affect human computer
speech text for processing in the next stage. The diagram
interaction quality in conversational systems design are: (i) the
which illustrates this stage is shown in Fig. 2.
techniques used to analyse the text using different grammar
sets to produce keywords, (ii) pattern matching techniques
Microphone used inside the Chatbot and depend on a variety of data base
access techniques and (iii) the type of response according to
Speech Digital the specific application. The focus in this survey is mainly on
Speech
Input Signal Chatbot design techniques and a comparison is made between
to Text
Processing them in terms of the software used, the contribution to the
research field in new techniques, and the breadth and depth of
the knowledge base used.
Fig. 2. The stage of speech recognition and converting to text
Speech
Secondly, the resulting text is split into separate words for
tagging with parts-of-speech labels according to their
positions and neighbours in the sentence. Different types of Speech to text
grammar can be used in this stage to chunk the individual
tagged words in order to form phrases. Keywords can be
extracted from these phrases by eliminating unwanted words
in chinking operations. These keywords can be checked and
corrected if they are not right. The phases of the text Splitting text to words and
processing stage are shown in Fig. 3. tagging the words
Choosing a phrase
(keywords)
Correcting Checking Omitting
Existing Keywords Redundant
Errors Words
A Chatbot built using any
technique
76 | P a g e
[Link]
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 6, No. 7, 2015
IV. A REVIEW ON RECENT CHATBOT DESIGN WORK Javascript + XML (AJAX). Again Malaysian is used.
A considerable body of work is associated with Chatbots The extension of ViDi designed in [23] makes it
and they have recently become a promising technique for available to users on the internet through a web
human-computer interaction. Dialogue systems have been browser.
built to meet a variety of applications and can be applied in a Pattern matching techniques can also be applied in the
number of fields. A number of selected studies between 2003 Chatbot design world, and can lead to increased
and 2013 are reviewed and explained below. accuracy of retrieval. The authors in [25] proposed a
Although creating a new type of Chatbot is a new technique for keyword matching using ViDi, ([23]
contribution to the field there are a limited number of and updated in [24]) as a test environment. The
options available to the software designer. The authors proposed technique is called One Match or All Match
in [10] created knowledge bases for Chatbots by Categories (OMAMC). OMAMC is used to test the
combining the attributes of two other Chatbots. The generation of possible keywords associated with one
authors processed the knowledge bases using three sample sentence. Then, the results are compared to
filters to eliminate overlapping, identify personal other keywords generated by another previous Chatbot
questions, and reject unwanted words or topics. The around the same sample sentence. It is found that
corpus is built from a combination of an ALICE OMAMC improves on keyword matching compared to
foundation type Chatbot, which is a QA form, and previous techniques. This new approach is likely to be
another, such as CLEVERBOT or JABBERWACKY, found in future instantiations of Chatbots.
which are good for handling conversational chatter. Educational systems are another application of
The authors processed the Chatbot to either dialog or Chatbots. The objective is to answer students‟
QA pair format according to gathered interaction questions or to test for an examination by asking
ordering. Then, according to the processed interaction, questions and assessing the answers. In [26] the
they produced a Chat corpus with around 7800 pairs of authors concentrates on an improvement to the Chatbot
interactions in total. The purpose of their study was to CHARLIE (CHAtteR Learning Interface Entity). The
improve Chatbot design techniques. platform is an INtelligent Educational System (INES)
Chatbots tend to evolve from one contribution to the with an AIML Chatbot incorporated inside. The
next with extensions added by subsequent researchers, performance and contribution of CHARLIE are
adding new features to the software. The author in documented in his paper and CHARLIE is able to
[22] looked at how to extend serious types of games by establish a general conversation with students; it can
adding dialogue using simple Chatbots. In fact, it is a show the material of the courses they study and it is
serious and positive step in conversation insertion into prepared to ask questions associated with the material
the games world. The existing serious game EMERGO learned. Educational applications of dialogue systems
has been used as a case study of the work. The author are particularly useful and are highly interactive. They
describes the Chatbot-EMERGO, which is designed to can be improved and updated easily since they are used
train students or trainees in a medical treatment in an academic environment.
environment [22]. The purpose of the study is to The application of Chatbots to Disability care requires
enhance speech interaction between the training the design of packages and systems in order to
programme and the trainees or students. empower disabled people with new technologies. The
A new Chatbot can be designed to solve health authors in [5] suggested a question-answer educational
problems or any other application in a wide variety of system for disabled people, considering natural
fields. In [23] the authors presented the Chatbot ViDi language speech and isolated word conversation. The
(Virtual Dietician) that interacts with diabetic patients system has been designed using an AIML knowledge
as a virtual adviser. The authors proposed a special base with limited vocabulary including voice
design for the Chatbot ViDi to make it remember the recognition or “groups of phonemes and words”. The
conversational paths taken during the question and AIML question-answer system is implemented to give
answer session. The path splits into three levels of 9 answers to queries, and then training data of 2000
questions each and it can be obtained by analysing the words is used to test it. 200 words of the data were
parameter Vpath which determines the path taken by used in the test and 156 of them were recognised;
the patient. The natural language that is used to therefore, the system accuracy was 78%. The aim of
interface with the user is the Malaysian local language. the study was to insert it in English language tutorial
software easy access by disabled people. People with
An extension has been made to the chat bot ViDi blindness and hand paralysis can benefit from adding
when the authors in [24] proposed the entire redesign this kind of feature into E-learning systems.
of the ViDi Chatbot by employing the advantages of a
relational database. They also added an extension and Introducing new matching models represents true
prerequisite algorithm to update ViDi into a web-based innovation within Chatbots. In [27] the author
Chatbot. The authors used web programming proposed a new model that produces a new sentence
languages such as PHP, HTML and XHR to implement from two existing sentences. The study proposes
the coding of the Chatbot in addition to Asynchronous employing a Genetic Algorithm (GA) to build a new
77 | P a g e
[Link]
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 6, No. 7, 2015
sentence depending on the sentences that are retrieved improve the diversity of the Chatbot response. The two
from an available database. The proposal is presented main contributions of the study are i) converting two
in order to adapt the GA to a natural language sentences into one and ii) Applying information
structure. retrieval techniques to Chatbots.
The proposal in [27] was implemented when the As seen in the above review, conversational techniques can
authors in [9] presented their new approach to Chatbot be applied to a variety of different applications involving the
design. The approach combines indexing and query interaction between people and computers. Efforts to insert
matching methods with pattern matching and applies conversation into these different systems is shown to be useful
Information Retrieval (IR) techniques to produce a new with all studies concluding that adding a Chatbot to a system
sentence from existing ones. In their study, the existing or software improves the interaction with the system.
sentences became the initial population of the GA, then
the swap and crossover operators were applied to V. SELECTED FACTORS INFLUENCING CHATBOT DESIGN
produce the new sentence as a new generation of the Commonalities and differences in Chatbot designs have
GA. Experimental evaluation for the Chatbot before been highlighted with the Influential factors included in the
and after applying the sentence combination approach survey. A summary of these factors can be seen in table 2.
were presented. The purpose of the approach was to
TABLE II. A SUMMARY OF THE SELECTED FACTORS INFLUENCING CHABOT DESIGN
Using
Creatin availab SQL usage Corpus
Study Voice Text AIML
g new le (Relational Matching technique (knowledge Application
usage
Chatbot Chatbo Database) base)
ts
Edger Chatbot matching
technique (combination of
Edgar
Pereira et al Yes TfIdf algorithms with Chatbot design.
[10] Yes Yes NO Yes NO Chatbot
natural language
normalization)
Rosmalen [22] NO Yes NO Yes Yes Yes QA matching form AIML Medical education
Lokman et al NO Yes Yes NO Yes Yes QA matching form VP bot Health assistance
[23]
Prerequisite ViDi
Lokman et al NO Yes NO Yes NO Yes Health assistance
[24] Matching Chatbot
One-Match All-Match ViDi
Lokman et al NO Yes NO Yes NO Yes Health assistance
[25] Category (OMAMC) Chatbot
78 | P a g e
[Link]
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 6, No. 7, 2015
Although the processing steps are the same for voice and evidence of using it in Loebner Prized Chatbots) added a new
text after the voice to text conversion, there are distinct technique to knowledge-bases, namely the Relational Data
differences in the use in conversational systems, particularly in Base, which enables the Chatbot to remember previous
terms of their applications. Text is used in most of the studies, conversations by accessing the history stored in the database
except [5], due to simplicity, whereas voice is used in [5] and designed using SQL. However, an AIML knowledgebase is
[10] for special needs applications e.g. for disabled people. still effective for Chatbot designs; for example, Mitsuku
The response in the case of disability applications should be a Chatbot won Loebner Prize in 2013 and it was based on
voice response. The commercial mobile applications AIML.
(Chatbots) which have emerged recently, e.g. Cortana and Siri,
accept speech as an input and give a voice response in In order to design new Chatbots or extend previous ones,
addition to text. each study has used a corpus that is different from the other as
illustrated in table 2. The corpus that is relied on to build a
New Chatbots have been created in [5], [9], [23], and Chatbot affects the design because it affects the knowledge
[27], which add new techniques or use improved previous base of the Chatbot and then the accuracy of the response
designs. Also new techniques, algorithms or extensions have since the response is a knowledgebase reflection.
been added to existing Chatbots in [10], [22], [24], [25], and
[26] in order to improve their function or extend available The application column in table 2 shows that each Chatbot
software by adding chat interaction. For example, the Loebner has been designed to meet certain needs for conversation by
Prized Chatbot ALICE (which won three times) was improved holding a chat with a specific group of people in a specific
several times in later iterations, and Joan (Jabberwacky) was organisation. The work in the future needs more focus on
the updated form of George (Jabberwacky). general purpose conversational systems by designing Chatbots
with more comprehensive knowledge bases in order to cover
Knowledge bases are built using different techniques. For general topics by using the latest techniques.
example, AIML, which is the technique first used with the
ALICE Chatbot, is used to build the Chatbots in [5], [10], and Table 3, which covers the contribution presented by each
of the selected studies, displays how each has made an
[26], while SQL (or RDB) is used in [24] and [25]. Both
AIML and SQL are used in [22] and [23]. Neither AIML or improvement to Chatbot design in spite of using different
SQL are used in [9] and [27]. The use of SQL (no clear techniques, algorithms, or programmes.
Study
Significant Improvements
Producing a new corpus (knowledge base) that avoids overlapping, identifies personal questions, and rejects
Pereira et al
unwanted words or topics by combining available QA and dialogue formats.
[10]
Extending an existing serious game by adding a simple Chatbot to give the opportunity for trainees to be aware of
Rosmalen [22] work and activities on the first day of their employment.
Designing a new Chatbot (ViDi) that has the ability to remember previous conversation in order to work as a
Lokman et al
virtual adviser for diabetic patients.
[23]
Redesigning and extending the Chatbot ViDi by adding the prerequisite matching techniques in order to attain a
Lokman et al
conversational manner rather than a QA form and make it available to users on the internet via a web browser.
[24]
Proposing a new matching technique OMAMC in order to produce improved results by reducing matching time
Lokman et al
and increasing context flexibility.
[25]
Updating the Chatbot CHARLIE to incorporate it into the platform INtelligent Educational System (INES) in order
Mikic et al [26] to improve the conversation between students and educational systems.
Designing a new AIML based Chatbot of natural language speech and limited word input and output so as to use it
Bhargava et al
in an E-learning systems to enable disabled people to learn via speech.
[5]
Proposing a new innovative pattern matching approach in a Chatbot. The authors adjusted Genetic Algorithms with
Vrajitoru
natural language to generate a new sentence from existing ones in order to improve the diversity of response.
[27]
i) Implementing the model proposed in [27], i.e. employing GA in pattern matching to produce a new sentence
Ratkiewicz from sentences retrieved from an existing database in order to increase the diversity of responses. ii). Applying
[9] information retrieval techniques to the Chatbot.
79 | P a g e
[Link]
(IJACSA) International Journal of Advanced Computer Science and Applications,
Vol. 6, No. 7, 2015
80 | P a g e
[Link]