This project evaluates nursing documentation notes against quality criteria using an LLM, then compares predictions to labelled ground truth (Met/Unmet).
experiments.ipynb: main notebook to run the full workflow.utils.py: helper functions for prompt creation, model calls, parsing, scoring, and reporting tables..env: environment variables (for exampleOPENAI_API_KEY).requirements.txt: Python dependencies.
- Load labeled data from
data.xlsx. - Select model provider (
openaiorhf). - Build a gold-standard table from the labeled columns.
- Evaluate each target note against quality criteria.
- Compute overall, per-note, and per-criterion accuracy.
- Display compact and detailed prediction tables.
Place a data.xlsx file in the project root with:
id: unique note identifier.note: note text.- One or more additional columns, each representing a quality criterion with values:
MetUnmet
Example schema:
| id | note | Criterion A | Criterion B |
|---|---|---|---|
| 1 | ... | Met | Unmet |
| 2 | ... | Unmet | Met |
python -m venv .venv
source .venv/Scripts/activate # On Windows Git Bash
pip install -r requirements.txtCreate a .env file:
OPENAI_API_KEY=your_api_key_hereStart Jupyter and open the notebook:
jupyter notebookThen run cells in experiment.ipynb from top to bottom.
In experiment.ipynb:
provider = 'openai'to use OpenAI API.provider = 'hf'to use Hugging Facetransformerspipeline.modelcontrols which model is used for either provider.example_note_idscontrols which notes are used as in-context examples.
The notebook produces:
- Evaluation summary (overall and breakdown metrics).
predictions_df: compact predictions table.detailed_df: side-by-side predicted vs gold labels.
- Hugging Face models may require significant RAM/VRAM depending on selected model size.
- If Excel loading fails, verify
openpyxlis installed anddata.xlsxexists in the root directory.