Class ReinforcementTuningStringMatchRewardScorerStringMatchExpression.Builder
- Enclosing class:
- ReinforcementTuningStringMatchRewardScorerStringMatchExpression
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Clears the value of expression field.Clears the value of matchOperation field.expression(String expression) Setter for expression.matchOperation(MatchOperation matchOperation) Setter for matchOperation.matchOperation(MatchOperation.Known knownType) Setter for matchOperation given a known enum.matchOperation(String matchOperation) Setter for matchOperation given a string.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
matchOperation
public abstract ReinforcementTuningStringMatchRewardScorerStringMatchExpression.Builder matchOperation(MatchOperation matchOperation) Setter for matchOperation.matchOperation: Match operation to use for evaluating rewards.
-
clearMatchOperation
@CanIgnoreReturnValue public ReinforcementTuningStringMatchRewardScorerStringMatchExpression.Builder clearMatchOperation()Clears the value of matchOperation field. -
matchOperation
@CanIgnoreReturnValue public ReinforcementTuningStringMatchRewardScorerStringMatchExpression.Builder matchOperation(MatchOperation.Known knownType) Setter for matchOperation given a known enum.matchOperation: Match operation to use for evaluating rewards.
-
matchOperation
@CanIgnoreReturnValue public ReinforcementTuningStringMatchRewardScorerStringMatchExpression.Builder matchOperation(String matchOperation) Setter for matchOperation given a string.matchOperation: Match operation to use for evaluating rewards.
-
expression
public abstract ReinforcementTuningStringMatchRewardScorerStringMatchExpression.Builder expression(String expression) Setter for expression.expression: A string or a regular expression to match against for evaluating rewards. Users can also provide a references map of `{key: value}` whose `value` will be used to replace the placeholder {{references.key}} in the expression. For example, if the following `references` are defined in the training / validation dataset: ``` { "systemInstruction": ..., "contents": ..., "references": { "concise_answer": "Yes", "verbose_answer": "The answer is Yes" } } ``` and if users define the following StringMatchExpression: { "matchOperation": "REGEX_CONTAINS", "expression": ".*{{references.concise_answer}}.*" } On evaluating the reward for each sample response, this StringMatchExpression will be substituted as: ``` { "matchOperation": "REGEX_CONTAINS", "expression": ".*Yes.*" } ```
-
clearExpression
@CanIgnoreReturnValue public ReinforcementTuningStringMatchRewardScorerStringMatchExpression.Builder clearExpression()Clears the value of expression field. -
build
-