Smart Banking Chatbot
Smart Banking Chatbot
https://doi.org/10.22214/ijraset.2022.41788
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IV Apr 2022- Available at www.ijraset.com
Abstract: The purpose of the project is to make any domain-specific website, in our case banking, more usable by integrating a
chatbot that serves as an interface for customer inquiries about services. This reduces customer interaction time with websites,
thereby valuing their time and improving their overall experience. As part of this project, we explored and attempted to create an
intelligent chatbot that could extract relevant information, recognize various intents and execute the pre-mapped actions. To
create a contextual assistant for the above purpose, we used the RASA framework. To train the model, we constructed a custom
dataset that includes multiple intents and entities. Additionally, we provide some python scripts (RASA actions) that will be
executed when some intents are detected. Our solution consisted of creating a pipeline having a chatbot and several actions
triggered by the chatbot. These actions will connect with the database and then provide the required data or make changes
according to the user’s query and display the feedback back to the user via the chat widget.
I. INTRODUCTION
At a very basic level chatbot can be considered to be an agent which can interact with a user like a human (voice or text) and
understand what the user wants from it and provide a specific set of services to the user according to the user’s demands. Chatbot
also acts as an information-gathering tool using which the organization can know their customer base more clearly and understand
their needs. Chatbots are used in a wide range of domains right from health care services to customer relationship management
services.
A chatbot broadly comprises three subsystems which are Natural Language Understanding(NLU) which understands what the user
is trying to communicate or what is the intent of the provided sentence, Dialog Management which maintains the state of
communication by remembering what key pieces of information have been provided by the user and how to drive the conversation
ahead and Natural Language Generation(NLG) which handles the part where the chatbot figures out what the bot should respond to
back to the user. RASA is an open-source Natural Language Processing(NLP) tool that is used to build virtual assistants and
contextual chatbots. RASA provides two main modules Rasa Open Source and Rasa Action Server. Rasa Open Source has Rasa
NLU to recognize the intent of communication and Rasa core to decide what to do next and how to proceed with the conversation.
Rasa Action Server allows the hosting of Python scripts to perform certain custom tasks like processing or modifying databases in
the backend. This paper presents a chatbot deployed on a banking website that offers certain services like checking account balance,
making a transaction, and many more to users right in the chat window.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 2320
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IV Apr 2022- Available at www.ijraset.com
B. Dataset
The custom dataset is created which contains in total of thirty-six intents out of which twenty are domain-specific intents these are
the ones that are related to common banking queries and sixteen intents are written for basic utterances while in a conversation.
Dataset consists of eleven entities(transaction_amount, email_id, location, phone_no, etc) that can be recognized by the model and
will further be stored in slots which in turn will drive the conversation. For domain-specific intents, on average approximately
fifteen examples are provided per intent. Here are some of the example sentences from the intent ‘pin_change’:-
1) I would like my pin to be [6711](pin);
2) set pin to [6665](pin);
3) I want my new pin to be [1234](pin);
4) pin change;
C. Technology Used
1) Chatbot Framework: RASA
2) Website backend: Django
3) Frontend: HTML5, CSS/BootStrap, JavaScript
4) Database: PostgreSQL
Fig. 1 This figure represents basic blocks of the whole system consisting of chatbot, website and database and how communication
occurs between them.
As shown in Fig. 1, firstly the user will provide a message on the website through the chat window, this message will be passed over
to the RASA server by the website. The Rasa server will process the message and then recognize the intent of the message and
extract entities if they are present. If this is a simple conversational text then the Rasa server will utter a predefined response and
will wait for the next message from the user or else the Rasa server will pass on the extracted entities to the Rasa action server that
will call upon a certain action which will establish a connection with the database to either read/modify the database. Once all the
processing is done, a feedback message will be uttered by the action server back to the user mentioning the status of the queried
process.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 2321
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IV Apr 2022- Available at www.ijraset.com
B. Design Implementation
1) Rasa: Rasa is an open-source Natural Language Processing tool for building chatbots. Using Rasa it was possible to build the
chatbot and train it according to the custom dataset. To create a custom model we had to work mainly on four files in the Rasa
file structure- ‘nlu.yml’, ‘stories.yml’, ‘config.yml’, and ‘domain.yml’.
a) nlu.yml - This file stores all the example sentences for all the intent over which the model will be trained.
b) stories.yml - This file contains all the predefined conversation paths. A story is a representation of a conversation between the
user and the chatbot.
c) domain.yml- In this file, all the intents, entities and slots are registered. It also stores some predefined responses(utterances).
d) config.yml - This file has all the details about the pipeline which is going to be used while training the model. There are many
factors that can be customized to tune the model according to our choice and have varying results.
2) Rasa: Rasa action server hosts a file ‘actions.py’ which contains custom python scripts that can be used to connect to the
database, external APIs or can be used to perform certain processing steps. Our project has a total of nineteen actions that are
dedicated to perform operations like transactions, checking account balances, changing PINs, etc. Another file named ‘otp.py’
is present which has the function to send OTP to the user via mail using ‘smtplib’.
V. PROJECT OUTPUTS
Our model makes use of the DIET classifier which stands for Dual Intent Entity Transformer Classifier. As the name suggests this
model is able to recognize intents as well as extract the entities. A model trained over the above dataset achieved an accuracy of
98.4% and an F1 score of 0.862 with a loss of 1.24.
TABLE I
METRICS WITH RESPECT TO INTENTS
Intent Precision Recall F1-
score
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 2322
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IV Apr 2022- Available at www.ijraset.com
Table I provides the precision, recall and F1 score for all the domain-specific intents, and we can observe the accuracy is around 1.0
while precision and recall are close to each other. There are some intents that have low accuracy like pin_provided as it is
ambiguous for the model to recognize PIN from various numerical entities like OTP, amount, phone number, etc.
In Fig. 2 the user interface of the chatbot is shown where initially the user is asking about the account balance but here the user is
not authenticated so the chatbot displays a message containing “For security reasons, I have to authenticate you, Can I please get
your email address. Thank you”. So the user will provide the email and an OTP (One Time Password) will be sent on the email
provided. After successfully entering the OTP the user will get a message stating “Thanks for the info, I have successfully
authenticated you. You may ask any query now.” After that, the user asks about his/her account balance and the account balance is
displayed.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 2323
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue IV Apr 2022- Available at www.ijraset.com
Further, if the user wants to transfer some funds then the chatbot will ask the user to enter a 12 digit account number after that the
amount which is to be transferred. For enhanced security purposes the user will have to enter a transaction OTP which is sent on
his/her email. After successfully entering the transaction OTP the user will get a message where he/she is informed that the
transaction is completed and a transaction reference id is provided.
If the user wants to know about his/her latest transactions a mini statement is provided as shown in Fig. 2.
VII. CONCLUSIONS
Implementation of this project would make the user experience of a customer on the website, more friendly and seamless. A chatbot
can also act as an information-gathering tool that would help the organizations to inspect the needs of customers and then implement
them.
VIII. ACKNOWLEDGMENT
We would like to extend our thanks to all the sources of motivation. We would like to grab this opportunity to thank Dr. S. D.
Sawarkar, principal for encouragement and support he has given for our project. We express our deep gratitude to Dr. A. P. Pande,
head of the department who has been the constant driving force behind the completion of this project. We wish to express our
heartfelt appreciation and deep sense of gratitude to my project guide Prof P. Y. Itankar for his encouragement, invaluable support,
timely help, lucid suggestions and excellent guidance which helped us to understand and achieve the project goal. We are also
thankful to all those who helped us directly or indirectly in completion of this work.
REFERENCES
[1] Jiao, Anran. (2020). An Intelligent Chatbot System Based on Entity Extraction Using RASA NLU and Neural Network. Journal of Physics: Conference Series.
1487. 012014. 10.1088/1742-6596/1487/1/012014.
[2] Fathima, Sasha & Student, Suhel & Shukla, Vinod & Vyas, Dr Sonali & Mishra, Ved P. (2020). Conversation to Automation in Banking Through Chatbot
Using Artificial Machine Intelligence Language. 10.1109/ICRITO48877.2020.9197825.
[3] Singh, Netra & Singh, Devender. (2019). Chatbots and Virtual Assistant in Indian Banks. Industrija. 47. 75-101. 10.5937/industrija47-24578.
[4] Petr Lorenc, “Joint model for intent and entity recognition” in arXiv:2109.03221v1 [cs.CL] 7 Sep 2021
[5] The Rasa documentation. [Online]. Available: https://rasa.com/docs/rasa/2.x
[6] Django documentation. [Online]. Available: https://docs.djangoproject.com/en/4.0/
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 2324