Judgement sets
A judgement set is a YAML file, conventionally named *.judgements.yaml. It holds queries and, for each, the documents a
person (or a reviewed LLM) judged, with a grade.
name: fruit
description: A tiny example set.
k: 5
threshold: 1
gates:
candidate: {ndcg@5: 0.7, success@1: 0.5}
queries:
- q: yellow fruit
id: q1
intent: wants fruits that are yellow
tags: [colour]
ratings: {/banana: 3, /lemon: 2, /apple: 0}
- q: citrus
relevant: [/lemon, /orange]
- depth the metrics are measured at
- the lowest grade that counts as relevant (default 1)
- per target; a breach exits 1
- optional stable key; defaults to the query text
- optional; the LLM judge reads it
- metrics are also reported per tag
- grades 0 and up
- shorthand: grade 1 each
Grades are integers from 0 up; 0 is irrelevant and 3 is a perfect answer in the examples on these pages. A document counts as
relevant when its grade is at least threshold. nDCG uses the grades themselves, so a grade-3 document is worth much more than a grade-1 one. The other metrics
only need relevant or not.
relevant: [...] is shorthand for a list of documents at the threshold grade, for when you only know which documents are right.
id is optional and defaults to the query text. Give a query an id when:
- the query text changes but it is the same query (so comparisons stay paired across runs);
- a TREC run file keys its rows by topic id: the run's
q1is matched to the set'sid: q1; - two queries have the same text but different intents (ids must be unique, and judy rejects a duplicate).
intent says in a sentence what the searcher wants. The LLM judge reads it next to the query. It helps
with ambiguous queries ("jaguar").
Every query can carry tags. Scorecards and results files report each metric per tag, next to the overall number. judy adds two groups itself. One is
words:1, words:2 and words:3+, by query length. The other is mode:lexical, mode:semantic or mode:hybrid, by how
the query was answered (see modes).
gates maps a target name to minimum metric values. judy run prints each gate as ok or FAIL. It exits with code 1 when
a gate fails:
gates
FAIL ndcg@5 0.638 < 0.800
FAIL success@1 0.333 < 0.500
See In CI.
- By hand, in YAML.
judy import wandsconverts the WANDS dataset (Exact 3, Partial 1, Irrelevant 0). A product labelled twice for one query keeps the higher grade, and judy says how many that was.judy import trecreads TREC qrels,judy import docs-builderandjudy import website-searchread older judgement lists.judy synthesizehas an LLM write queries for the documents of a corpus: each document is the grade-3 answer to its own queries. It is quick, and it flatters retrieval, because the queries come from the documents' own words. Use it for a first look, then replace it with real judgements.judy judgeadds LLM labels for documents nobody judged (see the judge). They live in{set}.llm.yaml, never in your set.
judy export trec writes topics and qrels for trec_eval or ranx; judy export run writes a results file's run.
A hit and a judgement meet by id, so the id your target returns must be the id your judgements use. For URLs and paths, the
docs.normalize setting in judy.yaml makes both sides comparable: lowercase, trailing-slash and strip-host. They are
applied to the set and to the results alike.