Skip to content
All projects
NLP

AetherMind

I built prototype scaffolding for a mental-health chat backend: sentence-transformer embeddings for intent matching, a layered safety check for crisis language, and auth and storage modules around them.

Pipeline06 stages
  1. 01
    Chat message
  2. 02
    Sentence-transformer embedding
  3. 03
    Cosine similarity intent match
  4. 04
    Regex + classifier safety check
  5. 05
    Tiered escalation
  6. 06
    SQLite session store
Schematic, not a screenshot

01Problem

A mental health chat tool has to read intent quickly and recognise crisis language reliably, and getting either wrong matters more than in an ordinary chatbot.

02Implementation

  • Intent recognition using all-MiniLM-L6-v2 sentence-transformer embeddings compared by cosine similarity against a 0.65 threshold, with per-session context tracking and an LRU embedding cache.
  • A safety engine layering regex crisis patterns over a Transformers text-classification pipeline with spaCy parsing and tiered escalation.
  • A BERT fine-tuning script for the distress detector using bert-base-uncased sequence classification with the Hugging Face Trainer, class weights, early stopping and Weights & Biases tracking.
  • A SQLite storage layer with a managed-cursor context manager, schema migration and a thread pool for concurrent reads.
  • FastAPI authentication scaffolding with Argon2 password hashing and JWT.

03Models

all-MiniLM-L6-v2 (sentence-transformers)
Embeds messages so intent can be matched by cosine similarity.
Regex crisis patterns
First-pass rule layer for explicit crisis language, ahead of any model.
bert-base-uncased sequence classification
Target of the distress-detector training script. No trained weights are committed.

04Input data

Chat text, with a small synthetic sample CSV in the repository. No real conversational dataset is included.

05Results

This is prototype scaffolding rather than a running service. The safety, NLP, storage and auth modules are sketched out, but no model was trained to completion here, no weights or evaluation results are committed, and nothing is deployed.

No model was trained to completion in this repository, so there are no metrics to report. Treat this as an architecture exploration.

06Stack

Pythonsentence-transformersTransformersspaCyFastAPIJWTSQLite

07Visuals

Screenshot or architecture diagram to be added