Class InferTrainedModelDeploymentResponse.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<InferTrainedModelDeploymentResponse.Builder>
co.elastic.clients.elasticsearch.ml.InferTrainedModelDeploymentResponse.Builder
- All Implemented Interfaces:
WithJson<InferTrainedModelDeploymentResponse.Builder>,ObjectBuilder<InferTrainedModelDeploymentResponse>
- Enclosing class:
- InferTrainedModelDeploymentResponse
public static class InferTrainedModelDeploymentResponse.Builder extends WithJsonObjectBuilderBase<InferTrainedModelDeploymentResponse.Builder> implements ObjectBuilder<InferTrainedModelDeploymentResponse>
Builder for
InferTrainedModelDeploymentResponse.-
Constructor Summary
Constructors Constructor Description Builder() -
Method Summary
Modifier and Type Method Description InferTrainedModelDeploymentResponsebuild()Builds aInferTrainedModelDeploymentResponse.InferTrainedModelDeploymentResponse.Builderentities(TrainedModelEntities value, TrainedModelEntities... values)If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.InferTrainedModelDeploymentResponse.Builderentities(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.Builderentities(java.util.List<TrainedModelEntities> list)If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.InferTrainedModelDeploymentResponse.BuilderisTruncated(java.lang.Boolean value)Indicates whether the input text was truncated to meet the model's maximum sequence length limit.InferTrainedModelDeploymentResponse.BuilderpredictedValue(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.BuilderpredictedValue(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.BuilderpredictedValueSequence(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.BuilderpredictionProbability(java.lang.Double value)Specifies a confidence score for the predicted value.protected InferTrainedModelDeploymentResponse.Builderself()InferTrainedModelDeploymentResponse.BuildertopClasses(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.BuildertopClasses(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.BuildertopClasses(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.Builderwarning(java.lang.String value)If the request failed, the response contains the reason for the failure.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJsonMethods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAllMethods 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:
entitiesAdds all elements of
listtoentities. -
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:
entitiesAdds 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:
entitiesAdds a value to
entitiesusing 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_valueAdds all elements of
listtopredictedValue. -
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_valueAdds 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_classesAdds all elements of
listtotopClasses. -
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_classesAdds 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_classesAdds a value to
topClassesusing a builder lambda. -
warning
If the request failed, the response contains the reason for the failure.API name:
warning -
self
- Specified by:
selfin classWithJsonObjectBuilderBase<InferTrainedModelDeploymentResponse.Builder>
-
build
Builds aInferTrainedModelDeploymentResponse.- Specified by:
buildin interfaceObjectBuilder<InferTrainedModelDeploymentResponse>- Throws:
java.lang.NullPointerException- if some of the required fields are null.
-