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

Smart College Enquiry Chatbot Using Deep Learning Algorithm

The document is a project report on the development of a 'Smart College Enquiry Chatbot' using deep learning algorithms, submitted by students from Annai Teresa College of Engineering. It outlines the chatbot's purpose to facilitate college-related inquiries through natural language processing and machine learning techniques. The report includes acknowledgments, an abstract, a literature survey, and various system design specifications, highlighting the project's aim to improve user interaction and response accuracy.

Uploaded by

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

Smart College Enquiry Chatbot Using Deep Learning Algorithm

The document is a project report on the development of a 'Smart College Enquiry Chatbot' using deep learning algorithms, submitted by students from Annai Teresa College of Engineering. It outlines the chatbot's purpose to facilitate college-related inquiries through natural language processing and machine learning techniques. The report includes acknowledgments, an abstract, a literature survey, and various system design specifications, highlighting the project's aim to improve user interaction and response accuracy.

Uploaded by

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

SMART COLLEGE ENQUIRY CHATBOT USING

DEEP LEARNING ALGORITHM


A PROJECT REPORT

Submitted by

SANTHIPRIYA D 420620104013
SINDHUJA P 420620104014
SARANYA P 420620104324

In partial fulfilment for the award of the degree


Of

BACHELOR OF ENGINEERING
In

COMPUTER SCIENCE AND ENGINEERING

ANNAI TERESA COLLEGE OF ENGINEERING –THIRUNAVALUR

ANNA UNIVERSITY-CHENNAI 600 025


MAY-2024
ANNA UNIVERSITY: CHENNAI 600 025

BONAFIDE CERTIFICATE

Certified that this project report “SMART COLLEGE ENQUIRY CHATBOT

USING DEEP LEARNING ALGORITHM” is the bonafide work of

“SANTHIPRIYA D (420620104013), SINDHUJA P (420620104014),

SARANYA P (420620104324)” who carried out the project work under my

supervision.

SIGNATURE SIGNATURE

Mrs.A.RAMYA,M.Tech., Mrs.HANISHA BEGAM.M.Tech.,

HEAD OF THE DEPARTMENT SUPERVISOR

ASSISTANT PROFFESOR ASSISTANT PROFESSOR

COMPUTER SCIENCE AND ENGINEERING COMPUTER SCIENCE AND ENGINEERING

ANNAI TERESA COLLEGE OF ENGINEERING ANNAI TERESA COLLEGE OF ENGINEERING

THIRUNAVALUR-607 204 THIRUNAVALUR-607 204

Submitted for the project viva-voice held on

INTERNAL EXAMINER EXTERNAL EXAMINER


ANNA UNIVERSITY: CHENNAI 600 025

BONAFIDE CERTIFICATE

Certified that this project report “SMART COLLEGE ENQUIRY CHATBOT

USING DEEP LEARNING ALGORITHM” is the bonafide work of

“SANTHIPRIYA D (420620104013)” who carried out the project work under my

supervision.

SIGNATURE SIGNATURE

Mrs.A.RAMYA,M.Tech., Mrs.HANISHA BEGAM.M.Tech.,

HEAD OF THE DEPARTMENT SUPERVISOR

ASSISTANT PROFFESOR ASSISTANT PROFESSOR

COMPUTER SCIENCE AND ENGINEERING COMPUTER SCIENCE AND ENGINEERING

ANNAI TERESA COLLEGE OF ENGINEERING ANNAI TERESA COLLEGE OF ENGINEERING

THIRUNAVALUR-607 204 THIRUNAVALUR-607 204

Submitted for the project viva-voice held on

INTERNAL EXAMINER EXTERNAL EXAMINER


ANNA UNIVERSITY: CHENNAI 600 025

BONAFIDE CERTIFICATE

Certified that this project report “SMART COLLEGE ENQUIRY CHATBOT

USING DEEP LEARNING ALGORITHM” is the bonafide work of

“SINDHUJA P (420620104014)” who carried out the project work under my

supervision.

SIGNATURE SIGNATURE

Mrs.A.RAMYA,M.Tech., Mrs.HANISHA BEGAM.M.Tech.,

HEAD OF THE DEPARTMENT SUPERVISOR

ASSISTANT PROFFESOR ASSISTANT PROFESSOR

COMPUTER SCIENCE AND ENGINEERING COMPUTER SCIENCE AND ENGINEERING

ANNAI TERESA COLLEGE OF ENGINEERING ANNAI TERESA COLLEGE OF ENGINEERING

THIRUNAVALUR-607 204 THIRUNAVALUR-607 204

Submitted for the project viva-voice held on

INTERNAL EXAMINER EXTERNAL EXAMINER


ANNA UNIVERSITY: CHENNAI 600 025

BONAFIDE CERTIFICATE

Certified that this project report “SMART COLLEGE ENQUIRY CHATBOT

USING DEEP LEARNING ALGORITHM” is the bonafide work of

“SARANYA P (420620104324)” who carried out the project work under my

supervision.

SIGNATURE SIGNATURE

Mrs.A.RAMYA,M.Tech., Mrs.HANISHA BEGAM.M.Tech.,

HEAD OF THE DEPARTMENT SUPERVISOR

ASSISTANT PROFFESOR ASSISTANT PROFESSOR

COMPUTER SCIENCE AND ENGINEERING COMPUTER SCIENCE AND ENGINEERING

ANNAI TERESA COLLEGE OF ENGINEERING ANNAI TERESA COLLEGE OF ENGINEERING

THIRUNAVALUR-607 204 THIRUNAVALUR-607 204

Submitted for the project viva-voice held on

INTERNAL EXAMINER EXTERNAL EXAMINER


ACKNOWLEDGEMENT

We take this opportunity to express our gratitude to all, whose contribution


in this project work can never be forgotten.

Our sincere thanks to our honourable chairman Ln.Dr.PRAKASHMULL


CHORDIA, M.Com., Ph.D., for this support during the entire course period.

We express our gratitude to our managing director Dr.P.DINESH KUMAR


CHORDIA, M.Com.,Ph.D., for this support during the entry course period.

We thank our PRINCIPAL Dr.J.KRISHNA KUMAR, M.Tech., Ph.d., for


this worthy encouragement to make this project as a successful one.

We express our thanks to our HEAD OF THE DEPARTMENT


Mrs.A.RAMYA, M.Tech, for her valuable suggestion and guidance for the
development completion of this project.

Word fail to express my gratitude to my PROJECT GUIDE


Mrs.HANISHA BEGAM.M.Tech., who took special interest on my project and
gave his consistent support and guidance during all stages of this project.

Finally, we thank all the STAFF MEMBERS OF COMPUTER


SCIENCE AND ENGINEERING of our college who helped to complete this
project. Above all we thank our PARENTS AND FAMILY MEMBERS for their
constant support and encouragement for completing this project
ABSTRACT

A type of human computer dialogue system known as a chatbot uses


natural language processing to communicate with users via text, speech, or chat. It
is primarily used to increase conversion rates and is built to handle millions of
requests at once. Natural language input activates a category of intelligent,
conversational software algorithms known as chatbots. A chatbot is an interactive
artificial intelligence computer that analyses user input and texts to choose the best
course of action. The chatbot was created using a deep learning model and
algorithms for natural language understanding. Natural language processing
methods like tokenization and lemmatization are used to process the question. The
Deep Neural Network (DNN) algorithm receives the processed query after spelling
correction. This System is basically a web application that provides valid responses
to the various queries of the users, which will make use of Natural Language
Processing (NLP).In this project, we have completed building a quite intellegent
chatbot based on NLP for basic college-related enquiries and admission related
queries especially.

i
TABLE OF CONTENTS

CHAPTER NO TITLE PAGE NO


Abstract i
List Of Tables ii
List Of Figure iii
List Of Abbreviations iv
1 INTRODUCTION
1.1 Overview Of Project 2
2 LITERATURE SURVEY
2.1 Chatbot System for Collage FAQ’s Using 6
Artificial Intelligence
2.2 College Enquiry Chat-Bot System 6
2.3 Artificially Intelligent Chatbot Universal 7
Research Reports
2.4 Chat-Bot For College Management 7
System
2.5 Online Chatting System for College 8
Enquiry using Knowledgeable Database
3 SYSTEM ANALYSIS
3.1 Existing System 11
3.1.2 Disadvantages Of Existing System 11
3.2 Proposed System 12
3.2.1 Advantages Of Proposed System 12
4 SYSTEM SPECIFICATION
4.1 Hardware Requirements 14

ii
4.2 Software Requirements 14
5 SYSTEM DESIGN
5.1 System Architecture 16
5.2 Data Flow Diagram 17
5.3 Uml Diagrams 19
5.4 Goals 19
5.5 Use Case Diagram 20
5.6 Class Diagram 21
5.7 Sequence Diagram 22
5.8 Activity Diagram 23
6 MODULE DESCRIPTION
6.1 List of Modules 25
6.2 Modules Description 25
6.2.1 Admin Login 25
6.2.2 Add Query And Dataset 25
6.2.3 User Login 25
6.2.4 Asking Querie 26
6.2.5 Providing Feedback 36
7 SYSTEM TESTING
7.1 Types Of Tests 28
7.1.1 Unit Testing 28
7.1.2 Integration Testing 28
7.1.3 Functional Test 29
7.1.4 System Test 29

iii
7.1.5 White Box Testing 30
7.1.6 Black Box Testing 30
7.1.7 Unit Testing 30
7.1.8 Test Strategy And Approach 30
7.1.9 Test Objectives 31
7.1.10 Features To Be Tested 31
7.2 Integration Testing 31
7.3 Acceptance Testing 32
8 APPLICATION AREAS
8.Application Areas 33
9 SYSTEM STUDY
9.1 Feasibility Study 35
9.1.1 Economical Feasibility 35
9.1.2 Technical Feasibility 35
9.1.3 Social Feasibility 36
10 CONCLUSION & FUTURE
ENCHANCEMENT
10.1 Conclusion 38
10.2 Future Enhancements 38
APPENDIX
A1. Software Environment 40
A2. Sample Code 54
A3.Screen Shots 69
REFERENCES 74

iv
LIST OF FIGURES

FIGURE NO FIGURE NAME PAGE NO

5.1 System Architecture 16


5.2 Data Flow Diagram 18
5.5 Use Case Diagram 20
5.6 Class Diagram 21
5.7 Sequence Diagram 22
5.8 Activity Diagram 23
A3 Screen short 69

v
LIST OF ABBREVATIONS

SVM Support Vector Machine


DNS Domain Name Server
ML Machine Learning
DL Deep Learning
CNN Convolutional neural networks
AI Artificial Intelligence
DL Deep Learning
NLP Natural Language Processing
LSTM Long Short Term Memory
RMI Remote Method Inovation
URL Uniform Resource Locator

vi
CHAPTER – 1

INTRODUCTION

1
1. INTRODUCTION

1.1. GENERAL

A chatbot was a computer programmes that could converse with people


naturally, much like humans do in real life.For many duties like responding to
inquiries, it can take the role of a person. An agent who converses with users in
straightforward English is known as a chatbot. It had been constructed in an effort
to deceive people. Machine learning is a key component of chatbot success in AI,
enabling them to understand user queries and provide the right response..A chatbot
for the college management system has been developed using AI algorithms that
look at user inquiries. To react to the user's questions, artificial intelligence has
been implemented.The user can then obtain the appropriate answers to their
concerns.For quick, accurate, and always-available answers to questions, a chatbot
is required. Deep learning uses high-level, abstract modelling techniques on data to
change nonlinear functions, which are layered and intricately interconnected.A
user must typically start a new topic or ask a question for a chat bot to function.
Software agents that simulate an entity, typically a human, include chat bots.These
programmes use artificial intelligence to comprehend user input and give
thoughtful responses based on predetermined knowledge bases.Command line,
graphical user interface (GUI), menu-driven, pattern, natural language, etc.are all
examples of user interfaces that can be utilized to operate software programmes.
Although GUI and web-based are the two popular user interfaces, there are times
when a different user interface is required. This area is well suited for a chatbot-
based conversational user interface.To work with this generation of pupils,
instructors now face a significant hurdle. Additionally, students who are more
interested in online learning tend to have the ability to view the study materials

2
non-linearly. This conclusion was reached after a thorough investigation into the
various navigational strategies used by pupils to function in a virtual environment.
To improve conversation comprehension, a multi-resolution RNN is used to
represent high-level course and natural language tokens .Contrary to the traditional
conversation systems like ELIZA,which are largely built with hand-crafted rules,
researchers have recently started to develop principled and data-driven approaches
to build open domain conversational systems due to the advantages of the large
scale social conversation data that is publicly available and the rapid advancement
of deep learning approaches.Non-task centred chatbots are gaining popularity
recently,and the secret to creating a chatbot is learning how to respond to messages
in an appropriate (human-like and natural) manner.The approaches currently in use
are either retrieval based or generation based. Nevertheless,because there is still a
problem with the language's library, the server's development is not complete. If
text recognition is possible for chatbots to learn from, an AI will be able to respond
to messages more accurately.Tensorflow training enhances the accuracy of these
chatbots using the convolution neural network technique.

AI is used by chatbots to create a false intelligence that enables them to


understand human questions and respond appropriately. Long Short Term Memory
(LSTM) networks,a particular type of recurrent Deep Neural Networks,and Natural
Language Processing (NLP) networks are used in this system to deliver valid
answers to the users' varied inquiries (DNN).This consists of software that will
help the user converse with a machine by leveraging artificial intelligence. The
remaining of paper as follows: section-II presents proposed system with
methodology. Section-III propounds results and discussion and finally, section-IV
concludes the paper

3
Chatbot was a computer application which may speak to human beings naturally,
the way they interact with one another. It can replace a person's for several tasks of
answering queries. A chatbot is an agent that interacts with users using simple
language. It had been built as an effort to fool humans. Several applications of
chatbots like Customer Service, call centers etc. uses AI terminology to talk with
user. One among the prime goals of chatbots is to resemble an intelligent human
and make it difficult for the receiver of the conversation to know the important
working alongside various architecture and capabilities for his or her usage has
widely broadened. These chatbots can prove sufficient to fool the user into
believing they're “talking” to a person's being, but are very limited in improving
their knowledge domain at runtime, and usually have a very little to no means of
keeping track of all the conversational data. Chatbots makes use of machine
learning to succeed in AI helping them to know the user query and supply an
appropriate response. The chatbots are developed using the synthetic Intelligence
terminology for communicating or interacting with the user.

4
CHAPTER – 2

2. LITERATURE SURVEY

5
2. LITERATURE SURVEY
2.1 Chatbot System for Collage FAQ’s Using Artificial Intelligence
Author: Mr.Ashish Saxena1 , Santosh S.Chinchalli
A chat larva (also called a talk Bot, chatterbox, Artificial informal Entity) may
be a worm that conducts oral communication via sensory system or matter ways.
Such programs are usually designed to convincingly simulate however an
individual's would have as a conversational partner, there by passing the Turing
test. Chat bots are typically employed in dialog systems for numerous sensible
functions as well as client service or information acquisition. This system will be a
web application which can give answers to the queries of the scholars. Students
simply ought to choose the class for the department queries then raise the question
to the larva which will be used for chatting. The answers will be provide
mistreatment the inbuilt computer science algorithms. Students won have to travel
to the college to make the enquiry. The system replies to the user with the help of
effective graphical user interface. The user can query about the college related
activities. Through on-line with the assistance of this internet application.
2.2 College Enquiry Chat-Bot System
Author: Harshala Gawade, Prachi Vishe
Nowadays, many people are using smartphone with many new applications i.e.
technology is growing day by day. Today Artificial Intelligence is playing a major
role in a variety of fields ranging from industries in product manufacturing, to
customer care in public relations. As there are many online Artificial Intelligence
(AI) systems or chat bots which are in existence that help people solve their
problems. So, we are going to implement a virtual assistant based on AI that can
solve any college related query. A chat bot has information stored in its database to
identify the sentences and making a decision itself as response to answer a given

6
question. Designed to convincingly simulate the way a human would behave as a
conversational partner. Bots can be created by using language like Artificial
Intelligence Mark-up Language(AIML), a language based on XML that allow
developer’s write rules for the bot to follow. Another drawback is writing rules for
different scenarios is very time consuming and it is impossible to write rules for
every possible scenario. So these bots can handle simple queries but fail to manage
complex queries.
2.3 Artificially Intelligent Chatbot Universal Research Reports
Author: Nitesh Thakur, Akshay Hiwrale
As Nowadays Technology is getting smarter day by day and helping Humans to
solve their queries. Today Artificial Intelligence is playing a major role in a variety
of fields ranging from industries in product manufacturing, to customer care in
public relations. As there are many online Artificial Intelligence (AI) system or
chat bots are in existence that help people solve their problems. So, our team is
going to implement a system (a virtual assistant) based on AI that can solve any
college related query. As this will help students in fetching the information without
visiting the college or to stand in queue. Students can use this chat bot to get the
answers to their queries in a very easy and fast way. This type of android
applications like Chat Bot project will be built using artificial intelligence
algorithms that will analyze user’s queries and understand user’s message. This
android application will provide answers to the queries of the students. Students
will just have to select the category for the department queries and then ask the
query to the bot that will be used for chatting.
2.4 Chat-Bot For College Management System
Author: Srushti Barve, Supriya Gaikwad

7
Chat-bot also known as a talkbot, chatterbox, Bot is a computer program that
mimics human conversation. A bot is a software which performs tasks
automatically. Basically a bot is a computer program designed for communication
and to get answers through that communication. Most of the Chat-bots are
developed using Artificial Intelligence algorithms. The user have to register and
then login to the bot. After login user can see the page on which queries can be
submitted to get answers so, users don’t need to go personally to the college for
inquiry. Chat-bots are created by the programmer and designed to have
communication and to get answers for queries. In this paper, a proposal is explain
to design a chat bot as a Web application which will be helpful for students to
solve all the problems they face and the questions which arises in their mind during
and after the admission. This proposal explains the implementation of chat bot
system as an application named as, college enquiry chat bot.
2.5 Online Chatting System for College Enquiry using Knowledgeable
Database
Author:Prof.S.A.Bhuskute
A chatterbox or Chatbot aims to make a conversation between both human and
machine. The machine has been embedded knowledge to identify the sentences
and making a decision itself as response to answer a question. The response
principle is matching the input sentence from user .The present technical project
consist of developing an expert System for college enquiry desk using an android
based Chabot, through Artificial Intelligence technology and virtual assistance
(Human-machine conversation),transmitting natural language to a server. Artificial
Intelligent is the fastest growing technology every were in the world. With the help
of Artificial Intelligent and Knowledgeable database. We can make the
transformation in the pattern matching and virtual assistance. A chatbot is a

8
technology that allows users to have natural conversations to access content and
services. Chatbots typically take the form of a chat client, leveraging natural
language processing to conduct a conversation with the user. Chatbots control
conversation flow based on the context of the user’s requests and respond with
natural language phrases to provide direct answers, request additional information
or recommend actions that can be taken.

9
CHAPTER – 3

SYSTEM ANALYSIS

10
3. SYSTEM ANALYSIS
3.1 EXISTING SYSTEM
Now a days there are many changes occurred in the Education system with help
of advanced technology. Everything is happening over the internet without any
trouble. In those days for enquiring about courses we have to visit the college, but as
the days are passing away it’s completing changing. Collecting the course details, fee
structure manually will be hectic procedure and it also needs a manpower. For
reducing that manpower and avoid such difficulties and time consuming many
devices or systems were emerged day by day

Machine Learning Models: Chatbots often use machine learning models like
support vector machines (SVM), decision trees, or deep learning models such as
recurrent neural networks (RNNs) or transformer models like BERT for intent
recognition and response generation

The existing system is not only tedious but also makes a gap between
administration and students. Surfing the website for small information can be
suffering sometimes.

It is rather better to just enter your query and get information on your fingertip.

In previous days for submitting a small application we had to visit that place,
but as the days are passing away it’s completely changing.

Collecting the applications manually will be hectic procedure and it also


needs alot of manpower.

3.1.2. DISADVANTAGES OF EXISTING SYSTEM


Collecting the applications manually will be hectic procedure and it also
needs alot of manpower.

11
The existing system is not only tedious but also makes a gap between
administration and students.
Surfing the website for small information can be suffering sometimes.
3.2 PROPOSED SYSTEM
Chat-bots are motivated by the need of traditional websites to provide a
chat facility where a bot is required to be able to chat with user and solve queries.
Lastly, the most important advantage of having a chat-bot is that it is available
24/7. No matter what time it is, a user can get a query solved.
All these advantages of a chat-bot constitute the motivation to implement a College
Enquiry Chat-bot
Natural Language Understanding (NLU): Deep learning models, such as
recurrent neural networks (RNNs) or transformer models like BERT, would be
used for NLU tasks like intent recognition, entity recognition, and sentiment
analysis. These models would help the chatbot better understand the nuances of
natural language.

3.2.1 ADVANTAGES OF PROPOSED SYSTEM

For the User, there is no need to visit the college personally to enquiry about
thecollege related information.
This system aids the students to be updated with college related activities.
This system is developed aiming at reducing the time for the student, parents
aswell as the faculty at the institution.

12
CHAPTER – 4

SYSTEM SPECIFICATION

13
4. SYSTEM SPECIFICATION

4.1 HARDWARE REQUIREMENTS


• System : Pentium IV 2.4 GHz.
• Hard Disk : 500 GB.
• Floppy Drive : 1.44 MB.
• Monitor : 15 VGA Colour.
• Mouse : Logitech.
• Ram : 8 GB.
4.2 SOFTWARE REQUIREMENTS
• Operating system : Windows 10(64-BIT System).
• Coding Language : Python.
• Software : Visual Studio Code.

14
CHAPTER – 5

SYSTEM DESIGN

15
5. SYSTEM DESIGN

5.1 SYSTEM ARCHITECTURE

Figure:5.1 System Architecture

16
5.2 DATA FLOW DIAGRAM

The DFD is also called as bubble chart. It is a simple graphical formalism


that can be used to represent a system in terms of input data to the system, various
processing carried out on this data, and the output data is generated by this
system.The data flow diagram (DFD) is one of the most important modeling tools.
It is used to model the system components. These components are the system
process, the data used by the process, an external entity that interacts with the
system and the information flows in the system.DFD shows how the information
moves through the system and how it is modified by a series of transformations. It
is a graphical technique that depicts information flow and the transformations that
are applied as data moves from input to output.DFD is also known as bubble chart.
A DFD may be used to represent a system at any level of abstraction. DFD may be
partitioned into levels that represent increasing information flow and functional
detail.

17
Figure:5.2 Data Flow Diagram

18
5.3 UML DIAGRAMS

UML stands for Unified Modeling Language. UML is a standardized general-


purpose modeling language in the field of object-oriented software engineering.
The standard is managed, and was created by, the Object Management Group.
The goal is for UML to become a common language for creating models of
object oriented computer software. In its current form UML is comprised of two
major components: a Meta-model and a notation. In the future, some form of
method or process may also be added to; or associated with, UML.
The Unified Modeling Language is a standard language for specifying,
Visualization, Constructing and documenting the artifacts of software system, as
well as for business modeling and other non-software systems.
The UML represents a collection of best engineering practices that have proven
successful in the modeling of large and complex systems.
The UML is a very important part of developing objects oriented software and
the software development process. The UML uses mostly graphical notations to
express the design of software projects.

5.4 GOALS
The Primary goals in the design of the UML are as follows:
1. Provide users a ready-to-use, expressive visual modeling Language so that
they can develop and exchange meaningful models.
2. Provide extendibility and specialization mechanisms to extend the core
concepts.
3. Be independent of particular programming languages and development
process.

19
5.5 USE CASE DIAGRAM

A use case diagram in the Unified Modeling Language (UML) is a type of


behavioral diagram defined by and created from a Use-case analysis. Its purpose is
to present a graphical overview of the functionality provided by a system in terms
of actors, their goals (represented as use cases), and any dependencies between
those use cases.

Figure:5.3 Use Case Diagram

20
5.6 CLASS DIAGRAM

In software engineering, a class diagram in the Unified Modeling Language


(UML) is a type of static structure diagram that describes the structure of a system
by showing the system's classes, their attributes, operations (or methods), and the
relationships among the classes. It explains which class contains information.

Input Output

Ask a Query Insert into unanswered table

Query processing

Insert into unanswered table Comparing query with


database query

Solution provided

Finally get Classified &


Display Result ( ):

Figure:5.4 Class Diagram

21
5.7 SEQUENCE DIAGRAM

A sequence diagram in Unified Modeling Language (UML) is a kind of


interactiondiagram that shows how processes operate with one another and in what
order. It is a construct of a Message Sequence Chart. Sequence diagrams are
sometimes called event diagrams, event scenarios, and timing diagrams.

Figure:5.5 Sequence Diagram

22
5.8 ACTIVITY DIAGRAM

Activity diagrams are graphical representations of workflows of stepwise


activities and actions with support for choice, iteration and concurrency. activity
diagrams can be used to describe the business and operational step-by-step
workflows of components in a system. An activity diagram shows the overall flow
of control.

Figure:5.6 Activity Diagram

23
CHAPTER – 6

MODULE DESCRIPTION

24
6. MODULE DESCRIPTION

6.1 MODULES
Our project modules are as follows.

 Admin Login
 Add Query And Dataset
 User Login
 Asking Querie
 Providing Feedback
6.2 MODULES DESCSRIPTION
6.2.1 Admin Login
System has one administrator (there is no registration for admin). The
administrator must log in using their username and password. The admin who is in
charge of keeping the college chatbot system up to date has a number of tasks to
complete, such as adding the query to the database, altering the data, deleting the
data, viewing user feedback, and so on.
6.2.2 Add Query And Dataset
If the administrator adds the dataset, the chatbot offers three ways to add the
query:by adding a question, by adding a response, or by choosing the category that
the dataset belongs to. If the administrator views the dataset, the chatbot enables
seeing the dataset by category. The chatbot also offers the two extra alternatives of
deleting and editing the dataset.
6.2.3 User Login
The user is welcomed by the chatbot system, which then asks them for their
login information. Then, the user and the chatbot begin a conversation.After
clicking on the chatbot provided in the college website. The chatbot system greets

25
the user and requests the user to provide the login id. After which the chatbot starts
chatting with the user. When the user proceeds to choose chatbot to get an answer to
his/her query, the chatbot displays a page to select few options regarding college and
identifies his/her category of query. If the user gets his query cleared then the task of
chatbot is completed.
6.2.4 Asking Queries
The chatbot system will ask the user to enter their question in words if they are
not pleased with the rule-based response, and the chatbot will then provide the
appropriate response. The database is first verified for the user's query. The user
receives an acceptable response if the query is genuine. If the question is
unfounded, the chatbot invites the user to ask questions about the college.
6.2.5 Providing Feedback
After the chat, the chatbot takes feedback from the user. Feedback is
taken in order to know the users experience with the chatbot. If the user gives
feedback positively then the bot thanks the user and provides a box to enter any
further queries. If the user gives feedback negatively then bot asks the user to
elaborate his/her query in order to respond. Username of the user is also stored and
phone number provided to helps users to track user actions.

26
CHAPTER – 7

SYSTEM TESTING

27
7. SYSTEM TESTING
The purpose of testing is to discover errors. Testing is the process of trying to
discover every conceivable fault or weakness in a work product. It provides a way
to check the functionality of components, sub assemblies, assemblies and/or a
finished product It is the process of exercising software with the intent of ensuring
that the Software system meets its requirements and user expectations and does not
fail in an unacceptable manner. There are various types of test. Each test type
addresses a specific testing requirement.

7.1 TYPES OF TESTS


7.1.1 UNIT TESTING
Unit testing involves the design of test cases that validate that the internal
program logic is functioning properly, and that program inputs produce valid
outputs. All decision branches and internal code flow should be validated. It is the
testing of individual software units of the application .it is done after the
completion of an individual unit before integration. This is a structural testing, that
relies on knowledge of its construction and is invasive. Unit tests perform basic
tests at component level and test a specific business process, application, and/or
system configuration. Unit tests ensure that each unique path of a business process
performs accurately to the documented specifications and contains clearly defined
inputs and expected results.

7.1.2 INTEGRATION TESTING


Integration tests are designed to test integrated software components to
determine if they actually run as one program. Testing is event driven and is more
concerned with the basic outcome of screens or fields. Integration tests
demonstrate that although the components were individually satisfaction, as shown

28
by successfully unit testing, the combination of components is correct and
consistent. Integration testing is specifically aimed at exposing the problems that
arise from the combination of components.

7.1.3 FUNCTIONAL TEST


Functional tests provide systematic demonstrations that functions tested are
available as specified by the business and technical requirements, system
documentation, and user manuals.

Functional testing is centered on the following items:

Valid Input : identified classes of valid input must be accepted.

Invalid Input : identified classes of invalid input must be rejected.

Functions : identified functions must be exercised.

Output : identified classes of application outputs must be exercised.

Systems/Procedures: interfacing systems or procedures must be invoked.

Organization and preparation of functional tests is focused on requirements, key


functions, or special test cases. In addition, systematic coverage pertaining to
identify Business process flows; data fields, predefined processes, and successive
processes must be considered for testing. Before functional testing is complete,
additional tests are identified and the effective value of current tests is determined.

7.1.4 SYSTEM TEST


System testing ensures that the entire integrated software system meets
requirements. It tests a configuration to ensure known and predictable results. An
example of system testing is the configuration oriented system integration test.

29
System testing is based on process descriptions and flows, emphasizing pre-driven
process links and integration points.

7.1.5 WHITE BOX TESTING


White Box Testing is a testing in which in which the software tester has
knowledge of the inner workings, structure and language of the software, or at least
its purpose. It is purpose. It is used to test areas that cannot be reached from a black
box level.

7.1.6 BLACK BOX TESTING


Black Box Testing is testing the software without any knowledge of the inner
workings, structure or language of the module being tested. Black box tests, as
most other kinds of tests, must be written from a definitive source document, such
as specification or requirements document, such as specification or requirements
document. It is a testing in which the software under test is treated, as a black box
.you cannot “see” into it. The test provides inputs and responds to outputs without
considering how the software works

7.1.7 UNIT TESTING

Unit testing is usually conducted as part of a combined code and unit test phase
of the software lifecycle, although it is not uncommon for coding and unit testing
to be conducted as two distinct phases.

7.1.8 TEST STRATEGY AND APPROACH


Field testing will be performed manually and functional tests will be written in
detail.

30
7.1.9 TEST OBJECTIVES

All field entries must work properly.


Pages must be activated from the identified link.
The entry screen, messages and responses must not be delayed.
7.1.10 FEATURES TO BE TESTED

Verify that the entries are of the correct format


No duplicate entries should be allowed
All links should take the user to the correct page.
7.2 INTEGRATION TESTING
Software integration testing is the incremental integration testing of two or
more integrated software components on a single platform to produce failures
caused by interface defects. The task of the integration test is to check that
components or software applications, e.g. components in a software system or –
one step up – software applications at the company level – interact without error.

Test Results: All the test cases mentioned above passed successfully. No defects
encountered.

7.3 ACCEPTANCE TESTING


User Acceptance Testing is a critical phase of any project and requires
significant participation by the end user. It also ensures that the system meets the
functional requirements.

31
CHAPTER – 8

APPLICATION AREAS

32
8. APPLICATION AREAS

A smart college enquiry chatbot using deep learning algorithms can find
application in streamlining various aspects of student services and administrative
tasks within a college or university. It can be used to provide quick and accurate
responses to inquiries related to admissions, course information, enrollment
procedures, campus facilities and services, as well as general questions about
college events and activities. By leveraging deep learning algorithms, the chatbot
can continuously improve its responses based on user interactions, offering a more
personalized and efficient way to engage with students, faculty, and staff.
Additionally, such a chatbot can help reduce the workload on administrative staff,
allowing them to focus on more complex tasks while enhancing the overall student
experience.

33
CHAPTER – 9

SYSTEM STUDY

34
9. SYSTEM STUDY

9.1 FEASIBILITY STUDY

The feasibility of the project is analyzed in this phase and business proposal is
put forth with a very general plan for the project and some cost estimates. During
system analysis the feasibility study of the proposed system is to be carried out.
This is to ensure that the proposed system is not a burden to the company. For
feasibility analysis, some understanding of the major requirements for the system
is essential.
Three key considerations involved in the feasibility analysis are

Economical Feasibility
Technical Feasibility
Social Feasibility
9.1.1 ECONOMICAL FEASIBILITY

This study is carried out to check the economic impact that the system will
have on the organization. The amount of fund that the company can pour into the
research and development of the system is limited. The expenditures must be
justified. Thus the developed system as well within the budget and this was
achieved because most of the technologies used are freely available. Only the
customized products had to be purchased.

9.1.2 TECHNICAL FEASIBILITY

This study is carried out to check the technical feasibility, that is, the technical
requirements of the system. Any system developed must not have a high demand
on the available technical resources. This will lead to high demands on the
available technical resources. This will lead to high demands being placed on the

35
client. The developed system must have a modest requirement, as only minimal or
null changes are required for implementing this system.

9.1.3 SOCIAL FEASIBILITY

The aspect of study is to check the level of acceptance of the system by the
user. This includes the process of training the user to use the system efficiently.
The user must not feel threatened by the system, instead must accept it as a
necessity. The level of acceptance by the users solely depends on the methods that
are employed to educate the user about the system and to make him familiar with
it. His level of confidence must be raised so that he is also able to make some
constructive criticism, which is welcomed, as he is the final user of the system.

36
CHAPTER – 10

CONCLUSION & FUTURE ENCHANCEMENT

37
10. CONCLUSION & FUTURE ENCHANCEMENT

10.1 CONCLUSION

The proposed system is used to deliver responses in relation to user input.


User-submitted questions will receive responses from this system. The primary
goal of this project is to create an interface and a database that will record data on
questions, responses, keywords, and questions that aren't valid.the system is the
Reduced workload for college employees and faster user query responses are two
additional major goals. A web-based chatbot system that combines Deep Learning-
based techniques for this. The system virtually always provided the consumers
with the right answers to their concerns. For this chatbot system, performance and
accuracy are very important, and response time is also quite fast.

10.2 FUTURE ENHANCEMENTS

To improve the current functionalities of College Enquiry Chatbot, in the


future, the scope of the chatbot can be increased by inserting data for all the
departments, training the bot with varied data, testing it on live website, and based
on that feedback inserting more training data to the bot. Some of the new features
which can be added to the bot are speech recognition feature through which
students can ask their queries verbally and get the answers from the Chatbot.:

38
APPENDIX 1

SOFTWARE ENVIRONMENT

39
A1. SOFTWARE ENVIRONMENT

A1.2.1.1 Python

Python is a high-level, interpreted, interactive and object-oriented scripting


language. Python is designed to be highly readable. It uses English keywords
frequently where as other languages use punctuation, and it has fewer syntactical
constructions than other languages.

Python is Interpreted − Python is processed at runtime by the interpreter. You


do not need to compile your program before executing it. This is similar to
PERL and PHP.

Python is Interactive − You can actually sit at a Python prompt and interact
with the interpreter directly to write your programs.

Python is Object-Oriented − Python supports Object-Oriented style or


technique of programming that encapsulates code within objects.

Python is a Beginner's Language − Python is a great language for the


beginner-level programmers and supports the development of a wide range of
applications from simple text processing to WWW browsers to games.

A1.2.1.2 History of Python

Python was developed by Guido van Rossum in the late eighties and early
nineties at the National Research Institute for Mathematics and Computer Science
in the Netherlands.

Python is derived from many other languages, including ABC, Modula-3, C, C++,
Algol-68, SmallTalk, and Unix shell and other scripting languages.

40
Python is copyrighted. Like Perl, Python source code is now available under the
GNU General Public License (GPL).

Python is now maintained by a core development team at the institute, although


Guido van Rossum still holds a vital role in directing its progress.

A1.2.1.3 Python Features

Python's features include −

Easy-to-learn − Python has few keywords, simple structure, and a clearly defined
syntax. This allows the student to pick up the language quickly.

Easy-to-read − Python code is more clearly defined and visible

to the eyes. Easy-to-maintain − Python's source code is fairly

easy-to-maintain.

A broad standard library − Python's bulk of the library is very portable and
cross-platform compatible on UNIX, Windows, and Macintosh.

Interactive Mode − Python has support for an interactive mode which allows
interactive testing and debugging of snippets of code.

Portable − Python can run on a wide variety of hardware platforms and has the
same interface on all platforms.

Extendable − You can add low-level modules to the Python interpreter. These
modules enable programmers to add to or customize their tools to be more
efficient.

Databases − Python provides interfaces to all major commercial databases.

41
GUI Programming − Python supports GUI applications that can be created and
ported to many system calls, libraries and windows systems, such as Windows MFC,
Macintosh, and the X Window system of Unix.
Scalable − Python provides a better structure and support for large programs
than shell scripting.
Apart from the above-mentioned features, Python has a big list of good features,
few are listed below −

It supports functional and structured programming methods as well as OOP.

It can be used as a scripting language or can be compiled to byte-code for


building large applications.

It provides very high-level dynamic data types and supports dynamic

type checking. It supports automatic garbage collection.

It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.

Python is available on a wide variety of platforms including Linux and Mac


OS X. Let's understand how to set up our Python environment.

A1.2.1.3.1 Getting Python

The most up-to-date and current source code, binaries, documentation, news, etc.,
is available on the official website of Python https://www.python.org.

Windows Installation

Here are the steps to install Python on Windows machine.

 Open a Web browser and go to https://www.python.org/downloads/.

 Follow the link for the Windows installer python-XYZ.msifile where XYZ

42
is the version you need to install.
 To use this installer python-XYZ.msi, the Windows system must support
Microsoft Installer 2.0. Save the installer file to your local machine and then
run it to find out if your machine supports MSI.

 Run the downloaded file. This brings up the Python install wizard, which is
really easy to use. Just accept the default settings, wait until the install is
finished, and you are done.

The Python language has many similarities to Perl, C, and Java. However, there
are some definite differences between the languages.

First Python Program


Let us execute programs in different modes of programming.

Interactive Mode Programming


Invoking the interpreter without passing a script file as a parameter brings up the
following prompt –

$ python

Python2.4.3(#1,Nov112010,13:34:43)

[GCC 4.1.220080704(RedHat4.1.2-48)] on linux2

Type"help","copyright","credits"or"license"for more information.

Type the following text at the Python prompt and press the Enter –

print"Hello, Python!"

If you are running new version of Python, then you would need to use print
statement with parenthesis as in print ("Hello, Python!");. However in Python

43
version 2.4.3, this produces the following result −
Script Mode Programming

Hello, Python!

Invoking the interpreter with a script parameter begins execution of the script and
continues until the script is finished. When the script is finished, the interpreter is
no longer active.

Let us write a simple Python program in a script. Python files have extension .py.
Type the following source code in a test.py file –

print"Hello, Python!"

We assume that you have Python interpreter set in PATH variable. Now, try to
run this program as follows –

$ python test.py

This produces the following result –

Hello, Python!

Flask Framework

Flask is a web application framework written in Python. Armin Ronacher,


who leads an international group of Python enthusiasts named Pocco, develops it.
Flask is based on Werkzeug WSGI toolkit and Jinja2 template engine. Both are
Pocco projects.

Http protocol is the foundation of data communication in world wide web.


Different methods of data retrieval from specified URL are defined in this
protocol.The following table summarizes different http methods –

44
Sr.No Methods & Description

GET

Sends data in unencrypted form to the server. Most common method.

HEAD

Same as GET, but without response body

POST

Used to send HTML form data to server. Data received by POST method is not
cached by server.

PUT

Replaces all current representations of the target resource with the uploaded
content.

DELETE

Removes all current representations of the target resource given by a URL

By default, the Flask route responds to the GET requests. However, this
preference can be altered by providing methods argument to route() decorator.

In order to demonstrate the use of POST method in URL routing, first let us
create an HTML form and use the POST method to send form data to a URL.

Save the following script as login.html

<html>

<body>

<formaction="http://localhost:5000/login"method="post">

45
<p>Enter Name:</p>

<p><inputtype="text"name="nm"/></p>

<p><inputtype="submit"value="submit"/></p>

</form>

</body>

</html>

Now enter the following script in Python shell.

from flask importFlask, redirect,url_for, request

app=Flask( name )

@app.route('/success/<name>')

def success(name):

return'welcome %s'% name

@app.route('/login',methods=['POST','GET'])

def login():

ifrequest.method=='POST':

user=request.form['nm']

return redirect(url_for('success',name= user))

else:

user=request.args.get('nm')

return redirect(url_for('success',name= user))

46
if name ==' main ':

app.run(debug =True)

After the development server starts running, open login.html in the browser, enter
name in the text field and click Submit.

Form data is POSTed to the URL in action clause of form tag.

http://localhost/login is mapped to the login() function. Since the server has


received data by POST method, value of ‘nm’ parameter obtained from the form
data is obtained by −

user = request.form['nm']

It is passed to ‘/success’ URL as variable part. The browser displays


a welcome message in the window.

Change the method parameter to ‘GET’ in login.html and open it again in the
browser. The data received on server is by the GET method. The value of ‘nm’
parameter is now obtained by –

User = request.args.get(‘nm’)

Here, args is dictionary object containing a list of pairs of form parameter and its
corresponding value. The value corresponding to ‘nm’ parameter is passed on to
‘/success’ URL as before.

Python is a popular programming language. It was created in 1991 by Guido van


Rossum.
It is used for:
 web development (server-side),

47
 software development,
 mathematics,
 system scripting.
A1.2.1.4 What can Python do
Python can be used on a server to create web applications.
Python can be used alongside software to create workflows.
Python can connect to database systems. It can also read and modify files.
Python can be used to handle big data and perform complex mathematics.
Python can be used for rapid prototyping, or for production-ready software
development.
A1.2.1.4.1Why Python
Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc).
Python has a simple syntax similar to the English language.
Python has syntax that allows developers to write programs with fewer lines
than some other programming languages.
Python runs on an interpreter system, meaning that code can be executed as
soon as it is written. This means that prototyping can be very quick.
Python can be treated in a procedural way, an object-orientated way or a
functional way.
Good to know
The most recent major version of Python is Python 3, which we shall be using
in this tutorial. However, Python 2, although not being updated with anything
other than security updates, is still quite popular.
In this tutorial Python will be written in a text editor. It is possible to write
Python in an Integrated Development Environment, such as Thonny, Pycharm,

48
Netbeans or Eclipse which are particularly useful when managing larger
collections of Python files.
Python Syntax compared to other programming languages
Python was designed to for readability, and has some similarities to the English
language with influence from mathematics.
Python uses new lines to complete a command, as opposed to other
programming languages which often use semicolons or parentheses.
Python relies on indentation, using whitespace, to define scope; such as the
scope of loops, functions and classes. Other programming languages often use
curly-brackets for this purpose.

A1.2.5 Python Install

Many PCs and Macs will have python already installed.

To check if you have python installed on a Windows PC, search in the start bar for
Python or run the following on the Command Line (cmd.exe):

C:\Users\Your Name>python --version

To check if you have python installed on a Linux or Mac, then on linux open the
command line or on Mac open the Terminal and type:

python --version

If you find that you do not have python installed on your computer, then you can
download it for free from the following website: https://www.python.org/

A1.2.6 Python Quickstart

Python is an interpreted programming language, this means that as a developer you


write Python (.py) files in a text editor and then put those files into the python
interpreter to be executed.

The way to run a python file is like this on the command line:

49
C:\Users\Your Name>python helloworld.py

Where "helloworld.py" is the name of your python file.

Let's write our first Python file, called helloworld.py, which can be done in any
text editor.

helloworld.py

print("Hello, World!")

Simple as that. Save your file. Open your command line, navigate to the directory
where you saved your file, and run:

C:\Users\Your Name>python helloworld.py

The output should read:

Hello, World!

Congratulations, you have written and executed your first Python program.
A1.2.7 The Python Command Line

To test a short amount of code in python sometimes it is quickest and easiest not to
write the code in a file. This is made possible because Python can be run as a
command line itself.

Type the following on the Windows, Mac or Linux command line:

C:\Users\Your Name>python

From there you can write any python, including our hello world example from
earlier in the tutorial:

C:\Users\Your Name>python

Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)]
on win32

Type "help", "copyright", "credits" or "license" for more information.

50
>>> print("Hello, World!")

Which will write "Hello, World!" in the command line:

C:\Users\Your Name>python

Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)]
on win32

Type "help", "copyright", "credits" or "license" for more information.

>>> print("Hello, World!")Hello, World!

Whenever you are done in the python command line, you can simply type the
following to quit the python command line interface:

exit()
Execute Python Syntax
As we learned in the previous page, Python syntax can be executed by writing
directly in the Command Line:
>>> print("Hello, World!")Hello, World!
Or by creating a python file on the server, using the .py file extension, and running
it in the Command Line:
C:\Users\Your Name>python myfile.py
Python Indentations
Where in other programming languages the indentation in code is for readability
only, in Python the indentation is very important.
Python uses indentation to indicate a block of code.
Example
if 5 > 2:
print("Five is greater than two!")
Python will give you an error if you skip the indentation:

51
Example
if 5 > 2:
print("Five is greater than two!")
Comments
Python has commenting capability for the purpose of in-code documentation.
Comments start with a #, and Python will render the rest of the line as a comment:
Example
Comments in Python:
#This is a comment.print("Hello, World!")
Docstrings
Python also has extended documentation capability, called docstrings.
Docstrings can be one line, or multiline.
Python uses triple quotes at the beginning and end of the docstring:
Example
Docstrings are also comments:
"""Thisis a multiline docstring."""print("Hello, World!")

52
APPENDIX 2

SOURCE CODE

53
A2. SOURCE CODE

from flask import


Flask,render_template,request,redirect,url_for import
tflearn
import numpy as
np import
pickle,random
import json
import
sqlite3
import nltk
from nltk.stem.lancaster import
LancasterStemmer stemmer =
LancasterStemmer()
import ms as ms
app = Flask( name )
with open("assets/input_data.pickle", "rb")
as f: words, labels, training, output =
pickle.load(f)
with open("assets/intents.json") as
myfile: data = json.load(myfile)
#tf.reset_default_graph()
network = tflearn.input_data(shape=[None,
len(training[0])]) network =
tflearn.fully_connected(network,8)
network = tflearn.fully_connected(network,8)

54
network =
tflearn.fully_connected(network,len(output[0]),activation="softmax"
) network = tflearn.regression(network)
model = tflearn.DNN(network)
model.load("assets/model.chatbot.tflearn"
) chats=[]
@app.route("/")
#home def hello():
return
render_template("home.html")
@app.route('/logon')
def logon():
return
render_template('signup.html')
@app.route('/login')
def login():
return
render_template('signin.html')
@app.route("/signup")
def signup():
username =
request.args.get('user','') name
= request.args.get('name','')
email =
request.args.get('email','')
number =
request.args.get('mobile','')

55
password =
request.args.get('password','') con =
sqlite3.connect('signup.db')
cur = con.cursor()
cur.execute("insert into `info` (`user`,`email`, `password`,`mobile`,`name`)
VALUES (?, ?, ?,
?,
?)",(username,email,password,number,
name)) con.commit()
con.close()
return
render_template("signin.html")
@app.route("/signin")
def signin():
mail1 = request.args.get('user','')
password1 =
request.args.get('password','') con =
sqlite3.connect('signup.db')
cur = con.cursor()
cur.execute("select `user`, `password` from info where `user` = ? AND `password`
=
?",(mail1,password
1,)) data =
cur.fetchone() if
data == None:
return render_template("signin.html")
elif mail1 == 'admin' and password1 == 'admin':

56
return render_template("form.html")
elif mail1 == str(data[0]) and password1 ==
str(data[1]): return
render_template("form.html")
else:
return
render_template("signup.html")
@app.route('/form')
def form():
return render_template('form.html')
@app.route("/start",methods=['POST','
GET']) def start():
inp = [str(x) for x in
request.form.values()] print(inp[0])
#return
render_template('chat_bot.html',result=inp[0])
results =
model.predict([bag_of_words(inp[0],words)])[0]
print(results)
results_index =
np.argmax(results) tag =
labels[results_index]
print(tag)
if results[results_index] < 0.8 or
len(inp[0])<2:
email="[email protected]"

57
Msg="Chat bot not able to answer for this
question"+inp ms.process(email,Msg)
result ="Sorry, I didn't get you. Please try again. Kindly make live chat to
6382621629" else:
for tg in data['intents']:
if tg['tag'] == tag:
responses =
tg['responses']
result=""+random.choice(response
s)
es= ["Sad to see you go :(", "Talk to you later", "Goodbye!", "See you
later","bye-bye"] if result in es:
email="[email protected]"

Msg="Chat bot not able to answer for this


question"+str(inp[0]) ms.process(email,Msg)
result+="Kindly make live chat to
6382621629" #result ="Sorry, I didn't get
you. Please try again."
chats.append("You: " +
inp[0])
chats.append(result)
return render_template('form.html',chats=chats[::-
1],type="") def bag_of_words(s,words):
bag = [0 for _ in
range(len(words))] s_words =
nltk.word_tokenize(s)

58
s_words = [stemmer.stem(word.lower()) for word in
s_words] for se in s_words:
for i,w in
enumerate(words)
: if w == se:
bag[i] =
1 return np.array(bag)
# start()
if name ==" main__":
app.run(debug=True)
import json
import numpy as
np import
random import
pickle import
tflearn
import tensorflow
as tf import os

import nltk

from nltk.stem.lancaster import


LancasterStemmer import ms as ms
stemmer = LancasterStemmer()

with open("assets/intents.json") as myfile:

data =
json.load(myfile)

59
try:
a
with open("assets/input_data.pickle",
"rb") as f: words, labels, training, output
= pickle.load(f) except:
words =
[] labels
= []
docs_x =
[] docs_y
= []
for intent in data["intents"]:

for pattern in intent["patterns"]:

wrds = nltk.word_tokenize(pattern) #break the sentences


into words words.extend(wrds)
docs_x.append(wrds)

docs_y.append(intent["tag"])
if intent["tag"] not in

labels:

labels.append(intent["ta

g"])

words = [stemmer.stem(w.lower()) for w in words if

60
w != "?"] words = sorted(list(set(words)))

labels = sorted(labels)
#one hot encoding --- bag of words
training = []
output = []

out_empty = [0 for _ in
range(len(labels))] for x,doc in
enumerate(docs_x):
bag = []
wrds = [stemmer.stem(w) for w
in doc] for w in words:#all
if w in
wrds:#current
bag.append(1)
else:
bag.append(0)
output_row = out_empty[:] #copy
output_row[labels.index(docs_y[x
])] = 1 #print("\n bag: "+str(bag))
#print("\n row: "+str(output_row))

training.append(bag)
output.append(output_r
ow) training =
np.array(training)
output =

61
np.array(output)
with open("assets/input_data.pickle",
"wb") as f: pickle.dump((words, labels,
training, output),f)
tf.compat.v1.reset_default_graph()
network = tflearn.input_data(shape=[None,
len(training[0])]) network =
tflearn.fully_connected(network,8)
network = tflearn.fully_connected(network,8)

network =
tflearn.fully_connected(network,len(output[0]),activation="softmax"
) network = tflearn.regression(network)
model = tflearn.DNN(network)
if
os.path.exists("model.chatbot.tflearn.
meta"):
model.load("model.chatbot.tflearn")
else:
model.fit(training, output, n_epoch=1000, batch_size=8,
show_metric=True) model.save("model.chatbot.tflearn")
def bag_of_words(s,words):
bag = [0 for _ in
range(len(words))] s_words =
nltk.word_tokenize(s)
s_words = [stemmer.stem(word.lower()) for word in
s_words] for se in s_words:

62
for i,w in enumerate(words):

if w == se:

bag[i] = 1

return
np.array(bag) def
start_chat():
print("\n\nBot is ready to talk to you. (type 'quit'
to stop) ") while True:
inp = input("You: ")

if inp.lower() in ["quit","exit"]:
break
results =
model.predict([bag_of_words(inp,words)])[0]
#print(results)
results_index =
np.argmax(results) tag =
labels[results_index]
#print(tag)
if results[results_index] < 0.8 or len(inp)<2:

print("Bot: Sorry, I didn't get you. Please try again.\n Kindly make live chat to
6382621629") email="[email protected]"

63
Msg="Chat bot not able to anser for this question"+inp

ms.process(email,Msg
) else:
for tg in data['intents']:

if tg['tag'] == tag:
responses = tg['responses']
print("Bot:
"+random.choice(responses)+"\n")
start_chat()

import json
import numpy as
np import
random import
pickle import
tflearn
import tensorflow
as tf import os
import nltk
from nltk.stem.lancaster import
LancasterStemmer import ms as ms
stemmer = LancasterStemmer()
with open("assets/intents.json") as myfile:

data =
json.load(myfile)
try:

64
a
with open("assets/input_data.pickle",
"rb") as f: words, labels, training, output
= pickle.load(f) except:
words =
[] labels
= []
docs_x =
[] docs_y
= []
for intent in data["intents"]:
for pattern in intent["patterns"]:
wrds = nltk.word_tokenize(pattern) #break the sentences
into words words.extend(wrds)
docs_x.append(wrds)
docs_y.append(intent["ta
g"]) if intent["tag"] not in
labels:
labels.append(intent["tag
"])

words = [stemmer.stem(w.lower()) for w in words if


w != "?"] words = sorted(list(set(words)))
labels = sorted(labels)
#one hot encoding --- bag of words
training = []
output = []

65
out_empty = [0 for _ in
range(len(labels))] for x,doc in
enumerate(docs_x):
bag = []
wrds = [stemmer.stem(w) for w
in doc] for w in words:#all
if w in
wrds:#current
bag.append(1)
else:
bag.append(0)
output_row = out_empty[:]
#copy
output_row[labels.index(docs_y[x
])] = 1 #print("\n bag: "+str(bag))

#print("\n row:
"+str(output_row))
training.append(bag)
output.append(output_row)
training = np.array(training)
output = np.array(output)
with open("assets/input_data.pickle",
"wb") as f: pickle.dump((words, labels,
training, output),f)
tf.compat.v1.reset_default_graph()
network = tflearn.input_data(shape=[None,

66
len(training[0])]) network =
tflearn.fully_connected(network,8)
network = tflearn.fully_connected(network,8)
network =
tflearn.fully_connected(network,len(output[0]),activation="softmax"
) network = tflearn.regression(network)
model = tflearn.DNN(network)
if
os.path.exists("model.chatbot.tflearn.m
eta"):
model.load("model.chatbot.tflearn")
else:

model.fit(training, output, n_epoch=1000, batch_size=8, show_metric=True)


model.save("model.chatbot.tflea
rn") def bag_of_words(s,words):
bag = [0 for _ in
range(len(words))] s_words =
nltk.word_tokenize(s)
s_words = [stemmer.stem(word.lower()) for word in
s_words] for se in s_words:
for i,w in enumerate(words):
if w == se:

bag[i] = 1
return
np.array(bag) def

67
start_chat():
print("\n\nBot is ready to talk to you. (type 'quit'
to stop) ") while True:
inp = input("You: ")
if inp.lower() in ["quit","exit"]:
break
results =
model.predict([bag_of_words(inp,words)])[0]
#print(results)

results_index =
np.argmax(results) tag =
labels[results_index]
#print(tag)
if results[results_index] < 0.8 or len(inp)<2:

print("Bot: Sorry, I didn't get you. Please try again.\n Kindly make live chat
to 63826229") email="[email protected]"
Msg="Chat bot not able to anser for this
question"+inp ms.process(email,Msg)
else:

for tg in data['intents']
if tg['tag'] == tag:
responses = tg['responses']
print("Bot:
"+random.choice(responses)+"\n")
start_chat()

68
APPENDIX 3

SCREEN SHOTS

69
A3.SCREEN SHOTS

Fig A3.1.Home page from

70
Fig A3:2.Login from

71
Fig A3:3. User Register page

Fig A3:4. Chat Application for college enquiry

72
Fig A3:5. This is Ask Question reply data

73
FigA3:6. This is gmail page to send user Feedback Manager

74
REFERENCES

1. B. Liu et al., "Content-Oriented User Modeling for Personalized Response


Ranking in Chatbots," in IEEE/ACM Transactions on Audio, Speech, and
Language Processing, vol. 26, no. 1, pp. 122-133, Jan. 2018, doi:
10.1109/TASLP.2017.2763243.
2. CP, Mallikarjuna Gowda, Anupam Srivastava, Shubham Chakraborty, Anurag
Ghosh, and Harsh Raj. "Development of information technology telecom chatbot:
An artificial intelligence and machine learning approach." In 2021 2nd
International Conference on Intelligent Engineering and Management (ICIEM), pp.
216-221. IEEE, 2021.
3. Koundinya, Hrushikesh, Ajay Krishna Palakurthi, Vaishnavi Putnala, and
Ashok Kumar. "Smart college chatbot using ML and Python." In 2020
International Conference on System, Computation, Automation and Networking
(ICSCAN), pp. 1-5. IEEE, 2020.
4. Kulkarni, Chaitrali S., Amruta U. Bhavsar, Savita R. Pingale, and Satish S.
Kumbhar. "BANK CHAT BOT–an intelligent assistant system using NLP and
machine learning." International Research Journal of Engineering and Technology
4, no. 5 (2017): 2374-2377.
5. Lalwani, Tarun, Shashank Bhalotia, Ashish Pal, Vasundhara Rathod, and
Shreya Bisen. "Implementation of a Chatbot System using AI and NLP."
International Journal of Innovative Research in Computer Science & Technology
(IJIRCST) Volume-6, Issue-3 (2018).
6. Prasomphan, Sathit. "Improvement of chatbot in trading system for SMEs by
using deep neural network." In 2019 IEEE 4th International Conference on Cloud

75
Computing and Big Data Analysis (ICCCBDA), pp. 517-522. IEEE, 2019
7. susanna, Ms Ch Lavanya, R. Pratyusha, P. Swathi, P. Rishi Krishna, and V. Sai
Pradeep. "College enquiry chatbot." International Research Journal of Engineering
and Technology (IRJET) 7, no. 3 (2020): 784-788.
8. Wu, Yu, Zhoujun Li, Wei Wu, and Ming Zhou. "Response selection with topic
clues for retrieval-based chatbots." Neurocomputing 316 (2018): 251-261. 10.
Windiatmoko, Yurio, Ridho Rahmadi, and Ahmad Fathan Hidayatullah.
"Developing facebook chatbot based on deep learning using rasa framework for
university enquiries." In IOP conference series: materials science and engineering,
v.ol. 1077, no. 1, p. 012060. IOP Publishing, 2021.
9. Yan, R., 2018, July. ” chitty-chitty-chat bot”: deep learning for convensational AI.
In IJCAI (vol. 18, pp. 5520-5526).

76

You might also like