A Comparative Study On Chatbot Based On Machine Learning and Lexicon Based Technique
A Comparative Study On Chatbot Based On Machine Learning and Lexicon Based Technique
A Comparative Study On Chatbot Based On Machine Learning and Lexicon Based Technique
ISSN No:-2456-2165
Abstract:- Sentimental Analysis is that particular This paper provides the detailed comparison between
domain ,where you try to understand human emotions lexicon based approach and machine learning based
with the help of a software.Human emotions are in approach .[4]Chatbot refers to a chatting robot.[4] It is a
written form and we can classify those sentiments as communication simulating computer program. [4]It is all
positive,negative and neutral.Sentimental analysis is also about the conversation with the user. [4]The conversation
referred to as opinion mining because in sentimental with a Chatbot is very simple. [4]It answers the questions
analysis we are trying to analyze the thoughts of a asked by the user.[6]A chatbot, also known as a
customer with respect to a particular thing. conversational agent, is a computer software capable of
taking a natural language input and providing a
However Natural Language Processing and conversational output in real time.[7]A chatbot is the best
Machine learning are considered to be the childrens of tool which provides a quick way to interact with the users.
Artificial Intelligence,Since they both work in [7]It is very helpful to the users as it allows them to enter
conjunction and lend a hand to solve large numbers of questions in natural language and desired information is
data problems.While Natural Language Processing obtained easily to the user. 2
provides us with an understanding about how computers chatbots(CHATBOT1,DOCBOT) were developed using the
and human(natural) language interact with each other. above mentioned approaches,and the chatbot which gives us
the most accurate results are discussed in this paper along
This paper aims to identify which approach(lexicon with advantage and disadvantage of each approach is also
or machine learning)is better among the two approaches discussed in this paper. Chatbot1 which we have developed
in terms of providing accurate results when it is comes under lexicon based approach ,and that chatbot takes
implemented in ChatBot. a list of words as an input from the user and it then identifies
the polarity of the text.The main work of CHATBOT1 is to
Python language is utilized for the development of take reviews of movies from the user and then classify those
the chatbots.one chatbot is developed for classifying reviews as positive,negative or neutral.This chatbot uses
movie reviews as positive,negative or neutral by taking TEXTBLOB library for processing textual data.The concept
the input from the user and another chatbot(DocBot) is of polarity and subjectivity is used while developing this
developed for providing all the information related to chatbot(CHATBOT1).
kidney disease to the user.
DOCBOT is another chatbot which is developed using
Keyword:- Chatbot, Lexicon, Machine Learning, polarity, Machine Learning Based Approach.The DOCBOT provides
subjectivity, tokenization. information related to kidney disease to the user.The
concept of tokenization(ie Lemmatization),TFIDVectorizer
I. INTRODUCTION is used while developing DOCBOT.
Nowadays customers play a very big role in making a This study helps us to compare which approach is
business or any entity successful.A customer can make or better and provides us with the suitable results.
break a business,therefore it is very important for the
organization to understand the sentiments of its customers II. MATERIALS AND METHODS
,client’s so that any organization can reach
heights.Therefore Sentimental analysis is Literature Survey
essential.Sentimental analysis determine useful There are 2 approaches which are extensively used to
information,those information can be used to understand detect sentiments from the text.They are symbolic
current market strategy,improve business.There are various techniques and machine learning techniques.
applications of Sentimental analysis such as Review
classification,Product Review Mining.[1]States that [1]In their research work concluded that machine
sentimental analysis is is a system or a model that takes the learning technique is very easier and efficient than symbolic
document that analyzed the input ,and generates a detailed techniques(Lexicon approach)
document summarizing the options of the given input
document. [2]Developed A Wat son chatbot which shows us and
performs the tasks like “on headlamps” or “Turn on
[4] states that chatbot is one of the simple ways to [9]Their paper explains a medical chatbot which can be
transport data from a computer without having to think for used to replace the conventional method of disease
proper keywords to look up in a search or browse several diagnosis and treatment recommendation using machine
web pages to collect information.In her review paper she learning approach.
concluded that the development and improvement of chatbot
design grow at an unpredictable rate due to variety of [10] In their survey, the results showed that the greatest
methods and approaches used to design a chatbot. advantage of using chatbots in marketing is the provision of
simple, fast information, but they also showed the fear of
[5]in their paper stated that larger lexicons may yield a respondents getting the wrong information from chatbots,
decrease in performance due to ambiguity of words polarity which is something that needs to be resolved in the future.
and increased model complexity.
Fig 1:- System Architecture of ChatBot for Movie Review Classification Using Lexicon Approach.
Fig 2:- System Architecture of ChatBot for Movie Review Classification Using Machine Learning Approach.
Step 7:create a function to return a list of lemmatized lower case words after removing punctuations.
PseudoCode:
def LemNormalize1(text1):
return nltk.word_tokenize(text1.lower().translate(remove_punc_dict))
The above is created to remove all the punctuations from the article.
pseudocode:GREETING_INPUTS1=["hi","hello","hola","wassup","hey"]
Step 10:create an array named GREETING_RESPONSES1 which should be triggered back to the user.
pseudocode:GREETING_RESPONSES=["howdy","hi","hey","what's good","hello","hey there"]
Step 11: create Function to return a random greeting response to a user's greeting.
Step 18:convert the text of a matrix to TF IDF Features.Get the measure of the similarity scores from the user query.
Using cosine_similarity module.
Step 19:Get the index of the most similar text/sentence to the users response
Step 23:if the similarity score is 0 then there is no text similar to the users query.
Step 24:if the similarity score is non-zero print the chatbot response and user’s query from the user’s token list.
Results
The following results were obtained for the chatbot which was implemented using Lexicon Technique.
Fig 3:- In the above figure the polarity measured from the Greeting sentence is less than 0 .So therefore the chatbot learns that the
user is angry,therefore displays appropriate messages and then terminates .
Fig 4:- In the above figure the polarity measured from the sentence is less than -0.5 .so therefore the chatbot learns that the movie
is worse.
Fig 5:- In the above figure the polarity measured from the sentence is greater than 0.7 .so therefore the chatbot learns that the
movie is wonderful.
Fig 6:- In the above figure the polarity measured from the sentence is greater than 0 and less than or equal to 0.4 .so therefore the
chatbot learns that the movie is average.
Fig 7:- In the above figure the polarity measured from the sentence is greater than or equal to 0.5 and less than or equal to 0.7 .so
therefore the chatbot learns that the movie is above average.
The following results were obtained for the chatbot which was implemented using Machine Learning Technique.
Fig 9:- if there is no similarity found in the user’s query then the chatbot prints appropriate messages.
1 Lexicon Easy to implement,Easy to Accuracy rate is low when It is implemented on chatbot which
understand ,Less complex compared with machine learning classifies movies as wonderful,above
when compared with machine approach,Based on WordNet average,average,worst based on user
learning approach. Database. reviews
2 Machine Accuracy rate is very much Complex to implement when It is implemented on chatbot which
Learning higher when compared with compared with lexicon approach answers all queries related to kidney
Lexicon approach,Very good disease.
performance.
Table 1:- Summary of Comparison.