A few years ago I started building a small app for people with ADHD. Journaling, check-ins, mood tracking, nothing groundbreaking. Somewhere in that process I added a Hugging Face emotion model to tag journal entries, mostly because I wanted to see whether it could pick up emotional patterns in what people were writing.
At first it was just a side feature. Then it kept growing. And over time, especially while working in behavioral health, I realized the interesting problem was not the model itself. It was the gap around clinical text.
There is still no real open source tool for looking at an intake note or therapy session summary and flagging the kinds of things clinicians actually need to catch. Not just a binary "suicidal or not," but broader signal detection across self-harm, harm to others, medication non-adherence, substance use, and clinical deterioration. Not just keyword spotting, but handling negation well enough to distinguish "denies SI" from suicidal ideation, and temporal context well enough to separate "attempt in 2019" from "I want to die right now."
That gap is what led me to start building bh-sentinel.
It is an open source behavioral health clinical safety signal detection project: 40 clinical flags across 6 domains, mapped to C-SSRS, with a 4-layer pipeline that combines deterministic pattern matching, transformer classification, emotion analysis, and configurable compound risk rules. I also spent a lot more time than expected working through an FDA Non-Device CDS compliance framework, because for something in this space, the architecture matters as much as the detection itself.
One of the better parts of this work was pressure-testing the taxonomy with clinical leadership. I handed the pattern library to our Head of Clinical Operations, and she immediately told me the psychosis flags needed work. She was right. The taxonomy is better because of that review.
I pulled the thinking together into a whitepaper covering the clinical flag taxonomy, detection architecture, escalation and compound risk rules, emotion lexicon, deployment model, and FDA compliance analysis. It ended up being 37 pages.
This is still early. It is not a finished product. Right now it is a whitepaper, an architecture, a taxonomy, and the beginning of the code. But I would rather share it in the open and make it better through feedback than wait for some imaginary version of perfect.
If you work in behavioral health tech, clinical informatics, or healthcare NLP, I'd genuinely value your perspective.
Whitepaper: Open Source Clinical Safety Signal Detection for Behavioral Health (PDF)
GitHub: bh-healthcare/bh-sentinel