Final Year Project Report
Final Year Project Report
A PROJECT REPORT
Submitted by
BACHELOR OF ENGINEERING
In
MAY 2024
ANNA UNIVERSITY: CHENNAI 600 025
BONAFIDE CERTIFICATE
Certified that this project report titled ”AI CHATBOT FOR GOVERNMENT
SCHEMES” is the bonafide work of PETCHI RAJA E (950020104306), ANAND S
(950020104701) , ARUN KUMAR S (950020104701) who carried out the project work
under my supervision.
Dr.C.AKILA Dr.T.BRINDA
Tirunelveli-627007 Tirunelveli-627007
We are also indebted to all the teaching and non-teaching staff members of
our college for helping us directly or indirectly by all means throughout the course
of our study and project work.
PETCHI RAJA E
ANAND S
ARUN KUMAR S
ABSTRACT
Accessing government schemes can be daunting for citizens due to the complexity
of information and the lack of personalized guidance. Many individuals struggle to
navigate through various programs, leading to underutilization of beneficial initiatives.
To address this challenge, a user-friendly chatbot system has been proposed. Leveraging
dynamic surveys and machine learning, this innovative solution aims to revolutionize the
way citizens interact with government schemes. The proposed chatbot acts as a virtual
assistant, providing tailored information about available programs and eligibility criteria.
Through continuous learning and adaptation enabled by machine learning algorithms, the
chatbot ensures accurate and personalized responses to user queries. Its intuitive interface
simplifies the process of accessing information, making it accessible to a wide range of
users. In evaluating the system's effectiveness, user feedback and performance metrics
demonstrate significant improvements in citizen engagement with government initiatives.
In summary, this project demonstrates how technology can enhance citizen access to
government services, empowering individuals to make informed decisions and participate
actively in programs tailored to their needs. By bridging the gap between citizens and
government schemes, this chatbot solution fosters a sense of empowerment and
encourages greater engagement with beneficial initiatives.
TABLE OF CONTENTS
ABSTRACT IV
LIST OF FIGURES VII
LIST OF TABLES VI
II
LIST OF ABBREVIATIONS IX
1 INTRODUCTION 1
1.1 Objective 1
1.2 Problem Description 2
1.3 Literature Review 2
2 SYSTEM DESCRIPTION 4
2.1 SYSTEM REQUIREMENTS 4
2.1.1 Hardware Requirements 4
2.1.2 Software Requirements 4
2.1.3 HTML,CSS 4
2.1.4 Python 5
2.1.5 Javascript 8
2.1.6 Sqlite 9
2.2 SYSTEM ANALYSIS 10
2.2.1 Existing System 10
2.2.2 Proposed Work 10
3 SYSTEM DESIGN 12
3.1 Architecture Diagram 12
3.2 Data Flow Diagram 13
3.2.1 DFD Level 0 13
3.2.2 DFD Level 1 14
3.2.3 DFD Level 2 15
ER Entity Relationship
INTRODUCTION
The aim is to build a chatbot that acts like a helpful guide, providing clear and
understandable information about government schemes. By simplifying complex details
and using language that everyone can understand, the goal is to make it easier for people
to learn about the support available to them. The focus is on creating a user-friendly
experience that empowers individuals to take advantage of government programs
confidently. Through this project, the hope is to foster greater awareness and
participation in government initiatives, ultimately contributing to the well-being and
prosperity of the community.
1.1 OBJECTIVE
1
1.2 PROBLEM DESCRIPTION
Understanding government schemes can be hard because it's all over the place and
not easy to understand. Visiting government offices or searching online takes a lot of
time and can be confusing. This project aims to make it easy for everyone. It's making a
friendly chatbot that talks like a friend and explains government stuff in a simple way.
So, anyone can ask questions and understand what they need. The goal is to help people
know about government programs and how they can help. By using this chatbot, people
can learn about government support without any hassle. With clear explanations and easy
access, individuals can make informed decisions and access the help they need.
1.3.1.1 Advantages
.
1.3.1.2 Disadvantages
2
● Limited customization options for specific use cases.
3
1.3.2 Website name: AskKBCI
1.3.2.1 Advantages
1.3.2.2 Disadvantages
4
CHAPTER 2
SYSTEM DESCRIPTION
2.1.3 HTML
HTML stands for Hyper Text Mark-up Language. It is used to describe the
webpage. It consists of many mark-up tags. Each tag is used for different purpose. We use
HTML to put our data on webpage. It is used to put any type of text on webpage.
CSS
CSS stands for Cascading Style Sheet. It is used to change the appearance of the
content of the webpage. CSS is a style sheet language used for describing the presentation of
a document written in a mark-up language like HTML.
5
There are three types of CSS:
6
Inline is used by style attribute within the HTML tag. We can use this type of
CSS on any HTML tag just by using the style attribute. If we want to apply the CSS on a
smart part or on a specific tag then we prefer this type of CSS.
Internal is used by using by typing the CSS code inside the head part of the
HTML tag within the style tag. To access any HTML tag in internal CSS we can use some
selectors like id, class.
External is used when we want to type the code in separate file to reduce the
complexity of the code. We can easily link that external file by giving the reference or
address of the file in the head part using style tag.
2.1.4 Python
2.1.4.1 Pandas
Pandas is widely used for data analysis and manipulation of tabular data using
DataFrames. It offers tools for reading and writing data between in-memory data structures
and different file formats, such as CSV, JSON, Excel, SQL databases, and more. The core
data structure in Pandas is the DataFrame, which is a two-dimensional labeled data structure
with columns that can be of different types. This allows for efficient data manipulation,
7
filtering, grouping, and aggregation operations. Additionally, Pandas provides functionalities
for handling missing data, reshaping and pivoting datasets, merging and joining datasets, and
time series analysis. Pandas is highly extensible, with a vibrant ecosystem of third-party
libraries and tools that further enhance its capabilities.
2.1.4.2 Scikit-learn
2.1.4.3 Joblib
Joblib stands as a specialized Python library crafted for the efficient saving and
loading of Python objects, particularly data structures, to and from disk. Predominantly
employed in machine learning workflows, it excels in serializing and deserializing objects,
8
including large NumPy arrays. This functionality streamlines the storage and retrieval of
trained models, preprocessing steps, and associated artifacts.
A notable strength of Joblib lies in its support for parallel processing, significantly
enhancing performance. This capability proves invaluable for managing model artifacts and
handling extensive datasets in machine learning projects, particularly when employed
alongside libraries like scikit-learn.
2.1.4.4 NumPy
An inherent advantage of NumPy lies in its seamless integration with other Python
libraries and frameworks, including TensorFlow, scikit-learn, and Matplotlib. Moreover,
NumPy offers robust tools for data input/output operations, facilitating seamless interaction
with common file formats such as CSV, HDF5, and its proprietary binary format. Leveraging
efficient computation using C and Fortran libraries, NumPy emerges as a cornerstone tool for
high-performance computing tasks.
9
2.1.4.5 Flask
Flask is a versatile web framework that equips developers with the necessary tools,
libraries, and technologies to construct web applications of varying complexity. Whether it's
a simple webpage, a blog, a wiki, or a robust web-based calendar or commercial website,
Flask empowers developers to create a wide array of web-based solutions. Notably
categorized as a microframework, Flask is designed to maintain a simple yet highly
extensible core, prioritizing flexibility and ease of use.
2.1.5 JAVASCRIPT
It is client side scripting language. When we want to run any script on the
browser then we use JavaScript as a medium. It is also used for applying the
10
validations over the webpage like checking that a field is blank or not. It is also used
for interacting with the user like inputting a value from the user. It is also used for
accessing the properties of various elements of the webpage as well as the browser. To
use JavaScript we have to write the code in head part of the HTML section inside the
script tag. We can access the properties of various elements of webpage by their name
or by their ids.
2.1.6 SQLite
11
2.2 SYSTEM ANALYSIS
The existing system for accessing information about government schemes primarily
relies on traditional methods such as visiting government offices, consulting with officials, or
searching through official websites. However, these methods often pose challenges such as
long wait times, complex bureaucratic procedures, and difficulties in navigating through
extensive documentation. Citizens may find it daunting to locate relevant information amidst
the vast array of government schemes and services available.
The proposed work aims to address the shortcomings of the existing approach by
introducing a user-friendly chatbot for accessing information about government schemes.
Unlike traditional chatbots that rely on user queries, this chatbot will guide users through a
series of single and multiple-choice questions to collect relevant information about their
needs and circumstances.
Based on the user's responses, the chatbot will analyze their inputs using advanced
decision-making algorithms to determine the most appropriate government schemes for their
specific situation. The chatbot will then provide personalized recommendations, highlighting
the schemes that best match the user's requirements and eligibility criteria.
12
Utilizing advanced natural language processing (NLP) algorithms, the chatbot will
ensure clear and concise communication throughout the interaction, making it easy for users
to understand the recommendations provided. Additionally, the chatbot will offer interactive
features such as detailed explanations of recommended schemes and guidance on the
application process.
13
CHAPTER 3
SYSTEM DESIGN
3.1 ARCHITECTURE
14
3.2 DATA FLOW DIAGRAM
Fig 3.2 Level 0 DFD shows that the user and chatbot interaction. The information is send
from the user and the schemes are retrieved from the database.
15
3.2.2 DFD LEVEL 1
Fig 3.3 describes the Level 1 DFD of Government Scheme Chatbot. In this level all the
16
process of Chatbot is shown.
17
3.2.3 DFD LEVEL 2
Fig. 3.4 describes Level 2 of the DFD of each operation in this process. Here we
collects user information, accesses a database of government schemes, and generates
personalized recommendations via a chatbot interface deployed on websites
A use case diagram is a graphic depiction of the interactions among the elements of the
system. A use case is a methodology used in system analysis to identify, clarify and organize
system requirements. Use case diagrams are employed in UML, a standard notation for the
modeling of real-world objects and systems.
18
Fig.3.5 Use Case Diagram
19
3.4 ENTITY RELATIONSHIP DIAGRAM
Fig 3.6 describes the entities such as Users, Schemes, and Criteria, showing their
attributes and relationships. Users generate Recommendations for various Schemes,
facilitating personalized recommendations in the chatbot system.
20
CHAPTER 4
SYSTEM DEVELOPMENT
In this Government Scheme Chatbot, there are three modules. The modules are
Knowledge Base Integration module, User Interface Design module and
Communication Interface module.
This module is responsible for integrating the knowledge base into the
system, enabling access to information about various government schemes. It
ensures that the system has a comprehensive database of government schemes,
including eligibility criteria, benefits, and application procedures.
websites, official documents, and press releases. This ensures up-to-date and
accurate data on existing and new schemes.
● APIs and data retrieval scripts allow the chatbot to seamlessly access and
retrieve specific scheme details based on user details, ensuring users receive
the most relevant information.
● Presents users with clear and intuitive forms to input their details.
This module facilitates communication between the chatbot system and the
website, ensuring seamless interaction and engagement for users accessing the
system through the web platform.
22
● Optimizes for mobile responsiveness, ensuring seamless functionality and
user experience across various devices and screen sizes.
CHAPTER 5
5.1 IMPLEMENTATION
Implementation includes all those activities that take place to convert
from the old system to the new. The old system consists of manual operations,
which is operated in a very different manner from the proposed new system. A
proper implementation is essential to provide a reliable system to meet the
requirements of the organizations. An improper installation may affect the success
of the computerized system.
23
Fig 5.1 User Info Collection
24
Fig 5.1 describes how the chatbot collects information from the user to provide them the
best schemes
Fig 5.2 describes how the chatbot provides schemes to the user based on the details given
25
Fig 5.3 Scheme details Page
Fig 5.3 shows scheme details page. Users can learn about the schemes here
26
5.2 TESTING
Testing is the important aspect of the Software Development Life Cycle. This
is the stage where we confirm whether the project has achieved the ultimate goal or not
testing encompasses a set of activities that were conducted systematically. This begins at
the module level and works towards the integration of the entire system. The purpose of
testing the system is to identify various bugs and to fix them.
27
S.N INPUT EXPECTED OBTAINED TEST
O DETAIL OUTPUT OUTPUT CASE
S RESULT
1 Successful User The system The system Pass
Information should accept the proceeds to the
Input input data next step in the
without errors process
and proceed to
the next step in
the process
2 Successful The system System returns a Pass
Scheme should return a list of relevant
Retrieval list of schemes and
government displayed them in
schemes which is a formatted and
appropriate easy-to-read
based on the manner
given details
3 Successful The system System generates Pass
Generation of should analyze personalized
Personalized the input data scheme
Scheme and generate recommendations
Recommendatio scheme based on the input
ns recommendation data
s tailored to the
user's profile
28
CHAPTER 6
30
APPENDIX
Sample code
Train.py:
# prediction
y_pred = classifier.predict(X_test)
hamming_losses = [hamming_loss(y_test[col], y_pred[:, idx])
for idx, col in
enumerate(y_test.columns)]
accuracies = [accuracy_score(y_test[col], y_pred[:, idx]) for
31
idx, col in
enumerate(y_test.columns)]
for idx, col in enumerate(y_test.columns):
print(f"Column: {col}")
print("Accuracy:", accuracies[idx])
print("Classification Report:\n",
classification_report(y_test[col], y_pred[:,
idx]))
# export the model
joblib.dump(classifier, "model.joblib")
Response.js:
$("#nameInput").val("");
$("#chatbox").append(userHtml);
document
.getElementById("userInput")
.scrollIntoView({ block: "start", behavior: "smooth" });
if (rawText.trim().toLowerCase() === "/start" || flag) {
$.get("/get_survey", { msg: rawText }).done(function (data) {
flag = data.process;
console.log(flag);
if (data.type === "simple") {
var botHtml =
'<p class="botText"><span>' + data.response +
"</span></p>";
} else if (data.type === "complex") {
var optionsHtml = "<ol>";
data.response.options.forEach(function (option) {
optionsHtml += "<li>" + option + "</li>";
});
32
optionsHtml += "</ol>";
var botHtml =
'<div class="botText"><span>' +
data.response.reply +
optionsHtml +
"</span></div>";
} else if (data.type === "result") {
let schemes;
let links;
try {
schemes = JSON.parse(data.response.schemes[0].replace(/'/g,
'"'));
links = JSON.parse(data.response.schemes[1].replace(/'/g,
'"'));
} catch (error) {
schemes = [data.response.schemes[0]];
links = [data.response.schemes[1]];
}
console.log(schemes);
console.log(links);
var resultsHtml = "<ul>";
for (let i = 0; i < schemes.length; i++) {
resultsHtml +=
"<li>" +
schemes[i] +
' (<a href="' +
links[i] +
'" target="_blank">Check here</a>)</li>';
}
resultsHtml += "</ul>";
var botHtml =
'<div class="botText"><span>' +
data.response.reply +
resultsHtml +
"</span></div>";
}
$("#chatbox").append(botHtml);
33
document
.getElementById("userInput")
.scrollIntoView({ block: "start", behavior: "smooth" });
});
} else {
// For other inputs, proceed with the regular response request
$.get("/get_response", { msg: rawText }).done(function
(data) {
flag = data.process;
var botHtml = '<p class="botText"><span>' + data.response +
"</span></p>";
$("#chatbox").append(botHtml);
document
.getElementById("userInput")
.scrollIntoView({ block: "start", behavior: "smooth" });
});
}
}
$("#nameInput").keypress(function (e) {
if (e.which == 13) {
var userInput = $("#nameInput").val().trim();
if (userInput !== "") {
getBotResponse();
}
e.preventDefault();
}
});
function sendButton() {
var userInput = $("#nameInput").val().trim();
if (userInput !== "") {
setTimeout(() => {
getBotResponse();
}, 100);
}
}
34
REFERENCES
35