Skip to content

kwasniewskin/finance_ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Finance AI - Personal Finance Assistant

An AI-powered personal finance assistant designed to analyze financial transactions, categorize spending patterns, and provide actionable insights through interactive visualizations. All processing is performed locally for maximum privacy.

Overview

Finance AI automates the analysis of bank statements by leveraging machine learning to intelligently categorize transactions. The system learns from user corrections, continuously improving its categorization accuracy. Features include comprehensive expense analysis, income tracking, and detailed spending visualizations.

Key Features

  • Automatic Transaction Categorization - AI-powered classification of financial transactions using LinearSVC
  • Multi-format Support - Process bank statements in CSV and XML formats
  • Interactive Visualizations - Pie charts and bar charts for spending analysis
  • Income and Expense Tracking - Real-time balance calculations and financial summaries
  • Active Learning - Retrain the model based on user corrections for improved accuracy
  • Privacy-First - All data processing occurs locally; no data leaves your computer

Technology Stack

  • Python 3.8+
  • Streamlit
  • scikit-learn
  • pandas
  • Plotly
  • joblib

Installation

  1. Clone the repository:
git clone https://github.com/kwasniewskin/finance_ai.git
cd finance_ai
  1. Install dependencies:
pip install -r requirements.txt

Project Structure

finance_ai/
├── app.py                           # Main Streamlit application
├── train_model.py                   # Model training pipeline
├── data_processor.py                # Data processing and standardization
├── finance_model.joblib             # Trained ML model
├── requirements.txt                 # Project dependencies
├── data/
│   ├── raw_training_data.csv                    # Original dataset
│   ├── categorized_financial_data.csv           # Processed training data
│   └── categorized_financial_data_backup.csv    # Backup of processed data
└── README.md                        # This file

Usage

To start the Finance AI application:

streamlit run app.py

The application will open in your default browser at http://localhost:8501

Workflow

  1. Export your bank statement as CSV or XML file
  2. Upload the file to Finance AI
  3. Review the automatically categorized transactions
  4. Correct any miscategorized transactions in the data editor
  5. Click "Save Corrections & Retrain AI" to improve the model
  6. View comprehensive spending analysis with interactive charts

Supported Bank Statement Formats

CSV Format

The application expects CSV files with columns similar to:

  • Data operacji (Transaction Date)
  • Kwota (Amount)
  • Opis transakcji (Transaction Description)

XML Format

The application processes XML files with operation elements containing:

  • order-date (Transaction Date)
  • amount (Transaction Amount)
  • Transaction description fields

How It Works

The system uses a TF-IDF Vectorizer combined with a Linear Support Vector Classifier (LinearSVC) to categorize transactions based on their descriptions. The model is trained on categorized financial data and can be retrained with user corrections to improve accuracy.

Model Training

To retrain the machine learning model with new data:

python train_model.py

The retraining process:

  1. Loads categorized transaction data
  2. Splits data into training and test sets (80/20)
  3. Trains the LinearSVC classifier with TF-IDF vectorization
  4. Evaluates accuracy on unseen data
  5. Saves the model as finance_model.joblib

Requirements

See requirements.txt for a complete list of dependencies:

  • pandas
  • scikit-learn
  • streamlit
  • plotly
  • joblib
  • lxml

License

MIT License - See LICENSE file for details

Author

Nikodem Kwaśniewski

Contributing

Contributions are welcome! Feel free to:

  • Report bugs and issues
  • Suggest new features
  • Submit pull requests with improvements
  • Share your feedback

Disclaimer

Finance AI is designed to assist with personal financial analysis. It should not be considered as financial advice. Always consult with a qualified financial advisor before making investment or financial decisions.

About

An AI-powered personal finance assistant and investment advisor.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages