Class InferenceResponseResult
java.lang.Object
co.elastic.clients.elasticsearch.ml.InferenceResponseResult
- All Implemented Interfaces:
JsonpSerializable
@JsonpDeserializable public class InferenceResponseResult extends java.lang.Object implements JsonpSerializable
- See Also:
- API specification
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInferenceResponseResult.BuilderBuilder forInferenceResponseResult. -
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<InferenceResponseResult>_DESERIALIZERJson deserializer forInferenceResponseResult -
Method Summary
Modifier and Type Method Description java.util.List<TrainedModelEntities>entities()If the model is trained for named entity recognition (NER) tasks, the response contains the recognized entities.java.util.List<TrainedModelInferenceFeatureImportance>featureImportance()The feature importance for the inference results.java.lang.BooleanisTruncated()Indicates whether the input text was truncated to meet the model's maximum sequence length limit.static InferenceResponseResultof(java.util.function.Function<InferenceResponseResult.Builder,ObjectBuilder<InferenceResponseResult>> fn)java.util.List<FieldValue>predictedValue()If the model is trained for a text classification or zero shot classification task, the response is the predicted class.java.lang.StringpredictedValueSequence()For fill mask tasks, the response contains the input text sequence with the mask token replaced by the predicted value.java.lang.DoublepredictionProbability()Specifies a probability for the predicted value.java.lang.DoublepredictionScore()Specifies a confidence score for the predicted value.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)Serialize this object to JSON.protected voidserializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)protected static voidsetupInferenceResponseResultDeserializer(ObjectDeserializer<InferenceResponseResult.Builder> op)java.util.List<TopClassEntry>topClasses()For fill mask, text classification, and zero shot classification tasks, the response contains a list of top class entries.java.lang.StringtoString()java.lang.Stringwarning()If the request failed, the response contains the reason for the failure.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
_DESERIALIZER
Json deserializer forInferenceResponseResult
-
-
Method Details
-
of
public static InferenceResponseResult of(java.util.function.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
@Nullable public final java.lang.Boolean 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
@Nullable public final java.lang.String 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
@Nullable public final java.lang.Double predictionProbability()Specifies a probability for the predicted value.API name:
prediction_probability -
predictionScore
@Nullable public final java.lang.Double 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
@Nullable public final java.lang.String 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:
serializein interfaceJsonpSerializable
-
serializeInternal
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
setupInferenceResponseResultDeserializer
protected static void setupInferenceResponseResultDeserializer(ObjectDeserializer<InferenceResponseResult.Builder> op)
-