Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

NLP Mini Project Report

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 27

UNIVERSITY OF MUMBAI

A DISSERTATION REPORT ON

“CHATBOT”
SUBMITTED IN PARTIAL FULFILMENT

FOR THE REQUIREMENT OF THE

DEGREE

BACHELOR OF ENGINEERING

IN

COMPUTER ENGINEERING

GROUP MEMBERS

Sonali Alhate (01)

Suraj Bind (03)

Rajshree Borkar (04)

Himanshu Dumbre (09)


UNDER THE GUIDENCE OF

PROF. DASHARATH MAGAR

DEPARTMENT OF COMPUTER ENGINEERING


G.V. ACHARYA INSTITUTE OF ENGINEERING AND TECHNOLOGY

UNIVERSITY OF MUMBAI
2022-2023
DECLARATION
We declare that this written submission represents my ideas in my own words
and where other’s ideas or words have been included, I have adequately cited
and referenced the original sources. I also declare that I have adhered to all
principal of academic honesty and integrity and have not misrepresented or
fabricated or falsified any idea/data/fact/source in my submission. I understand
that any violation of the above will be cause for disciplinary action by the
Institute and can also evoke penal action from the sources which have thus not
been properly cited or from whom proper permission has not been taken when
needed.

Sonali Alhate (01)


Suraj Bind (03)
Rajshree Borkar (04)
Himanshu Dumbre (09)

Date:
Place: SHELU
CERTIFICATE
This is to certify that the project entitled “CHATBOT” is a bonafide work of
“Sonali Alhate (01), Suraj Bind (03), Rajshree Borkar (04), Himanshu
Dumbre (09)” submitted to the University of Mumbai in partial fulfillment of
the requirement for the award of the degree of “BE” in “Bachelor of
Computer Engineering”.

Prof. Dashrath Magar Prof. Dashrath


Magar
Head of Department Project Guide
Computer Engineering Computer
Engineering
G.V.A.I.E.T G.V.A.I.E.T
Index

TABLE OF CONTENTS

Sr. No. Title Page No.

Abstract

List of Figures

List of Tables

Chapter 1 Introduction 1

Chapter 2 Literature Survey 2-4

Chapter 3 Problem Statement 5

Chapter 4 Objectives and scope 6

Chapter 5 Proposed methodology 7

Chapter 6 System Architecture 8

Chapter 7 Tools and Dataset required 9

Chapter 8 Implementation screenshot 10-15

Chapter 9 Conclusion 16

Reference 17

2
Abstract

Chatbots are intelligent conversational computer systems designed to mimic


human conversation to enable automated online guidance and support. The increased
benefits of chatbots led to their wide adoption by many industries in order to provide
virtual assistance to customers. Chatbots utilize methods and algorithms from two
Artificial Intelligence domains: Natural Language Processing. However, there are
many challenges and limitations in their application. In this survey we review recent
advances on chatbots, Natural Language processing are used. . Chatbots are also known
as smart bots, interactive agents, digital assistants, or artificial conversation entities. Chatbots
can mimic human conversation and entertain users but they are not built only for this. They are
useful in applications such as education, information retrieval, business, and e-commerce.
They became so popular because there are many advantages of chatbots for users and
developers too. Most implementations are platform-independent and instantly available

3
List of Figures

Sr. No. Name of Figure Page No.

1 System Architecture 8

4
List of Tables

Sr. No. Name of Table Page No.

1 Tools 9

5
Chapte

r1
Introdu

ction
1.1 Motivation:
The idea of this project was not to create some chatbot with exceptional cognitive skills
but just to utilize and test my Python skills. This was one of my very first projects,
created when I just stepped into the world of NLP and I thought of creating a simple
chatbot just to make use of my newly acquired knowledge. A chatbot is a typical
example of an AI system and one of the most elementary and widespread examples of
intelligent Human-Computer Interaction (HCI). It is a computer program, which
responds like a smart entity when conversed with through text or voice and understands
one or more human languages by Natural Language Processing (NLP) . In the lexicon,
a chatbot is defined as “A computer program designed to simulate conversation with
human users, especially over the Internet”. Chatbots are also known as smart bots,
interactive agents, digital assistants, or artificial conversation entities. Chatbots can
mimic human conversation and entertain users but they are not built only for this. They
are useful in applications such as education, information retrieval, business, and e-
commerce . They became so popular because there are many advantages of chatbots for
users and developers too. Most implementations are platform-independent and instantly
available to users without needed installations. Knowledge in the use of one chatbot is
easily transferred to the usage of other chatbots, and there are limited data
requirements. Communication reliability, fast and uncomplicated development
iterations, lack of version fragmentation, and limited design efforts for the interface are
some of the advantages for developers too

1.1.1 Need of the problem

Cost and Time Effective ~ Humans cannot be active on-site 24/7 but chatbots can and
the replying power of chatbots is much fast than humans.

Cheap Development cost ~ with the advancement in technology many tools are
developed that help easy development and integration of chatbots with little
investment.

Human Resource ~ Today Chatbots can also talk with text o speech technology so it
gives the feel as a human is talking on another side.

Business Branding ~ Businesses are changing with technology and chatbot is one out

1
of them. Chatbot also helps in advertising, branding of organization product and
services and give daily updates to users.

2
Chapter 2
Problem
Statement

2.1 Problem statement


All the companies want their clients to know about them and they 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 tedious work, and 'time is money' your client
will not wait too long for your response. And you cannot assign humans to answer everyone at
the same time twenty-four by seven. So for that, you need 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 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 our "Intelligent Chatbot" you can
overcome all the above-given issues, you do not need humans to do manual work, your clients
will be happy. A chatbot is a conventional agent that is capable to communicate with
operators by using natural languages. As numerous chatbot platforms already exist, there are
still some problems in building data-driven system because a huge amount of data is required
for their development.

2.2 Features
1. Easy customization
Every business is built different. They have different integrations, different apps,
different workflows and require customized solutions for everything.

Our platform is just built for that. Pick and chatbot, any domain, any industry - our
chatbots are ready to be deployed. And we’ll do quick customizations for you and get
your bot up and running in less than a week.

2.Interactive flow builder

chatbot flow builder helps you determine the path and the flow of the chatbot conversations.

3
3.Easy live chat

Your chatbots can handle around 80% of your customer queries without human
intervention. And for the complex conversation, you can switch or direct the
interactions to live agents to serve them better.

4.Security & privacy

With so many data breaches, your chatbot must be secure. It’s a good idea to have
a fully transparent policy regarding the data bots, such as what they collect and
exactly what it is used for.

2.3 Objectives
NLP chatbots today are bridging the gap between consumer expectation and brand
communication. NLP makes any chatbot better and more relevant for contemporary
use, considering how other technologies are evolving and how consumers are using
them to search for brands.

One of the major reasons a brand should empower their chatbots with NLP is that it
enhances the consumer experience by delivering a natural speech and humanizing the
interaction.

In addition, NLP for chatbots offers the following benefits:

 They are mission-critical and focused on delivering relevant information.

 It help to reduce manpower costs to the company.

 They are known to fetch higher satisfaction rates from customers.

 They are a great tool for market research and analysis in-house.

2.4 Specifications of the system


Chatbot is a computer application which uses artificial intelligence to mimic human
conversation. It helps the user by answering the questions asked by them. The program is
implemented using Java programming language. Particularly.

4
A Chatbot refers to a chatting robot. It is a communication simulating computer
program. It is all about the conversation with the user. The conversation with a
Chatbot is very simple. It answers to the questions asked by the user. During
designing a Chatbot, how does the Chatbot speak to the user? And how will be the
conversation with the user and the Chatbot is very important.
Chat – Chat is a class that contains complete logic for processing the text data which
the chatbot receives and find useful information out of it.

reflections – Another import we have done is reflections which is a dictionary


containing basic input and corresponding outputs. You can also create your own
dictionary with more responses you want. if you print reflections it will be something
like this.

After importing the libraries, First, we have to create rules. The lines of code given
below create a simple set of rules. the first line describes the user input which we have
taken as raw string input and the next line is our chatbot response. You can modify
these pairs as per the questions and answers you want.

After creating pairs of rules, we will define a function to initiate the chat process. The
function is very simple which first greet the user, and ask for any help. And the
conversation starts from here by calling a Chat class and passing pairs and reflections
to it.

We have created an amazing Rule-based chatbot just by using Python and NLTK
library. The nltk.chat works on various regex patterns present in user Intent and
corresponding to it, presents the output to a user. Let’s run the application and chat
with your created chatbot.

5
Chapter 3
Literature Review

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 or ALICE communicates.

1.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. The chatbot doesn't understand what it is saying. It only
produces results according to rules.

2.A.L.I.C.E : ALICE was implemented by richard wallace in 1995. It uses pattern matching
and stores the information in artificial intelligence mark-up language, or else known as AIML,
files. An AIML file is similar to an XML file that was developed to store pattern knowledge
for chatbots.

6
Chapter 4

Objective and

Scope
Objective:

NLP chatbots today are bridging the gap between consumer expectation and brand
communication. NLP makes any chatbot better and more relevant for contemporary
use, considering how other technologies are evolving and how consumers are using
them to search for brands.

One of the major reasons a brand should empower their chatbots with NLP is that it
enhances the consumer experience by delivering a natural speech and humanizing the
interaction.

In addition, NLP for chatbots offers the following benefits:

 They are mission-critical and focused on delivering relevant information.


 It help to reduce manpower costs to the company.
 They are known to fetch higher satisfaction rates from customers.
 They are a great tool for market research and analysis in-house.

Scope:

Chatbots are also referred to as virtual assistants. It is a rudimentary form of artificial


intelligence software that can mimic human conversation. The Chatbots can be
analyzed and improved. It can be used in various fields such as education,
business, online chatting etc. It can be used in the field of education as a learning
tool. The information necessary for education can be stored in the data base and can
be retrieved any time by querying the bot. In business field, it can be used to provide
business solutions in an efficient way. When the solutions are efficient, the business
can be improved and the growth of the organization will be increased. This
Chatbot can be used in online chatting for entertainment purpose. People can chat
with these bots online when they are bored for the purpose of entertainment. These
bots can also be used to learn different kinds of language. The language that has to
learnt can be stored in the database and can be learnt by asking questions to the bot.

7
They can also be used in the field of medical to solve health related problems. Chatbots
are going to explode and can be really dominating in future. Chatbots can provide a
new and flexible way for users.

8
Chapter 5
Proposed

Methodology

Our project is based on artificial intelligence- powered chatbot. A python is


software that provides a user-friendly interface to make the connection easier and
convenient with the internet providing valid and reliable web services. We've created a
sample chatbot using the same with a twitch as an online platform that provides a
chatbot platform to the online clients. The web-based platform provides a vast
intelligent base that can help simulate problem-solving for humans. We can help if the
user wants to have any query or he wants to enquire about something. Our methodology
includes API of chatbot that will be developed with cascading style sheet which covers
all the styling part and the JavaScript is used for functioning the chatbot back end part
will be done with python programming language. It also contains various machine
learning algorithms to learn the chatbot by experiencing.

9
Chapter 6
System Architecture

A Chatbot refers to a chatting robot. It is a communication simulating computer


program. It is all about the conversation with the user. The conversation with a
Chatbot is very simple. It answers to the questions asked by the user. During
designing a Chatbot, how does the Chatbot speak to the user? And how will be the
conversation with the user and the Chatbot is very important. The System
Architecture of a Chatbot is represented using diagram as follows:

Fig. System Architecture of Chatbot

10
Chap
ter 7
Tools

Software Google Colaboratory


Browser Chrome
Operating System Windows 10
Backend Python

11
Chapter 8
Implementation
screenshot

Program code-

import nltk
from nltk.chat.util import Chat, reflections

reflections = {
"i am"  : "you are",
"i was" : "you were",
"i" : "you",
"i'm" : "you are",
"i'd" : "you would",
"i've"  : "you have",
"i'll"  : "you will",
"my"  : "your",
"you are" : "I am",
"you were" : "I was",
"you've"  : "I have",
"you'll"  : "I will",
"your"  : "my",
"yours" : "mine",
"you" : "me",
"me"  : "you"
}

pairs = [
    [
        r"my name is (.*)",
        ["Hello %1, How are you today ?",]
    ], 
    [
        r"hi|hey|hello", 
        ["Hello", "Hey there",]
    ], 
    [
        r"what is your name ?",
        ["I am a bot created by G.V.Acharya Student. you can call me cr
azy!",]
    ], 
    [

12
        r"how are you ?",
        ["I'm doing goodnHow about You ?",]
    ], 
    [
        r"sorry (.*)",
        ["Its alright","Its OK, never mind",]
    ], 
    [
        r"I am fine",
        ["Great to hear that, How can I help you?",]
    ], 
    [
        r"i'm (.*) doing good",
        ["Nice to hear that","How can I help you?:)",]
    ], 
    [
        r"(.*) age?",
        ["I'm a computer program dudenSeriously you are asking me this?
",]
    ], 
    [
        r"what (.*) want ?",
        ["Make me an offer I can't refuse",]
    ], 
    [
        r"(.*) created ?",
        ["Rajshree, Sonali, Suraj and Himanshu created me using Python'
s NLTK library ","top secret ;)",]
    ], 
    [
        r"(.*) (location|city) ?", ['Indore, Madhya Pradesh',]
    ], 
    [
        r"how is weather in (.*)?",
        ["Weather in %1 is awesome like always","Too hot man here in %1
","Too cold man here in %1","Never even heard about %1"]
    ], 
    [
        r"i work in (.*)?",
        ["%1 is an Amazing company, I have heard about it. But they are 
in huge loss these days"]

    ],
    [
        r"(.*)raining in (.*)",
        ["No rain since last week here in %2","Damn its raining too muc
h here in %2"]
    ],
    [

13
        r"how (.*) health(.*)",
        ["I'm a computer program, so I'm always healthy ",]
    ],
    [
        r"(.*) (sports|game) ?",
        ["I'm a very big fan of Football",]
    ],
    [
        r"who (.*) sportsperson ?", ["Messy","Ronaldo","Roony"]
    ], 
    [
        r"who (.*) (moviestar|actor)?", ["Brad Pitt"]
    ], 
    [
        r"i am looking for online guides and courses to learn data scie
nce, can you suggest?", ["Crazy_Tech has many great articles with each 
step explanation along with code, you can explore"]
    ], 
    [
        r"quit",
        ["Bye take care. See you soon :) ","It was nice talking to you. 
See you soon :)"]
    ],
    ]

def chat():
    print("Hi! I am a chatbot created by G.V.Acharya Students for your 
service") 
    chat = Chat(pairs, reflections)
    chat.converse()       
if __name__ == "__main__": 
    chat()
      

14
Output-

Fig 1

Fig 2

15
Fig 3

Fig 4

16
fig 5

fig 6

17
Chapt

er 9

Concl

usion
Minimal human interference in the use of devices is the goal of our world of
technology. Chatbots can reach out to a broad audience on messaging apps and be
more effective than humans are. At the same time, they may develop into a capable
information gathering tool. They provide significant savings in the operation of
customer service departments. With further development of AI and machine learning,
somebody may not be capable of understanding whether he talks to a chatbot or a real-
life agent. The Chatbot must be simple and conventional.
A chatbot is one of the simple ways to transport data from a computer without
having to think for 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, 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
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 the questions that are hard to find.

18
References
1. Bansal, H., Khan, R.: A review paper on human computer interaction. Int. J. Adv. Res.
Comput. Sci. Softw. Eng. 8, 53 (2018).
https://doi.org/10.23956/ijarcsse.v8i4.630

2. Khanna, A., Pandey, B., Vashishta, K., Kalia, K., Bhale, P., Das, T.: A study of today’s
A.I. through chatbots and rediscovery of machine intelligence. Int. J. u- e-Serv. Sci.
Technol. 8, 277–284 (2015). https://doi.org/10.14257/ijunesst.2015.8.7.28

3. chatbot | Definition of chatbot in English by Lexico


Dictionaries. https://www.lexico.com/en/
definition/chatbot

4. Abu Shawar, B.A., Atwell, E.S.: Chatbots: are they really useful? J. Lang. Technol.
Comput. Linguist. 22, 29–49 (2007)

5. Klopfenstein, L., Delpriori, S., Malatini, S., Bogliolo, A.: The rise of bots: a survey of
conversational interfaces, patterns, and paradigms. In: Proceedings of the 2017
Conference on Designing Interactive Systems, pp. 555–565. Association for Computing
Machinery (2017)

6. Turing, A.M.: Computing machinery and intelligence. Mind 59,


433–460 (1950). https://doi. org/10.1093/mind/LIX.236.433

7. Weizenbaum, J.: ELIZA—a computer program for the study of natural language
communication between man and machine. Commun. ACM 9, 36–45 (1966).
https://doi.org/10.1145/ 365153.365168

8. Brandtzaeg, P.B., Følstad, A.: Why people use chatbots. In: Kompatsiaris, I., et al. (eds.)
Internet Science, pp. 377–392. Springer,
Cham (2017). https://doi.org/10.1007/978-3-319- 70284-1_30

19

You might also like