Spaces:
Sleeping
Sleeping
Commit History
-
Milestone 0.7.0: LLM MEAT extractor (Qwen/Qwen2.5-3B-Instruct + T4)β
Replaces the rule-based MEAT matcher (which couldn't follow implicit references like "Continue metformin" β TREAT-for-DM) with a small instruction-tuned LLM producing structured JSON. Component I's byte-exact substring guarantee still enforces faithfulness downstream. New - app/pipeline/components/f_meat_llm.py::LLMMEATExtractor * Lazy transformers import; CPU-only installs unaffected. * Chat-formatted prompt asking for {"M","E","A","T"} with verbatim quotes or null. * Balanced-JSON parser over the model output. * try_extract() returns None when unavailable / empty list when the LLM saw no MEAT β Composite uses the distinction. Changed - f_meat.py adds CompositeMEATExtractor and a HCC_MEAT_EXTRACTOR_BACKEND env selector. CompositeMEATExtractor only falls back to rule-based when the primary (LLM) is genuinely unavailable; empty LLM output is trusted ("LLM saw no MEAT") to avoid rule-based false positives. - app/api/server.py lifespan spawns a background thread foβ¦5eed8db -
0.6.0: Dark modeβ
Foundation - tailwind.config.ts: darkMode: "class". - ui/src/lib/useTheme.ts: class-strategy toggle with localStorage persistence, prefers-color-scheme fallback on first load, cross-tab sync via storage events. - ui/src/components/ThemeToggle.tsx: header toggle button (Sun/Moon icon). UI sweep β every rendered surface now has a dark: variant: - App shell: header, footer, main background, kbd hints. - TabBar, DisclaimerBanner. - NotePanel (including textarea + highlight preview + gallery select). - HCCList (rows, skeleton, copy/query pills, MEAT dots). - DrillIn (MEAT rows with category bars, risk reasons + component weights, supporting-ICD list, copyable codes). - RAFSummary (three tinted cards + totals footer). - FilteredMentionsPanel (collapsible; struck-through spans retain contrast). - SpecificityHints (amber callout + hint rows). - QueryModal (backdrop, headers, markdown pre block, Copy button). - WelcomeModal (gradient header, body bullets, amber disclaimer, footer kbdβ¦9ce893e -
Milestone 0.5.0: clinical UX pass (chart-query, RAF summary, filtered mentions, glossary)β
Pipeline - Chart-query generator: every HCCCandidate gets query_draft (markdown the coder pastes into their provider-query tool) when any MEAT category is insufficient. None when MEAT is complete. - CodingResult.filtered_mentions: expose every span the pipeline saw but did not attribute, with a FilterReason (negated / family_history / historical_non_chronic / hypothetical). Gives the coder a reassurance surface that the filter didn't overreach. - New helper functions: CodingResult.captured_raf / low_risk_raf / audit_exposure_raf for the RAF summary card. UI - RAFSummary hero card: three tiles (Submit as-is / After query / Audit exposure) with RAF sums + candidate counts. Externalizes the coder's mental model into a single-screen glance. - FilteredMentionsPanel: collapsible, groups dropped spans by reason, shows surface text + section kind + plain-English explanation per bucket. - RiskBadge: color-coded with lucide icons (CheckCircle2 / AlertTriangle / AlertOctagon β¦af68ac3 -
Milestone 0.4.0: narrative + polish (blog, demo script, keybinds, calibrator fit)β
Narrative - docs/BLOG_DRAFT.md β clinical-workflow framing first, ML second. Opens on RADV audits; pitches calibrated + auditable over SOTA F1. - docs/DEMO_SCRIPT.md β 75-second shot-by-shot demo video script with narration, UI actions, and recording hygiene notes. UI polish - ui/src/lib/useKeybinds.ts + App.tsx wiring: β/Ctrl + Enter codes the note; j / β and k / β navigate the HCC suspect list. Disabled while focus is in an editable control. - HCCList now shows a three-row animated pulse skeleton while loading, an informative empty-state explaining negation/family-history/historical filtering, and a pre-run state pointing at the keyboard shortcut. - Footer surfaces verifier_drops alongside latency β S1 is visible per run. - Header shows the keybinding cheatsheet on md+ screens. Calibrator - g_calibrator.default_calibrator() now loads data/models/calibrator.pkl if present (overridable via HCC_MEAT_CALIBRATOR_PATH). Identity fallback unchanged. - scripts/fit_calibratoβ¦6fc49c1 -
Milestone 0.3.0: coder-voiced README, benchmark button, NER feature flag, CMS fetcherβ
README - Opening rewritten in coder vocabulary (suspect list / capture / MEAT / RADV risk / hierarchy trumping). Targets the S4 30-second recruiter skim. Benchmark endpoint + UI - POST /api/benchmark re-runs every gallery item live and returns min/median/p95/max/mean ms + per-case timings. Surfaces the S2 target (8000 ms p95 on CPU free tier) explicitly. - MetricsTab now has a "Run gallery benchmark" button with a red/green p95 card and a collapsible per-case breakdown. NER backend feature flag - New TransformersNER wrapper around the HF token-classification pipeline with lazy import + label normalization onto SpanType. - default_ner() reads HCC_MEAT_NER_BACKEND (dictionary|transformers) and HCC_MEAT_NER_MODEL (default blaze999/Medical-NER). - test_ner_backend_selection.py asserts selector behavior without importing transformers when the env var is unset β keeps CI lean. CMS fetcher - scripts/fetch_cms_hcc_v28.py now has two subcommands: inspect β download the CMS β¦e43bca6 -
Milestone 0.2.0: metrics tabs, TF-IDF linker, 25-case fixture, Synthea scaffoldβ
UI - Add Metrics / Calibration / Subgroups / About tabs alongside the existing three-panel Coding view. - Wire a TabBar so switching tabs doesn't rerun the pipeline. API - New GET /api/metrics returning a snapshot computed against the regression fixture at startup. Shape is frozen for the UI contract. Pipeline - New TFIDFLinker β sklearn char-ngram TF-IDF over ICD-10 descriptions with an alias fast-path and exact-description shortcut. Now the default; the prior ExactMatchLinker stays available for lean runs. - Introduce a Linker Protocol in d_linker and drop the concrete dep on ExactMatchLinker from the orchestrator. Fixtures - Expand regression_suite.json from 10 β 25 cases: paroxysmal AF, unstable angina, hepatitis-C + cirrhosis trumping, PVD, COPD exacerbation, lowercase + typo'd notes, resolved acute, three-level kidney hierarchy, rare HCC-48, systolic-CHF specificity, pulmonary fibrosis, hypothetical workup, long multi-specialty prose, and an empty-note edge cβ¦cd5b31c -
Tighten MEAT extractor candidate-mention matcherβ
The prior _mentions_candidate fired on any label token with len > 3, which includes function words like "with" that appear in many HCC labels β giving false-positive MEAT matches on unrelated sentences. New matcher: 1. Primary: the NER-grounded condition surface text (so "DM2" matches). 2. Fallback: distinctive label tokens (len >= 5, stoplist-filtered). 3. Final: distinctive tokens from supporting ICD-10 descriptions (len >= 6). Also log the HF Space remote URL (charlesyapai/hcc-meat-coder) in the BUILD_LOG backlog and add repository_git_clone.txt to .gitignore as local scratch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>78549ab -
Initial scaffold: HCC-MEAT Coder v0.1.0β
End-to-end runnable pipeline with rule-based baselines in place of ML components, a FastAPI backend serving a React three-panel UI, and a 10-case regression suite guarding the invariants from AGENT_BRIEF.md Β§3 (faithfulness, negation/family-history filtering, hierarchy trumping, transparent risk). Deterministic components (real, tested): - E β HCC crosswalk + trumping over CMS-HCC v28 seed tables - H β over-coding (RADV) risk heuristic with named components + reasons - I β faithfulness verifier (substring guarantee + NLI hook) Baseline / swappable components: - A segmenter, B dictionary NER, C negation, D exact/alias linker, F rule-based MEAT extractor, G identity calibrator Infra: uv-driven pyproject, ruff + pytest + pre-commit, GH Actions CI for Python and UI, multi-stage Dockerfile for the HF Docker Space, typer CLIs for pipeline (`hcc-meat`) and evaluation (`hcc-meat-eval`). Reference data in data/reference/ uses PLACEHOLDER RAF weights; hydrate via scripts/fetch_cms_hcc_v28.β¦c6cfe5f