0% found this document useful (0 votes)
28 views

ChatBot Using Python Flask

Uploaded by

siddesh.17265
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

ChatBot Using Python Flask

Uploaded by

siddesh.17265
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Proceedings of the 7th International Conference on Intelligent Computing and Control Systems (ICICCS-2023)

IEEE Xplore Part Number: CFP23K74-ART; ISBN: 979-8-3503-9725-3

ChatBot using Python Flask


st nd rd th
1 Vineet Singh 2 Y.Rohith 3 Bhanu Prakash 4 Usha Kumari
2023 7th International Conference on Intelligent Computing and Control Systems (ICICCS) | 979-8-3503-9725-3/23/$31.00 ©2023 IEEE | DOI: 10.1109/ICICCS56967.2023.10142484

ECE ECE ECE ECE


GRIET GRIET GRIET GRIET
Hyderabad, India Hyderabad, India Hyderabad, India Hyderabad, India
vineetvs1 921@ gmail.com yallarohith13@ gmail.co m bhanupra kashmuppalla2001@ gm ail.c om ushakum ari.c@ gm ail.com

Abstract—In orde r to obtain information about the college, such In order to do this, a chat bot system must uses various technologies
as the colle ge fe e s, college facilities, the semester schedule, etc., like artificial intelligence, natural language processing etc. There are
stude nts usually need to visit the college administration throug hout various approaches of doing it,the approach used to construct a chat
the admissions process or as needed on a daily basis. In order to
bot depends on place where the chat bot is being employed, the
solve this issue, a chat bot may be created and built that can simply
be conne cted with any college website in order to deliver relevant features it plans to deliver, the target audience, etc. all have a role in
information about colleges. Chat-bots are software programs that choosing a suitable method.
conduct online chat conversations utilizing text or text -to-spee ch This literature review covers few of these approaches. Natural
which is proce ssed further, instead of putting you in direct contact Language Processing (NLP) is used to determine the context of an
with a re al human agent. The user’s request is processed by a chat query when a user submits one. To identify the input query’s
bot using natural language processin g, which produces a thoughtful
answe r. The chat bot is also powered by an artificial intelligence feelings, grammatical forms labeling and Word Net are used
syste m which itself decides the proper response to a certain query [5].Further processing is done by removing suffixes from words in
fire d by the use r based on the information contained in the database. English, many techniques such as the Lancaster Stemmer Algorithm
The task of the colle ge administration in giving information to [6], porter stemmer etc [7] are utilized. Word request proximity
stude nts can be le ssened by this system. between two sentences is estimated using the word request vector
Index Terms—Chat bot, Artificial Intelligence, Natural Lan-
guage Processing,Natural language toolkit, Flask, MySQL technique. Sentences that have the exact same words but are arranged
differently may have a completely disparate meaning, the chat bot
I. INTRODUCTION further evaluates the user’s confidence [8] score which helps the chat
A chat bot is a computer program that simulates human bot understand the query thoroughly. Finally query is processed
discussions in their natural setting in addition to text and voice through three keyword matching algorithms as part of the keyword
communication. When used with natural language processing, AI match calculation [9]. If the keyword matching is unsuccessful, the
approaches (NLP) [1], Latent Semantic Analysis (LSA) and query is then submitted to the database for 1 and 2 keyword
Artificial Intelligence M arkup Language [2] are utilized in the matching. The chat bot will respond with a predefined query like ”No
development of chat bots, which are used to describe general response Found” if the search doesn’t bring up any results that match
inquiries such as how do you do?, how can I assist you, and so on. the keywords in the question
[3] This pattern may also be used to generate random answers for the Another approach utilized for chat bot applications is the usage of
same question. In order to identify similarities between words as logic adapters to select an answer. The job done by an input adapter
vector representations, latent semantic analysis (LSA) is used. is to collect input from the bot source and then translate it into a
language that the chat bot can comprehend. The chat bot system
LSA interprets AIM L’s unanswered questions as a response.
employs a distinctive logic adaptor that permits selection of the
However, other chat bots employ more advanced techniques. The
appropriate response from a pool of offered possibilities. The M ulti
majority of chat bots primarily search for specific key -words,
Logic Adapter is used to choose one of the replies provided by the
phrases, and instances in their databases. Thus far, no chat bot has
logic adapters that the chat bot has been configured to utilize. Word
been able to completely fool humans into believing it is one of them
embedding is used for information preprocessing, Every word in this
by displaying typical dialect information [4]. This research
case is allocated to a vector, and the vector structure is spoken to in a
emphasizes the necessity for chat bots in the educational space and is
one-hot encoded way [10], suggesting that 1 signals the presence of a
built to satisfy readers.
word and 0 denotes everything else
II. LITERATURE REVIEW Natural Language Tool Kit (NLTK) is a Python module that
A variety of applications can be created by utilizing the science of assists in Natural Language Processing (NLP). Tokenizers are
artificial intelligence (AI). There is research being done on how to integrated into NLTK [11].
make the AI chat bots more informative, flexible, responsive and
informative which helps us finish a dialogue in an conversational
human language.

979-8-3503-9725-3/23/$31.00 ©2023 IEEE 1182


Authorized licensed use limited to: Shah and Anchor Kutchhi Engineering College. Downloaded on March 19,2024 at 08:48:33 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the 7th International Conference on Intelligent Computing and Control Systems (ICICCS-2023)
IEEE Xplore Part Number: CFP23K74-ART; ISBN: 979-8-3503-9725-3

The NLTK includes several different tokenizers, including those that The architecture of the chat bot is shown in the following figure. The
adhere to the follow-ing norms: letters, paths, keywords, words, user’s roles include asking questions, providing feedback, and so
classes, N-grams, patterns, and so on. The most popular tokenizer is forth. All of the user’s functions are detailed below, as seen in figure
word-punkt [12], which punctuates phrases at empty spaces. The 2.
NLTK tokenizers are exceptional in terms of their accuracy, speed,
and efficiency. The chat bot programme answers to the users’
questions using computational logic.

III. IMPLEMENTATION DETAILS OF COLLEGE


ENQUIRY BOT
The chat bot used in this research consists of these modules namely a
training dataset (.Json file), frontend code which has HTM L and CSS
in it and lastly the backend code, the programming language used
here is python. Some of the libraries used in the python code are
numpy, tensorflow, tflearn, mysql.connector, flask, M ySQL, nltk.
The dataset i.e. is the .Json file consists of 58 keywords and 58
responses to respond to the user.
The chat bot used is an AI based chat bot, and figure 1 depicts
how it functions. The chat bot engine in the chat bot uses Python
Flask, it includes the NLTK packages and string processing
(Lancaster stemming) that enables the chat bot to respond to users.
The chat bot also has training data that is saved in .Json file, where
the administrator adds all of the user-specific queries that the chat bot
is supposed to respond to. In addition, the admin section provides a
log where if the questions are not entered in the training data, it will
be treated as a feedback from the end user if the chat bot has not
responded on time and the chat bot can respond to the end user next
time.

Fig. 2. User Functions


As soon as the user enters a chat bot query, the flask
application takes over. Tokenizing is the first thing that is done to the
user input. Next stop words are removed using Natural Language
Toolkit (NLTK) from the input query and using Lancaster stemmer,
Fig. 1. Overall Architecture the remaining words are reduced from the input to their base or root
form. If the output from the above steps matches any of the
predefined keywords in the .Json dataset file then a predefined
Using the training data that is available in the .Json file, the chat
response as coded in the dataset is displayed as output and if there is
bot answers to the user in accordance with the architec-ture. JSON no matching keyword found in the dataset the output displayed
file and feedback file, along with a log file, are included to help users would be a predefined response and the input from the user is
and make it simple for administrators to develop queries. Chat bot directly sent to the SQL database where in the administrator can have
consists of training data in a .Json file. HTM L, CSS, flask are used in a look at it and update the dataset so that when a similar question is
developing web interface and NLTK package is used for string fired at the chat bot a predefined output will be displayed from now
processing. on.

979-8-3503-9725-3/23/$31.00 ©2023 IEEE 1183


Authorized licensed use limited to: Shah and Anchor Kutchhi Engineering College. Downloaded on March 19,2024 at 08:48:33 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the 7th International Conference on Intelligent Computing and Control Systems (ICICCS-2023)
IEEE Xplore Part Number: CFP23K74-ART; ISBN: 979-8-3503-9725-3

If the user wants to give a feedback regarding the college, the chat
bot then the user can use the below shown figure of feedback box in
figure 3

V. CONCLUSION
It is frequently impossible to obtain all of the data on a single
interface without having to navigate through many forms and
windows. The college chat bot tries to eliminate this obstacle by
providing a common and user-friendly interface for college students
to handle their queries.A chatbot system’s goal is to mimic a human
conversation. Its architecture combines a language model and a
computational method to simulate information online communication
between a human and a computer using natural language
processing techniques. Stu-dents are welcome to post their
queries . The chat bot quickly and effectively searches for the
answers to users’ questions and finds the pertinent links. In order
Fig. 3. Feedback Box. to establish the right link, background research was conducted,
which included an overview of the discussion process and an
IV. RESULTS attempt to identify the pertinent keywords associated with that
query. Information regarding questions, responses, keywords, and
This has been implemented using Visual Studio code or VS code logs is stored in the database.
and the program is executed on a GPU, NVIDIA’s GeForce GTX To improve the answering capability of the chat bot the
1650 in a CUDA-integrated environment. Fig-ure 4 shows a clear administrator has to train the bot with more and more data
picture of the website, as well as the proposed chat bot icon on time to time as the data is collected in the MYSQL database
the website, which is located on the right bottom of the website and collecting feedbacks can help us improve the overall chat
page and in the figure 5 shows the chat bot answering various bot system and college web page. Users can use this chat bot
queries of a user. 24X7 from anywhere and at any time just by visiting the
college web page.

REFERENCES

[1] K. Bala ,M. Kumar, S.Hulawale, and S. Pandita, “Chat-Bot ForCollege


Management System Using A.I”, International ResearchJournal of Engi-
neering and T echnology (IRJET ), Vol. 04, Issue.11, pp.2395 -0072,
2017
[2] Thomas, N. T. (2016). An e-business chatbot using AIML and LSA. 2016
International Conference on Advances in Computing, Communi-cations and
Informatics (ICACCI). doi:10.1109/icacci.2016.7732476
[3] N. Thomas, “ An e-business chatbot using aiml and lsa,” in Advances in
Computing, Communications and Informatics (ICACCI), 2016 Interna-tional
Fig. 4. Website with Integrated ChatBot Conference on. IEEE, 2016, pp. 2740–2742.
[4] S. Reshmi and K. Balakrishnan, “Implementation of an inquisitive
chatbot for database supported knowledge bases,” Sadhan ¯ a¯, vol. 41,
no. 10, pp. 1173–1178, 2016
[5] Prof.K.Bala, Mukesh Kumar, SayaliHulawale, SahilPandita,“ Chat -Bot
For College Management System Using A.I” International Research
Journal of Engineering and T echnology (IRJET) Volume: 04, Issue: 11,
Page no: 2030-2033— Nov 2017.
[6] Lancaster Stemmer Algorithm, Available at https://www.nltk.org/api/
nltk.stem.lancaster.html
[7] Porter Stemmer Algorithm, Available at the link https://tartarus.org/
martin/PorterStemmer
[8] Amey T iwari, Rahul Talekar, Prof.S.M.Patil, “College Information Chat
Bot System” International Journal of Engineering Research and General
Science (IJERGS) Volume: 5, Issue: 2, Page no: 131-137— March-
April

Fig. 5. Some responses in the ChatBot

979-8-3503-9725-3/23/$31.00 ©2023 IEEE 1184


Authorized licensed use limited to: Shah and Anchor Kutchhi Engineering College. Downloaded on March 19,2024 at 08:48:33 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the 7th International Conference on Intelligent Computing and Control Systems (ICICCS-2023)
IEEE Xplore Part Number: CFP23K74-ART; ISBN: 979-8-3503-9725-3

[9] Guruswami Hiremath, Aishwarya Hajare, Priyanka Bhosale,


Rasika Nanaware, Dr. K. S. Wagh, “Chatbot for education
system” Interna-tional Journal of Advance Research, Ideas and
Innovations in T echnol-ogy (IJARIIT ) ISSN: 2454-132X,
Volume: 4, Issue: 3, Page no: 37-43—2018. 2017.
[10] Punith S , Chaitra B , Veeranna Kotagi, Chethana R M,
Research Paper on Chatbot for Student Admission Enquiry,
Journal of Advancement in Software Engineering and T esting,
Vol. 3 Issue 1, 2020, pp.1-9.
[11] Naeun Lee, Kirak Kim, T aeseon Yoon, “Implementation of
Robot Journalism by Programming Custombot using
T okenization and Cus-tom Tagging” International Conference
on Advanced Communications Technology (ICACT ) Page no:
566-570— Feb 2017.
[12] Basics of Natural Language T oolKit, Avalilable at
https://www.nltk.org/

979-8-3503-9725-3/23/$31.00 ©2023 IEEE 1185


Authorized licensed use limited to: Shah and Anchor Kutchhi Engineering College. Downloaded on March 19,2024 at 08:48:33 UTC from IEEE Xplore. Restrictions apply.

You might also like