Chatbot Using TensorFlow For Small Businesses
Chatbot Using TensorFlow For Small Businesses
2 4
Harshkumar Patel Nitin Mishra
(Student) (Student)
Department of Computer Engineering Department of Computer Engineering
K J Somaiya College of Engineering K J Somaiya College of Engineering
Mumbai, India Mumbai, India
[email protected] [email protected]
Abstract— Chatbots are software used in entertainment where response is nothing but manipulated version of user
industry, businesses and user support. Chatbots are modeled on query e.g. Eliza.
various techniques such as knowledge base, machine learning
based. Machine learning based chatbots yields more practical Small businesses and small startups generally have a high
results. Chatbot which gives responses based on the context of customer to employee’s rate. They cannot attend to every
conversation tends to be more user friendly. The chatbot we are customer personally. Such small businesses need automation in
proposing demonstrates a method of developing chatbot which can their customer support system. Chatbot can automate the
follow the context of the conversation. This method uses customer support part. Chatbot can increase the profits by
TensorFlow for developing the neural network model of the
decreasing the resources strain. We here provide the method for
chatbot and uses the nlp techniques to maintain the context of the
conversation. This chatbots can be used in small industries or
making such chatbots that a small company can make with very
business for automating customer care as user queries will be little resources. This can be useful for many other organizations
handled by chatbots thus reducing need of human labour and such as universities and colleges, as displayed in our demo.
expenditure.
Keywords— Chatbots; Neural Networks; Machine learning; In this project, we created a chatbot which will provide
Conversational models; Machine translation; Artificial intelligence; information about admission in K.J. Somaiya college of
Statistics; Computational linguistics; Natural language processing; engineering to the student through web interface using
Text mining; TensorFlow; Tflearn. TensorFlow and NLP techniques. Thus, our bot will act as a
person at enquiry office whom they can ask any questions
regarding admission and college environment at any time in
more interactive way. Thus, reducing workload of the
I. INTRODUCTION admission cell personnel. This system can be integrated on
Chatbots are simple computer programs that interacts with college website and thus students who desires to get admission
users using natural language. The interaction can be textual or in the college can clear their doubts from their home. we have
auditory depending upon the need. The popularity of this bots provided a feedback mechanism through will user can rate bot’s
are increasing every day and are used in various practical responses and thus bot can respond more accurately next time.
applications which include customer service, information
TensorFlow is used to create Neural model on which bot will
acquisition and dialogue systems. This bot uses Natural
be trained based on intent file. This model can be updated as
language processing techniques for understanding user query
and when new rule is implemented in the college. This bot can
and give response. Now there are bots which uses fixed
maintain context and can give responses based on context.
response techniques where user query is searched for fixed
Thus, this paper focuses on the sample bot which can be used
keywords and returns response which matches the most with
as a reference for creating chatbots for many other purposes.
the query. Also, some bots use string manipulation techniques
The paper talks about the methods and technologies used in
Authorized licensed use limited to: Somaiya University. Downloaded on January 30,2023 at 14:03:16 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the 2nd International Conference on Inventive Communication and Computational Technologies (ICICCT 2018)
IEEE Xplore Compliant - Part Number: CFP18BAC-ART; ISBN:978-1-5386-1974-2
creating this chatbot, and why some things are preferred over standard replies that ELIZA would use if a keyword is not
other. The paper by explaining the inner working of this sample found. Some examples would be “Very interesting, please go
chatbot explains the proposed methodology of developing on” or “Can you think of a special example?”.
similar purpose chatbot.
Few Chatbots with useful applications are presented. We will ALICE was implemented by Richard Wallace in 1995 [6]. Eliza
discuss about ELIZA and ALICE as of now. was source of inspiration for Alice. It is a natural language
processing bot which uses pattern matching for retrieving
ELIZA responses. The information is stored in Artificial Intelligence
Markup Language also known as AIML files. AIML files were
specifically designed to store pattern knowledge base for
The first chatbot developed was ELIZA [1]. It was developed chatbots. These files are like XML files. AIML are of three
by Joseph Weizenbaum using a keyword matching and string categories.
manipulation techniques. When user provides the query, this
chatbot searches for certain keyword. These keywords were Atomic categories: [6]
already defined and if found then the response was retrieved. If In this AIML category there is exact match and thus response is
not found, then Eliza would perform certain string manipulation generated directly.
techniques or use certain rules to obtain detail knowledge from <category>
the user to continue the interaction. <pattern>What is your name? </pattern>
<template>My name is john</template>
Consider the following example to understand how this would </category>
work.
Default categories: [11]
USER: How can I get in touch with my mother? Default categories are general form of input query which makes
use of wild character such as * so as to match user submitted
Clearly ‘Mother’ is the keyword in the given user query, so query.
the bot will try to find words related to mother like family. <category>
Then by using some string operation it will give an answer. <pattern>What is *</pattern>
<template>It is my name</template>
ELIZA: Tell me more about your family </category>
Also, Eliza uses string manipulation techniques where it If response is not generated using first category it will proceed
replaces some words from user query and gives it as a response. to this category. Consider if user enters, “what is john?”, Alice
will search for default category and if match is found response
USER: I am fine is displayed.
ELIZA: How long have you been fine? Recursive categories: In this category special tags are used to
specify recursion and get more information form user [8,9].
The chatbot doesn't understand what it is saying. It only
produces results according to rules, static responses and string
manipulation. However most of the time there are some
Authorized licensed use limited to: Somaiya University. Downloaded on January 30,2023 at 14:03:16 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the 2nd International Conference on Inventive Communication and Computational Technologies (ICICCT 2018)
IEEE Xplore Compliant - Part Number: CFP18BAC-ART; ISBN:978-1-5386-1974-2
1. User interface
This module is the main core of the whole system. This is the
III. PROPOSED SYSTEM part which generates the actual response for the user query. First
the model is defined using TensorFlow which is trained using
intent file created. Intent file is in form of json file which is as
follows:
The proposed system uses the machine learning at its core. The
proposed system uses the TensorFlow to make a neural network
{"tag": "admission_enquiry",
and train it with intent file to generate a response model. This
"patterns": ["i have some doubts regarding process", "I want
response model can be used to predict the response from the
to know about admission process", "enquiry about
query of the user. The proposed system consists of three main
admission"],
parts
"responses": ["Okay, what do you wanna know?", "what are
you doubts?", "Okay, you can ask"]
},
1) User Interface
{"tag": "application_date",
2) Neural network model and NLP unit
"patterns": ["when do i apply?", "What is the due date for
3) Feedback System
application?", "what is last date of the application?","what
is starting date of the application?" ],
"responses": ["Application process will remain open at 04th
of July to 14th of august", "from 4th July to 14th
august","you can apply from 4th july to 14th august"]
},
{"tag":"Application_form",
"patterns":["how to avail admission form?","From where to
have admission form?","where can I get an application
form? "],
"responses":["Application form for admission is available at
the Somaiya website","from somaiya website","you can get
forms from somaiya website","visit somaiya website for
forms"]
},
{"tag":"Location",
"patterns":["where is the location of the college?","College is
located at?","How to reach college?"],
"responses":["Somaiya college of engineering is Located
near vidyavihar station at central railway.","College is
located in mumbai near vidyavihar railway station."]
},
Authorized licensed use limited to: Somaiya University. Downloaded on January 30,2023 at 14:03:16 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the 2nd International Conference on Inventive Communication and Computational Technologies (ICICCT 2018)
IEEE Xplore Compliant - Part Number: CFP18BAC-ART; ISBN:978-1-5386-1974-2
process. Here NLP takes place where various functions are In this case model predicted two intent Hosel_availability with
applied in form of pipeline which includes [2] probability of 0.6343 and greeting with probability of 0.166 as
Sentences -> Tokenization -> Lemmatization -> POS-tagging. Threshold is 0.15 as of now. The intent with higher probability
This data is then stored in form of bag of words which is used is selected and response is generated accordingly.
as input to training model. We have used bag of words
technique for feature extraction. Feed forward network is QUERY: activities related to sports
created using tensorflow with 4 layers (1 Input layer + 2 hidden PREDICTION: [('Sport_support', 0.99963164)]
layer + 1 output layer). Trained model is saved which is used RESPONSE: Skream is a national…...
for predicting responses taking input as user query.
Authorized licensed use limited to: Somaiya University. Downloaded on January 30,2023 at 14:03:16 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the 2nd International Conference on Inventive Communication and Computational Technologies (ICICCT 2018)
IEEE Xplore Compliant - Part Number: CFP18BAC-ART; ISBN:978-1-5386-1974-2
form 0.99642229]
Authorized licensed use limited to: Somaiya University. Downloaded on January 30,2023 at 14:03:16 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the 2nd International Conference on Inventive Communication and Computational Technologies (ICICCT 2018)
IEEE Xplore Compliant - Part Number: CFP18BAC-ART; ISBN:978-1-5386-1974-2
VI. FUTURE SCOPE [8] B.A shawar and E. Atwell, “Evaluation of Chatbot Information System,
in Eighth Maghrebian Conference on Software Engineering and Artificial
Intelligence.
The method presented uses solely machine learning with some
helping natural language processing for converting the intent [9] B.A shawar and E. Atwell, “JLCL,”2007. [Online]. Available:
into bag of words. The method can be improved by using some http://www.jlcl.org/2007_heft1/Bayan_Abu-
additional level natural language processing. The natural shawar_and_Eric_Atwell.pdf
language processing can be used to do sentiment analysis which
can complement the machine learning predictor. The [10] B. Setiaji and F. W. Wibowo, "Chatbot Using a Knowledge in Database:
Human-to-Machine Conversation Modeling," in Intelligent \ Systems,
sentimental part can be analyzed using natural language Modelling and Simulation (ISMS), 2016 7th International Conference on,
processing which will emphasize on the keywords in the user Bangkok, Thailand.
query which can be very useful in reducing the error in
prediction. [11] B. R. Ranoliya, N. Raghuwanshi and S. Singh, "Chatbot for university
related FAQs," in Advances in Computing, Communications and
Instead of using natural language processing to perform the Informatics (ICACCI), 2017.
sentimental analysis and find out the key aspect of queries we
can add multiple machine learning neural models to do the
same. The first method is quite hard to achieve as it is very hard
to determine the keywords and emphasis in query using natural
language processing. The machine learning does not understand
sentimental analysis as it is purely based on mathematical
functions.
REFERENCES
[1] A. Vichare, A. Gyani, Y. Shrikhande and N. Rathod, "A chatbot system
demonstrating Intelligent Behaviour using NLP," in International Journal
of Advanced Research in Computer Engineering & Technology
(IJARCET), 10 October 2015. J. Clerk Maxwell, A Treatise on Electricity
and Magnetism, 3rd ed., vol. 2. Oxford: Clarendon, 1892, pp. 68-73.
[2] R. Shah, S. Lahoti and P. L. K., "An Intelligent Chat-bot using Natural
Language Processing," in International Journal of Engineering Research,
1 May 2017. T. L. Gilbert, Formulation, Foundations and Applications of
the Phenomenological Theory of Ferromagnetism, Ph.D. dissertation,
Illinois Inst. Tech., Chicago, IL, 1956, unpublished.
Authorized licensed use limited to: Somaiya University. Downloaded on January 30,2023 at 14:03:16 UTC from IEEE Xplore. Restrictions apply.