Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
21 views

Final Year Project Report

The project report details the development of an AI chatbot designed to simplify access to government schemes for citizens, addressing the challenges of complex information and lack of personalized guidance. The chatbot utilizes machine learning and natural language processing to provide tailored information and improve citizen engagement with government initiatives. The report outlines the system's objectives, requirements, design, and implementation, highlighting its potential to empower users and enhance accessibility to government services.

Uploaded by

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

Final Year Project Report

The project report details the development of an AI chatbot designed to simplify access to government schemes for citizens, addressing the challenges of complex information and lack of personalized guidance. The chatbot utilizes machine learning and natural language processing to provide tailored information and improve citizen engagement with government initiatives. The report outlines the system's objectives, requirements, design, and implementation, highlighting its potential to empower users and enhance accessibility to government services.

Uploaded by

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

AI CHATBOT FOR GOVERNMENT SCHEMES

A PROJECT REPORT

Submitted by

PETCHI RAJA E (950020104306)


ANAND S (950020104701)
ARUN KUMAR S (950020104702)

in partial fulfillment for the award of the degree of

BACHELOR OF ENGINEERING
In

COMPUTER SCIENCE AND ENGINEERING

ANNA UNIVERSITY REGIONAL CAMPUS - TIRUNELVELI


ANNA UNIVERSITY: CHENNAI 600 025

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.

Signature of HOD Signature of Supervisor

Dr.C.AKILA Dr.T.BRINDA

Assistant Professor, Assistant Professor,


Dept. of Computer Science Dept. of Computer Science
And Engineering, and Engineering,
Anna University Regional Campus, Anna University Regional Campus,

Tirunelveli-627007 Tirunelveli-627007

Submitted for the CS8811 Viva–Voce examination held on / /2024

INTERNAL EXAMINER EXTERNAL EXAMINER


ACKNOWLEDGEMENT

We wish to express our deep sense of gratitude to Dr.N.SHENBAGA


VINAYAGA MOORTHI, Professor and Dean, Anna University, Regional
Campus-Tirunelveli, for his support and encouragement throughout this project
work.

We express our sincere thanks to our Head of the Department Dr.C.AKILA,


Assistant Professor, Department of Computer Science and Engineering, for her
motivation, inspiration and encouragement to undertake this work.

We owe our special thanks and gratitude to our internal guide


Dr.T.BRINDA, Assistant Professor, Department of Computer Science and
Engineering, for her suggestions and supports during the course of this project.

We express our sincere thanks to our coordinator Dr.C.AKILA, Assistant


Professor, Department of Computer Science and Engineering, for giving us such
attention and time.

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

CHAPTER NO TITLE PAGE NO.

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

3.3 Use Case Diagram 15


3.4 Entity Relationship Diagram 17
4 SYSTEM DEVELOPMENT 18
4.1 MODULES 18
4.1.1 Knowledge Base Integration Module 18
4.1.2 User Interface Module 18
4.1.3 Communication Interface Module 19
5 SYSTEM IMPLEMENTATION AND TESTING 2
0
5.1 IMPLEMENTATION 2
0
5.2 TESTCASE 23

6 CONCLUSION AND FUTURE 25


ENHANCEMENT
APPENDIX 27
REFERENCES 31
LIST OF FIGURES

FIG.NO FIGURE NAME PAGE


. NO.

3.1 Architecture Diagram 12


3.2 DFD Level 0 13
3.3 DFD Level 1 14
3.4 DFD Level 2 15
3.5 Use Case Diagram 16
3.6 Entity Relationship Diagram 17
5.1 User Info Collection 20
5.2 Scheme Recommendation 21
5.3 Scheme Details Page 22
LIST OF TABLES

TABLE NO. TABLE NAME PAGE NO.

5.1 Test Case for Chatbot 24


LIST OF ABBREVIATIONS

DFD Data Flow Diagram

ER Entity Relationship

HTML Hyper Text Mark-up Language

CSS Cascading Style Sheet

SQL Structured Query Language

GUI Graphical User Interface

RDBMS Relational Database Management


System
CHAPTER 1

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

The objective is to design and implement a chatbot system capable of effectively


disseminating information about government schemes. The aim is to integrate advanced
natural language processing (NLP) algorithms to accurately understand user queries and
provide relevant responses. Additionally, we seek to develop a modular architecture that
allows for easy scalability and integration with various communication channels. By
achieving these technical objectives, our goal is to create a robust and versatile chatbot
solution that enhances accessibility to government services and promotes citizen
engagement with public initiatives.

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 LITERATURE REVIEW

1.3.1 Website Name: Mitsuku.com

Mitsuku is a conversational AI chatbot developed by Steve Worswick. It is widely


regarded as one of the most advanced chatbots, having won the Loebner Prize Turing
Test multiple times. Mitsuku is known for its human-like conversational abilities and
extensive knowledge base.

1.3.1.1 Advantages

● Advanced conversational abilities.

● Extensive knowledge base covering a wide range of topics.

.
1.3.1.2 Disadvantages

2
● Limited customization options for specific use cases.

● Requires internet access to function effectively.

3
1.3.2 Website name: AskKBCI

AskKBCI is a chatbot developed by the Karnataka government, designed to provide


information and assistance regarding various government schemes and services available
to citizens. It aims to simplify the process of accessing government services by offering a
user-friendly interface for citizens to inquire about eligibility criteria, application
procedures, and other details related to government schemes.

1.3.2.1 Advantages

● Provides easy access to information about government schemes and services.

● Offers personalized assistance to citizens based on their queries and needs.

1.3.2.2 Disadvantages

● Limited scope and coverage of government schemes depending on the region.

● May require improvements in conversational capabilities and response accuracy.

4
CHAPTER 2

SYSTEM DESCRIPTION

2.1 SYSTEM REQUIREMENTS

2.1.1 HARDWARE REQUIREMENTS

Processor : Pentium 4 or above


RAM : Minimum 2GB or above
Hard Disk : Around 500 MB of free disk space

2.1.2 SOFTWARE REQUIREMENTS

Operating System : Windows


Language : HTML, CSS, Javascript and Python
Backend Database : SQLite
Architecture : Client Server

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

Python is a high-level, interpreted programming language known for its simplicity


and readability. Python emphasizes code readability and uses a clean and straightforward
syntax, making it an excellent language for beginners and experienced programmers alike.
Python's syntax is designed to be intuitive and readable. Its code resembles English-like
expressions, which makes it easier to understand and write. Python Django is a high-level
web framework that is built on top of Python. It provides a robust set of tools and features for
developing web applications quickly and efficiently. Django follows the Model-View-
Controller (MVC) architectural pattern, with some variations, known as Model-View-
Template (MVT).

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

Scikit-learn is a renowned open-source machine learning library designed for


Python, offering an extensive collection of supervised and unsupervised learning algorithms.
These algorithms cover a broad spectrum of tasks, including classification, regression,
clustering, and dimensionality reduction. Notable algorithms integrated into scikit-learn
comprise support vector machines (SVM), random forests, gradient boosting, k-means, and
DBSCAN.

A distinguishing feature of scikit-learn is its user-friendly interface and seamless


integration with other Python libraries like NumPy and SciPy. This compatibility enables
users to efficiently preprocess data, conduct feature engineering, and apply machine learning
algorithms without the hassle of switching between different libraries. Furthermore, scikit-
learn provides a comprehensive suite of tools for model selection, evaluation, and tuning.
Users can readily compare various algorithms and hyperparameters to identify the most
suitable model for their dataset. Overall, scikit-learn stands as a robust and versatile library
highly esteemed within the machine learning community for its broad utility and ease of
implementation.

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

NumPy, or Numerical Python, stands as an essential library for numerical


computing in Python. It offers robust support for multi-dimensional arrays and matrices,
complemented by an extensive suite of mathematical functions optimized for efficient array
operations. At its core, NumPy revolves around its primary data structure, the array, enabling
vectorized computation and streamlined manipulation of large datasets.

NumPy boasts a diverse array of mathematical capabilities, spanning linear algebra,


Fourier analysis, random number generation, and more. Its homogeneous arrays, housing
elements of a single data type, ensure efficient memory utilization and accelerated
computation. Additionally, NumPy provides comprehensive functionalities for array
creation, manipulation, and indexing, alongside advanced features like broadcasting and
masking.

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.

One distinguishing characteristic of microframeworks like Flask is their minimal


dependencies on external libraries. While this minimalist approach ensures lightweight and
streamlined development, it may also require developers to handle certain tasks themselves
or incorporate additional plugins for extended functionality. In Flask's case, its core
dependencies include:

● WSGI (Web Server Gateway Interface): A standardized protocol for


communication between web servers and Python web applications.
● Werkzeug: A powerful WSGI toolkit that provides essential components such
as request and response objects, forming the foundation of Flask's
functionality.
● Jinja2: A widely-used templating engine for Python that enables dynamic
rendering of web pages by combining templates with data sources

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

MySQL (structured query language) is an open source relational database


management system (RDBMS), the world's second most used relational database following
SQLite. It is deployed with every Android (operating system) and iPhone device along with
the Google Chrome and Firefox browsers. The MySQL development project has made its
source code available under the terms of the GNU General Public License, as well as under a
variety of proprietary software agreements. MySQL is a popular choice of database for use in
web applications, and is a central component of the widely used LAMP (software bundle)
open source web application software stack and other list of AMP packages.

11
2.2 SYSTEM ANALYSIS

2.2.1 EXISTING SYSTEM

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.

Despite efforts to improve online platforms and information dissemination,


accessibility remains a significant issue, particularly for individuals with limited internet
literacy or those from marginalized communities. Moreover, existing platforms may lack
interactive features or personalized assistance, making it challenging for users to find specific
information tailored to their needs.

2.2.2 PROPOSED WORK

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

Architecture diagram is the process of creating visual representations of


software system components. In a software system, the term architecture refers to various
functions, their implementations, and their interactions with each other.
.

Fig 3.1 Architecture of Govt. Scheme Chatbot

14
3.2 DATA FLOW DIAGRAM

A DFD diagram is a way of representing a flow of data through a process or a system.


The DFD also provides information about the outputs and inputs of each entity and
process itself. It provides a clear overview of how data moves through the system.

3.2.1 DFD LEVEL 0

Fig 3.2 Data Flow Diagram Level-0

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 Data Flow Diagram 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 Data Flow Diagram 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

3.3 USE CASE DIAGRAM

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

An Entity Relationship Diagram (ERD) shows the relationships of entity sets


stored in a database. In other words, ER diagrams illustrate the logical structure of databases. It
looks like a flow chart. It has the specialized symbols and the meaning of these symbols, that
make it unique.

Fig 3.6 E-R Diagram for Govt. Scheme

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.

4.1 Knowledge Base Integration 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.

● The chatbot gleans information from reliable sources like government

websites, official documents, and press releases. This ensures up-to-date and
accurate data on existing and new schemes.

● A well-organized database is essential for efficient storage and retrieval of


scheme details. Structures and organizes information for easy retrieval and
navigation.

● The knowledge base structure should effectively represent all aspects of a


scheme. This includes clear descriptions, eligibility criteria breakdowns,
application process steps, and relevant resources.

● 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.

4.2 User Interface Design Module


21
The user interface module serves as the primary interaction point between
users and the system, allowing users to input their information and preferences
conveniently. It provides a user-friendly interface that guides users through the
process of accessing government schemes.

● Presents users with clear and intuitive forms to input their details.

● Guides users through a series of questions to gather relevant


information.Validates user inputs to ensure accuracy and completeness.

● Understanding your target audience is crucial. Define user personas


representing diverse needs, like unemployed individuals or students. This
guides the design and language used in the chatbot.

● The conversation flow is well-structured with a welcoming message, clear


question prompts, and multiple response options. This allows users to
interact with the chatbot in a way that feels natural.

4.3 Communication Interface Module

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.

● Integrates seamlessly with the website, providing a dedicated chat interface


for users to interact with the chatbot.

● User-friendly chat interfaces guide users through the interaction process,


making it easy to give details and receive assistance.

22
● Optimizes for mobile responsiveness, ensuring seamless functionality and
user experience across various devices and screen sizes.

● Adaptive design elements and layout adjustments enhance usability on


smartphones and tablets, accommodating users on-the-go.

CHAPTER 5

SYSTEM IMPLEMENTATION AND TESTING

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 Scheme Recommendation

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.

It provides a way to check the functionality. 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.

5.2.1 TEST CASE

A test case is a document, which has a set of test data, preconditions,


expected results and post conditions, developed for a particular test scenario in order to
verify compliance against a specific requirement.

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

Table 5.1 Test Cases for Chatbot

28
CHAPTER 6

CONCLUSION AND FUTURE ENHANCEMENT

The implementation of a chatbot for government scheme


recommendations presents a pivotal advancement in public service accessibility
and user engagement. By harnessing the power of artificial intelligence and
integrating seamlessly with websites, the chatbot provides users with personalized
recommendations tailored to their specific needs and circumstances. This not only
simplifies the process of navigating through a plethora of government schemes
but also empowers users with valuable insights to make informed decisions
regarding their welfare and benefits.

Furthermore, the successful development and deployment of


this project underscore the transformative potential of technology in enhancing
citizen-centric services. Through the utilization of data-driven algorithms and
intuitive user interfaces, the chatbot bridges the gap between citizens and
government schemes, fostering greater inclusivity and efficiency in service
delivery.

In the future, this chatbot can be further enhanced to provide


more comprehensive support to users. One potential enhancement could involve
integrating additional data sources to enrich the recommendation engine. By
incorporating real-time data on user demographics, socioeconomic factors, and
recent policy changes, the chatbot can offer even more personalized and up-to-
date recommendations.
29
Another avenue for improvement is to enhance the chatbot's
natural language processing capabilities. By refining its understanding of user
queries and context, the chatbot can provide more accurate and relevant
responses, further enhancing the user experience. Additionally, incorporating
sentiment analysis features can enable the chatbot to better gauge user satisfaction
and adapt its responses accordingly.

Overall, the development of this chatbot represents just the


beginning of a journey towards revolutionizing citizen-government interactions.
By continually refining and expanding its capabilities, this chatbot has the
potential to become an indispensable tool for citizens seeking access to
government services and benefits.

30
APPENDIX

Sample code

Train.py:

from sklearn.ensemble import RandomForestClassifier


from sklearn.model_selection import train_test_split
from sklearn.multioutput import MultiOutputClassifier
from sklearn.metrics import hamming_loss, accuracy_score,
classification_report
import pandas as pd
import joblib
import warnings
df = pd.read_csv("dataset.csv")
X = df[['age', 'religion', 'community', 'income', 'gender',
'segment']]
y = df[['scheme', 'link']]
# remove warnings
warnings.filterwarnings("ignore", category=UserWarning,
module="sklearn")
X_encoded = pd.get_dummies(X, columns=['religion',
'community', 'gender',
'segment'])
print(X_encoded.info())
X_train, X_test, y_train, y_test = train_test_split(X_encoded,
y, test_size=0.2,
random_state=42)
classifier = MultiOutputClassifier(RandomForestClassifier())
classifier.fit(X_train, y_train)

# 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:

let flag = false;


function getBotResponse() {
var rawText = $("#nameInput").val();
console.log(rawText);
var userHtml = '<p class="userText"><span>' + rawText +
"</span></p>";
console.log(userHtml);

$("#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

● Alvin Chaidrata,Zhiyuan Chen and Zi Li Yong “Intent Matching based


Customer Services Chatbot with Natural Language Understanding” in 2022.
● Ritik Raut, Ritesh Sharma and Riteek Kharbade “The Career Guidance
ChatBot” in 2021.
● Ergun Gide, Niti Sandhu, “AI-Chatbots to Enhance Student Learning
Experience” in 2021.
● Nithuna S and Laseena C.A, “ Implementation Techniques of Chatbot” in
2020.
● Tarun Lalwani, Shashank Bhalotia, Ashish Pal, Shreya Bisen, Vasundhara
Rathod, “Implementation of a Chatbot System using AI and NLP ” in 2020.
● Guruswami Hiremath, Aishwarya Hajare, Priyanka Bhosale, Rasika
Nanaware ,” Chatbot for education system” in 2020.
● Chatbot for education system , Hardeo K. Thakur “Survey of Various AI
Chatbots” in 2021.
● Naz Albayrak, Aydeniz Ozdemir and Engin Zeydan ” Artificial Intelligence
Based Chatbots” in 2020.
● Shaziya Banu ,Shantala Devi Patil “An Intelligent Web App Chatbot” in
2022.

35

You might also like