artefactual.preprocessing.read_judgment#

artefactual.preprocessing.read_judgment(completion)[source]#

Whether the judge said the answer was CORRECT, or None if its reply cannot be read.

Note the polarity: True means the answer was correct, which is the opposite of the class a detector predicts, so a caller building labels wants not read_judgment(…). This is Judgment.from_completion(completion).judgment, which also keeps the explanation.

Parameters:

completion (Any) – A chat completion, as a mapping or an attribute-style object. A batch line’s completion is exactly this, including the None a failed line yields.

Return type:

bool | None

Returns:

True when the judge said the answer was correct, False when it said it was not, None when there is no readable verdict – an unreadable reply, a completion with no message, or no completion at all.