Package dev.dokimos.core.evaluators
Class PrecisionEvaluator.Builder
java.lang.Object
dev.dokimos.core.evaluators.PrecisionEvaluator.Builder
- Enclosing class:
PrecisionEvaluator
Builder for constructing PrecisionEvaluator instances.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the PrecisionEvaluator.evaluationParams(List<EvalTestCaseParam> params) Sets which test case parameters to validate before evaluation.expectedKey(String expectedKey) Sets the key for expected (relevant) items in expectedOutputs.matchingStrategy(MatchingStrategy matchingStrategy) Sets the strategy for matching retrieved items to expected items.Sets the evaluator name.retrievedKey(String retrievedKey) Sets the key for retrieved items in actualOutputs.threshold(double threshold) Sets the minimum score threshold for success.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
name
Sets the evaluator name.- Parameters:
name- the evaluator name- Returns:
- this builder
-
retrievedKey
Sets the key for retrieved items in actualOutputs. Default is "retrieved".- Parameters:
retrievedKey- the key for retrieved items- Returns:
- this builder
-
expectedKey
Sets the key for expected (relevant) items in expectedOutputs. Default is "relevant".- Parameters:
expectedKey- the key for expected items- Returns:
- this builder
-
threshold
Sets the minimum score threshold for success. Default is 0.5.- Parameters:
threshold- the threshold value (0.0 to 1.0)- Returns:
- this builder
-
matchingStrategy
Sets the strategy for matching retrieved items to expected items. Default isMatchingStrategy.byEquality().- Parameters:
matchingStrategy- the matching strategy- Returns:
- this builder
-
evaluationParams
Sets which test case parameters to validate before evaluation.- Parameters:
params- the parameters to validate- Returns:
- this builder
-
build
Builds the PrecisionEvaluator.- Returns:
- a new PrecisionEvaluator instance
-