Production-Ready ML Application for Intelligent Ticket Classification
View Live Demo View on GitHub
Live Demo: https://nlp-support-ticket.up.railway.app
GitHub: https://github.com/ijonathans/nlp-support-ticket
This project delivers a production-ready NLP system that automatically routes customer support tickets to the correct department with 67.2% accuracy and 1.28ms inference latency. The system implements a human-in-the-loop strategy using confidence thresholding, achieving 78% accuracy on 70% of tickets while routing uncertain cases to human agents.
Manual ticket routing in customer support is:
Build a text classification system that:
| Department | Count | Percentage | Imbalance Ratio |
|---|---|---|---|
| Tech Support | 7,343 | 44.9% | 1.00x (majority) |
| Product Support | 3,073 | 18.8% | 2.39x |
| Customer Service | 2,646 | 16.2% | 2.77x |
| Billing | 1,595 | 9.8% | 4.60x |
| Returns | 820 | 5.0% | 8.95x |
| Sales | 513 | 3.1% | 14.31x |
| HR | 348 | 2.1% | 21.10x (minority) |
| Department | Precision | Recall | F1-Score | Performance |
|---|---|---|---|---|
| Billing | 0.91 | 0.75 | 0.82 | ⭐⭐⭐⭐⭐ Excellent |
| Tech Support | 0.71 | 0.84 | 0.77 | ⭐⭐⭐⭐ Strong |
| Customer Service | 0.53 | 0.56 | 0.54 | ⭐⭐⭐ Moderate |
| Product Support | 0.56 | 0.51 | 0.53 | ⭐⭐⭐ Moderate |
| HR | 1.00 | 0.36 | 0.53 | ⚠ Low Recall |
| Returns | 0.70 | 0.38 | 0.49 | ⚠ Low Recall |
| Sales | 0.65 | 0.27 | 0.39 | ⚠ Poor |
| Metric | Baseline (TF-IDF + LR) | Deep Learning (CNN) | Improvement |
|---|---|---|---|
| Accuracy | 49.2% | 67.2% | +18.0% |
| Macro F1 | 48.9% | 58.2% | +9.3% |
| Latency | N/A | 1.28ms | ⚡ Fast |
The system routes low-confidence predictions to human agents, balancing automation and accuracy.
| Threshold | Coverage | Reject Rate | Auto Accuracy | Strategy |
|---|---|---|---|---|
| 0.50 | 92.4% | 7.6% | 70.2% | Aggressive automation |
| 0.60 | 83.1% | 16.9% | 73.6% | Moderate automation |
| 0.70 | 74.5% | 25.5% | 76.2% | Balanced |
| 0.75 | 70.0% | 30.0% | 78.1% | ⭐ Recommended |
| 0.80 | 63.7% | 36.3% | 79.4% | Conservative |
Problem: PyTorch with CUDA support is 2.5 GB
Solution: Switched to PyTorch CPU-only (205 MB)
Result: Image size reduced to ~2 GB
Problem: app.py had wrong parameters (embed_dim=150, filters=128)
Solution: Updated to match trained model (embed_dim=200, filters=256)
Result: Model loads successfully
Problem: Gunicorn workers didn't inherit global variables
Solution: Added --preload flag and lazy loading check
Result: Model accessible in all workers
Text classification, class imbalance handling, model evaluation
CNN architecture, PyTorch, training optimization
Flask API, frontend development, Git version control
Docker, cloud deployment, production optimization
EDA, preprocessing, feature engineering, visualization
Problem scoping, ROI analysis, risk management
This project successfully delivers a production-ready NLP system that automates 70% of support ticket routing with 78% accuracy. The system demonstrates technical excellence through an end-to-end ML pipeline, delivers clear business value through significant efficiency gains, and maintains production quality with sub-2ms latency.
| Criterion | Target | Achieved | Status |
|---|---|---|---|
| Accuracy | >60% | 67.2% | Exceeded |
| Latency | <10ms | 1.28ms | Exceeded |
| Deployment | Production-ready | Deployed on Railway | Complete |
| Automation | >50% | 70% | Exceeded |
| Code Quality | Clean, documented | Well-structured | Complete |
This project showcases my ability to deliver complete machine learning solutions from conception to production deployment, demonstrating end-to-end data science and software engineering capabilities.