Skip to content
dgDavid Gray
All work

Patient Care Portal Triage

An NLP pipeline that routes patient portal messages to the right team and surfaces relevant evidence-based research while they wait for a human.

Type
Research
Year
2025
Built with
PyTorch · EmbeddingGemma · NLP · Information retrieval

Patient portals have a quiet failure mode: a question lands in a generic inbox, waits, and gets forwarded twice before it reaches someone who can answer it. The patient learns nothing in the meantime.

This project attacks both halves of that. A classifier triages incoming queries to the correct team — insurance, scheduling, medical advice, and so on — and an information retrieval step surfaces relevant evidence-based research so the patient has something credible to read while they wait for a professional.

How it works

I built the classifier in PyTorch on top of sentence embeddings from Google’s EmbeddingGemma 300M model. Working on embeddings rather than raw text means the classifier stays small, trains fast, and generalises across the enormous variety of ways people describe the same problem.

What I’d want before it touched a real patient

The honest answer is: a lot. Confidence thresholds with a human fallback, explicit handling for anything that reads as an emergency, and retrieval that can only cite a vetted corpus. Healthcare is exactly the domain where the interesting question is not “how accurate is it” but “what does it do when it is wrong.”

Let's connect

Have something hard that has to work?

Contract work, a full-time role, or a problem you want a second opinion on — I read every message and reply to the ones that aren't a template.

Email me

Usually replies within 24 hours · St. Louis, Missouri

ESC

Home

Main landing page & highlights

Page

Work

All engineering projects & case studies

Page

Writing

Technical notes & engineering articles

Page

Photos

Photography & outdoor expeditions

Page

About

Background, career timeline & skills

Page

Contact

Email, inquiries & consultation

Page

Copy Email Address

davidgraymi@gmail.com

Action

Toggle Light / Dark Theme

Switch color theme

Action

Download Résumé

Word document (.docx)

Download

Play Wordlet

Launch the Flutter word puzzle in browser

Game

Visit GitHub

github.com/davidgraymi

External

Visit LinkedIn

linkedin.com/in/david-gray-mi

External

A processor built from the ground up

Kernel, task scheduler and communication protocol written from nothing, in C and Ada, now in production and distributed globally.

Professional

Sign Language Interpretation System

Control any smart device with American Sign Language — hand tracking, a gesture classifier and grammar correction, wired together over a client-server link.

Capstone

A system library that runs anywhere

One portable C++ library targeting any RTOS or bare-metal system, packaged with Docker, Bazel and GitLab CI — cutting porting work by 4×.

Professional

Patient Care Portal Triage

An NLP pipeline that routes patient portal messages to the right team and surfaces relevant evidence-based research while they wait for a human.

Research

Bindersnap

GitHub for everyone who doesn't use GitHub — document management, review lifecycle, team collaboration, search and an in-browser editor.

Personal

Wordlet

A word guessing game built in Flutter and compiled to the web — playable right here, no install, no account.

Personal

Reinforcement Learning applied to Tetris

An agent that learns to play Tetris — a genuinely fun excuse to get hands-on with reward shaping.

School

Handwritten digit recognition with weighted KNN

A KNN classifier for handwritten digits, plus a k-value optimizer that collapses repeated distance calculations into a single pass.

School

ID3 mushroom classification

A from-scratch ID3 decision tree that predicts whether a mushroom is edible or poisonous from its attributes.

School

Healthcare length-of-stay estimator

A data mining project predicting how long a patient will stay, from admission-time features.

School

This website

A static site built with Astro, hosted free on GitHub Pages, designed so writing a post costs one markdown file and nothing else.

Personal

I rebuilt this site so that publishing costs one file

The old site was a single 41,000-character index.html. Every change was archaeology. Here is what I replaced it with and why the constraint was maintenance, not design.

Post
to navigate to select
Linear / Raycast mode