RULE BASED CHATBOT USING NLTK
A MINI PROJECT REPORT
Submitted by
822320104001 T. AARTHI
822320104002 A. ARUNMANI
822320104005 A. B. GOKULA PRIYAA
822320104008 K. KAYALVIZHI
in partial fulfilment for the award of the degree
of
BACHELOR OF ENGINEERING
in
COMPUTER SCIENCE AND ENGINEERING
VANDAYAR ENGINEERING COLLEGE,THANJAVUR
ANNA UNIVERSITY:CHENNAI 600025
MAY 2023
ANNA UNIVERSITY: CHENNAI 600 025
BONAFIDE CERTIFICATE
Certified that this project report “RULE BASED CHATBOT USING NLTK“is the
bonafied work of “T.AARTHI (822320104001), A.ARUNMANI
(822320104002), A.B. GOKULA PRIYAA (822320104005),
K.KAYALVIZHI (822320104008)” who carried out the project work under
my supervision.
Dr.S.SAMUNDEESWARI,M.Tech.,Ph.D Mr. M.SARAVANAKUMAR, M.E.,
PROFESSOR HEAD OF THE DEPARTMENT
DEPARTMENT OF CSE DEPARTMENT OF CSE
Vandayar Engineering College Vandayar Engineering College
Thanjavur-613501 Thanjavur-613501
Submitted for the project viva voice examination held on ………………...
INTERNAL EXAMINER EXTERNAL EXAMINER
ABSTRACT
This project implements a simple chatbot using Python's Natural Language
Toolkit (NLTK) library. The chatbot is capable of responding to user input
based on a set of predefined rules. It can respond to common greetings,
recommend a random song from a list of songs, tell a joke from a list of
jokes, or provide a quote from a list of quotes. The chatbot works by first
tokenizing the user's input, then checks if the input contains any of the
predefined keywords, such as greetings, song, joke, or quote. If a keyword is
found, the chatbot responds with an appropriate response. If no keyword is
found, the chatbot generates a default response. The chatbot is designed to be
interactive and will continue to respond to user input until the user enters the
word "quit." The chatbot can be modified to include additional functionality
or to respond to different keywords, making it a useful tool for a variety of
applications, such as customer service or personal assistance.
iiii
ACKNOWLEDGEMENT
First of all, I thank god for his blessing and grace on every success in the
life and also this project.
The success of any work lies in the involvement and commitment of its
makers, this being no exception. At this juncture I would like to acknowledge
the many minds that made this project of ours to be a reality.
My grateful thank to our beloved Chairman Mr.S.GUNASEKARA
VANDAYAR, M.Com and Correspondent Mr.G.VIJAY PRAKASH, B.E.,
M.Tech., M.B.A for the continuous help during our course period by arranging
various activities.
Next my grateful thanks to our Principal Dr.SAMUNDEESWARI,
M.Tech., Ph.D for providing his hands to us to successfully complete the
course.
The encouragement and support of our Head of the Department
Mr.M.SARAVANAKUMAR, M.E., as always guiding with spirit throughout
the course period. Whenever clouds of disappointment hung above, I am always
had one never failing ray of hope that showed the path, time and again, in the
form of our Head of the Department.
My special thanks for the invaluable help and guidance given by my
internal guide Dr.SAMUNDEESWARI, M.Tech., Ph.D Professor Department
of Computer Science and Engineering, Vandayar Engineering College,
Thanjavur.
I would be failing in my duty if I do not mention the whole hearted
support and technical assistance extended to me by all the FACULTY
MEMBERS AND TECHNICAL STAFFS of the Computer Science and
Engineering Department, Vandayar Engineering College, Thanjavur.
TABLE OF CONTENTS
S.NO TITLE PAGE NO
ABSTRACT iii
LIST OF FIGURE iv
LIST OF ABBREVIATION v
INTRODUCTION 1
1 1.1 INTRODUCTION 1
1.2 SCOPE OF THE PROJECT
2
1.3 OBJECTIVE OF THE PROJECT
1.4 REPORT SUMMARY 2
LITERATURE SURVEY 3
2.1 RESERCH PAPERS ON RULE BASED
2
CHATBOTS 3
2.2 AN OVERVIEW OF CHATBOT
TECHNOLOGY 3
2.3 NLTK NATURAL LANGUAGE TOOLKIT 5
3 EXISTING SYSTEM 6
3.1 RULE BASED CHATBOT 6
3.2 RULE BASED CHATBOT USING NLTK 7
4 PROPOSED WORK 9
4.1 INTRODUCTION 9
4.2 RULE BASED CHATBOT USING NLTK
10
FRAMEWORK
4.3 RULE BASED CHTBOT ALGORITHM 11
5 SYSTEM SPECIFICATION 12
5.1 SOFTWARE REQUIREMENT 12
5.2 HARDWARE REQUIREMENT 14
6 IMPLEMENTATION AND RESULTS 18
6.1 CHAATBOT IMPLEMENTATION 18
7 PERFORMANCE COMPARISON 19
8 CONCLUSION 20
APPENDIX – I 21
APPENDIX – II 25
LIST OF FIGURES
FIG.NO FIGURES PAGENO
Fig. 3.1 Mitsuku and Jabberwacky chatbot 7
Fig. 3.2 Restaurant Chatbot and Weather Chatbot 8
Fig. 4.1 Difference between Rule-based and AI-powered chatbot 10
Fig. 6.1 Sample Chatbot conversation 18
Fig. 7.1 Accuracy and Precision Graph 19
LIST OF TABLES
TABLE NAME OF THE TABLES PAGE
NO NO
1 Software Specifications 12
2 Hardware Specification 14
3 Comparison Analysis 18
LIST OF ABBREVATIONS
S. NO ABBREVATION EXPANSION
1 NLTK Natural Language Toolkit
2 AI Artificial Intellegence
3 NLP Natural Language Processing
4 SIL Safety Integrity Level
5 NIST National Institute of Standards and
Technology
6 CMU Carnegie Mellon University
7 CoNLL Conference on Natural Language
Learning
8 IEER Institute for energy and environmental
research
9 AMD Advanced Micro Devices
10 HCI Human Communication Interaction
11 ALICE Artificial Linguistic Internet Computer
Entity