abdulhafis/growwithme-nana-nlu
GrowWithMe Nana NLU v2 — offline intent + subject classifier
On-device natural-language understanding for Nana, the AI care assistant in GrowWithMe, a maternal & child health app for Northern Ghana. When the phone has no internet, this model classifies what the caregiver said (in Ghanaian English / Pidgin, with SMS-style typos) so the app can act — replies are curated in-app; the model never generates text, so it cannot hallucinate health advice.
Files
Task
Input: one caregiver utterance → intent (one of 17) + subject (child / pregnancy / unknown).
Intents: starthealthcheck, openaddchild, openaddpregnancy, plandiet, readtoday, gettip, logweight, setreminder, greeting, helpother, askdangersigns, askfeedingquestion, askvaccine, findclinic, opencalendar, opentips, start_checkin
Metrics (this training run)
Training data: 5201 examples from a Ghana-grounded generator (Pidgin constructions, SMS noise, local foods, hard negatives) + optional LLM distillation.
Featurizer contract (required to use the model)
Input is an L2-normalized 8192-dim hashed bag of features: lowercase; [^a-z0-9' ]→space; word unigrams u:tok, bigrams b:t1_t2, char trigrams c:xyz of ^tok$; bucket = FNV-1a-32(feature) % 8192. Output tensor = [17 intent probs] + [3 subject probs] concatenated. Reference implementations: ml/train_nana_nlu.ipynb (Python) and mobile/lib/data/model/nlu_service.dart (Dart) in the GrowWithMe repo.
Safety design
- The app runs a deterministic symptom-keyword check BEFORE this model; a symptom mention always routes to the health check regardless of model output.
- Below confidence 0.5 the app falls back to keyword matching.
- Decision support for app navigation only — not a medical device.
