2. The conversational agent architectures available were lacking the incorporation of
the cognitive theory with them. My research is an attempt to incorporate the conver-
sational agent architecture with the cognitive architecture so that the chatbot will sound
more like a human.
3 Design of an Emotional Cognitive Conversational Agent
Architecture (ECCAA)
My hypothesis is ‘There is an internal cognitive system in a conversational agent
architecture that will map a syntactic structure to a semantic one based on
pragmatics’.
Emotional Cognitive Conversational Agent Architecture (ECCAA) is a 7 Layer
architecture where each layer is connected to a specific database which stores suc-
cessful conversations. Basically the conversations are categorized into 5 different levels
such as Reflexive layer, Reactive layer, Deliberative layer, Learning layer and Cog-
nition layer based on SMCA. But in the case of conversational agent architecture we
need to further classify the Cognition layer. Thus in ECCAA, the Cognitive layer is
further classified into Cognition, Meta Cognition and Epistemic Cognition. Apart from
the horizontal layers; there are vertical layers such as perception, action and emotion
[4]. Thus ECCAA is language independent, flexible to all socio-cultural environments.
The language and knowledge engine is used to store the syntax, semantics of the
language and environmental, social facts respectively. Though the implementation is
based on the English language, the model will be universal and will be robust irre-
spective of the language [5].
3.1 Reflexive Layer
This is the first layer and it has very limited intelligence. It is based on the biological
reflex mechanism which acts instantly before thinking. This layer is completely
dependent on the knowledge engine. In conversational agents just one word answers
such as yes/no/ok are generated from this layer. The intelligence is only limited to
knowing its environment and acting spontaneously. As the intelligence capabilities of
the agent increases by experience more answers will fall under this layer [6].
3.2 Reactive Layer
The next layer is the reactive layer whose intelligence is completely based on facts and
general knowledge. Reasoning or decision making is not required for such type of
answers. Learned and successful conversations are stored in the knowledge engine and
the language protocols such as the syntax and semantics of the language are stored in
the language engine. It uses the knowledge engine for the acquiring data and the
language engine for communicating [6].
Building a ChatBot Using Emotional Cognitive Conversational 1837
3. 3.3 Deliberative Layer
This layer does the goal based reasoning using heuristic search techniques to choose
the most optimum answer for the current situation. Understanding of the environment,
the role played by the agent, the purpose of the conversation etc. will be the deciding
factors [7].
3.4 Learning Layer
The only task of the learning layer is to store the successful conversations in the
knowledge base which will be used by the deliberative layer for future choices. When
the agents are allowed to communicate with each other this knowledge is multiply.
3.5 Cognitive Layer
This layer is considered to be one of the layers with the highest levels of intelligence. If
this level of intelligence is achieved in our conversational agent then we can consider
all the conversations to be successful. This level is achieved when there a proper
understanding of the environment, perseverance and problem solving capabilities. This
level when achieved could be the closet level to any human to human conversation.
3.6 Meta Cognition Layer
This layer is also considered to be one of the layers with the highest levels of intel-
ligence which is self reflective with consciousness. The agent will reflect on how
successful and be able to act wisely and come up with strategies to eliminate failure
without any human intervention. So as the agent lives more on certain circumstances
will tend to become more experienced and wise like humans do (Fig. 1).
ECCAA
Fig. 1. Architecture for emotional cognitive conversational agent
1838 G. Gnanaguru
4. 3.7 Epistemic Cognition Layer
This layer is considered to be in the highest levels of intelligence which is self reflective
too [8]. In Epistemic cognition level, the agent reflects on the limits of its knowledge
and overcome such limitations. In this level of intelligence the agent must be able to
differentiate the known from the unknown. This intelligence is above the human level
of intelligence. Here the agent should know that it needs to have more
knowledge/information to participate in certain conversations and be able to say ‘I
don’t know’ and also have the urge to know. So the agent will know its limitations, will
have certainty of knowledge and also the criteria for knowing.
4 Implementation of the ECCAA Model
4.1 Reflexive Layer
In this layer only the yes/no responses are trained to the ‘GGBot’.
E.g. Are apples red fruits? Is India democratic?
Here basic stimuli and responses can be trained from the knowledge base and meta
data which is the information on the agent’s involved in conversation are stored. The
dataset used to train is ‘ggbotyesno’.
Knowledge base of Domain includes Company policies, Do’s and Dont’s, Today’s
Rates, Trouble shooting queries, Clarification, Functioning and protocols, etc.
Meta Data is information about the Agent which includes Name, Address, Status,
designation, family details, employer details, etc., Personality, state of mind, Status in
the society, body language, facial expressions, emotions, etc., Desire, Belief, Intentions
(BDI) and Goals.
4.2 Reactive Layer
This layer is very similar to the previous layer, except that instead of on yes/no
responses; responses are facts stored in the knowledge base and in the meta data. The
dataset contains more stimuli-response with the responses derived from the facts stored
in knowledge base together with the yes/no responses. The dataset used for this level of
training is known as ‘ggbotfacts’ (Fig. 2).
Building a ChatBot Using Emotional Cognitive Conversational 1839
5. E.g. Who is the president of United States? What is your designation?
4.3 Deliberative Layer
A Heuristic search is performed based on Neural Networks to choose the most accurate
reply. In order to train and perform heuristic search a large English corpus know as
‘ChatterBot English Corpus is used along with my datasets ‘ggbotcorpus’, ‘ggbo-
tyesno’ and ‘ggbotfacts’.
The numbers above indicate the percentage of accuracy which is also referred as
confidence in the responses.
4.4 Learning Layer
In all the above models, learning is inevitable in a ChatBot. So practically learning is
not a separate layer. Whenever there is a response for a stimulus, the new response is
stored in the database.
4.5 Cognition Layer
The core of the ECCAA is the cognitive layer. ‘Emotion’ is added to the dataset.
Before training the dataset, every stimuli and response is analyzed and classified based
on the emotions. This is done using an emotion detector API known as ‘indico’. It is
capable of detecting which is the dominant emotion in the sentence. The basic emotions
Fig. 2. Training a ChatBot
1840 G. Gnanaguru
6. considered are anger, joy, fear, sadness, surprise. For every statement, a vector value is
derived for every emotion. Now training is performed as usual with all the stimulus and
responses with emotions. The emotion with highest vector value is assigned to that
particular sentence (Fig. 3).
Fig. 3. Classification based on emotions
Fig. 4. Meta-cognition layer with self reflection
Building a ChatBot Using Emotional Cognitive Conversational 1841
7. 4.6 Meta Cognition Layer
This layer is more intelligent than the above layers. This layer is self-reflective. This
can be implemented in which the chatbot has to choose responses with confidence
value more than the threshold assigned. If the confidence is say 65% then, the
response must be a specific response such as ‘I am sorry, I don’t know’ (Fig. 4).
Fig. 5. Epistemic cognition layer with self knowledge gaining
Fig. 6. Reflexive layer
1842 G. Gnanaguru
8. 4.7 Epistemic Cognition Layer
In Epistemic cognition level, the agent reflects on the limits of its knowledge and
overcome such limitations. This is the highest level in ECCAA. It is not only ‘self-
reflective’ but also learns by itself. This is implemented by adding responses directly to
store in the database that is specified in the ‘Storage Adapter’. This added response is
added to the trained dataset (Fig. 5).
Fig. 7. Reactive layer
Fig. 8. Deliberative layer
Building a ChatBot Using Emotional Cognitive Conversational 1843
9. 5 Results
A questionnaire was prepared commonly for all the models in order to measure their
performances. A graph was plotted with responses in the x axis and the confidence
value in the y axis. The result was as follow for various models (Figs. 6, 7, 8, 9, 10 and
11).
Fig. 9. Cognition layer
Fig. 10. Meta cognition layer
1844 G. Gnanaguru
10. 6 Conclusion
Thus general conversational agent may produce good results, but in order to achieve
results that are close to the human responses, the cognitive model ECCAA is sug-
gested. The result suggests that it is a very efficient one. This model can be incorpo-
rated to any conversational agent architecture. This model also works for training
multilingual conversational agents with respective datasets.
References
1. Langley P, Laird JE, Rogers S (2009) Cognitive architectures: research issues and challenges.
Cogn Syst Res 10(2):141–160, ISSN 1389-0417
2. Venkatamuni MV (2008) A society of mind approach to cognition and metacognition in a
cognitive architecture. Dissertation of Doctor of Philosophy in computer science and
engineering, University of Hull, London
3. Singh P (2005) EMONE: an architecture for reflective commonsense thinking. Dissertation of
Doctor of Philosophy in computer science and engineering, Massachusetts Institute of
Technology, Cambridge, MA
4. Weitzenfeld A, Arbib M, Alexander A (2002) NSL—neural simulation language: a system for
brain modeling. MIT Press, Cambridge, MA
5. Gnanaguru G, Venkatamuni, MV (2017) Building a conversational agent based on the
principles of cognitive pragmatics using cognitive architecture. Int J Eng Res Technol 6(2),
ISSN: 2278-0181
6. AbuShawar B, Atwell, E (2015) ALICE chatbot: trials and outputs, Computación y Sistemas
19(4):625–63
Fig. 11. Epistemic cognition layer
Building a ChatBot Using Emotional Cognitive Conversational 1845
11. 7. Davis N (2002) Computational architectures for intelligence and motivation. In: 17th IEEE
international symposium on intelligent control, Vancouver, Canada
8. Hintze A (2016) Understanding the four types of AI, from reactive robots to self-aware
beings. Michigan State University, 14 November 2016. https://theconversation.com/
understanding-the-four-types-of-ai-from-reactive-robots-to-self-aware-beings-67616, Acces-
sed 15 Nov 2017
1846 G. Gnanaguru