Class InferTrainedModelDeploymentResponse.Builder

java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.elasticsearch.ml.InferTrainedModelDeploymentResponse.Builder
All Implemented Interfaces:
ObjectBuilder<InferTrainedModelDeploymentResponse>
Enclosing class:
InferTrainedModelDeploymentResponse

public static class InferTrainedModelDeploymentResponse.Builder
extends ObjectBuilderBase
implements ObjectBuilder<InferTrainedModelDeploymentResponse>
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • entities

      public final InferTrainedModelDeploymentResponse.Builder entities​(java.util.List<TrainedModelEntities> list)
      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 to entities.

    • entities

      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

      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

      public final InferTrainedModelDeploymentResponse.Builder isTruncated​(@Nullable java.lang.Boolean value)
      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

      public final InferTrainedModelDeploymentResponse.Builder predictedValue​(java.util.List<java.lang.String> list)
      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.

      API name: predicted_value

      Adds all elements of list to predictedValue.

    • predictedValue

      public final InferTrainedModelDeploymentResponse.Builder predictedValue​(java.lang.String value, java.lang.String... 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.

      API name: predicted_value

      Adds one or more values to predictedValue.

    • predictedValueSequence

      public final InferTrainedModelDeploymentResponse.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.

      API name: predicted_value_sequence

    • predictionProbability

      public final InferTrainedModelDeploymentResponse.Builder predictionProbability​(@Nullable java.lang.Double value)
      Specifies a confidence score for the predicted value.

      API name: prediction_probability

    • topClasses

      public final InferTrainedModelDeploymentResponse.Builder topClasses​(java.util.List<TopClassEntry> list)
      Required - 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 to topClasses.

    • topClasses

      public final InferTrainedModelDeploymentResponse.Builder topClasses​(TopClassEntry value, TopClassEntry... values)
      Required - 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 InferTrainedModelDeploymentResponse.Builder topClasses​(java.util.function.Function<TopClassEntry.Builder,​ObjectBuilder<TopClassEntry>> fn)
      Required - 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

      public final InferTrainedModelDeploymentResponse.Builder warning​(@Nullable java.lang.String value)
      If the request failed, the response contains the reason for the failure.

      API name: warning

    • build

      Specified by:
      build in interface ObjectBuilder<InferTrainedModelDeploymentResponse>
      Throws:
      java.lang.NullPointerException - if some of the required fields are null.