Project Duration: Feb 2026 Domain: Machine Learning, NLP, FinTech Automation Tech Stack: Python, Scikit‑learn, XGBoost, Pandas, NumPy, Flask, Jupyter Notebook
Modern financial platforms like QuickBooks automatically categorize expenses (e.g., Travel, Food, Utilities, Office Supplies) from raw transaction data. This project replicates that real‑world system using Natural Language Processing (NLP) and structured numerical features, building a production‑ready ML pipeline for intelligent expense categorization.
The system takes raw transaction descriptions and metadata as input, predicts the most likely expense category, and assigns a confidence score. Low‑confidence predictions are flagged for human review, ensuring reliability and user trust — a core requirement in FinTech products.
- Automate expense categorization at scale
- Combine text‑based NLP features with numerical transaction signals
- Handle uncertainty using confidence‑based decision logic
- Design the solution with production deployment in mind
Manual expense categorization is:
- Time‑consuming
- Error‑prone
- Not scalable for large transaction volumes
The goal is to build a machine learning system that:
- Accurately classifies expenses into predefined categories
- Explains prediction confidence
- Falls back to human intervention when the model is uncertain
The project uses a synthetic but realistic QuickBooks-style expense dataset designed to closely mirror real-world financial transaction data used in accounting platforms.
Dataset File: quickbooks_synthetic_expenses_7k_diverse.csv
- ~7,000 transaction records
- Multi-class expense categorization problem
Text Feature
description– Raw transaction description containing merchant names, payment context, and notes (primary NLP signal)
Numerical / Structured Features
amount– Transaction amountpayment_mode– Mode of payment (card, UPI, cash, bank transfer, etc.)merchant_type– Merchant category signalis_recurring– Indicates recurring transactionsday_of_week– Temporal pattern featuremonth– Seasonal spending signal
Target Variable
expense_category– Ground truth expense class (e.g., Travel, Food, Utilities, Office Supplies, Entertainment, Healthcare, etc.)
- Mimics noisy, short-text financial descriptions
- Contains overlapping categories (realistic ambiguity)
- Supports confidence-based decision making
- Suitable for NLP + structured feature fusion
The dataset is explored, cleaned, and modeled end-to-end inside the Jupyter Notebook.
- Lowercasing & normalization
- Stopword removal
- TF‑IDF vectorization to convert transaction descriptions into numerical vectors
- Scaling and normalization
- Handling missing values
- Feature alignment between training and inference
- Combined TF‑IDF vectors with numerical features into a single feature space
-
Model Used: XGBoost (Multi‑Class Classifier)
-
Why XGBoost?
- Handles mixed feature types well
- Strong performance on structured + sparse data
- Robust to noise and feature interactions
- Train‑validation split
- Hyperparameter tuning
- Multi‑class classification training
- Performance evaluation
Evaluation metrics used:
- Accuracy
- Precision / Recall / F1‑Score (per class)
- Confusion Matrix
Model performance analysis is documented step‑by‑step in the Jupyter Notebook.
To make the system production‑ready:
- Model outputs class probabilities
- Maximum probability is treated as confidence score
- High confidence → Auto‑categorize
- Low confidence → Flag for manual review
This approach:
- Reduces incorrect auto‑classifications
- Improves long‑term trust
- Enables continuous feedback and retraining
A Flask‑based inference service is implemented to:
-
Accept transaction input via API
-
Apply the same preprocessing pipeline
-
Return:
- Predicted category
- Confidence score
- Review flag (True / False)
This mirrors real‑world ML deployment patterns used in FinTech companies.
project-root/
│
├── notebook/
│ └── Expense_Categorization.ipynb
│
├── app.py # Flask inference service
├── model.pkl # Trained XGBoost model
├── vectorizer.pkl # TF-IDF vectorizer
├── requirements.txt
├── README.md
└── data/
└── transactions.csv
pip install -r requirements.txtjupyter notebookOpen Expense_Categorization.ipynb to explore training and evaluation.
python app.py{
"predicted_category": "Travel",
"confidence": 0.87,
"manual_review_required": false
}This project closely aligns with:
- QuickBooks expense automation
- Invoice & transaction intelligence systems
- Enterprise‑grade ML pipelines
It demonstrates skills in:
- End‑to‑end ML system design
- NLP + structured data modeling
- Deployment‑ready ML thinking
- Deep learning models (BERT‑based text encoders)
- Online learning with feedback loops
- Explainability using SHAP values
- Multi‑language transaction support
Utsav Kashyap Data Scientist Machine Learning | Backend | NLP
⭐ If you find this project useful, feel free to star the repository!