0% found this document useful (0 votes)
2 views27 pages

chat

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 27

lOMoARcPSD|50465996

Sample- Mini Project Report

cse (Vignan's Foundation for Science, Technology and Research)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)
lOMoARcPSD|50465996

A
MINI PROJECT
REPORT ON
CREATING A CHATBOT USING PYTHON AND
MACHINE LEARNING
In partial fulfillment of the requirements for the award of the degree of
Bachelor of Technology in

COMPUTER SCIENCE AND ENGINEERING


Submitted By
S. Bhavani 18UP1A05A3
Sainikhitha 18UP1A0599
R. Ridhima 18UP1A0598

Under the Guidance of


Mr. XXX
(Assistant Professor)

Department of Computer Science and Engineering

Vignan's Institute of Management and Technology


for Women
Affiliated to JNTUH, Hyderabad, Accredited by
NBA Kondapur, Ghatkesar-501301

Academic Year: 2021-2022

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

(Accredited by NBA, Approved by AICTE and A昀케liated to JNT University,


Hyderabad)

Department of Computer Science and Engineering

CERTIFICATE

This is to certify that this is the bonafide record of the mini project
entitled “Creating A Chatbot Using Python And Machine Learning”
submitted by S.Bhavani (18UP1A05A3), Sainikhitha (18UP1A0599)
and R.Ridhima (18UP1A0598) of B.Tech in the partial fulfillment of
the requirements for the degree of Bachelor of Technology in Computer
Science and Engineering during the year 2020-2021. The results
embodied in this mini project report have not been submitted to any
other university or institute for the award of any degree or diploma.

Internal Guide Head of the Department

Mr.CH. Sunil Dr. A. Sudhir Babu

External Examiner

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

DECLARATION

We, hereby declare that the results embodied in this dissertation entitled
“Creating A Chatbot Using Python And Machine Learning” is carried
out by us during the year 2021-2022 in partial fulfillment of the award of
Bachelor of Technology in Computer Science and Engineering from
VIGNAN’S INSTITUTE OF MANAGEMENT AND TECHNOLOGY
FOR WOMEN is an authentic record of our work carried under the
guidance of Mr. CH. Sunil (Assistant Professor),Department of Computer
Science and Engineering. We have not submitted the same to any other
university or organization for the award of any other degree.

S. Bhavani (18UP1A05A3)
Sainikhitha (18UP1A0599)
R.Ridhima (18UP1A0598)

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

ACKNOWLEDGEMENT

We would like to express sincere gratitude to Dr. G. Appa Rao


Naidu, Principal, Vignan’s Institute of Management and Technology for
Women for his timely suggestions which helped us to complete the
project in time.

We would also like to thank Dr. A. Sudhir Babu, Head of the


Department, Computer Science and Engineering, for providing us with
constant encouragement and resources which helped us to complete the
project in time.

We would like to thank the project guide Mr. CH.Sunil, Assistant


Professor in Computer Science and Engineering, for his timely
cooperation and valuable suggestions throughout the project. We
indebted to his for the opportunity given to work under herguidance.

We would like to thank our Project coordinator Dr. S. Ranga


Swamy for his kind guidance and encouragement from time to time.

Finally, we also thank all the teaching and non-teaching staff of


Department of Computer Science and Engineering for their support
throughout the project work.

S. Bhavani (18UP1A05A3)
Sainikhitha (18UP1A0599)
R.Ridhima (18UP1A0598)

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

ABSTRACT

Chatbots in Python have become wildly popular in the tech and business sectors.
Chatbots is a present new way for individuals to interact with computer systems.
Traditionally, to get a question answered by a software program involved using a
search engine, or filling out a form. A chatbot allows a user to simply ask questions
inthe same way that it would address a human. Chatbots are currently being take up at
a high rate on computer chat platform. Chatbot applications are streamline interactions
between people and services, enhancing customer experience. From e-commerce
firms to healthcare institutions, everyone seems to be leveraging this nifty tool to
business benefits. At the same time, it offer companies for a new opportunities to
improve operational efficiency by reducing the cost of customer service.

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

INDEX

Chapter_No Contents Page_No


1 Introduction 1-5

1.1 Machine Learning 1-2

1.1.1 Supervised Machine Learning Algorithms 1

1.1.2 Unsupervised Machine Learning Algorithms 1

1.1.3 Natural Language processing 2

1.2 About Chatbot 3

1.3 Existing System 3

1.4 Proposed System 4

1.5 Problem Definition 5

1.6 Objectives of Project 5

2 Requirements Analysis 6-9

2.1 Software Requirements 6

2.1.1 Python scientific libraries and tools 6-7

2.2 Software requirements objectives 8-9

3 System Design 10-13

3.1 Architecture 10

3.2 Sequence Diagram 11-12

3.3 Use case Diagram 12-13


4 Implementation 14-16

4.1 Building the Bot 14

5 Results 17

6 Conclusion and Future Enhancements 18

6.1 Conclusion 18

6.2 Future Enhancements 18

7 References 19

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

LIST OF FIGURES

Figure_No Title Page_No

1 Architecture of Chatbot 11

2 Sequence Diagram 12

3 Use Case Diagram 13

4 Importing Libraries 16

5 Chatbot Result 17

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

1. INTRODUCTION
Technology plays a solid role in the industry and in daily routine task. It serves a
variety of purposes and is applied in a different way in different parts of the world.
Recently, the public has been fantasized by Artificial Intelligence. To be more
precise and closely related to humans, the AI Chatbots are now replacing human
responses with this software. A Chatbot is a computerized program that acts like a
chitchat between the human and the bot, a virtual assistant that has become
exceptionally popular in recent years mainly improvements in the areas like artificial
intelligence, machine learning and other underlying technologies.

Machine Learning

Machine learning is an application of artificial intelligence (AI) that provides


system the ability to automatically learn and improve from experience without being
explicitly programmed. The primary aim of machine learning is to allow the
computers learn automatically without human intervention and adjust actions
accordingly. Machine Learning algorithms are classified as:

Supervised machine learning algorithms


The algorithm is applied to the learned data (past data) to the new where machines
are trained using well labelled data to predict the output values. The system provide
targets for any new input after sufficient training. The learning algorithm can also
compare its output with the correct, intended output and find errors in order to modify
the model. The aim of a supervised learning algorithm is to find a mapping function to
map the input variable(x) with the output variable(y). In the real-world, supervised
learning can be used for Risk Assessment, Image classification, Fraud Detection,
spam filtering, etc.
Unsupervised machine learning algorithms
Unsupervised machine learning algorithms are used when the information used to
train it is neither classified nor labelled. The algorithms describe hidden patterns in
data without the need for human. Unsupervised learning models are used for three
main tasks: clustering, association and dimensionality reduction. using this method
improve learning accuracy.

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

Semi-supervised machine learning algorithm uses the combination of labelled and un


labelled data and it falls in between supervised and unsupervised learning. It uses a
small amount of labelled data and a large amount of un labelled data. The systems
using this method improve learning accuracy. Usually, semi-supervised learning is
chosen when the acquired labelled data requires skilled and relevant resources in
order to train it or learn from it. It is a learning method that interacts with environment
by producing actions and discovers errors to make sequence of decisions. Trial and
error search and delayed reward are characteristics of reinforcement learning. The
method allows machines and software agents to automatically determine the ideal
behaviour within a specific context in order to maximize its performance.
Natural Language processing

Natural language processing (NLP) is the ability of a computer program to


understand human language. As it is spoken and written so it is referred to as natural
language. It is a component of artificial intelligence. It has a variety of real-world
applications in a number of fields, including medical research, search engines and
business intelligence. NLP enables computers to understand natural language as
humans understand. There are two main phases to natural language processing: data
preprocessing and algorithm development. Data pre processing involves preparing and
"cleaning" text data for machines to be able to analyze it.

• Naïve Bayes Theorem


Naïve Bayes algorithm is a supervised learning algorithm, which is based on Bayes
theorem and used for solving classification problems. Therefore, not all customers
will get the answers they are searching for. The chatbot using Python are programmed
to take in the information you provide it and then analyze it with the help of complex
AI algorithms, and provide us with a written or verbal response.
It is called naïve bayes because it comprises of two words Naïve and Bayes.
Naïve: It is called Naïve because it assumes that the occurrence of a certain feature is
independent of the occurrence of other features.
Bayes: It is called Bayes because it depends on the principle of Bayes' Theorem.

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

About Chatbot

Artificial intelligence (A.I.) has grown in popularity for conversations between bots
and humans, particularly on mobile platforms. Chatbot experiences can happen
through textor voice interactions. The number of chatbot apps on mobile has steadily
grown, as number of chatbot functions that live in communication platforms like
Facebook Messenger, Slack, Telegram, and Skype.

Existing System

Chatbots are used in many organizations instead of humans when this is possible.
Most of the time systems like that are based on the ways ELIZA communicates.
ELIZA:

• The first chat bot developed was ELIZA. It was developed by Joseph
Weizenbaum using a keyword matching technique.
• The idea was to read the user input and search for certain keywords, if a
keyword was found then the answer was retrieved.
• If a keyword was not present then ELIZA would try, according to specified
rules, to get more information from the user to keep the conversation going.
• Consider the following example,

• User: How can I get in touch with my mother?

• Then the chatbot would identify the keyword mother and would find a
connection between mother and family and it would respond with a question.
• Disadvantages:
1) Chatbots sound too Mechanical: Chatbots are not human and so obviously it
cannot interact as a human with customers. It sound’s too mechanical and
can only give answers to problems that they have been programmed with. It
cannot answer a customer according to the context.
2) Chatbots can only handle basic Questions: Chatbots are still a basic
Artificial Intelligence technology and so it can only answer the basic
questions of customers and provide general information that is already
available to it.
3) Chatbots are Difficult to Create: Chatbots are created using Natural
Language Processing which is extremely popular for customer support.
3

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

4) Chatbots require Constant Maintenance: Companies cannot just create a


chatbot and then leave it hoping that it will correctly answer.

Proposed System:
Creating a chatbot using twitch as an online platform that provides a chatbot
platform to the online clients. Using chatbots may provide faster customer service
overall, but these aren’t perfect. Simple ones may have only limited responses for
customers. Therefore, not all customers will get the answers they are searching for.
The chatbot using Python are programmed to take in the information you provide
it and then analyze it with the help of complex AI algorithms, and provide us with a
written or verbal response. It also helps, if the user wants to have any query or he
wants to enquire about something.

• Advantages Of Proposed System:

1) Chatbots have 24/7 Availability: Chatbots can be available to solve customer


problems 24/7. chatbots can answer customer queries whenever customers have
queries that help in increasing customer loyalty.
2) Chatbots provide Long term Financial Savings: Companies that have human
customer support teams have to pay a very large amount of money as salaries to
their employees. Using chatbots can reduce expenditure.
3) Chatbots cause an Increase in Sales: Customers can get quick support and
solutions for the problems using chatbots.

Problem Definition
All the companies want the clients to know about them and company can get more
projects or sell their products. So the most primary way to do this is to have a good
interactive website in the advanced world of digital marketing. But in this advanced
world, just having a website is not enough as it does not cover all the details and can
not solve the queries of the clients. Maybe a comment section is an answer, but it's
slow work, and 'time is money' client will not wait too long for response. And
humans cannot be assigned to answer everyone at the same time twenty-four by
seven.So for that, there is need of a chatbot, not a normal one "An Intelligent
ChatBot” with Artificial Intelligence technology. “Artificial intelligence chatbot is a
technology that makes interactions between man and machines using

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

natural language possible. A chatbot can give different responses from the same
input given by the user according to the current conversation issue". By using this
"Intelligent ChatBot" issues can overcome and there is no need of human to do
manual work.

Objectives of project

A chatbot is an AI-based software designed to interact with humans in natural


languages. These chatbots are usually converse via auditory or textual methods, and
it can effortlessly mimic human languages to communicate with human beings in a
human- like manner. A chatbot is arguably one of the best applications of Natural
language processing. chatbots can be categorized into two primary variants – Rule-
Based and Self-learning.

The Rule-based approach trains a chatbot to answer questions based on a set of pre-
determined rules on which it was initially trained. These set rules can either be very
simple or very complex. While rule-based chatbots can handle simple queries quite
well, it usually fail to process more complicated queries/requests.

The Self-learning bots are chatbots that can learn on their own. These leverage
advanced technologies like Artificial Intelligence and Machine Learning to train
themselves from instances and behaviour.

A) Retrieval - based Chatbot:

A retrieval-based chatbot is one that functions on predefined input patterns and set
responses. Once the question/pattern is entered, the chatbot uses a heuristic approach
to deliver the appropriate response. The retrieval-based model is extensively used to
design goal-oriented chatbots with customized features like the flow and tone of the
bot to enhance the customer experience.
B) Generative Chatbots:

Unlike retrieval-based chatbots, generative chatbots are not based on predefined


responses they leverage seq2seq neural networks. In seq2seqapproach the input is
transformed into an output. chatbots can generate the answers and not always replies
with one of the answers from a set of answers.

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

2. REQUIREMENT ANALYSIS

Software requirements deal with software and hardware requirements deal with
resources that need to be installed on a server that provides optimal functioning for
the application. These software and hardware requirements need to be installed before
the packages are installed. These are the most common set of requirements defined by
any operating system. These software and hardware requirements provide compatible
support to the operating system in developing an application.

Software Requirements

 Operating system : Windows 10


 Coding Language : Python
 Libraries : Numpy, Scikit
 IDE : Jupyter Notebook

Python

Python is an interpreted, high-level, general-purpose programming language.


Created by Guido van Rossum and first released in 1991. It supports multiple
programming paradigms, including structured (particularly, procedural), object
oriented, and functional programming. Python's simple, easy to learn syntax
emphasizes readability and therefore reduces the cost of program maintenance.
Python supports modules and packages, which encourages program modularity and
code reuse. The Python interpreter and the extensive standard library are available in
source or binary form without charge for all major platforms, and can be freely
distributed.

Python scientific libraries and tools

 Pandas

Pandas is a library for data manipulation and analysis. The library provides
data structures and operations for manipulating numerical tables and time series.

 Mlpy

Mlpy is a machine learning library built on top of NumPy/SciPy, the GNU

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

Scientific Libraries. Mlpy provides a wide range of machine learning methods for
supervised and unsupervised problems and it is aimed at finding a reasonable
compromise between modularity, maintainability, reproducibility, usability and
efficiency.

 Matplotlib

Matplotlib is a python 2D plotting library which produces publication quality


figures in a variety of hardcopy formats and interactive environments across
platforms. Matplotlib allows you to generate plots, histograms, power spectra, bar
charts, error charts, scatterplots, and more.

 NumPy

NumPy is the fundamental package for scientific computing with Python, adding
support for large, multi-dimensional arrays and matrices, along with a large library
of high-level mathematical functions to operate on these arrays.

 Scikit-learn

Scikit-learn is a machine learning library. It features various classification,


regression and clustering algorithms including support vector machines, random
forests, gradient boosting, k-means and DBSCAN, and is designed to interoperate
with the Python numerical and scientific libraries NumPy and SciPy.

Supported languages to start developing in Python with Jupyter Notebook first step is
to download and install Python from python.org depending on respective platform.

Jupyter Notebook supports the following versions of Python:

 Python 2: version 2.7

 Python 3: from the version 3.6 up to the version 3.11

Besides, in the Professional edition, one can develop Django, Flask, and Pyramid
applications. Also, it fully supports HTML (including HTML5), CSS, JavaScript, and
XML, these languages are bundled in the IDE via plugins and are switched on for by
default.

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

Software requirements objectives

 Complex dialogues

In addition to understanding and interacting within conversations, an outstanding


chatbot software has NLP functions (Natural Language Processing) to analyze the
context of a conversation.

It can identify the intent of a question to provide an accurate answer and suggest
options to confirm or resolve the issue.

The best chatbots have advanced conversation features and can proactively search
for information and ask clarifying questions even if the conversation is not linear.

 Flexible data connections

By using Knowledge Graphs, data can be structured and modelled, which in turn
helps to generate new knowledge.

Moreover, the integration of company data or external data sources extends the
functions of chatbot software enormously.

The chatbot can capture, read and process large amounts of data to gain insights
from relevant data and to quickly solve customer problems.

 Multi-channel capability

A great chatbot communicates across multiple channels such as websites, apps,


messenger, phone systems or voice assistants such as Google Assistant or Amazon
Alexa.

For a seamless experience, data and context can be stored over several channels. If a
customer shares order, email address or other information with the bot, it can use this
input for further actions on other channels. Also interesting Thing is it Improves
Customer Experience With The Help Of Voice Assistants.

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

 Fast onboarding

Even if chatbots often build on multi-layered and technologically complex


software, this does not mean that getting started should be an equally complex
process. It’s definitely an advantage if a chatbot can be launched quickly.

Plug & Talk solutions that make a chatbot ready to go in 2-4 weeks are therefore
very beneficial for companies.

 Easy handling

Well-designed user interfaces and experiences (UI / UX), both on the company and
customer side, are essential.

It has to be possible to edit corporate identity settings, change and add content
quickly, send notifications to employees and have a clear and structured overview of
conversations.

In addition, the chatbot software has to be able to handle the huge amount of data
without any problems and GDPR settings have to be taken into account.

 Ongoing optimization

Every single customer interaction represents a way of learning for artificial


intelligence (AI). The more often a chatbot is used, the better it gets because it can
access more and more data with continuous use. Therefore, a chatbot software
should continuously expand its own knowledge base by analysing conversations.

 Analytics & reporting

An outstanding chatbot is an excellent source of data and customer information.


However, if you cannot extract it and use it to increase your knowledge, it will be of
little use. Choose a chatbot provider that provides in-depth chatbot analytics and
analysis of customer information, responses and requests, and gives you the
information you need to tailor your products and services to your customers
expectations.

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

3. SYSTEM DESIGN

Systems design is the process or art of defining the architecture, components, less
interfaces, and data for a system to satisfy specified requirements. One could see it
as a application of systems theory to product development. There is some overlap
and synergy with the disciplines of systems analysis, systems architecture and
systems engineering.

 System Design Document Overview

The System Design Document describes the system requirements, operating


environment, stem and subsystem architecture, files and database design, input
formats, output layouts, human-machine interfaces, detailed design, processing
logic, and external interfaces.

Architecture

In this section, describe the system and/or subsystem(s) architecture for the project.
References to external entities should be minimal.

Figure 1: Architecture of Chatbot

10

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

• System Software Architecture


System software and organization, Include a list of software modules (this could
include functions, subroutines, or classes), computer languages, and programming
computer-aided software engineering tools (with a brief description of the function
of each item). Use structured organization diagrams/ object-oriented diagrams that
show the various segmentation levels down to the lowest level. All features on the
diagrams should have reference numbers and names.

Sequence Diagram

The sequence diagram represents the flow of messages in the system and is also
termed as an event diagram. It helps in envisioning several dynamic scenarios. It
portrays the communication between any two lifelines as a time-ordered sequence of
events, such that these lifelines took part at the run time. In UML, the lifeline is
represented by a vertical bar, whereas the message flow is represented by a vertical
dotted line that extends across the bottom of the page. It incorporates the iterations as
well as branching.

 A sequence diagram in Unified Modeling Language (UML) is the most


commonly used interaction diagram.

 A sequence diagram simply depicts interaction between objects in a sequential


order i.e., the order in which these interactions take place.

 The steps for volume control is been represented using Figure 4 which consists
of five steps such as video stream, share image, hand detection, gesture
recognition and then finally volume control.

11

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

Figure 3: Sequence Diagram

Use case Diagram

In the Unified Modeling Language (UML), a use case diagram can summarize the
details of system's users (also known as actors) and their interactions with the system
as shown in Figure. This chart contains the course of action of use cases, performing
pros and their relationship.

In Figure it can observed the interaction between user, system and server. To build
one, set of specialized symbols and connectors are used. An effective use case
diagram can help team discuss and represent:

 Scenarios in which the system or application interacts with people,


organizations, or external systems.

 The scope of the system.

12

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

Figure 4: Use case Diagram

A use case diagram doesn't go into a lot of detail—for example, don't expect it to
model the order in which steps are performed. Instead, a proper use case diagram
depicts a high-level overview of the relationship between use cases, actors, and
systems. Experts recommend that use case diagrams be used to supplement a more
descriptive textual use case.

13

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

4. IMPLEMENTATION

Building the Bot

 Pre-requisites

Hands-On knowledge of scikit library and NLTK is assumed.

 NLTK(Natural Language Toolkit)

It is a leading platform for building Python programs to work with human


language data. It provides easy-to-use interfaces to over 50 corpora and lexical
resources such as WordNet, along with a suite of text processing libraries for
classification, tokenization, stemming, tagging, parsing, and semantic reasoning,
wrappers for industrial-strength NLP libraries. NLTK has been called “a
wonderful tool for teaching and working in computational linguistics using
Python” and “an amazing library to play with natural language.”

 Natural Language Processing with Python

It provides a practical introduction to programming for language processing. I


highly recommend this book to people beginning in NLP with Python.

a) Downloading and installing NLTK

1. Install NLTK: run pip install nltk

2. Test installation: run python then type import nltk

3. For platform-specific instructions, read here.

14

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

b) Installing NLTK Packages

Import NLTK and run nltkdownload().This will open the NLTK downloader
from where you can choose the corpora and models to download. You can also
download all packages at once.

c) Text Pre- Processing with NLTK

The main issue with text data is that it is all in text format (strings).
However, Machine learning algorithms need some sort of numerical feature
vector to perform the task. So before we start with any NLP project, we need
to pre- process it to make it ideal for work. Basic text pre-processing includes:

 Converting the entire text into uppercase or lowercase so that the algorithm
does not treat the same words in different cases as different.
 Tokenization: Tokenization is just the term used to describe the process of
converting the normal text strings into a list of tokens, i.e., words that we want.
A sentence tokenizer can be used to find the list of sentences, and a Word
tokenizer can be used to find the list of words in strings.

The NLTK data package includes a pre-trained Punkt tokenizer for English.

 Removing Noise: i.e., everything that isn’t in a standard number or letter are
removed.

 Removing Stop words: Sometimes, some extremely common words that appear
to be of little value in helping select documents matching a user need are
excluded from the vocabulary entirely. These words are called stop words.

 Stemming: Stemming is the process of reducing inflected (or sometimes derived)


words to their stem, base, or root form — generally a written word form. For
example, if we were to stem the following words: “Stems,” “Stemming,”
“Stemmed,” “and Stemtization,” the result would be a single word, “stem.”

15

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

 Lemmatization: A slight variant of stemming is lemmatization. The major


difference between these is that stemming can often create non-existent words,
whereas lemmas are actual words. So, your root stem, meaning the word you end
up with, is not something you can look up in a dictionary, but you can look up a
lemma. Examples of Lemmatization are that “run” is a base form for words like
“running” or “ran” or that the word “better” and “good” are in the same lemma,
so they are considered the same.

A) Importing the necessary libraries

Figure 5: Importing Libraries


 Corpus
Using the Wikipedia page for chatbots as our corpus. Copy the contents from
the page and place them in a text file named ‘chatbot.txt’.

B) Reading in the data

The corpus.txt file and convert the entire corpus into a list of sentences and a list of
words for further pre-processing.

C) Pre-processing the raw text

 Keyword Matching

Define a function called Lem Tokens which will take as input the tokens and
return normalized tokens. Next, define a function for a greeting by the bot, i.e., if a
user’s input is a greeting, the bot shall return a greeting response. ELIZA uses a
simple keyword matching for greetings.

 Generating Response

To generate a response from our bot for input questions, the concept of document
similarity will be used. So we begin by importing the necessary modules.

16

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

5.RESULT

Figure 6: Chatbot Result

The ROBO responds to user input. It won’t fool anyone, and for a production
system. It is a very simple bot with cognitive skills.

17

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

6. CONCLUSION AND FUTURE SCOPE

Conclusion

Consumers of today are always on the lookout for the best and most
personalized customer experience. It may be thought as an impossible task to
fu1lfill demands. However, there is one solution primed to satisfy the modern
customer, and that is a chatbot. 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.

To summarize it, this system has accomplished several objectives in this project:

 Chatbots can reach out to a large audience on messaging apps and be more
effective than humans and also organizations can easily offer high-quality
support and conflict resolution any time of day, and for a large quantity of
customers simultaneously.

Future Enhancement

Chatbots can bring technological advancements and vastly improve customer


engagement. It can communicate with clients to create enhanced lead generation. The
chatbot is a perfect tool to make suggestions on everything from products to services,
helping you to capture super-targeted leads.

18

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)


lOMoARcPSD|50465996

7. REFERENCES
[1] Bhaumik Kohli , Tanupriya Choudhury, Shilpi Sharma, Praveen Kumar,” A
Platform for Human- Chat bot Interaction Using Python”, IEEE , 2018.
[2] Tussanai Parthornratt, Pasd Putthapipat, Dollachart Kitsawat , Prapap
Koronjaruwat,” A Smart Home Automation via Facebook Chatbot and Raspberry
Pi”, IEEE, 2018.
[3] Parth Thosani ,Manas Sinkar ,Jaydeep Vaghasiya, Radha Shankarmani,” A Self
Learning Chat-Bot from User Interactions and Preferences”, IEEE , 2020.
[4] Prakhar Srivastava, Nishant Singh,” Automatized Medical Chatbot (Medibot)”,
IEEE, 2020.
[5] Jitendra, Purohi, Aditya Bagwe, Rishbh Mehta, OjaswiniMangaonkar , Elizabeth
George, “Natural Language Processing based Jaro-The Interviewing Chatbot” ,
IEEE, 2019.
[6] Bhavika R. Ranoliya , Nidhi Raghuwansh and Sanjay Singh , “Chatbot for
University Related FAQs”,IEEE, 2017.
[7] Ankil Shah, Bhargav Jain, Bhavin Agrawal, Saurabh Jain, Simon Shim, “Problem
Solving Chat bot for DataStructures”, IEEE, 2018.
[8] Falguni Patel, Riya Thakore,Ishita Nandwani , Santosh kumar Bharti, “Combating
Depression in Students using an Intelligent Chat Bot: A Cognitive Behavioral
Therapy”, IEEE ,2019.
[9] Nitirajsingh Sandu , Ergun Gide, “Adoption of AI- Chatbots to Enhance Student
Learning Experience in Higher Education in India”, IEEE ,2019.
Neelkumar P. Patel, Devangi R. Parikh, “AI and Web-Based Human-Like
Interactive University Chat bot (UNIBOT)”, IEEE,2019.
[10] Urmil Bharti, Deepali Bajaj, Hunar Batra, Shreya Lalit, Shweta Lalit,
Aayushi Gangwan, “Med bot: Conversational Artificial Intelligence Powered Chat
bot for Delivering Tele-Health after COVID-19”, IEEE , 2020.
[11] Urmil Bharti, Deepali Bajaj, Hunar Batra, Shreya Lalit, Shweta Lalit,
Aayushi Gangwan, “Med bot: Conversational Artificial Intelligence Powered Chat
bot for Delivering Tele-Health after COVID-19”, IEEE , 2020.
[12] Chatbot Magazine (2019). A Visual History of Chatbots. Retrieved March 9,
2019 from: https://chatbotsmagazine.com/a-visual-history-of-chatbots-8bf3b31dbfb2
[13] Egencia (2018). What is a Chatbot and How does it work? Retrieved March
9, 2019 from: https://www.youtube.com/watch?v=38sL6pADCog
19

Downloaded by Raghavendhar Reddy (raghavendharreddy007@gmail.com)

You might also like