Class ZeroShotClassificationInferenceOptions.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<ZeroShotClassificationInferenceOptions.Builder>
co.elastic.clients.elasticsearch.ml.ZeroShotClassificationInferenceOptions.Builder
- All Implemented Interfaces:
WithJson<ZeroShotClassificationInferenceOptions.Builder>
,ObjectBuilder<ZeroShotClassificationInferenceOptions>
- Enclosing class:
- ZeroShotClassificationInferenceOptions
public static class ZeroShotClassificationInferenceOptions.Builder extends WithJsonObjectBuilderBase<ZeroShotClassificationInferenceOptions.Builder> implements ObjectBuilder<ZeroShotClassificationInferenceOptions>
Builder for
ZeroShotClassificationInferenceOptions
.-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
Modifier and Type Method Description ZeroShotClassificationInferenceOptions
build()
Builds aZeroShotClassificationInferenceOptions
.ZeroShotClassificationInferenceOptions.Builder
classificationLabels(java.lang.String value, java.lang.String... values)
Required - The zero shot classification labels indicating entailment, neutral, and contradiction Must contain exactly and only entailment, neutral, and contradictionZeroShotClassificationInferenceOptions.Builder
classificationLabels(java.util.List<java.lang.String> list)
Required - The zero shot classification labels indicating entailment, neutral, and contradiction Must contain exactly and only entailment, neutral, and contradictionZeroShotClassificationInferenceOptions.Builder
hypothesisTemplate(java.lang.String value)
Hypothesis template used when tokenizing labels for predictionZeroShotClassificationInferenceOptions.Builder
labels(java.lang.String value, java.lang.String... values)
The labels to predict.ZeroShotClassificationInferenceOptions.Builder
labels(java.util.List<java.lang.String> list)
The labels to predict.ZeroShotClassificationInferenceOptions.Builder
multiLabel(java.lang.Boolean value)
Indicates if more than one true label exists.ZeroShotClassificationInferenceOptions.Builder
resultsField(java.lang.String value)
The field that is added to incoming documents to contain the inference prediction.protected ZeroShotClassificationInferenceOptions.Builder
self()
ZeroShotClassificationInferenceOptions.Builder
tokenization(TokenizationConfig value)
The tokenization options to update when inferringZeroShotClassificationInferenceOptions.Builder
tokenization(java.util.function.Function<TokenizationConfig.Builder,ObjectBuilder<TokenizationConfig>> fn)
The tokenization options to update when inferringMethods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
tokenization
public final ZeroShotClassificationInferenceOptions.Builder tokenization(@Nullable TokenizationConfig value)The tokenization options to update when inferringAPI name:
tokenization
-
tokenization
public final ZeroShotClassificationInferenceOptions.Builder tokenization(java.util.function.Function<TokenizationConfig.Builder,ObjectBuilder<TokenizationConfig>> fn)The tokenization options to update when inferringAPI name:
tokenization
-
hypothesisTemplate
public final ZeroShotClassificationInferenceOptions.Builder hypothesisTemplate(@Nullable java.lang.String value)Hypothesis template used when tokenizing labels for predictionAPI name:
hypothesis_template
-
classificationLabels
public final ZeroShotClassificationInferenceOptions.Builder classificationLabels(java.util.List<java.lang.String> list)Required - The zero shot classification labels indicating entailment, neutral, and contradiction Must contain exactly and only entailment, neutral, and contradictionAPI name:
classification_labels
Adds all elements of
list
toclassificationLabels
. -
classificationLabels
public final ZeroShotClassificationInferenceOptions.Builder classificationLabels(java.lang.String value, java.lang.String... values)Required - The zero shot classification labels indicating entailment, neutral, and contradiction Must contain exactly and only entailment, neutral, and contradictionAPI name:
classification_labels
Adds one or more values to
classificationLabels
. -
resultsField
public final ZeroShotClassificationInferenceOptions.Builder resultsField(@Nullable java.lang.String value)The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.API name:
results_field
-
multiLabel
public final ZeroShotClassificationInferenceOptions.Builder multiLabel(@Nullable java.lang.Boolean value)Indicates if more than one true label exists.API name:
multi_label
-
labels
public final ZeroShotClassificationInferenceOptions.Builder labels(java.util.List<java.lang.String> list)The labels to predict.API name:
labels
Adds all elements of
list
tolabels
. -
labels
public final ZeroShotClassificationInferenceOptions.Builder labels(java.lang.String value, java.lang.String... values)The labels to predict.API name:
labels
Adds one or more values to
labels
. -
self
- Specified by:
self
in classWithJsonObjectBuilderBase<ZeroShotClassificationInferenceOptions.Builder>
-
build
Builds aZeroShotClassificationInferenceOptions
.- Specified by:
build
in interfaceObjectBuilder<ZeroShotClassificationInferenceOptions>
- Throws:
java.lang.NullPointerException
- if some of the required fields are null.
-