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

Sem Project

Uploaded by

21202040
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Sem Project

Uploaded by

21202040
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

COLLEGE ENQUIRE CHAT BOT

MINI PROJECT REPORT

Submitted by

VASU MORUBINA (111521202058)


PANGULURI OMPRAKASH (111521202040)
CHOWDARY
SHAIK SADHIK SODABANDI (111521202050)

BACHELOR OF ENGINEERING
IN
COMPUTER SCIENCE ENGINEERING

R.M.D. ENGINEERING
COLLEGE
(An Autonomous Institution)

KAVARAIPETTAI - 601206

APRIL 2024
BONAFIDE CERTIFICATE

Certified that this project report titled “EMOTIONAL CHAT BOT”, is a bonafide

work of who carried out the work under my supervision.

VASU MORUBINA (111521202058)


PANGULURI OMPRAKASH (111521202040)
CHOWDARY
SHAIK SADHIK SODABANDI (111521202050)

SIGNATURE SIGNATURE

Dr. P. Ezhumalai, B.E, M.Tech, Ph.D., Mrs.A.Tamizharasi, B.E, M.E., Ph.D.,

HEAD OF THE DEPARTMENT ASSISTANT PROFESSOR


Department of Computer Science Department of Computer
Science Engineering, Engineering,
RMD Engineering College RMD Engineering College
R.S.M Nagar R.S.M Nagar
Kavaraipettai – 601 206. Kavaraipettai – 601 206.
VIVA-VOCE EXAMINATION

The V i v a - Voce Examination of the following students who have


submitted this project work held on………………

VASU MORUBINA (111521202058)


PANGULURI OMPRAKASH (111521202040)
CHOWDARY
SHAIK SADHIK SODABANDI (111521202050)

INTERNAL EXAMINER
ACKNOWLEDGEMENT

I take this opportunity to put to record my sincere thanks to all who


enlightened my path towards the successful completion of this project. At the very
outset, I thank the almighty for his abundant blessing on me.
It is my greatest privilege to convey my thanks to Chairman
Thiru. R. S. MUNIRATHINAM and Vice-Chairman Thiru. R. M. KISHORE
B.E, MBA., for having provided me with all required facilities to complete my
project without hurdles.
It is my greatest privilege to convey my thanks to Principal
Dr. N. ANBUCHEZHIAN M.S., MB.A., M.E., Ph.D., for having provided me
with all required facilities to complete my project without hurdles.
We take this opportunity to give profound and heartfelt thanks to the Dean-
Research Dr. K. K. THYAGHARAJAN B.E., M.E., Ph.D., for their continuous
support in successful completion of this project.
I express my sincere feeling of gratitude to our Head of Department of
Computer Science and Engineering Dr. P. EZHUMALAI B.E, M.Tech, Ph.D.,
for his advice and encouragement in all stages of my project work.
It’s my pleasant duty to deliver hearty thanks to the extraordinary efforts of
our project guide, Mrs.A.TAMIZHARASI B.E,M.E,Ph.D., Assistant Professor,
Computer Science Engineering for his continuous guidance and suggestions
without whom this project would not have become a reality.
I owe my sincere thanks to Computer science and Engineering department
staff of R.M.D. Engineering college for their constant support and encouragement
towards the completion of this project.
Abstract:
An emotionally intelligent chatbot system aims to make an effective
conversation between humans and machines in as natural and interactive
manner as possible. The chatbot agent has pre-embedded knowledge base
to identify the sentences, intents, entities and context of the input query to
be precise for making a valid, predictable decision itself as a self-
generated response to answer the query. The present technical project
consists of developing an intelligent system for college enquiry purposes
using a web-based chatbot agent, through machine learning, query
processing and sentiment and emotion classification system to analyze the
sentiment of the visitor towards the college. Emotionally Intelligent
College Enquiry Chatbot System is nothing but chatbot to understand the
user queries and respond to it during a conversation. Chatbot can actively
help human to involve in a digital automated conversation with a machine
or a system with effective. In the following proposed system, feature
extraction and data cleaning techniques are applied on the dataset and
classifiers such as multinomial naive bayes, logistic regression and k
nearest neighbors are used to train the model. The classifier with highest
accuracy is further used for emotion classification of users.

5
TABLE OF CONTENTS

CHAPTER NO. TITLE PAGE NO.

ABSTRACT 5

1. INTRODUCTION 8

2. LITERATURE REVIEW 10

3. METHODLOGY 15

4. RESULT 19

5. CONLUDION 21

REFERENCES 25

6
CHAPTER 1:INTRODUCTION

1. Introduction
Textual conversational agents or chatbots development gather tremendous
traction from both academic and industries in recent years. Nowadays,
chatbots are widely used as an agent to communicate with a human in some
services such as booking assistant, customer service and also a personal
partner. Emotion Recognition is a buzz research topic in the field of Human
Computer Interaction. It has potentially wide applications, such as the
interface with robots, banking, call centers, car board systems, computer
games etc. Many chatbot systems are created for various purposes but very
few of them are designed to know the feedback of the system and the
organization indirectly from the user. That is why the Emotionally Intelligent
College Enquiry Chatbot System came into picture in our research work. The
proposed idea consists of developing an intelligent chatbot system for college
enquiry purposes using a web-based chatbot agent platform DialogFlow,
generating a valid response to the user, and retrieving the conversation history
from google logfiles for sentiment and emotion classification of the user to
determine his/her interests in the college towards taking the admission.
Human sentiment can be measured in scores between -1 and 1 which is also
called the polarity of the text. For detailed emotion recognition apart from
Positive, Negative or Neutral sentiments, we have used the twitter Journal of
University of Shanghai for Science and Technology ISSN: 1007-6735
Volume 23, Issue 6, June - 2021 Page -69 dataset which contains tweets with
corresponding emotions. The dataset has 40,000 rows and three classifiers as
Multinomial Naive Bayes, Logistic Regression and K-Nearest Neighbors are
trained. The models are evaluated on their accuracy, f1 score and confusion
matrices and the most accurate one is selected. Furthermore, an emotion
classification is carried out on the conversation history of users in general and
each query will be classified into seven different emotional classes such as
neutral, happy, excited, satisfied, not satisfied, boredom and disgust and in the
results dataset each query is attached with a polarity, analyzed sentiment and
corresponding emotion for more details of the affective states of the user.

7
CHAPTER 2:LITERATURE REVIEW

2. Literature Review
Ms. Ch. Lavanya Susanna, R. Pratyusha, P. Swathi, P. Rishi
Krishna, V. Sai Pradeep,” COLLEGE ENQUIRY CHATBOT”,
International Research Journal of Engineering and Technology
(IRJET), on 2020
This paper proposes to develop an algorithm which will be wont to identify
answers associated with user submitted questions. To develop a database were
all the related data are going to be stored and to develop an internet interface.
The user will not waste a lot of time searching for the acceptable notices .

A. Harimi1*, A. Shahzadi1, A.R. Ahmadyfard and Kh.


Yaghmaie Department of Electrical Engineering and Robotics,
Shahrood University of technology, Iran, 09 February 2013
This paper proposes to evaluate the proposed SPs and HEs for the recognition of human emotions
from speech. Aim of a speech emotion recognition system is to recognize emotions for real work
data, evaluating the proposed system under different conditions such as the presence of noise and
chatter is useful.

Sumit Wailthare, Tushar Gaikwad, Ketkee Khadse, Pooja Dubey”


Artificial Intelligence Based Chat-Bot”, Dept. Of Computer Science
Technology, Nagpur Institute of Technology, Nagpur, Maharashtra,
India 03 (IRJET), Mar-2018
This paper has to be providing answers to the query of the user very effectively. The objective of
the project is to develop an algorithm that will be used to identify answers related to user submitted
questions. The need is to develop a database where all the related data will be stored and to develop
a web interface.

8
Gustavo Assunção, Paulo Menezes Institute of Systems and
Robotics, Coimbra, Portugal,” Speaker Awareness for Speech
Emotion Recognition” (2020)
In this paper, we evaluated a large-scale machine learning model for classification of emotional
states trained for speaker identification which aim to verify that SER improves when some
speaker’s emotional prosody cues are considered. Journal of University of Shanghai for Science
and Technology ISSN: 1007-6735 Volume 23, Issue 6, June - 2021 Page -70

CHATER 3: METHODOLOGY

3. Methodology
The machine-based emotion classification of the user has gained a lot of
attention in recent times especially by the social media companies for
businesses such as ad recommendations, etc. The modules used in this
methodology are chatbot design, conversation history retrieval, data pre-
processing, feature engineering, sentiment analysis, emotion classification and
exploratory data analysis. The proposed methodology is shown in Figure. 2

9
3.1: Data Pre-processing
Data preprocessing is a technique in which we transform the raw data in a
useful, clean and efficient format for further training the models. In our
module, we transform the raw conversation history downloaded from google
log files into clean data. Initially it contained 366 rows and 171 columns and
only 2 were extracted ‘textPayload’ and ‘timestamp’ for our purposes. All the
rows containing null values in the ‘textPayload’ column are dropped and the
data frame is ready for the sentiment analysis part. On the other hand, we
loaded a preprocessed twitter emotion dataset for the training phase (for
Journal of University of Shanghai for Science and Technology ISSN: 1007-
10
6735 training model for emotion classification) as shown in Figure 2 which
contained 40000 rows and 5 columns from which 2 columns ‘emotion’ and
‘content’ are retrieved for further purpose. The tweets are cleaned using
regular expressions for removing mentions, hashtags, retweets, hyperlinks and
punctuation marks. Here lemmatization is introduced. Lemmatization is a
process of converting all the words in the ‘content’ column to their base form
for increasing the accuracy of the model. An NLTK toolkit is used for
removing stopwords from the twitter emotion data and lemmatization is
applied to the ‘content’ column.

3.2 Feature Engineering

Feature engineering is a process of transforming the features in the dataset


into formats that algorithms can understand that better represent the input
values to the predictive models. Here we use the Countvectorizer from scikit-
learn for feature extraction. We transform the twitter data into vectors based
on the frequency count of each word in the text in the ‘content’ column.
CountVectorizer creates a matrix in which each unique word is represented by
a column of the matrix, and each tweet sample from the ‘content’ column is a
row in the matrix. The conversation history is split into two data frames for
query requests and chatbot responses for further analysis.

3.3 Sentiment Analysis

Sentiment analysis is a process of analyzing the emotional sentiment in the


text. Here, we compute the polarity and subjectivity of the text using TextBlob
and visualize them with scatter plots and histograms (as shown in Figure. 5
11
and Figure. 6). The sentiments are classified in three classes as Positive,
Negative and Neutral sentiment. These are computed based on the polarity of
the text which defines the orientation of the sentiment. The polarity lies in the
range of [-1,1]. Polarity score below 0 is considered as negative sentiment,
polarity above 0 reflects the positive sentiment and polarity equal to 0 shows
neutral sentiment.

12
3.4 Multinomial Naive Bayes Classification
Multinomial Naive Bayes is a probabilistic learning method based on Bayes
theorem which predicts the tag of a text (in our case ‘content’ column data) by
computing the probability of each tag for a given sample and then gives the
tag with highest probability as output. Bayes theorem calculates the
probability of a word occurring in the text based on the prior knowledge of
conditions related to occurrence of that word in the training dataset. It is based
on the following equation.

Where we are calculating the probability of class A when predictor B is


already provided.
P(B) = Probability of class B
P(A) = Probability of class
A P(B|A) = Occurrence of predictor B given class A probability
The vectors formed from count vectorizer and the target variable are trained
with Multinomial Naive Bayes classifier along with Logistic Regressor and k-
NN classifier. We have implemented Naive Bayes with the following steps:
1) Take the input from the count vectorizer.
2) Take the input from the target column ‘emotion’.
3) Train the model.

13
4) Comparison of the features from test data to training data is done in
following steps for classifying the emotion in the test data:
1. Naive Bayes creates a frequency table of training data and lists count of all
the words against corresponding emotion.
2. It finds probability of each word for each emotion and creates a likelihood
table.
3. It assumes that the effect of predictor (A) on a given class (B) is
independent of the values of other predictors.
4. It computes the posterior probability for each emotion using the Naive
Bayes theorem.
5. The emotion with the highest probability will be the outcome of that word
in the data.
6. Classified emotion of the string is returned.
5) Repeat steps from 1 to 4 until all the training set is computed

CHAPTER 4 :RESULT

4. Results and Discussion


We have used the twitter emotion dataset from Kaggle to evaluate
the performance of our emotion classification system model. The
dataset (after cleaning) is shown in the Figure. 7 below

14
The results obtained from our proposed system are explained below. The
overall performance of the system is evaluated by

Accuracy and F1 score. Accuracy is calculated by: (2) The accuracy of the
proposed system is then calculated by using the total number of correctly
classified emotions divided by the total number of emotions. The accuracy for
logistic regressor is 71.5%, and of k-NN is 59%, and maximum accuracy
came out to be of naive bayes i.e. 73.8%. The confusion matrix is evaluated
for the naive bayes model and heatmap is generated for that confusion matrix
displayed by percentages

CHAPTER5: CONCLUSION AND REFERNCES

5. Conclusion and Future Scope


It is essential to understand the sentiment and emotion of the user for
evaluating his/her interest in the college and estimating user’s future decisions
about taking the admission in the college. In this project, we proposed a
system where the user can ask their queries in textual or voice-based format to
our chatbot system and appropriate response is generated by the chatbot. The
proposed methodology classifies emotions of users based on their input
queries and also computes the overall sentiment. In the proposed work, data
preprocessing is carried out using techniques such as count vectorization and
15
lemmatization. The overall accuracy achieved by the system is 73.8%. In
future the accuracy of the proposed system can be increased by combination
of feature extraction techniques such as TF-IDF and Count vectorization.

Acknowledgements
I would like to take this opportunity to thank my internal guide Prof. Jameer
Kotwal for giving me all the help and guidance I needed. I am grateful to them
for their kind support. Their valuable suggestions were very helpful. I am also
grateful to Prof. Archana Chaugule, Head Of Computer Engineering
Department, Pimpri Chinchwad College Of Engineering And Research for her
indispensable support, suggestions. In the end our special thanks to all the
staff members for providing various resources such as a laboratory with all the
needed software platforms, continuous Internet connections for our project.

REFERENCES
[1] Ms.Ch.Lavanya Susanna, R.Pratyusha, P.Swathi, P.Rishi Krishna, V.Sai
Pradeep,” COLLEGE ENQUIRY CHATBOT”, International Research
Journal of Engineering and Technology (IRJET), on 2020.
[2] Gustavo Assuncao, Paulo Menezes, Fernando Perdigao, “Speaker
Awareness for Speech Emotion, Special Focus Paper—Speaker Awareness
for Speech Emotion Recognition, 2020
[3] Intelligent ChatBot System using Artificial Intelligence and Deep
Learning, International Research Journal of Engineering and Technology
(IRJET) on 2020
[4] Chat-Bot”, International Research Journal of Engineering and Technology
(IRJET), on 2018
[5] Harimi1*, A. Shahzadi1, A.R. Ahmadyfard and Kh.Yaghmaie Department
of Electrical Engineering and Robotics, Shahrood University of technology,
Iran09 February 2013

16

You might also like