Enhancing Bangla Document Classification Using a Hybrid Ensemble of Bangla-BERT and Bi-LSTM Models
(IDAA 2025 – Published Research)
This repository contains a production-ready Django web application for Bangla document classification using a hybrid ensemble of Bangla-BERT and Bi-LSTM models.
The system is designed for research, academic demonstration, and real-world deployment of Bangla NLP models.
This project is production-ready and fully containerized with Docker.
docker build -t bangla-classifier .
docker run -p 8000:8000 bangla-classifier
http://localhost:8000
# Tag for Docker Hub
docker tag bangla-classifier your-username/bangla-classifier
docker push your-username/bangla-classifier
# Or for DigitalOcean Container Registry
docker tag bangla-classifier registry.digitalocean.com/your-registry/bangla-classifier
docker push registry.digitalocean.com/your-registry/bangla-classifier
git clone https://github.com/Mahedi9/Django-Bangla-Document-Classification-Using-Deep-learning.git
cd Django-Bangla-Document-Classification-Using-Deep-learning
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
http://127.0.0.1:8000/
The application classifies Bangla news articles into eight categories using a hybrid ensemble learning strategy:
- Bi-LSTM for sequential text representation
- Bangla-BERT for contextual semantic understanding
- weighted voting ensemble with confidence-based decision logic
The system produces:
- Final prediction with confidence
- Model-wise predictions
- Probability distribution visualizations
- Ambiguity warnings when predictions are uncertain
- Hybrid ensemble of Bi-LSTM + Bangla-BERT
- Confidence threshold–based ambiguity detection
- Model-wise prediction cards with probabilities
- Probability bar charts for each model
- Class-wise probability table
- Minimum input validation (≥ 20 Bangla words)
- Clean, responsive UI using Bootstrap
- Modular Django ML architecture
- Economy
- Education
- Entertainment
- International
- National
- Politics
- Science_Technology
- Sports
bangla_classifier_django/
├── bangla_classifier_django/
│ ├── settings.py
│ ├── urls.py
│ ├── asgi.py
│ └── wsgi.py
│
├── classifier/
│ ├── ml/
│ │ ├── loader.py (Model loading)
│ │ ├── preprocess.py (Text cleaning & stopword removal)
│ │ └── predict.py (Inference & ensemble logic)
│ │
│ ├── templates/classifier/
│ │ └── index.html (UI template)
│ │
│ ├── views.py (Controller logic)
│ ├── urls.py
│ └── apps.py
│
├── models/
│ ├── bilstm_model.keras
│ ├── bilstm_tokenizer.pkl
│ ├── bilstm_label_encoder.pkl
│ └── bangla_bert_model/
│
├── static/
├── Dockerfile
├── manage.py
├── requirements.txt
├── .gitignore
└── .gitattributes
- User submits a Bangla news article (minimum 20 words)
- Text is preprocessed (cleaning, stemming, stopword removal)
- Bi-LSTM and Bangla-BERT generate class probabilities
- Probabilities are combined using soft voting
- Confidence threshold determines final decision
- Results are visualized and displayed
- Dataset: Potrika Bangla News Dataset
- Total Articles: 329,110
- Number of Classes: 8
- Hybrid Ensemble Accuracy: 97.16%
Title
Enhancing Bangla Document Classification Using a Hybrid Ensemble of Bangla-BERT and Bi-LSTM Models
Conference
International Conference on Intelligent Data Analysis and Applications (IDAA 2025)
Venue
Daffodil International University, Dhaka, Bangladesh
Mahedi Hasan Emon
Researcher | Bangla NLP | Deep Learning
Published Author – IDAA 2025
- Potrika Bangla News Dataset
- Hugging Face Transformers
- TensorFlow
- PyTorch
- bnltk
- Daffodil International University
This project is released for research and educational use.
For commercial usage, please contact the author.