Ref 4

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Proceedings of the Third International Conference on Smart Systems and Inventive Technology (ICSSIT 2020)

IEEE Xplore Part Number: CFP20P17-ART; ISBN: 978-1-7281-5821-1

Jollity Chatbot- A contextual AI Assistant


Kanakamedala Deepika Veeranki Tilekya Jatroth M amatha
Dept of It Dept of It Dept of It
BVRIT Hyderabad College of BVRIT Hyderabad College of BVRIT Hyderabad College of
Engineering for Women Engineering for Women Engineering for Women
Hyderabad, India Hyderabad, India Hyderabad, India
17wh1a1209@bvrithyderabad.edu.in 17wh1a1215@bvrithyderabad.edu.in 17wh1a1208@bvrithyderabad.edu.in
Subetha T
Assistant Professor
Dept of It
BVRIT Hyderabad College of
Engineering for Women
Hyderabad, India
subetha.t@bvrithyderabad.edu.in

Abstract— Chatbot is a software application that can whenever you need it. There are two different tasks that takes
stimulate a conversation via text, instead of direct contact with place at the core of a chatbot:
a live human through messaging applications, websites and
mobile applications. Chatbot applications help to make 1)User request analysis: The first task that user request
interactions between people and services by enhancing the analysis performs is to analyses the user’s request to identify
customer experience. Chatbot is widely used in the areas of the user intent and to extract relevant entities from the given
food ordering, ecommerce and transportation, etc. Practically input by the user’s.
it is not possible to find a permanent companion to make us
2)Returning the response: After the user intent is identified
happy all the time. Hence, this paper has planned to design a
then chatbot must provide the most accurate response for the
jollity chatbot to talk with the human users and make sure that
it entertains and give suggestion and motivation in tough times.
user’s requests.
The jollity chatbot is implemented in Rasa, an open-source In general, there are two types of chatbot such as retrieval
conversational AI framework an d it is easy to customize. The based model and generative-based model [2]. Retrieval-
proposed method has added 12 intents with each more than 8 based models [3] (easier) retrieves the responses from a
text examples constituting a total of 100 input samples in predefined response repository or it uses some heuristic ru les
nlu.md and their response in domain.yml . The flow of
to dig out the correct response depending on our input and
interactions is given in stories.md. The jollity chatbot is the context. The heuristic can be either some machine
deployed in Telegram using ngrok and the server URL details
and the access token are given in the credentials.yml. The
learning algorithms or some rule-based classifier. In contrast
system is experimented with various evaluation measures like
generative based model chatbot [4] doesn’t use any
accuracy of the intents, accuracy of the stories and the predefined repository. This contextual AI Assistant is more
confusion matrix to shows that the proposed jollity chatbot advanced and found to be effective. The reason is it
system is more robust and can identify the user intents understands everything from the beginning using Deep
appropriately. learning. Th is adapts the knowledge fro m machine
translation. In machine translation we will translate an input
which is one language to another language whereas chatbot
Keywords—Chatbot, Contextual AI Assistant, Rasa, Rasa NLU, will translate fro m intent classification to response. The
Rasa Core overall flowchart of chatbot is shown in Figure 1.

I. INT RODUCT ION


Chatbots are not recent development. They are imitation
of a situation or process which can understand human
language and interact back with hu mans while performing
specific task. The purpose of chatbots is to support business
by helping them to maintain their relat ions with customers. It
can be implemented in major chat applications like Facebook
Messenger, Telegram, RocketChat, Google Hangouts Chat,
etc. Chatbots may sound like a very modern idea, but
according to Global Web Index statistics, it is said that 75%
of internet users are adopting messenger platforms. Chatbot
will be handling 85% of customer interactions by the year Figure 1: Overall flowchart of Chatbot
2020 as per a report by Gartner,. Also, 80% of business are
expected to have some sort of chatbot automation by 20 20. This paper aims in developing a generative-based
These-days we virtually have chatbots everywhere, but it contextual AI assistant using Rasa [5] that can help the
doesn’t mean that all will be efficient enough. The challenge people in their tough time. Since the major concern revolving
there is not to develop a chatbot but to develop a well - around the world is depression and it makes many people to
functioning one. It would be great if someone could ease commit suicide. There will not be a person accompanying
your pain by helping you out 24*7 making your work easier the depressed person for the whole day and comfort him.
and less hectic. Chatbots can do just that and stay with you Chatbots like A lexa [15] and Google assistant [16] are for

978-1-7281-5821-1/20/$31.00 ©2020 IEEE 1196

Authorized licensed use limited to: University of Glasgow. Downloaded on November 01,2020 at 02:35:31 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the Third International Conference on Smart Systems and Inventive Technology (ICSSIT 2020)
IEEE Xplore Part Number: CFP20P17-ART; ISBN: 978-1-7281-5821-1

wide range community whereas our chatbot focuses on only Kataria et. al[12] generated a user adaptive chatbot that can
one kind of co mmunity i.e. depressed people. Many chat engagingly with user mit igating the depression of the
depressed people need psychology sessions which are not user.
affordable by a middle class or lower middle class this
chatbots helps this people in their low t imes without costing III. PROPOSED JOLLIT Y CHAT BOT
them a penny. So this chatbot is designed in such a way that The main aim of the jo llity chatbot is to confer with people
it consoles the affected person with the appropriate messages
and help them by suggesting articles, videos and images.
and comforts them with the positive messages like positive
Most of the chatbots are retrieval-based models but the
quotes, motivational videos, and humour videos depending
jollity chatbot is generative based. The jollity chatbot
upon the mood of the user. Initially we have prepared all
possible intents the user might be looking for and the understands the flow of the interaction and can ease the pain
corresponding answers. The system is also trained with more of the user by giving appropriate or exact results to the user.
than ten stories to make the system learn about the user flow In general, chatbots there might not be NLU processing but
of interactions. The developed jollity in our chatbot NLU take cares of spelling mistake and g ives
the most exact result to the user. The follo wing steps shows
The paper is organized as follows. Section II describes how it is done.
about the allied works carried out in chatbots. Section III •Providing instant replay when they want to talk to someone
describes about the proposed jollity chatbot. Section IV during their tough times.
depicts about experimental results followed by the •To engage the users with some fun videos and s ongs.
conclusion in Section V.
•To create a virtual friend for the users.
II. RELATED WORKS •To create interactive interface for the user.
In NLU Training data both the intent and sentences are
The chatbot developed in earlier days maintains a simp le added. For example, sentences like I am feeling stressed, I
conversational flow with the users in a simp le request and am stressed are grouped under the intent stress. So, if a user
response flow. As the research progresses, the recent says, “I am feeling stressed”, or “I am stressed”, Here, the
chatbots can understand the context of the users and the intent would be “stress”. Any Verbs in a sentence is an
flow of interactions and give the appropriate responses. intent. Once the system analyzes the user’s input, the system
Various chatbots developed for handling the people’s must reply to the user. The bot responds to the user by
psychological problems and other chatbots developed using fetching out the appropriate responses. This can be done by
Rasa are discussed in this section. creating more stories in stories.md. In stories, the actions to
Gillian et.al [6] outlined a chatbot for dig ital counselling. be performed by the bot is specified and this helps the bot to
They have suggested that utilization of chatbot enables retrieve appropriate messages back to the user. Stories are
better user interactions and they can talk anytime and sample interaction between the user and bot, defined in terms
anywhere. They have only developed the prototype and of intents captured and actions performed. So, the developer
haven’t started the implementation. can mention what to do if you get a user input of some intent
Bhuvan et. al [7] designed a therapy chatbot that can furnish with/without some entities. The universe in which your
the details regarding the health in formation. The authors assistant operates is called domain. It specifies the list of all
the intents, entities, slots and actions. It also includes
highlighted the advantages of having a therapy chatbot
responses for the things the bot can say. The final
which can alleviate the pain of a person remotely. They also
deployment details are in the credential file. The credential
give a prototype of how the system has to be developed. and token details are stored in this file and this can be used to
Anran Jio[8] developed a chatbot using Rasa for checking deploy the bot on apps like Telegram, facebook, etc,. During
the finance status. The system can identify the user request deployment, ngrok[13] is used as a testing tool. The
and fetch the appropriate response related to finance. The developed jollity chatbot is deployed in Telegram using
system shows better performance than RNN and it is ngrok. The overall samp le flow of the jollity chatbot for the
deployed in wechat. single intent stress is shown in Figure 2.
Falguni et. al [9] developed a chatbot that classifies the text
into emotion labels and categorise the stress level using the
emotion classification. The text are trained using three
different classifiers such as convolutional neural network
(CNN), hierarchical attention network (HAN), recurrent
neural network (RNN). But the system fails in providing the
positive messages.
Delahunty et. al [10] designed a chatbot that can have
conversation with the users and uses machine learning
classifier to identify the depression level of the user and
supports the user. This paper suggests that the further
development of these bots in real-t ime can help users in
many ways.
Fulmer et.al [11] conducted web-based survey and obtained
the depressed students list. These students were given access
to Tess, a conversational chatbot and analyzed the results
after the program. The cost-effective chatbot provides a
better solution compared to the costly therapeutic sessions. Figure 3: Sample flow of Jollity chatbot

978-1-7281-5821-1/20/$31.00 ©2020 IEEE 1197

Authorized licensed use limited to: University of Glasgow. Downloaded on November 01,2020 at 02:35:31 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the Third International Conference on Smart Systems and Inventive Technology (ICSSIT 2020)
IEEE Xplore Part Number: CFP20P17-ART; ISBN: 978-1-7281-5821-1

2.Then the user sends his/hers first msg after a configurable


NLU Training Data Module: period of in activity
Intent: 3.A manual session is triggered with the /session_start intent
Intent is a chatbot jargon with an intention behind each message Responses are normally stored in domain file and it
message that the chatbot receives. It is all about what the is given in Figure 5.
user wants to get out of the interaction. For example, if user Session_config key defines the period of the inactivity after
says “I need motivation” the intent behind the message is to which the new conversation is triggered. The time o f
browse the article, videos, images related to motivation and inactivity in minutes after which a new session will begin is
a sample intent stress associated with the text messages are called session_exp iration_time. Whether existing set slot
given in Figure 3. An intent based bot works by detecting should be carried over to new session is defined by
the user intent. Instead of relying on specific input, the carry_over_slot_to_new_session. Here slots are nothing but
chatbot can identify the mean ing of message the user is the bot’s memo ry wh ich can act as a key value store and can
trying to convey (and then offers a relevant and tailored be used to store the information that the user can provides as
response). The sample intents file is shown in Figure 4. well as the information gathered about the outside world.

Figure 3: Stress intent

Figure 5: Sample Domain file

Stories Module:

Stories are form of training data which are used to train the
rasa core dialogue management models. It represents an
actual conversation between user and the bot and the stories
file is given in Figure 6.

Figure 4: Sample Intent file


Domain Module:

Do main specifies intent, entities, slots and actions our bot


should know about it should also include responses for the
thing bot can say. The bot should respond to user messages
and the responses should be managed. The t rain ing data of
our bot, stories specify the actions that the bot should
execute these actions can use responses to reply back to the
user.
This happens in three ways:
1.The user starts the conversation with the bot

978-1-7281-5821-1/20/$31.00 ©2020 IEEE 1198

Authorized licensed use limited to: University of Glasgow. Downloaded on November 01,2020 at 02:35:31 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the Third International Conference on Smart Systems and Inventive Technology (ICSSIT 2020)
IEEE Xplore Part Number: CFP20P17-ART; ISBN: 978-1-7281-5821-1

Figure 8: ngrok

Figure 6: Stories file

Credentials Module:

The file credentials.yml contains credentials that helps us to


make our bot available on messaging platforms.

Figure 9: Botfather

Figure 7: Credentials file

Deployment Module:
There are d ifferent messenger platforms to deploy our
chatbot such as slack, Facebook Messenger, Rocket Chat,
Telegram and Google Hangouts etc. We choose Telegram to
deploy our project as it is one of the popular IM p latforms
today which allows users to store messages on cloud instead Figure 10: Jollity chatbot
on just their devices. Building a chatbot in Telegram is
simp le and requires litt le t ime and very few steps to IV. EXPERIMENT AL RESULT S
complete. The proposed jollity chatbot is imp lemented in Rasa X. The
To deploy our bot on Telegram, a new bot is created using *developed chatbot is deployed in Telegram using botfather
BotFather [14]. Ng rok is an application that gives external and ngrok. Various evaluation measures like intent
access to our private system that are behind NAT or a accuracy, story accuracy and confusion matrix are used to
Firewall. A secure tunnel along with the public u rl is created evaluate the robustness of the system. The nu mber o f
on our local machine by using the tool Ng rok as shown in intents correctly identified by the system is given in
Figure 7. The file credentials.yml as shown in Figure 8 that equation 1.
contains credentials to make our bot available on messaging
platforms. In credential.y ml we have access token which we (1)
have request fro m our BotFather as shown in Figure 9 to
control the bot and the developed chatbot is shown in Figure The number of correct flo w of interaction identified by the
10. It takes 0.01 seconds for the jollity bot to respond to the
system is given in equation 2.
user input in telegram.
(2)

978-1-7281-5821-1/20/$31.00 ©2020 IEEE 1199

Authorized licensed use limited to: University of Glasgow. Downloaded on November 01,2020 at 02:35:31 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the Third International Conference on Smart Systems and Inventive Technology (ICSSIT 2020)
IEEE Xplore Part Number: CFP20P17-ART; ISBN: 978-1-7281-5821-1

International Conference on Inventive Communication and


Assuming 50 rando m intents that contains 10 equal nu mber Computational T echnologies (ICICCT) (pp. 1915-1920). IEEE.
[5] Bocklisch, T., Faulkner, J., Pawlowski, N., & Nichol, A. (2017).
of intents, if the jollity bot classifies 10 intents correctly we Rasa: Open source language understanding and dialogue
will add 0.1 else 0. All correctly classified intents are management. arXiv preprint arXiv:1712.05181.
positioned on the diagonal of the confusion matrix. This [6] Cameron, G., Cameron, D., Megaw, G., Bond, R., Mulvenna, M.,
makes us to visualize the errors easily as the wrongly O’Neill, S., ... & McTear, M. (2017, July). Towards a chatbot for
classified intents are placed outside of the d iagonal values. digital counselling. In Proceedings of the 31st International BCS
Human Computer Interaction Conference (HCI 2017) 31 (pp. 1-7).
The confusion matrix obtained for the jo llity bot is given in
[7] Sharma, B., Puri, H., & Rawat, D. (2018, April). Digital psychiatry -
Table 1. Experimental results shows that the proposed curbing depression using therapy chatbot and depression analysis. In
jollity chatbot achieves an accuracy of 90%. The jollity bot 2018 Second International Conference on Inventive Communication
is tested with different flo w of stories and the performance and Computational Technologies (ICICCT) (pp. 627-631). IEEE.
of our bot with respect to frequent mood swings produces [8] Jiao, A. (2020). An Intelligent Chatbot System Based on Entity
accurate results. Extraction Using RASA NLU and Neural Network. JPhCS, 1487(1),
012014.
[9] Patel, F., Thakore, R., Nandwani, I., & Bharti, S. K. (2019,
Table 1: Confusion Matrix December). Combating Depression in Students using an Intelligent
motivation depression angry stress bored ChatBot: A Cognitive Behavioral Therapy. In 2019 IEEE 16th India
motivation 1.0 Council International Conference (INDICON) (pp. 1-4). IEEE.
depression 0.8 0.1 0.1 [10] Delahunty, F., Wood, I. D., & Arcan, M. (2018). First Insights on a
angry 0.1 0.8 0.1 Passive Major Depressive Disorder Prediction Syst em with
stress 1.0 Incorporated Conversational Chatbot. In AICS (pp. 327-338).
bored 1.0 [11] Fulmer, R., Joerin, A., Gentile, B., Lakerink, L., & Rauws, M. (2018).
Using psychological artificial intelligence (Tess) to relieve symptoms
V. CONCLUSION of depression and anxiety: randomized controlled trial. JMIR mental
health, 5(4), e64.
Chatbots are not only used for bookings, educational [12] Kataria, P., Rode, K., Jain, A., Dwivedi, P., Bhingarkar, S., & India,
purposes, and hospitality, etc. but our chatbot is unique in its M. C. P. (2018). User adaptive chatbot for mitigating depression.
one way as it will be a virtual friend for a person whenever, International Journal of Pure and Applied Mathematics, 118(16), 349 -
361.
he needs especially during his low times by suggesting
[13] Ngrok- https://ngrok.com/docs
videos, articles, and images to make him feel better. This
[14] Bots- https://core.telegram.org/bots
Jollity chatbot mitigates the problems of the depression by
[15] Amazon Lex https://aws.amazon.com/lex/ #:~:text= Conversational
providing an invisible friend to the user who m they can rely %20AI%20for%20Chatbots&text=With%20Amazon%20Lex%2C%2
on and they can also chat with the bot for the whole day. 0the%20same,bots%20(%E2%80%9Cchatbots%E2%80%9D).
This is cost-effective because they don’t want to afford a [16] Google Assistant “https://www.gupshup.io/developer/docs/bot -
costly psychological session that makes them cheerful. The platform/guide/how-to-build-a-bot-on-google-home”
jollity chatbot is imp lemented in Rasa and deployed in
Telegram. The system is evaluated with various parameters
such as intent accuracy, story accuracy, and confusion
matrix. The experimental results show that the system can
recognize the intents and fetch the appropriate responses
with an accuracy of 90%. The future scope of the jollity
chatbot is to fetch the real-life examp les by adding the
platforms like Quora so that the user can understand the
feeling of another person how they are dealing it when they
are depressed and it also makes them realize that they are
not only the one who goes through it but there are many
people in the world who has been through low time at least
once in their life. We would also like to add speech to text
conversation in our future implementation.
REFERENCES

[1] Singh, A., Ramasubramanian, K., & Shivam, S. (2019). Introduction


to Microsoft Bot, RASA, and Google Dialogflow. In Building an
Enterprise Chatbot (pp. 281-302). Apress, Berkeley, CA.
[2] Hussain, S., Sianaki, O. A., & Ababneh, N. (2019, March). A survey
on conversational agents/chatbots classification and design
techniques. In Workshops of the International Conference on
Advanced Information Networking and Applications (pp. 946-956).
Springer, Cham.
[3] Ramesh, K., Ravishankaran, S., Joshi, A., & Chandrasekaran, K.
(2017, May). A survey of design techniques for conversational agents.
In International Conference on Information, Communication and
Computing Technology (pp. 336-350). Springer, Singapore.
[4] Varghese, E., & Pillai, M. R. (2018, April). A standalone generative
conversational interface using deep learning. In 2018 Second

978-1-7281-5821-1/20/$31.00 ©2020 IEEE 1200

Authorized licensed use limited to: University of Glasgow. Downloaded on November 01,2020 at 02:35:31 UTC from IEEE Xplore. Restrictions apply.

You might also like