Class InferenceResponseResult.Builder

java.lang.Object
All Implemented Interfaces:
WithJson<InferenceResponseResult.Builder>, ObjectBuilder<InferenceResponseResult>
Enclosing class:
InferenceResponseResult

public static class InferenceResponseResult.Builder
extends WithJsonObjectBuilderBase<InferenceResponseResult.Builder>
implements ObjectBuilder<InferenceResponseResult>
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • entities

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

      API name: entities

      Adds all elements of list to entities.

    • 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

      public final InferenceResponseResult.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 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. 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 type

      API name: predicted_value

      Adds all elements of list to predictedValue.

    • 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 type

      API 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 type

      API 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. Additionally

      API 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

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

      API name: prediction_score

    • topClasses

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

      API name: top_classes

      Adds all elements of list to topClasses.

    • 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

      public final InferenceResponseResult.Builder warning​(@Nullable java.lang.String value)
      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 models

      API name: feature_importance

      Adds all elements of list to featureImportance.

    • featureImportance

      The feature importance for the inference results. Relevant only for classification or regression models

      API name: feature_importance

      Adds one or more values to featureImportance.

    • featureImportance

      The feature importance for the inference results. Relevant only for classification or regression models

      API name: feature_importance

      Adds a value to featureImportance using a builder lambda.

    • self

      Specified by:
      self in class WithJsonObjectBuilderBase<InferenceResponseResult.Builder>
    • build

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