Class InferTrainedModelDeploymentResponse.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.elasticsearch.ml.InferTrainedModelDeploymentResponse.Builder
- All Implemented Interfaces:
ObjectBuilder<InferTrainedModelDeploymentResponse>
- Enclosing class:
- InferTrainedModelDeploymentResponse
public static class InferTrainedModelDeploymentResponse.Builder extends ObjectBuilderBase implements ObjectBuilder<InferTrainedModelDeploymentResponse>
Builder for
InferTrainedModelDeploymentResponse
.-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
Modifier and Type Method Description InferTrainedModelDeploymentResponse
build()
Builds aInferTrainedModelDeploymentResponse
.InferTrainedModelDeploymentResponse.Builder
entities(TrainedModelEntities value, TrainedModelEntities... values)
If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.InferTrainedModelDeploymentResponse.Builder
entities(java.util.function.Function<TrainedModelEntities.Builder,ObjectBuilder<TrainedModelEntities>> fn)
If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.InferTrainedModelDeploymentResponse.Builder
entities(java.util.List<TrainedModelEntities> list)
If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.InferTrainedModelDeploymentResponse.Builder
isTruncated(java.lang.Boolean value)
Indicates whether the input text was truncated to meet the model's maximum sequence length limit.InferTrainedModelDeploymentResponse.Builder
predictedValue(java.lang.String value, java.lang.String... values)
If the model is trained for a text classification or zero shot classification task, the response is the predicted class.InferTrainedModelDeploymentResponse.Builder
predictedValue(java.util.List<java.lang.String> list)
If the model is trained for a text classification or zero shot classification task, the response is the predicted class.InferTrainedModelDeploymentResponse.Builder
predictedValueSequence(java.lang.String value)
For fill mask tasks, the response contains the input text sequence with the mask token replaced by the predicted value.InferTrainedModelDeploymentResponse.Builder
predictionProbability(java.lang.Double value)
Specifies a confidence score for the predicted value.InferTrainedModelDeploymentResponse.Builder
topClasses(TopClassEntry value, TopClassEntry... values)
Required - For fill mask, text classification, and zero shot classification tasks, the response contains a list of top class entries.InferTrainedModelDeploymentResponse.Builder
topClasses(java.util.function.Function<TopClassEntry.Builder,ObjectBuilder<TopClassEntry>> fn)
Required - For fill mask, text classification, and zero shot classification tasks, the response contains a list of top class entries.InferTrainedModelDeploymentResponse.Builder
topClasses(java.util.List<TopClassEntry> list)
Required - For fill mask, text classification, and zero shot classification tasks, the response contains a list of top class entries.InferTrainedModelDeploymentResponse.Builder
warning(java.lang.String value)
If the request failed, the response contains the reason for the failure.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
-
entities
public final InferTrainedModelDeploymentResponse.Builder entities(java.util.List<TrainedModelEntities> list)If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.API name:
entities
Adds all elements of
list
toentities
. -
entities
public final InferTrainedModelDeploymentResponse.Builder entities(TrainedModelEntities value, TrainedModelEntities... values)If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.API name:
entities
Adds one or more values to
entities
. -
entities
public final InferTrainedModelDeploymentResponse.Builder entities(java.util.function.Function<TrainedModelEntities.Builder,ObjectBuilder<TrainedModelEntities>> fn)If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.API name:
entities
Adds a value to
entities
using a builder lambda. -
isTruncated
public final InferTrainedModelDeploymentResponse.Builder isTruncated(@Nullable java.lang.Boolean value)Indicates whether the input text was truncated to meet the model's maximum sequence length limit. This property is present only when it is true.API name:
is_truncated
-
predictedValue
public final InferTrainedModelDeploymentResponse.Builder predictedValue(java.util.List<java.lang.String> list)If the model is trained for a text classification or zero shot classification task, the response is the predicted class. For named entity recognition (NER) tasks, it contains the annotated text output. For fill mask tasks, it contains the top prediction for replacing the mask token. For text embedding tasks, it contains the raw numerical text embedding values.API name:
predicted_value
Adds all elements of
list
topredictedValue
. -
predictedValue
public final InferTrainedModelDeploymentResponse.Builder predictedValue(java.lang.String value, java.lang.String... values)If the model is trained for a text classification or zero shot classification task, the response is the predicted class. For named entity recognition (NER) tasks, it contains the annotated text output. For fill mask tasks, it contains the top prediction for replacing the mask token. For text embedding tasks, it contains the raw numerical text embedding values.API name:
predicted_value
Adds one or more values to
predictedValue
. -
predictedValueSequence
public final InferTrainedModelDeploymentResponse.Builder predictedValueSequence(@Nullable java.lang.String value)For fill mask tasks, the response contains the input text sequence with the mask token replaced by the predicted value.API name:
predicted_value_sequence
-
predictionProbability
public final InferTrainedModelDeploymentResponse.Builder predictionProbability(@Nullable java.lang.Double value)Specifies a confidence score for the predicted value.API name:
prediction_probability
-
topClasses
public final InferTrainedModelDeploymentResponse.Builder topClasses(java.util.List<TopClassEntry> list)Required - For fill mask, text classification, and zero shot classification tasks, the response contains a list of top class entries.API name:
top_classes
Adds all elements of
list
totopClasses
. -
topClasses
public final InferTrainedModelDeploymentResponse.Builder topClasses(TopClassEntry value, TopClassEntry... values)Required - For fill mask, text classification, and zero shot classification tasks, the response contains a list of top class entries.API name:
top_classes
Adds one or more values to
topClasses
. -
topClasses
public final InferTrainedModelDeploymentResponse.Builder topClasses(java.util.function.Function<TopClassEntry.Builder,ObjectBuilder<TopClassEntry>> fn)Required - For fill mask, text classification, and zero shot classification tasks, the response contains a list of top class entries.API name:
top_classes
Adds a value to
topClasses
using a builder lambda. -
warning
If the request failed, the response contains the reason for the failure.API name:
warning
-
build
Builds aInferTrainedModelDeploymentResponse
.- Specified by:
build
in interfaceObjectBuilder<InferTrainedModelDeploymentResponse>
- Throws:
java.lang.NullPointerException
- if some of the required fields are null.
-