Class InferenceResponseResult
java.lang.Object
co.elastic.clients.elasticsearch.ml.InferenceResponseResult
- All Implemented Interfaces:
JsonpSerializable
@JsonpDeserializable
public class InferenceResponseResult
extends Object
implements JsonpSerializable
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final JsonpDeserializer<InferenceResponseResult>
Json deserializer forInferenceResponseResult
-
Method Summary
Modifier and TypeMethodDescriptionfinal List<TrainedModelEntities>
entities()
If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.The feature importance for the inference results.final Boolean
Indicates whether the input text was truncated to meet the model's maximum sequence length limit.static InferenceResponseResult
final List<FieldValue>
If the model is trained for a text classification or zero shot classification task, the response is the predicted class.final String
For fill mask tasks, the response contains the input text sequence with the mask token replaced by the predicted value.final Double
Specifies a probability for the predicted value.final Double
Specifies a confidence score for the predicted value.void
serialize
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected void
serializeInternal
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static void
final List<TopClassEntry>
For fill mask, text classification, and zero shot classification tasks, the response contains a list of top class entries.toString()
final String
warning()
If the request failed, the response contains the reason for the failure.
-
Field Details
-
_DESERIALIZER
Json deserializer forInferenceResponseResult
-
-
Method Details
-
of
public static InferenceResponseResult of(Function<InferenceResponseResult.Builder, ObjectBuilder<InferenceResponseResult>> fn) -
entities
If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.API name:
entities
-
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
-
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
-
warning
If the request failed, the response contains the reason for the failure.API name:
warning
-
featureImportance
The feature importance for the inference results. Relevant only for classification or regression modelsAPI name:
feature_importance
-
serialize
Serialize this object to JSON.- Specified by:
serialize
in interfaceJsonpSerializable
-
serializeInternal
-
toString
-
setupInferenceResponseResultDeserializer
protected static void setupInferenceResponseResultDeserializer(ObjectDeserializer<InferenceResponseResult.Builder> op)
-