reliable · intermediate · 50 min
Grade with a judge you have checked
Use a model to grade answers, and prove first that it grades the way you do.
HANDS-ON LAB · YOU RUN IT ON YOUR MACHINE · 4 STEPS
-
Grade 40 claim decisions yourself: right or wrong
Run this to check
wc -l labels.csvYou pass when
41 lines: a header and 40 rows of claim, decision and your grade. Make about a quarter of them wrong decisions.
Files you write
- labels.csv
-
Write a judge prompt and grade the same 40 with a model
Run this to check
uv run --with openai --with scikit-learn judge.py labels.csvYou pass when
A 2 by 2 table of your grade against the judge's, with precision and recall.
Files you write
- judge.py
- JUDGE.md
-
Print agreement beyond chance (Cohen's kappa)
Plain agreement flatters a judge when most answers are right. Kappa takes out the agreement you would get by luck.
Run this to check
uv run --with openai --with scikit-learn judge.py labels.csv --kappaYou pass when
A number up to 1. Below 0.6, read the rows you disagree on, tighten the judge prompt and run again.
Files you write
- JUDGE.md
-
Decide which mistake is worse: paying a bad claim or refusing a good one
Run this to check
cat COSTS.mdYou pass when
A price on each mistake, and the judge setting you chose because of it.
Files you write
- COSTS.md
No transcript here on purpose. This page does not show terminal output, because model answers differ from run to run. Each step says what a pass looks like; your own terminal is the proof.