An AI-powered text analysis tool with explainable predictions using SHAP and LIME for suicide risk detection. See report at report.pdf.
- Accuracy: 92%
- Base Model: BERT (bert-base-uncased)
- Dataset: Kaggle Suicide and Depression Detection (12,000+ samples)
- Labels: Binary classification (Suicidal / Non-Suicidal)
- Real-time text classification
- SHAP (SHapley Additive exPlanations) visualizations
- LIME (Local Interpretable Model-agnostic Explanations) analysis
- Minimalist black & white UI
- REST API endpoint
- Production-ready with Gunicorn
- Python 3.10+
- Git
- Git LFS (for model files)
- UV package manager (recommended) or pip
# Clone repository
git clone git@github.com:creme332/suicide-detector.git
cd suicide-detector
# Create virtual environment and install dependencies
uv venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -r requirements.txt
# Run the app
uv run python app.py# Clone repository
git clone git@github.com:creme332/suicide-detector.git
cd suicide-detector
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run the app
python app.pyAccess the app at http://localhost:5000 in your browser.
curl -X POST http://localhost:5000/api/predict \
-H "Content-Type: application/json" \
-d '{"text": "I feel hopeless and dont want to live"}'- Backend: Flask
- ML Framework: PyTorch, Transformers
- Explainability: SHAP, LIME
- Frontend: HTML, CSS, JavaScript
- Deployment: Gunicorn
