Class InferenceResponseResult.Builder
- All Implemented Interfaces:
WithJson<InferenceResponseResult.Builder>
,ObjectBuilder<InferenceResponseResult>
- Enclosing class:
- InferenceResponseResult
public static class InferenceResponseResult.Builder extends WithJsonObjectBuilderBase<InferenceResponseResult.Builder> implements ObjectBuilder<InferenceResponseResult>
InferenceResponseResult
.-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
Modifier and Type Method Description InferenceResponseResult
build()
Builds aInferenceResponseResult
.InferenceResponseResult.Builder
entities(TrainedModelEntities value, TrainedModelEntities... values)
If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.InferenceResponseResult.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.InferenceResponseResult.Builder
entities(java.util.List<TrainedModelEntities> list)
If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.InferenceResponseResult.Builder
featureImportance(TrainedModelInferenceFeatureImportance value, TrainedModelInferenceFeatureImportance... values)
The feature importance for the inference results.InferenceResponseResult.Builder
featureImportance(java.util.function.Function<TrainedModelInferenceFeatureImportance.Builder,ObjectBuilder<TrainedModelInferenceFeatureImportance>> fn)
The feature importance for the inference results.InferenceResponseResult.Builder
featureImportance(java.util.List<TrainedModelInferenceFeatureImportance> list)
The feature importance for the inference results.InferenceResponseResult.Builder
isTruncated(java.lang.Boolean value)
Indicates whether the input text was truncated to meet the model's maximum sequence length limit.InferenceResponseResult.Builder
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.InferenceResponseResult.Builder
predictedValue(java.util.function.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.InferenceResponseResult.Builder
predictedValue(java.util.List<FieldValue> list)
If the model is trained for a text classification or zero shot classification task, the response is the predicted class.InferenceResponseResult.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.InferenceResponseResult.Builder
predictionProbability(java.lang.Double value)
Specifies a probability for the predicted value.InferenceResponseResult.Builder
predictionScore(java.lang.Double value)
Specifies a confidence score for the predicted value.protected InferenceResponseResult.Builder
self()
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.InferenceResponseResult.Builder
topClasses(java.util.function.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.InferenceResponseResult.Builder
topClasses(java.util.List<TopClassEntry> list)
For fill mask, text classification, and zero shot classification tasks, the response contains a list of top class entries.InferenceResponseResult.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.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
-
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(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
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
public final InferenceResponseResult.Builder 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. 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(java.util.function.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
public final InferenceResponseResult.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. AdditionallyAPI name:
predicted_value_sequence
-
predictionProbability
public final InferenceResponseResult.Builder predictionProbability(@Nullable java.lang.Double value)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(java.util.function.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(java.util.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(java.util.function.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:
java.lang.NullPointerException
- if some of the required fields are null.
-