CoolFace
Modelpublic

alexanderfeix/qwen3-1.7B-Instruct_doctor-notes

sourceHugging Faceupdated 1y agoView on Hugging Face
1likes7downloads
Model Card

Fine-tuned Qwen3-1.7B-Instruct โ€” From Doctor Notes ๐Ÿ‘จ๐Ÿผโ€โš•๏ธ to JSON ๐Ÿ—’๏ธ

Task: Convert short doctor/therapist notes into JSON, in format:

  • โ€”summary (string)
  • โ€”tags (comma-separated)
  • โ€”risk-level (0โ€“10 integer)

Base Model

๐Ÿš€ Very lightweight, runs locally on almost any doctor computer, which ensures data privacy on confidential medical patient data.

  • โ€”unsloth/Qwen3-1.7B-unsloth-bnb-4bit

Training

  • โ€”Method: QLoRA (r=16, alpha=32, dropout=0.03)
  • โ€”Target modules: q_proj,k_proj,v_proj,o_proj
  • โ€”Context length: 2048
  • โ€”Optimizer: adamw_8bit
  • โ€”Time: One epoch, 26 min on one L4 GPU

Dataset

A total of 4524 training pairs, consisting of input doctor notes and the JSON data as output. During training, 565 evaluation pairs were used and 395 for final model testing. Around 60% is crawled reddit data from subreddits like r/depression, the other 40% were synthetically generated by GPT-5-mini. Example data format:

{"input": "You are a clinical note assistant. Given terse doctor notes from a patient session, produce a JSON with fields summary (clear, neutral), tags (comma-separated), and risk-level (0-10). Only output valid JSON.\n\nDoctor notes:\nPatient reports recurrent flashbacks and nightmares after military deployment and avoids reminders. States occasional passive thoughts about death but no plan or intent; increased startle and hypervigilance noted. Continue trauma-focused therapy and safety planning reviewed.", "output": "{\"summary\": \"Patient reports recurrent PTSD symptoms with flashbacks, nightmares, avoidance, hypervigilance, and occasional passive thoughts about death but no plan or intent.\", \"tags\": \"PTSD,Anxiety,Self-harm\", \"risk-level\": 6}"}

Evaluation Results

MetricValue of FT-ModelValue of Base-ModelImprovement
JSON validity rate0.98480.9570+2.9% โœ…
Tag precision0.75400.1850+307.6% โœ…
Tag recall0.71590.3406+110.2% โœ…
Tag F1 score0.73440.2398+206.3% โœ…
Tag exact match0.26480.0000
Risk MAE0.73522.2434โˆ’67.2% (lower is better) โœ…
Risk RMSE1.07792.7898โˆ’61.4% (lower is better) โœ…
Rouge F1 score0.48280.4240+13.9% โœ…
High risk recall0.98780.9250+6.8% โœ…
High risk precision0.88040.4868+80.9% โœ…
High risk F1 score0.93100.6379+45.9% โœ…

A more comprehensive model evaluation with additional plots can be found in the GitHub repository

Intended Use & Limitations

  • โ€”For summarizing structured notes only. Not a diagnostic tool.
  • โ€”High-risk predictions (โ‰ฅ8) should be reviewed by a clinician.

Prompt format

Use the chat template shipped here.

<|im_start|>system  
You are a clinical note assistant. Given terse doctor notes from a patient session, output ONLY valid JSON with fields: summary (clear, neutral), tags (comma-separated), and risk-level (0-10).<|im_end|>  
<|im_start|>user  
Patient reports feeling increasingly anxious about work deadlines and has trouble sleeping at night. She mentions a racing mind and difficulty concentrating during the day. No self-harm thoughts expressed.<|im_end|>  
<|im_start|>assistant  
<think>  

</think>  

{  
  "summary": "e.g: Patient reports increased anxiety about work deadlines, difficulty sleeping, racing mind, and trouble concentrating during the day. No self-harm thoughts.",  
  "tags": "e.g: anxiety, insomnia, concentration, stress",  
  "risk-level": e.g: 4  
}<|im_end|>