https://github.com/deypadma2020/banking-faq-rag-system
An end-to-end NLP-based Banking FAQ Intent Classification System using TF-IDF, Machine Learning, Ensemble Models, and Streamlit deployment for real-time banking query intent prediction and bulk CSV classification.
https://github.com/deypadma2020/banking-faq-rag-system
banking-applications nlp-machine-learning supervised-machine-learning
Last synced: about 2 months ago
JSON representation
An end-to-end NLP-based Banking FAQ Intent Classification System using TF-IDF, Machine Learning, Ensemble Models, and Streamlit deployment for real-time banking query intent prediction and bulk CSV classification.
- Host: GitHub
- URL: https://github.com/deypadma2020/banking-faq-rag-system
- Owner: deypadma2020
- License: mit
- Created: 2026-05-17T07:44:03.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-05-23T14:57:10.000Z (about 2 months ago)
- Last Synced: 2026-05-23T16:15:40.235Z (about 2 months ago)
- Topics: banking-applications, nlp-machine-learning, supervised-machine-learning
- Language: Jupyter Notebook
- Homepage: https://banking-faq-rag-system.onrender.com
- Size: 18.6 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ฆ Banking FAQ Intent Classification System
An end-to-end NLP-based Banking FAQ Intent Classification System built using:
- TF-IDF Feature Engineering
- Machine Learning Models
- Ensemble Learning
- Streamlit Deployment
- Render Cloud Hosting
The project classifies banking-related customer queries into predefined intent categories such as:
- UPI Services
- Loans
- Debit Card
- Mutual Funds
- Account Services
- Financial Markets
- and more.
---
# ๐ Project Overview
This project demonstrates a complete NLP pipeline for banking query intent classification.
The system:
- preprocesses banking text data
- generates TF-IDF features
- trains multiple ML models
- evaluates model performance
- predicts intents for new queries
- supports bulk CSV prediction
- deploys as a Streamlit web application
---
# ๐ Features
## โ
Single Question Prediction
Users can enter a banking question and instantly receive the predicted intent.
Example:
```text
How can I block my debit card?
```
Output:
```text
Debit Card Services
```
---
## โ
Bulk CSV Prediction
Users can upload a CSV file containing multiple banking questions.
The application:
- predicts intents for all questions
- displays total predictions
- allows downloading the predicted CSV file
---
## โ
NLP Pipeline
Implemented:
- text preprocessing
- regex cleaning
- TF-IDF vectorization
- word-level features
- character-level features
---
## โ
Machine Learning Models
Models evaluated:
- Logistic Regression
- Naive Bayes
- Random Forest
- LinearSVC
- Ensemble Voting Classifier
---
## โ
Best Performing Model
`LinearSVC` achieved the best overall performance for sparse TF-IDF text classification.
---
# ๐ง Technologies Used
- Python
- Pandas
- NumPy
- Scikit-learn
- SciPy
- Streamlit
- Pickle
- Render
---
# ๐ Project Structure
```text
BANKING-FAQ-RAG-SYSTEM/
โ
โโโ app/
โ โโโ streamlit_app.py
โ
โโโ data/
โ โโโ raw_data/
โ โโโ verification_data/
โ โโโ banking_cleaned.csv
โ โโโ banking_processed.csv
โ
โโโ models/
โ โโโ best_model.pkl
โ โโโ word_vectorizer.pkl
โ โโโ char_vectorizer.pkl
โ โโโ label_encoder.pkl
โ
โโโ notebooks/
โ โโโ 01_eda.ipynb
โ โโโ 02_preprocessing.ipynb
โ โโโ 03_intent_classification.ipynb
โ โโโ 04_model_acc_verification.ipynb
โ
โโโ scripts/
โ โโโ download_nlp_resources.py
โ โโโ setup_nltk.py
โ โโโ setup_spacy.py
โ
โโโ test/
โ โโโ test.ipynb
โ
โโโ .gitignore
โโโ LICENSE
โโโ README.md
โโโ render.yaml
โโโ requirements.txt
โโโ runtime.txt
โโโ setup.py
โโโ template.sh
```
---
# โ๏ธ Installation
## 1๏ธโฃ Clone Repository
```bash
git clone https://github.com/your-username/Banking-FAQ-RAG-System.git
```
---
## 2๏ธโฃ Create Virtual Environment
```bash
python -m venv venv
```
Activate environment:
### Windows
```bash
venv\Scripts\activate
```
### Linux / Mac
```bash
source venv/bin/activate
```
---
## 3๏ธโฃ Install Requirements
```bash
pip install -r requirements.txt
```
---
# โถ๏ธ Run Streamlit Application
```bash
streamlit run app/streamlit_app.py
```
---
# ๐ Render Deployment
This project is deployment-ready for Render.
## Deployment Files Included
- `render.yaml`
- `runtime.txt`
- `requirements.txt`
---
# ๐ Machine Learning Workflow
## 1. Data Preprocessing
- lowercasing
- punctuation removal
- whitespace normalization
---
## 2. Feature Engineering
### Word-Level TF-IDF
```python
ngram_range=(1,3)
```
### Character-Level TF-IDF
```python
analyzer='char_wb'
ngram_range=(3,5)
```
---
## 3. Sparse Feature Combination
```python
hstack([word_features, char_features])
```
---
## 4. Model Training
Trained Models:
- Logistic Regression
- Naive Bayes
- LinearSVC
- Ensemble Voting Classifier
---
# ๐ Model Evaluation
Evaluation Metrics:
- Training Accuracy
- Testing Accuracy
- Cross Validation Accuracy
- Classification Report
- Overfitting Gap
---
# ๐งช Verification System
A separate verification dataset was used to:
- validate predictions
- calculate real-world accuracy
- generate classification reports
---
# ๐ฆ Model Artifacts
Saved using `pickle`:
- trained model
- vectorizers
- label encoder
These files are used directly during Streamlit inference.
---
# ๐ฅ๏ธ Streamlit Application Functionalities
## Single Query Prediction
Input:
```text
How to activate UPI?
```
Output:
```text
UPI Services
```
---
## Bulk CSV Prediction
Input CSV:
```csv
Question
How to activate UPI?
What is SWIFT transfer?
```
Output CSV:
```csv
Question,Predicted_Intent
How to activate UPI?,UPI Services
What is SWIFT transfer?,International Banking
```
---
# ๐ Future Improvements
Possible future enhancements:
- BERT / Transformer Models
- Semantic Search
- FAISS Vector Database
- Retrieval-Augmented Generation (RAG)
- Banking Chatbot Integration
- FastAPI Backend
- Docker Deployment
---
# ๐จโ๐ป Author
**Tuktuki Halder**
---
# ๐ License
This project is licensed under the MIT License.
---
# โญ If You Like This Project
Please consider giving this repository a โญ on GitHub.