0% found this document useful (0 votes)
21 views15 pages

finbot ai record

FinBot is an AI-powered chatbot designed to assist users with personalized financial guidance across various roles, including investors, savers, borrowers, and financial planners. Utilizing advanced technologies such as Natural Language Processing and machine learning, it provides tailored advice on budgeting, saving, investing, credit management, and retirement planning. The chatbot aims to enhance financial literacy and empower users to make informed financial decisions, contributing to sustainable economic growth.

Uploaded by

venkat Mohan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views15 pages

finbot ai record

FinBot is an AI-powered chatbot designed to assist users with personalized financial guidance across various roles, including investors, savers, borrowers, and financial planners. Utilizing advanced technologies such as Natural Language Processing and machine learning, it provides tailored advice on budgeting, saving, investing, credit management, and retirement planning. The chatbot aims to enhance financial literacy and empower users to make informed financial decisions, contributing to sustainable economic growth.

Uploaded by

venkat Mohan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Aim:

To develop an AI-powered chatbot, FinBot, that assists users in making informed financial
decisions by providing personalized guidance on budgeting, saving, investing, credit
management, debt repayment, and retirement planning, tailored to various user roles such as
investors, savers, borrowers, and financial planners.

Description:
FinBot is a comprehensive AI-powered chatbot integrated into a personal finance application,
designed to support users in managing their finances and making informed financial choices.
Developed using cutting-edge technologies like Natural Language Processing (NLP), machine
learning, and contextual AI models (e.g., Rasa, ChatGPT API), FinBot provides round-the-clock
support to users involved in various aspects of personal finance.

The core purpose of FinBot is to bridge the communication and knowledge gap between
individuals and financial services by offering instant, personalized assistance. By
understanding the user's intent and context, FinBot delivers intelligent responses and
actionable financial advice.

FinBot supports five major roles:

1. Investor:
FinBot helps users evaluate investment opportunities, offers tips on diversifying
portfolios, explains stock market basics, and provides market insights. It assists with
selecting ETFs, index funds, and understanding risk levels, all while encouraging smart,
long-term investment strategies.

2. Saver:
FinBot provides personalized saving tips, helps users set financial goals, and advises on
emergency funds. It offers methods to automate savings, track spending, and identify
areas for potential savings, ensuring that users are always on track to meet their
financial objectives.

3. Borrower:
Borrowers can use FinBot to understand different loan types (e.g., personal, mortgage,
student loans), compare interest rates, and explore repayment strategies. The bot also
provides tips on improving credit scores and avoiding high-interest debt, ensuring
borrowers make sound financial decisions.
4. Financial Planner:
FinBot assists financial planners in creating long-term financial strategies for their
clients. It offers tools for retirement planning, tax filing advice, and estate planning,
helping planners optimize financial portfolios for future security.

5. Credit: Manager:
FinBot helps users manage credit, offering advice on improving credit scores,
understanding credit reports, and managing credit card usage. It also provides
guidance on utilizing credit responsibly to maintain financial health and avoid falling
into debt.

Universal Features:
In addition to role-specific support, FinBot includes universal features accessible by all users:

• Real-time financial queries like "How do I start saving for retirement?"

• Information about credit scores, loans, and interest rates

• Monthly savings progress tracking and goal setting

• Financial literacy resources and tips

• Multi-device support for financial tracking on the go

Technology Stack:

• Dialogflow / Rasa for building contextual conversational flows

• OpenAI GPT API for dynamic financial guidance (e.g., budgeting advice, investment
tips)

• Firebase for user data management and progress tracking

• Geo APIs for location-based financial assistance (e.g., finding financial advisors)

• Multilingual NLP models for broader user support.

Impact:
FinBot supports SDG 1 (No Poverty) and SDG 8 (Decent Work and Economic Growth) by
enhancing financial literacy and empowering users to manage their finances. It helps users
achieve financial independence, reduce debt, and plan for retirement, fostering financial
stability and contributing to sustainable economic growth.
PROGRAM CODE:

from flask import Flask, render_template, request, jsonify

import random

import re

import json

import os

# Initialize Flask app

app = Flask(__name__)

knowledge_base = {

"greetings": [

"Hello! I'm FinBot, your personal financial assistant. How can I help you today?",

"Hi there! FinBot at your service. Ready to talk money?",

"Welcome! I'm FinBot. Whether it's budgeting or investing, I've got you covered."

],

"farewells": [

"Goodbye! Stay financially savvy!",

"See you next time! Remember to track your spending!",

"Take care! Keep building your financial future!"

],

"thanks": [

"You're welcome! I'm always here to help with your finances.",

"No problem! Financial clarity is just a chat away.",

"Happy to help! Your financial health matters!"

],

"identity": [

"I'm FinBot, your smart assistant for all things personal finance — budgeting, investing,
saving, and more!",
"FinBot here! I help you understand and improve your financial life.",

"Think of me as your AI-powered money guide!"

],

"budgeting_tips": [

"A 50/30/20 budget rule is a great starting point: 50% needs, 30% wants, 20% savings.",

"Tracking every expense for a month can uncover surprising spending habits.",

"Use budgeting apps or spreadsheets to stay consistent and organized."

],

"emergency_fund": [

"An emergency fund should ideally cover 3 to 6 months of living expenses.",

"Keep your emergency fund in a high-yield savings account for easy access and growth.",

"Unexpected events happen — your emergency fund gives you peace of mind."

],

"saving_tips": [

"Pay yourself first — treat savings like a fixed bill.",

"Automate transfers to savings right after payday.",

"Cut small daily costs like takeout coffee to save more over time."

],

"investment_basics": [

"Investing means putting your money to work for potential future returns.",

"Start with index funds or ETFs — they offer diversification and lower risk.",

"Only invest money you can leave untouched for at least 5 years."

],

"stock_vs_bonds": [

"Stocks are ownership in companies; bonds are loans you give to governments or
corporations.",

"Stocks are higher risk, higher reward. Bonds are more stable but usually lower returns."
],

"mutual_funds": [

"Mutual funds pool money from investors to buy diversified portfolios.",

"They are managed by professionals and are a great way to diversify easily."

],

"credit_score_basics": [

"A credit score reflects how reliably you manage debt. Higher scores mean better rates.",

"Pay bills on time, keep credit utilization low, and limit hard inquiries to improve your score."

],

"loan_types": [

"Common loans include personal, auto, mortgage, and student loans.",

"Each loan type has its own interest rates, term lengths, and approval criteria."

],

"debt_repayment_strategies": [

"Snowball method: pay smallest debts first. Avalanche method: pay highest interest first.",

"Always pay more than the minimum if you can to reduce interest."

],

"tax_filing_tips": [

"File your taxes early to avoid stress and reduce identity theft risks.",

"Keep all income and expense records organized throughout the year.",

"Consider using tax software or a CPA if your finances are complex."

],

"insurance_basics": [

"Insurance protects you from big financial losses — health, auto, home, and life are key
types.",

"Always compare multiple quotes before buying a policy."

],

"retirement_planning": [
"Start retirement savings early to benefit from compound growth.",

"401(k)s and IRAs are great retirement vehicles with tax advantages.",

"Aim to replace about 70–80% of your pre-retirement income."

],

"compound_interest": [

"Compound interest means you earn interest on your interest. It’s the key to growing
wealth.",

"The earlier you start saving, the more time compounding works in your favor."

],

"financial_goals": [

"Set SMART goals — Specific, Measurable, Achievable, Relevant, Time-bound.",

"Break big goals into smaller monthly milestones for motivation."

],

"student_loans": [

"Know the difference between federal and private loans — repayment options differ.",

"Consider income-driven repayment if you’re struggling to pay."

],

"credit_card_tips": [

"Pay off your credit card balance in full each month to avoid interest.",

"Use less than 30% of your credit limit to maintain a good credit score."

],

"mortgage_tips": [

"A fixed-rate mortgage offers predictable payments. An ARM may be cheaper short-term.",

"Get pre-approved before house hunting to know your budget."

],

"fraud_prevention": [

"Monitor your credit report and bank activity regularly.",

"Use two-factor authentication and avoid public Wi-Fi for banking."


],

"financial_literacy": [

"Financial literacy means understanding how to manage money, debt, and investments
wisely.",

"Improving your financial knowledge leads to better decisions and financial freedom."

],

"unknown": [

"Hmm, I didn't quite catch that. Could you ask about savings, budgeting, or investing?",

"I'm still learning. Could you rephrase or try a finance-related topic like loans or
retirement?",

"Let’s stay on money matters. Ask me about credit, savings, debt, or financial planning!"

],

"learned_responses": []

# Function to preprocess text (simplified)

def preprocess_text(text):

text = text.lower().strip()

text = re.sub(r'[^\w\s]', '', text)

return text

# Load knowledge base

if os.path.exists('ecobot_knowledge_base.json'):

with open('ecobot_knowledge_base.json', 'r', encoding="utf-8") as f:

knowledge_base = json.load(f)

else:

# Create simplified knowledge base with all original categories


#

# Save initial knowledge base

with open('ecobot_knowledge_base.json', 'w', encoding="utf-8") as f:

json.dump(knowledge_base, f, indent=4)

# User role tracking (simplified)

user_info = {

"current_role": "unknown",

"waste_type": None

# Simple intent detection (without spaCy)

def detect_intent(user_input):

user_input = preprocess_text(user_input)

print(user_input)

# Basic interactions

if re.search(r'\b(hi|hello|hey|greetings)\b', user_input):

return "greetings"

elif re.search(r'\b(bye|goodbye|see you|farewell)\b', user_input):

return "farewells"

elif re.search(r'\b(thanks|thank you|appreciate)\b', user_input):

return "thanks"

elif re.search(r'\b(who are you|what are you|your name|your identity)\b', user_input):

return "identity"

# Financial literacy and planning

elif re.search(r'\b(budget|budgeting|spending plan|track expenses)\b', user_input):


return "budgeting_tips"

elif re.search(r'\b(emergency fund|unexpected expenses|rainy day)\b', user_input):

return "emergency_fund"

elif re.search(r'\b(save money|saving tips|how to save|best way to save)\b', user_input):

return "saving_tips"

elif re.search(r'\b(invest|investment|etf|index fund|stock market)\b', user_input):

return "investment_basics"

elif re.search(r'\b(stock.*bond|difference between stocks and bonds)\b', user_input):

return "stock_vs_bonds"

elif re.search(r'\b(mutual fund|sip|investment fund)\b', user_input):

return "mutual_funds"

elif re.search(r'\b(credit score|fico|credit report|improve credit)\b', user_input):

return "credit_score_basics"

elif re.search(r'\b(loans?|loan types|borrow|debt)\b', user_input):

return "loan_types"

elif re.search(r'\b(pay off debt|repay loans|snowball method|avalanche)\b', user_input):

return "debt_repayment_strategies"

elif re.search(r'\b(tax filing|income tax|file taxes|tax tips)\b', user_input):

return "tax_filing_tips"

elif re.search(r'\b(insurance|health insurance|car insurance|life insurance|coverage)\b',


user_input):

return "insurance_basics"

elif re.search(r'\b(retirement|401k|ira|pension|retire)\b', user_input):

return "retirement_planning"

elif re.search(r'\b(compound interest|interest growth|compound return)\b', user_input):

return "compound_interest"

elif re.search(r'\b(financial goal|save for|plan savings)\b', user_input):

return "financial_goals"
elif re.search(r'\b(student loan|college debt|education loan)\b', user_input):

return "student_loans"

elif re.search(r'\b(credit card|credit utilization|credit limit)\b', user_input):

return "credit_card_tips"

elif re.search(r'\b(mortgage|home loan|buy house|house loan)\b', user_input):

return "mortgage_tips"

elif re.search(r'\b(fraud|identity theft|scam|protect info)\b', user_input):

return "fraud_prevention"

elif re.search(r'\b(financial literacy|learn finance|understand money)\b', user_input):

return "financial_literacy"

# Default fallback

return "unknown"

# Function to generate response (simplified)

def generate_response(user_input):

intent = detect_intent(user_input)

print(intent)

# Check if we have responses for this intent

if intent in knowledge_base:

reply = random.choice(knowledge_base[intent])

print(reply)

return reply

# Default response

return random.choice(knowledge_base["unknown"])
# Conversation context (simplified)

conversation_context = {

"learning_mode": False,

"question_to_learn": "",

"last_user_input": ""

# Process user message

def process_message(user_input):

global conversation_context

# Check if we're in learning mode

if conversation_context["learning_mode"]:

if user_input.lower() in ["no", "nevermind", "cancel"]:

conversation_context["learning_mode"] = False

return "No problem! Let's continue our eco-conversation."

elif conversation_context["question_to_learn"]:

# Save the new knowledge

knowledge_base["learned_responses"][conversation_context["question_to_learn"]] =
user_input

with open('ecobot_knowledge_base.json', 'w') as f:

json.dump(knowledge_base, f, indent=4)

conversation_context["learning_mode"] = False

conversation_context["question_to_learn"] = ""

return "Thank you for teaching me! I'll remember that for future sustainability
discussions."

elif user_input.lower() == "yes":


conversation_context["question_to_learn"] = conversation_context["last_user_input"]

return "Great! Please provide the eco-friendly answer to your question."

# Regular conversation flow

conversation_context["last_user_input"] = user_input

response = generate_response(user_input)

# Check if we should enter learning mode

if response == "I don't know the answer to that eco-question yet. Would you like to teach
me? (yes/no)":

conversation_context["learning_mode"] = True

return response

@app.route("/")

def home():

return render_template("index.html")

@app.route("/get_response", methods=["POST"])

def get_response():

user_input = request.json.get("message")

print("User said:", user_input) # Debug log

bot_reply = process_message(user_input)

return jsonify({"response": bot_reply})

if __name__ == "__main__":

app.run(debug=True)
SCREENSHOTS:
RESULT:

Thus, we developed FinBot, an AI-powered chatbot providing personalized financial guidance


for investors, savers, borrowers, and financial planners. Integrated AI-driven Natural Language
Processing (NLP) and data analysis were implemented successfully to support budgeting, debt
management, investment advice, and retirement planning.

You might also like