Package dev.dokimos.server.service
Class AlignmentService
java.lang.Object
dev.dokimos.server.service.AlignmentService
Computes per-run, per-evaluator agreement between automated evaluator verdicts and human
annotations. A CORRECT verdict is treated as the item passing and INCORRECT as failing; an
evaluator result agrees when its success flag matches that expectation. UNSURE verdicts and items
with no annotation are excluded from the rate, and UNSURE counts are reported separately so the
caller can show how much of the run is still ambiguous.
-
Constructor Summary
ConstructorsConstructorDescriptionAlignmentService(ExperimentRunRepository runRepository, ItemResultRepository itemResultRepository, AnnotationRepository annotationRepository) -
Method Summary
Modifier and TypeMethodDescriptiongetAlignment(UUID runId) Computes the judge-human alignment breakdown for a run.
-
Constructor Details
-
AlignmentService
public AlignmentService(ExperimentRunRepository runRepository, ItemResultRepository itemResultRepository, AnnotationRepository annotationRepository)
-
-
Method Details
-
getAlignment
Computes the judge-human alignment breakdown for a run. Items are loaded with their eval results in one query and their annotations batch-loaded by item id to avoid an N+1 fan-out. Each evaluator's rate uses only items it ran on whose human verdict was CORRECT or INCORRECT.- Parameters:
runId- the run to analyze- Returns:
- the per-evaluator agreement breakdown, ordered by first appearance of each evaluator
- Throws:
IllegalArgumentException- ifrunIdis null or the run does not exist
-