Class InferenceResponseResult.Builder
- All Implemented Interfaces:
WithJson<InferenceResponseResult.Builder>
,ObjectBuilder<InferenceResponseResult>
- Enclosing class:
- InferenceResponseResult
InferenceResponseResult
.-
Constructor Summary
-
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
(FieldValue value, FieldValue... values) If the model is trained for a text classification or zero shot classification task, the response is the predicted class.If the model is trained for a text classification or zero shot classification task, the response is the predicted class.predictedValue
(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.Builder
self()
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
withJson
Methods 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:
entities
Adds all elements of
list
toentities
. -
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:
entities
Adds 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:
entities
Adds a value to
entities
using 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_value
Adds all elements of
list
topredictedValue
. -
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_value
Adds one or more values to
predictedValue
. -
predictedValue
public final InferenceResponseResult.Builder predictedValue(Function<FieldValue.Builder, ObjectBuilder<FieldValue>> fn) 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_value
Adds a value to
predictedValue
using a builder lambda. -
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_classes
Adds all elements of
list
totopClasses
. -
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_classes
Adds 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_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
-
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_importance
Adds all elements of
list
tofeatureImportance
. -
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_importance
Adds 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_importance
Adds a value to
featureImportance
using a builder lambda. -
self
- Specified by:
self
in classWithJsonObjectBuilderBase<InferenceResponseResult.Builder>
-
build
Builds aInferenceResponseResult
.- Specified by:
build
in interfaceObjectBuilder<InferenceResponseResult>
- Throws:
NullPointerException
- if some of the required fields are null.
-