Multiclass NLP classifier for Kenyan university student mental-health text (Depression, Alcohol, Suicide, Drugs) — IndabaX Kenya / Zindi Tech4MentalHealth hackathon
# IndabaX Kenya — Tech4MentalHealth
Multiclass NLP system that classifies statements from Kenyan university students into mental-health support categories for a chatbot prototype.
Built for the **IndabaX Kenya Tech4MentalHealth Hackathon** on Zindi.
---
## Problem
Students respond to the prompt *“What is on your mind?”* with short, noisy, slang-heavy text. The model must assign probabilities for:
| Class | Description |
|-------|-------------|
| **Depression** | Low mood, stress, hopelessness, academic/emotional strain |
| **Alcohol** | Alcohol use, craving, quitting, related harm |
| **Suicide** | Suicidal ideation, meaning of life, crisis language |
| **Drugs** | Substance use (including local terms such as *bhang*) |
**Evaluation metric:** Log Loss (lower is better)
**Output format:** per-class probabilities in `[0, 1]` (need not sum to 1)
---
## Results (public leaderboard)
| # | Submission | Approach | Public Log Loss |
|--:|------------|----------|----------------:|
| 1 | `01_calibrated_ensemble.csv` | Optimized classical + tree blend with calibration | 0.4173 |
| 2 | `02_antioverfit_mix.csv` | Anti-overfit ComplementNB mix with softened prior blend | 0.4409 |
| 3 | `03_cnb_svc_blend.csv` | ComplementNB + calibrated LinearSVC (TF-IDF word/char + keywords) | 0.4376 |
| 4 | `04_power_from_sub5.csv` | Reverse-psychology upgrade of best lineage (multi-seed bag + pseudo-labels) | 0.4056 |
| 5 | `05_last_bullet.csv` | Final upgrade of POWER lineage (7-seed dual-variant + stronger repair) | **0.4002** *(best)* |
Lower is better. Best public score achieved: **0.4002**.
---
## Method (final reproducible pipeline)
The maintained trainer in `src/train.py` focuses on a strong, interpretable classical stack:
1. **Text normalization** — light spelling fixes while preserving local slang
2. **Features**
- TF-IDF word n-grams `(1, 2)`
- TF-IDF character n-grams `(3, 5)` (robust to typos)
- Domain keyword indicators (depression / alcohol / suicide / drugs)
3. **M …