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.
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.
- 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
- Python 3.8+
- Streamlit
- scikit-learn
- pandas
- Plotly
- joblib
- Clone the repository:
git clone https://github.com/kwasniewskin/finance_ai.git
cd finance_ai- Install dependencies:
pip install -r requirements.txtfinance_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
To start the Finance AI application:
streamlit run app.pyThe application will open in your default browser at http://localhost:8501
- Export your bank statement as CSV or XML file
- Upload the file to Finance AI
- Review the automatically categorized transactions
- Correct any miscategorized transactions in the data editor
- Click "Save Corrections & Retrain AI" to improve the model
- View comprehensive spending analysis with interactive charts
The application expects CSV files with columns similar to:
Data operacji(Transaction Date)Kwota(Amount)Opis transakcji(Transaction Description)
The application processes XML files with operation elements containing:
order-date(Transaction Date)amount(Transaction Amount)- Transaction description fields
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.
To retrain the machine learning model with new data:
python train_model.pyThe retraining process:
- Loads categorized transaction data
- Splits data into training and test sets (80/20)
- Trains the LinearSVC classifier with TF-IDF vectorization
- Evaluates accuracy on unseen data
- Saves the model as
finance_model.joblib
See requirements.txt for a complete list of dependencies:
- pandas
- scikit-learn
- streamlit
- plotly
- joblib
- lxml
MIT License - See LICENSE file for details
Nikodem Kwaśniewski
- Email: nikodem.kwasniewski@outlook.com
- GitHub: @kwasniewskin
Contributions are welcome! Feel free to:
- Report bugs and issues
- Suggest new features
- Submit pull requests with improvements
- Share your feedback
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.