Class InferenceResponseResult.Builder
- All Implemented Interfaces:
WithJson<InferenceResponseResult.Builder>,ObjectBuilder<InferenceResponseResult>
- Enclosing class:
- InferenceResponseResult
InferenceResponseResult.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aInferenceResponseResult.entities(TrainedModelEntities value, TrainedModelEntities... values) If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.entities(List<TrainedModelEntities> list) If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.featureImportance(TrainedModelInferenceFeatureImportance value, TrainedModelInferenceFeatureImportance... values) The feature importance for the inference results.featureImportance(Function<TrainedModelInferenceFeatureImportance.Builder, ObjectBuilder<TrainedModelInferenceFeatureImportance>> fn) The feature importance for the inference results.The feature importance for the inference results.isTruncated(Boolean value) Indicates whether the input text was truncated to meet the model's maximum sequence length limit.predictedValue(List<FieldValue> value, List<FieldValue>... values) If the model is trained for a text classification or zero shot classification task, the response is the predicted class.predictedValue(List<List<FieldValue>> list) If the model is trained for a text classification or zero shot classification task, the response is the predicted class.predictedValueSequence(String value) For fill mask tasks, the response contains the input text sequence with the mask token replaced by the predicted value.predictionProbability(Double value) Specifies a probability for the predicted value.predictionScore(Double value) Specifies a confidence score for the predicted value.protected InferenceResponseResult.Builderself()topClasses(TopClassEntry value, TopClassEntry... values) For fill mask, text classification, and zero shot classification tasks, the response contains a list of top class entries.For fill mask, text classification, and zero shot classification tasks, the response contains a list of top class entries.topClasses(List<TopClassEntry> list) For fill mask, text classification, and zero shot classification tasks, the response contains a list of top class entries.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, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
entities
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 InferenceResponseResult.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 InferenceResponseResult.Builder entities(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
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
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. For regression models, its a numerical value For classification models, it may be an integer, double, boolean or string depending on prediction typeAPI name:
predicted_valueAdds all elements of
listtopredictedValue. -
predictedValue
public final InferenceResponseResult.Builder predictedValue(List<FieldValue> value, List<FieldValue>... 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. For regression models, its a numerical value For classification models, it may be an integer, double, boolean or string depending on prediction typeAPI name:
predicted_valueAdds one or more values to
predictedValue. -
predictedValueSequence
For fill mask tasks, the response contains the input text sequence with the mask token replaced by the predicted value. AdditionallyAPI name:
predicted_value_sequence -
predictionProbability
Specifies a probability for the predicted value.API name:
prediction_probability -
predictionScore
Specifies a confidence score for the predicted value.API name:
prediction_score -
topClasses
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 InferenceResponseResult.Builder topClasses(TopClassEntry value, TopClassEntry... values) 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 InferenceResponseResult.Builder topClasses(Function<TopClassEntry.Builder, ObjectBuilder<TopClassEntry>> fn) 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 -
featureImportance
public final InferenceResponseResult.Builder featureImportance(List<TrainedModelInferenceFeatureImportance> list) The feature importance for the inference results. Relevant only for classification or regression modelsAPI name:
feature_importanceAdds all elements of
listtofeatureImportance. -
featureImportance
public final InferenceResponseResult.Builder featureImportance(TrainedModelInferenceFeatureImportance value, TrainedModelInferenceFeatureImportance... values) The feature importance for the inference results. Relevant only for classification or regression modelsAPI name:
feature_importanceAdds one or more values to
featureImportance. -
featureImportance
public final InferenceResponseResult.Builder featureImportance(Function<TrainedModelInferenceFeatureImportance.Builder, ObjectBuilder<TrainedModelInferenceFeatureImportance>> fn) The feature importance for the inference results. Relevant only for classification or regression modelsAPI name:
feature_importanceAdds a value to
featureImportanceusing a builder lambda. -
self
- Specified by:
selfin classWithJsonObjectBuilderBase<InferenceResponseResult.Builder>
-
build
Builds aInferenceResponseResult.- Specified by:
buildin interfaceObjectBuilder<InferenceResponseResult>- Throws:
NullPointerException- if some of the required fields are null.
-