Chat Bot
Chat Bot
SUBMITTED BY
PAVITHRA S (711721244065)
SHANKARI G (711721244068)
DEEPIKA S (711721244011)
SWETHA R (711721244059)
ARVIND M (711721244005)
BONAFIDE CERTIFICATE
First and foremost, I wish to thank god for his grace to complete this “EDUCATIONAL
CHATBOT USING CNN” project successfully. I would also thank my special thanks to my
dear parents from the bottom of my heart for their support in making our project complete.
I express a deep sense of gratitude to Dr. Ashok Bakthavathsalam, Founder chairman, and a
special thanks to Dr. Shankar principal, and Dr. Suresh Kumar Vice Principal, and also a
special thanks to Dr. P. Rajkumar Professor& Head of the Department of Computer Science
and Business Systems, KGISL Institute for granting the permission and providing necessary
facilities to carry out project work.
I am highly indebted to KGISL Institute of Technology (KITE) and express my special and
sincere thanks to my passion project supervisor Mrs. G. ELIZABETH RANI Assistant
Professor, CSBS of KGISL Institute of Technology for her inspiring guidance, constant
encouragement with my work during all stages. I am feeling very glad to do the project under
her guidance, which truly practices and appreciates deep thinking. I will be forever indebted
to my guide for supporting me in difficult times, when started this project and during
compilation errors, she gave moral support and let this project move on.
CHAPTER NO TITLE PAGE NO
1 INTRODUCTION
2 LITERATURE SURVEY
3 EXISTING SYSTEM
4 PROPOSED SYSTEM
5 SYSTEM ENVIRONMENT
5.1 SOFTWARE
REQUIREMENTS
5.2 HARDWARE
REQUIREMENTS
6 RESULTS AND
DISCUSSION
CONCLUSION AND
FUTURE ENHANCEMENT
REFERENCE
APPENDIX
ABSTRACT
The use of educational chatbots evolved rapidly in numerous fields in recent years,
including Marketing, Supporting Systems, Education, Health Care, Cultural Heritage, and
Entertainment. This paper presents a historical overview of the evolution of the international
community’s interest in chatbots. Next, we discuss the motivations that drive the use of
chatbots, and we clarify chatbots’ usefulness in a variety of areas. Moreover, we highlight the
impact of social stereotypes on chatbot design. After clarifying necessary technological
concepts, we move on to a chatbot classification based on various criteria, such as the area of
knowledge they refer to, the need they serve, and others. Furthermore, we present the general
architecture of modern chatbots while also mentioning the main platforms for their creation.
Our engagement with the subject so far, reassures us of the prospects of chatbots and
encourages us to study them to greater extent and depth.
A chatbot enables a user to simply ask questions in the same manner that they
would respond to humans. The most well-known chatbots currently are voice chatbots: SIRI
and Alexa. However, chatbots have been adopted and brought into daily application at a high
rate on the computer chat platform. NLP also allows computers and algorithms to understand
human interactions through various languages. Recent advances in machine learning have
greatly improved the accuracy and effectiveness of natural language processing, making
chatbots a viable option for many organizations. This improvement in NLP is firing a great
deal of additional research which should lead to continued improvement in the effectiveness
of chatbots in the years to come. A bot is trained on and according to the training, based on
some rules on which it is trained, it answers questions. It is called ruled based approach. The
language by which these bots can be created is Artificial Intelligence Markup Language
(AIML).
Chapter 1
INTRODUCTION
An educational chatbot is an application that has a database, it has an app l and APIs to
call other external administrations. However, bots cannot comprehend what the customer has
planned. It is a very much common problem that must be tackled. Bots are generally trained
according to the past information which is only available to them. So in most organizations,
chatbot maintains their logs of discussions so that they can understand their customer’s
behavior.
Developers utilize these logs to analyze what clients are trying to ask. Developers
coordinate with their client inquiries and reply with the best appropriate answer with the
blend of machine learning tools and models. Training a chatbot is much faster and on a large
scale compared to human beings. A customer support chatbot is filled with a very large
number of conversation logs which help the chatbot to understand what kinds of questions
should be asked and what answers should be given. While normal customer service
representatives are given manual instructions which they have to go through with. The
chatbots are based on three methods:
Pattern Matches: The pattern matches a group of texts utilized by the bots and so it produces
an appropriate response to the customers. The standard structured model used for the creation
of these patterns is “Artificial Intelligence Markup Language”.
Natural Language Understanding (NLU): Finding the way to convert the user’s speech or
text into structured data is called Natural Language Processing. It is used to get relevant
answers for the customers. To develop a chatbot one must be very clear about what one wants
from that chatbot. Often, they are developed for business platforms like Net Banking sites to
handle customer Q&A. Other types of chatbots that are widely developed and used are smart
assistants like Google Assistant, Siri, Alexa, Cortana, etc.
A chatbot is an AI program that copies human discussions including content and
communication in natural language utilizing artificial intelligence methods for example,
Natural Language Processing is a picture and video processing and voice analysis.
Chapter 2
LITERATURE SURVEY
According to the research intent detection-based Lithuanian chatbot was created via an
Automatic DNN hyper-parameter. Optimization they handled a purpose recognition issue for
the Lithuanian language with real supervised data. The main principle of focus is on the
upgrade of the NL.
Understanding module, responsible for the comprehension of user questions. The NLU
model is prepared with an appropriately selected word vectorization type and a Deep Neural
Network classifier. During their experiment, they tentatively investigated fast text and Bert
embeddings [2-3].
EXISTING SYSTEM
1. Dialog flow: Dialog flow is a chatbot development platform by Google that allows
developers to build and integrate conversational interfaces into mobile apps, web
applications, devices, and bots.
2. IBM Watson: IBM Watson is a cognitive computing system that uses natural
language processing and machine learning algorithms to understand human language
and provide intelligent responses to queries.
3. Microsoft Bot Framework: The Microsoft Bot Framework is a set of tools and
services for building and deploying intelligent bots on a variety of platforms including
Skype, Slack, Facebook Messenger, and other popular chat platforms.
PROPOSED SYSTEM
There are seven steps to designing the Chatbot process they are scope and requirement,
identifying the inputs, understanding the UI elements, crafting the first interaction, building
conversation and finally testing.
Figure-2 describes the flow diagram of the chatbot which helps us to identify and easy to
understand.
The first step to designing the Chatbot is to know the scope and requirements like why
the chatbot, the platform to launch chatbots, and its limitations. The second step is to identify
the inputs from users in the form of queries through text, voice, or images, from devices, and
intelligence systems. The third step is to understand the User Interface (UI) elements, that we
can see in our applications. UI elements are of five types they are Command Line(CL),
Graphical User Interface(GUI), Menu-Driven Interface (MDI), Form-Based Interface (FBI),
and Natural Language Interface (NLI). After understanding user interface elements, the next
step is to craft the first interaction and build a conversation. The final step of the Chatbot
design process is testing, which is done on mobile and websites to know how it’s working.
Figure-3 describes the system architecture of the chatbot to figure out the given program or
information.
WORKFLOW
API Gateway passes on the incoming request from different clients to respective
services.
The chatbot server takes in chat messages from different clients and responds.
The NLU engine is responsible for predicting the intents and entities from a given
text.
The Chatbot server also acts as an action server that calls external APIs to perform a
specific action.
Chatlog service is responsible for logging all the messages in the system.
Redis store is responsible for maintaining the state of the messages for each user.
Figure -4 describes the workflow of the chatbot which helps to reduce the testing steps and
can get accurate results.
BrowserStack is a cloud-based website and mobile testing platform that offers 3000+ real
browsers and devices (desktop and mobile) for instant, on-demand testing.
Login to BrowserStack. Launch Automate If you don’t have an account already, sign
up for free.
The sample code is already available. Just modify and add your code.
Once it is configured, set up the dependencies and desired capabilities to run the test.
Follow the detailed instructions below if you are using Gradle or Maven to build your
Java project. Add the maven dependency to your pom.xml file or you can directly
configure your build path by adding the selenium jar file to your library to run the test
case.
Figure-5 describes the testing method of the chatbot. How to server control the chatbot and
how the data are handled in the server.
Chapter 5
SYSTEM ENVIRONMENT
The hardware requirements for a chatbot depend on the scale and complexity of the
chatbot application. Here are some general hardware requirements to consider :
1. Processor.
2. RAM.
3. Storage.
4. Networking.
5. Operating system.
6. Cloud infrastructure.
Chapter 6
Figure 6 describes the webpage of the chatbot which is named Dear Professor. Here the
students can enroll in their courses. The chatbot will help to collect their basic information.
Chatbots – also known as “conversational agents” – are software applications that mimic
written or spoken human speech to simulate a conversation or interaction with a real person.
There are two primary ways chatbots are offered to visitors: via web-based applications or
standalone apps.
Figure.7 – Chatbot structure.
Figure 7 describes the required chatbot, here we will be answering some queries regarding
our knowledge or we can know about the education information. Tech-savvy consumers of
today are always on the lookout for the best and most personalized customer experiences. It
can seem an impossible task to fulfill the onslaught of ever-evolving demands. However,
there is one solution primed to satisfy the modern customer, and that is a chatbot. With a
chatbot, your organization can easily offer high-quality support and conflict resolution any
time of day, and for a large quantity of customers simultaneously. According
to Microsoft, 90% of consumers expect an online portal for customer service. As a
significant aspect of business evolution, the need for AI-powered chatbots will only continue
to rise. Now is the time to deploy a chatbot solution so that your company doesn’t get left
behind.
Figure 8 – Design of Chatbot.
Figure 8 describes the chatbot design and here you can see the questions asked by the
penguin and we are answering their queries. From my perspective, chatbots or smart
assistants with artificial intelligence are dramatically changing businesses. There is a wide
range of chatbot-building platforms that are available for various enterprises, such as e-
commerce, retail, banking, leisure, travel, healthcare, and so on. Chatbots can reach out to a
large audience on messaging apps and be more effective than humans. They may develop
into a capable information-gathering tool shortly.
CONCLUSION
An Educational chatbot is one of the simple ways to transport data from a computer
without having to think of proper keywords to look up in a search or browse several web
pages to collect information; users can easily type their query in natural language and retrieve
information. In this paper, information about the design, and implementation of the chatbot
has been presented. From the survey above, it can be said that the development and
improvement of chatbot design grow at an unpredictable rate due to the variety of methods
and approaches used to design a chatbot. Chatbot is a great tool for quick interaction with the
user. They help us by providing entertainment, saving time, and answering questions that are
hard to find. The Chatbot must be simple and conversational. Since there are many designs
and approaches for creating a chatbot, it can be at odds with commercial considerations.
Researchers need to interact and must agree on a common approach for designing a Chatbot.
In this project, we looked into how Chatbots have developed and the applications of Chatbots
in various fields. In addition, the comparison has been made with other Chatbots. General
purpose Chatbot must be simple, user-friendly, must be easily understood and the knowledge
base must be compact. Although some commercial products have recently emerged,
improvements must be made to find a common approach for designing a Chatbot.
FUTURE ENHANCEMENT
Chatbots can provide buyers with a great experience across all devices, offering deep
insights about the buyer that businesses can use to make personalized offers. Chatbots help
people obtain the information they need and solve their problems.
A company's credibility and the quality of the customer experience are two essential
components of any company wishing to achieve a successful business model.
Many well-known companies are now using a to keep up with the changing world. The
technology sector has seen a massive increase in AI development, which has led to the
creation of chatbots that can help users easily find the information they need online.
Chatbots powered by artificial intelligence effectively create a strong brand image. They
will continue to evolve and play an important role in customer service for businesses.
REFERENCES
1. Abdolrahmani, A., Kuber, R., Branham, S.M.: “Siri Talks at You”: An Empirical
Investigation of Voice-Activated Personal Assistant (VAPA) Usage by Individuals
Who Are Blind. In: Proceedings of the 20th International ACM SIGACCESS
Conference on Computers and Accessibility, Galway, Ireland, October 2018. pp. 249–
258. Association for Computing Machinery, New York, NY, USA (2018). doi:
10.1145/3234695.3236344.
2. Baldauf, M., Bösch, R., Frei, C., Hautle, F., Jenny, M.: Exploring requirements and
opportunities of conversational user interfaces for the cognitively impaired. In:
Proceedings of the 20th International Conference on Human-Computer Interaction
with Mobile Devices and Services Adjunct, Barcelona, Spain, September 2018. pp.
119–126. Association for Computing Machinery, New York, NY, USA (2018). doi:
10.1145/3236112.3236128.
3. Beaunoyer, E., Dupéré, S., Guitton, M.J.: COVID-19 and digital inequalities:
Reciprocal impacts and mitigation strategies. Comput Human Behav. 111 (2020).
doi:10.1016/j.chb.2020.106424.
5. Bigham, J.P., Aller, M.B., Brudvik, J.T., Leung, J.O., Yazzolino, L.A., Ladner, R.E.:
Inspiring blind high school students to pursue computer science with instant
messaging chatbots. SIGCSE Bulletin. 40, 449–453 (2008). doi:
10.1145/1352322.1352287.
6. Boshoff, A.: Accessibility and chatbots: how to make your chatbot user-friendly for
everyone. Rogerwilco. https://www.rogerwilco.co.za/blog/accessibility-and-chatbots-
how-make-your-chatbot-user-friendly-everyone (2018) Accessed 17 December 2020
7. Brave, S., Nass, C., Hutchinson, K.: Computers that care: investigating the effects of
orientation of emotion exhibited by an embodied computer agent. International
Journal of Human-Computer Studies. 62, 161–178 (2005).
doi:10.1016/j.ijhcs.2004.11.002.
APPENDIX
SOURCE CODE
import nltk
nltk.download('popular')
from nltk.stem import WordNetLemmatizer
lemmatizer = WordNetLemmatizer()
import pickle
import numpy as np
def clean_up_sentence(sentence):
# tokenize the pattern - split words into array
sentence_words = nltk.word_tokenize(sentence)
# stem each word - create short form for word
sentence_words = [lemmatizer.lemmatize(word.lower()) for word in
sentence_words]
return sentence_words
# return bag of words array: 0 or 1 for each word in the bag that exists in the
sentence
def chatbot_response(msg):
ints = predict_class(msg, model)
res = getResponse(ints, intents)
return res
app = Flask(__name__)
app.static_folder = 'static'
@app.route("/")
def home():
return render_template("index.html")
@app.route("/get")
def get_bot_response():
userText = request.args.get('msg')
return chatbot_response(userText)
if __name__ == "__main__":
app.run()
Traning .py
mport nltk
nltk.download ()
lemmatizer = WordNetLemmatizer()
import json
import pickle
import numpy as np
import random
import nltk
words=[]
classes = []
documents = []
data_file = open('data.json').read()
intents = json.loads(data_file)
w = nltk.word_tokenize(pattern)
words.extend(w)
documents.append((w, intent['tag']))
classes.append(intent['tag'])
words = sorted(list(set(words)))
# sort classes
classes = sorted(list(set(classes)))
# classes = intents
pickle.dump(words,open('texts.pkl','wb'))
pickle.dump(classes,open('labels.pkl','wb'))
training = []
bag = []
pattern_words = doc[0]
# create our bag of words array with 1, if a word match is found in the current
pattern
for w in words:
# output is a '0' for each tag and '1' for the current tag (for each pattern)
output_row = list(output_empty)
output_row[classes.index(doc[1])] = 1
training.append([bag, output_row])
random.shuffle(training)
training = np.array(training)
train_x = list(training[:,0])
train_y = list(training[:,1])
# Create model - 3 layers. The first layer 128 neurons, the second layer has 64
neurons, and 3rd output layer contains a number of neurons
model = Sequential()
model.add(Dropout(0.5))
model.add(Dense(64, activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(len(train_y[0]), activation='softmax'))
model.compile(loss='categorical_crossentropy', optimizer=sgd,
metrics=['accuracy'])
print("model created")