MedNote
CLINICAL NLP / FULL-STACK AI
MedNoteClassifier — Clinical Feature Span Extraction
A full-stack clinical NLP solution for automated span extraction on the NBME® Clinical Patient Notes dataset, pairing PyTorch sequence tagging with a React 19 interactive annotation dashboard.
Unstructured clinical patient notes contain vital diagnostic criteria buried in free-text prose, making manual grading, rubric alignment, and standardized extraction tedious and prone to inter-annotator variance.
An end-to-end clinical NLP span extraction pipeline combining lexicon matching, hybrid n-gram classification, and deep transformer sequence tagging, served through a real-time annotation and benchmarking web interface.
MedNoteClassifier is a clinical NLP solution designed for automated span extraction on the NBME® — Score Clinical Patient Notes dataset (USMLE® Step 2 Clinical Skills). The system identifies exact character offsets [start, end] in unstructured patient notes corresponding to standardized rubric concepts (e.g., 'heart pounding', 'family history of MI').
The workspace bundles a high-performance Python machine learning engine with a modern React 19 & Vite web application. The ML pipeline ensembles an Exact Lexicon Matcher with strict word-boundary enforcement, a Hybrid Character N-Gram Logistic Regression model, a PyTorch BIO sequence Transformer, and hooks for fine-tuned PubMedBERT models.
The interactive web dashboard provides clinicians and researchers with real-time text tokenization, span visual highlighting, and comparative micro-F1 benchmark evaluation across candidate model checkpoints.
Architecture in Action
Visual walk-through of the operational pipeline, core algorithmic stages, and execution telemetry. Click any diagram to inspect in full resolution.

Exact Character Offset Extraction & Highlight Inspector
Interactive clinical annotation workspace displaying patient note free-text with real-time character-level offset boundaries [start, end]. Color-coded highlights isolate clinical entities (palpitations, substernal chest pressure, exertional dyspnea, family MI history) mapped directly against standardized NBME rubric concepts.

Ensemble Architecture: Lexicon Matcher, N-Gram & PyTorch BIO Transformer
End-to-end inference ensemble fusing an Exact Lexicon Matcher with strict boundary enforcement, a Character N-Gram Logistic Regression classifier for irregular typos, and a deep PyTorch BIO sequence Transformer (PubMedBERT). An arbitration decoder merges candidate probabilities into contiguous and discontinuous span offsets.

Kaggle Benchmark Evaluation & Validation Micro-F1 Analytics
Comprehensive model evaluation dashboard displaying test set character-level Micro-F1 scores (0.893 test score), precision-recall curves, and cross-entropy loss trajectories across DistilBERT, PubMedBERT, and the final ensemble checkpoint.
System Components
React 19, Vite, TanStack Router, and Tailwind CSS v4
Node.js & Express API bridge with Python 3.10+ subprocess execution
NBME patient notes corpus, Kaggle evaluation rubrics, and serialized PyTorch checkpoints
PyTorch BIO Transformer, DistilBERT / PubMedBERT fine-tuning, Character-level Micro-F1 evaluation engine
Core Implemented Features
- Exact character-level offset decoder ([start, end]) for unstructured clinical patient notes
- Multi-model inference ensemble: Exact Lexicon Matcher, Hybrid Char N-Gram LogReg, and PyTorch BIO Transformer
- Interactive clinical span annotator with real-time text highlighting and prediction visualizer
- Character-level Micro-F1 evaluation engine and automated model comparison benchmarking suite
- Extensible training harness for fine-tuning PubMedBERT and DistilBERT on specialized clinical ontologies
- Streamlit standalone interactive demo app alongside modern React 19 web dashboard
Overcoming Bottlenecks
Clinical patient notes feature complex medical abbreviations, misspellings, and discontinuous symptom mentions. Mapping exact character offsets from subword transformer tokens back to raw character slices required a custom offset indexer to prevent prediction drift.
Visual Artifacts & Diagrams



