Package dev.braintrust.eval
Interface Scorer<INPUT,OUTPUT>
- Type Parameters:
INPUT- type of the input dataOUTPUT- type of the output data
public interface Scorer<INPUT,OUTPUT>
A scorer evaluates the result of a test case with a score between 0 (inclusive) and 1
(inclusive).
-
Method Summary
Modifier and TypeMethodDescriptiongetName()static <INPUT,OUTPUT>
Scorer<INPUT,OUTPUT> of(String scorerName, BiFunction<OUTPUT, OUTPUT, Double> scorerFn) static <INPUT,OUTPUT>
Scorer<INPUT,OUTPUT> of(String scorerName, Function<TaskResult<INPUT, OUTPUT>, Double> scorerFn) score(TaskResult<INPUT, OUTPUT> taskResult)
-
Method Details
-
getName
String getName() -
score
-
of
static <INPUT,OUTPUT> Scorer<INPUT,OUTPUT> of(String scorerName, Function<TaskResult<INPUT, OUTPUT>, Double> scorerFn) -
of
static <INPUT,OUTPUT> Scorer<INPUT,OUTPUT> of(String scorerName, BiFunction<OUTPUT, OUTPUT, Double> scorerFn)
-