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 InferenceResponseResultbuild()Builds aInferenceResponseResult.InferenceResponseResult.Builderentities(TrainedModelEntities value, TrainedModelEntities... values)If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.InferenceResponseResult.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.InferenceResponseResult.Builderentities(java.util.List<TrainedModelEntities> list)If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.InferenceResponseResult.BuilderfeatureImportance(TrainedModelInferenceFeatureImportance value, TrainedModelInferenceFeatureImportance... values)The feature importance for the inference results.InferenceResponseResult.BuilderfeatureImportance(java.util.function.Function<TrainedModelInferenceFeatureImportance.Builder,ObjectBuilder<TrainedModelInferenceFeatureImportance>> fn)The feature importance for the inference results.InferenceResponseResult.BuilderfeatureImportance(java.util.List<TrainedModelInferenceFeatureImportance> list)The feature importance for the inference results.InferenceResponseResult.BuilderisTruncated(java.lang.Boolean value)Indicates whether the input text was truncated to meet the model's maximum sequence length limit.InferenceResponseResult.BuilderpredictedValue(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.BuilderpredictedValue(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.BuilderpredictedValue(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.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.InferenceResponseResult.BuilderpredictionProbability(java.lang.Double value)Specifies a probability for the predicted value.InferenceResponseResult.BuilderpredictionScore(java.lang.Double value)Specifies a confidence score for the predicted value.protected InferenceResponseResult.Builderself()InferenceResponseResult.BuildertopClasses(TopClassEntry value, TopClassEntry... values)For fill mask, text classification, and zero shot classification tasks, the response contains a list of top class entries.InferenceResponseResult.BuildertopClasses(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.BuildertopClasses(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.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
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(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
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(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_valueAdds 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_valueAdds a value to
predictedValueusing 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_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(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_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(java.util.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(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_importanceAdds a value to
featureImportanceusing a builder lambda. -
self
- Specified by:
selfin classWithJsonObjectBuilderBase<InferenceResponseResult.Builder>
-
build
Builds aInferenceResponseResult.- Specified by:
buildin interfaceObjectBuilder<InferenceResponseResult>- Throws:
java.lang.NullPointerException- if some of the required fields are null.
-