Class PredictResponse.Builder (2.3.0)

See more code actions.
public static final class PredictResponse.Builder extends GeneratedMessageV3.Builder<PredictResponse.Builder> implements PredictResponseOrBuilder

Response message for PredictionService.Predict.

Protobuf type google.cloud.automl.v1.PredictResponse

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllPayload(Iterable<? extends AnnotationPayload> values)

public PredictResponse.Builder addAllPayload(Iterable<? extends AnnotationPayload> values)

Prediction result. AutoML Translation and AutoML Natural Language Sentiment Analysis return precisely one payload.

repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;

Parameter
NameDescription
valuesIterable<? extends com.google.cloud.automl.v1.AnnotationPayload>
Returns

addPayload(AnnotationPayload value)

public PredictResponse.Builder addPayload(AnnotationPayload value)

Prediction result. AutoML Translation and AutoML Natural Language Sentiment Analysis return precisely one payload.

repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;

Parameter
NameDescription
valueAnnotationPayload
Returns

addPayload(AnnotationPayload.Builder builderForValue)

public PredictResponse.Builder addPayload(AnnotationPayload.Builder builderForValue)

Prediction result. AutoML Translation and AutoML Natural Language Sentiment Analysis return precisely one payload.

repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;

Parameter
NameDescription
builderForValueAnnotationPayload.Builder
Returns

addPayload(int index, AnnotationPayload value)

public PredictResponse.Builder addPayload(int index, AnnotationPayload value)

Prediction result. AutoML Translation and AutoML Natural Language Sentiment Analysis return precisely one payload.

repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;

Parameters
NameDescription
indexint
valueAnnotationPayload
Returns

addPayload(int index, AnnotationPayload.Builder builderForValue)

public PredictResponse.Builder addPayload(int index, AnnotationPayload.Builder builderForValue)

Prediction result. AutoML Translation and AutoML Natural Language Sentiment Analysis return precisely one payload.

repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;

Parameters
NameDescription
indexint
builderForValueAnnotationPayload.Builder
Returns

addPayloadBuilder()

public AnnotationPayload.Builder addPayloadBuilder()

Prediction result. AutoML Translation and AutoML Natural Language Sentiment Analysis return precisely one payload.

repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;

Returns

addPayloadBuilder(int index)

public AnnotationPayload.Builder addPayloadBuilder(int index)

Prediction result. AutoML Translation and AutoML Natural Language Sentiment Analysis return precisely one payload.

repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;

Parameter
NameDescription
indexint
Returns

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public PredictResponse.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns Overrides

build()

public PredictResponse build()
Returns
TypeDescription
PredictResponse

buildPartial()

public PredictResponse buildPartial()
Returns
TypeDescription
PredictResponse

clear()

public PredictResponse.Builder clear()
Returns Overrides

clearField(Descriptors.FieldDescriptor field)

public PredictResponse.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns Overrides

clearMetadata()

public PredictResponse.Builder clearMetadata()
Returns

clearOneof(Descriptors.OneofDescriptor oneof)

public PredictResponse.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns Overrides

clearPayload()

public PredictResponse.Builder clearPayload()

Prediction result. AutoML Translation and AutoML Natural Language Sentiment Analysis return precisely one payload.

repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;

Returns

clearPreprocessedInput()

public PredictResponse.Builder clearPreprocessedInput()

The preprocessed example that AutoML actually makes prediction on. Empty if AutoML does not preprocess the input example. For AutoML Natural Language (Classification, Entity Extraction, and Sentiment Analysis), if the input is a document, the recognized text is returned in the document_text property.

.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;

Returns

clone()

public PredictResponse.Builder clone()
Returns Overrides

containsMetadata(String key)

public boolean containsMetadata(String key)

Additional domain-specific prediction response metadata. AutoML Vision Object Detection max_bounding_box_count : (int64) The maximum number of bounding boxes to return per image. AutoML Natural Language Sentiment Analysis sentiment_score : (float, deprecated) A value between -1 and 1, -1 maps to least positive sentiment, while 1 maps to the most positive one and the higher the score, the more positive the sentiment in the document is. Yet these values are relative to the training data, so e.g. if all data was positive then -1 is also positive (though the least). sentiment_score is not the same as "score" and "magnitude" from Sentiment Analysis in the Natural Language API.

map<string, string> metadata = 2;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getDefaultInstanceForType()

public PredictResponse getDefaultInstanceForType()
Returns
TypeDescription
PredictResponse

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getMetadata()

public Map<String,String> getMetadata()

Use #getMetadataMap() instead.

Returns
TypeDescription
Map<String,String>

getMetadataCount()

public int getMetadataCount()

Additional domain-specific prediction response metadata. AutoML Vision Object Detection max_bounding_box_count : (int64) The maximum number of bounding boxes to return per image. AutoML Natural Language Sentiment Analysis sentiment_score : (float, deprecated) A value between -1 and 1, -1 maps to least positive sentiment, while 1 maps to the most positive one and the higher the score, the more positive the sentiment in the document is. Yet these values are relative to the training data, so e.g. if all data was positive then -1 is also positive (though the least). sentiment_score is not the same as "score" and "magnitude" from Sentiment Analysis in the Natural Language API.

map<string, string> metadata = 2;

Returns
TypeDescription
int

getMetadataMap()

public Map<String,String> getMetadataMap()

Additional domain-specific prediction response metadata. AutoML Vision Object Detection max_bounding_box_count : (int64) The maximum number of bounding boxes to return per image. AutoML Natural Language Sentiment Analysis sentiment_score : (float, deprecated) A value between -1 and 1, -1 maps to least positive sentiment, while 1 maps to the most positive one and the higher the score, the more positive the sentiment in the document is. Yet these values are relative to the training data, so e.g. if all data was positive then -1 is also positive (though the least). sentiment_score is not the same as "score" and "magnitude" from Sentiment Analysis in the Natural Language API.

map<string, string> metadata = 2;

Returns
TypeDescription
Map<String,String>

getMetadataOrDefault(String key, String defaultValue)

public String getMetadataOrDefault(String key, String defaultValue)

Additional domain-specific prediction response metadata. AutoML Vision Object Detection max_bounding_box_count : (int64) The maximum number of bounding boxes to return per image. AutoML Natural Language Sentiment Analysis sentiment_score : (float, deprecated) A value between -1 and 1, -1 maps to least positive sentiment, while 1 maps to the most positive one and the higher the score, the more positive the sentiment in the document is. Yet these values are relative to the training data, so e.g. if all data was positive then -1 is also positive (though the least). sentiment_score is not the same as "score" and "magnitude" from Sentiment Analysis in the Natural Language API.

map<string, string> metadata = 2;

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getMetadataOrThrow(String key)

public String getMetadataOrThrow(String key)

Additional domain-specific prediction response metadata. AutoML Vision Object Detection max_bounding_box_count : (int64) The maximum number of bounding boxes to return per image. AutoML Natural Language Sentiment Analysis sentiment_score : (float, deprecated) A value between -1 and 1, -1 maps to least positive sentiment, while 1 maps to the most positive one and the higher the score, the more positive the sentiment in the document is. Yet these values are relative to the training data, so e.g. if all data was positive then -1 is also positive (though the least). sentiment_score is not the same as "score" and "magnitude" from Sentiment Analysis in the Natural Language API.

map<string, string> metadata = 2;

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getMutableMetadata()

public Map<String,String> getMutableMetadata()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

getPayload(int index)

public AnnotationPayload getPayload(int index)

Prediction result. AutoML Translation and AutoML Natural Language Sentiment Analysis return precisely one payload.

repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
AnnotationPayload

getPayloadBuilder(int index)

public AnnotationPayload.Builder getPayloadBuilder(int index)

Prediction result. AutoML Translation and AutoML Natural Language Sentiment Analysis return precisely one payload.

repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;

Parameter
NameDescription
indexint
Returns

getPayloadBuilderList()

public List<AnnotationPayload.Builder> getPayloadBuilderList()

Prediction result. AutoML Translation and AutoML Natural Language Sentiment Analysis return precisely one payload.

repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;

Returns
TypeDescription
List<Builder>

getPayloadCount()

public int getPayloadCount()

Prediction result. AutoML Translation and AutoML Natural Language Sentiment Analysis return precisely one payload.

repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;

Returns
TypeDescription
int

getPayloadList()

public List<AnnotationPayload> getPayloadList()

Prediction result. AutoML Translation and AutoML Natural Language Sentiment Analysis return precisely one payload.

repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;

Returns
TypeDescription
List<AnnotationPayload>

getPayloadOrBuilder(int index)

public AnnotationPayloadOrBuilder getPayloadOrBuilder(int index)

Prediction result. AutoML Translation and AutoML Natural Language Sentiment Analysis return precisely one payload.

repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;

Parameter
NameDescription
indexint
Returns

getPayloadOrBuilderList()

public List<? extends AnnotationPayloadOrBuilder> getPayloadOrBuilderList()

Prediction result. AutoML Translation and AutoML Natural Language Sentiment Analysis return precisely one payload.

repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;

Returns
TypeDescription
List<? extends com.google.cloud.automl.v1.AnnotationPayloadOrBuilder>

getPreprocessedInput()

public ExamplePayload getPreprocessedInput()

The preprocessed example that AutoML actually makes prediction on. Empty if AutoML does not preprocess the input example. For AutoML Natural Language (Classification, Entity Extraction, and Sentiment Analysis), if the input is a document, the recognized text is returned in the document_text property.

.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;

Returns
TypeDescription
ExamplePayload

The preprocessedInput.

getPreprocessedInputBuilder()

public ExamplePayload.Builder getPreprocessedInputBuilder()

The preprocessed example that AutoML actually makes prediction on. Empty if AutoML does not preprocess the input example. For AutoML Natural Language (Classification, Entity Extraction, and Sentiment Analysis), if the input is a document, the recognized text is returned in the document_text property.

.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;

Returns
TypeDescription
ExamplePayload.Builder

getPreprocessedInputOrBuilder()

public ExamplePayloadOrBuilder getPreprocessedInputOrBuilder()

The preprocessed example that AutoML actually makes prediction on. Empty if AutoML does not preprocess the input example. For AutoML Natural Language (Classification, Entity Extraction, and Sentiment Analysis), if the input is a document, the recognized text is returned in the document_text property.

.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;

Returns

hasPreprocessedInput()

public boolean hasPreprocessedInput()

The preprocessed example that AutoML actually makes prediction on. Empty if AutoML does not preprocess the input example. For AutoML Natural Language (Classification, Entity Extraction, and Sentiment Analysis), if the input is a document, the recognized text is returned in the document_text property.

.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;

Returns
TypeDescription
boolean

Whether the preprocessedInput field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

internalGetMutableMapField(int number)

protected MapField internalGetMutableMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(PredictResponse other)

public PredictResponse.Builder mergeFrom(PredictResponse other)
Parameter
NameDescription
otherPredictResponse
Returns

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public PredictResponse.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns Overrides Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public PredictResponse.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns Overrides

mergePreprocessedInput(ExamplePayload value)

public PredictResponse.Builder mergePreprocessedInput(ExamplePayload value)

The preprocessed example that AutoML actually makes prediction on. Empty if AutoML does not preprocess the input example. For AutoML Natural Language (Classification, Entity Extraction, and Sentiment Analysis), if the input is a document, the recognized text is returned in the document_text property.

.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;

Parameter
NameDescription
valueExamplePayload
Returns

mergeUnknownFields(UnknownFieldSet unknownFields)

public final PredictResponse.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns Overrides

putAllMetadata(Map<String,String> values)

public PredictResponse.Builder putAllMetadata(Map<String,String> values)

Additional domain-specific prediction response metadata. AutoML Vision Object Detection max_bounding_box_count : (int64) The maximum number of bounding boxes to return per image. AutoML Natural Language Sentiment Analysis sentiment_score : (float, deprecated) A value between -1 and 1, -1 maps to least positive sentiment, while 1 maps to the most positive one and the higher the score, the more positive the sentiment in the document is. Yet these values are relative to the training data, so e.g. if all data was positive then -1 is also positive (though the least). sentiment_score is not the same as "score" and "magnitude" from Sentiment Analysis in the Natural Language API.

map<string, string> metadata = 2;

Parameter
NameDescription
valuesMap<String,String>
Returns

putMetadata(String key, String value)

public PredictResponse.Builder putMetadata(String key, String value)

Additional domain-specific prediction response metadata. AutoML Vision Object Detection max_bounding_box_count : (int64) The maximum number of bounding boxes to return per image. AutoML Natural Language Sentiment Analysis sentiment_score : (float, deprecated) A value between -1 and 1, -1 maps to least positive sentiment, while 1 maps to the most positive one and the higher the score, the more positive the sentiment in the document is. Yet these values are relative to the training data, so e.g. if all data was positive then -1 is also positive (though the least). sentiment_score is not the same as "score" and "magnitude" from Sentiment Analysis in the Natural Language API.

map<string, string> metadata = 2;

Parameters
NameDescription
keyString
valueString
Returns

removeMetadata(String key)

public PredictResponse.Builder removeMetadata(String key)

Additional domain-specific prediction response metadata. AutoML Vision Object Detection max_bounding_box_count : (int64) The maximum number of bounding boxes to return per image. AutoML Natural Language Sentiment Analysis sentiment_score : (float, deprecated) A value between -1 and 1, -1 maps to least positive sentiment, while 1 maps to the most positive one and the higher the score, the more positive the sentiment in the document is. Yet these values are relative to the training data, so e.g. if all data was positive then -1 is also positive (though the least). sentiment_score is not the same as "score" and "magnitude" from Sentiment Analysis in the Natural Language API.

map<string, string> metadata = 2;

Parameter
NameDescription
keyString
Returns

removePayload(int index)

public PredictResponse.Builder removePayload(int index)

Prediction result. AutoML Translation and AutoML Natural Language Sentiment Analysis return precisely one payload.

repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;

Parameter
NameDescription
indexint
Returns

setField(Descriptors.FieldDescriptor field, Object value)

public PredictResponse.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns Overrides

setPayload(int index, AnnotationPayload value)

public PredictResponse.Builder setPayload(int index, AnnotationPayload value)

Prediction result. AutoML Translation and AutoML Natural Language Sentiment Analysis return precisely one payload.

repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;

Parameters
NameDescription
indexint
valueAnnotationPayload
Returns

setPayload(int index, AnnotationPayload.Builder builderForValue)

public PredictResponse.Builder setPayload(int index, AnnotationPayload.Builder builderForValue)

Prediction result. AutoML Translation and AutoML Natural Language Sentiment Analysis return precisely one payload.

repeated .google.cloud.automl.v1.AnnotationPayload payload = 1;

Parameters
NameDescription
indexint
builderForValueAnnotationPayload.Builder
Returns

setPreprocessedInput(ExamplePayload value)

public PredictResponse.Builder setPreprocessedInput(ExamplePayload value)

The preprocessed example that AutoML actually makes prediction on. Empty if AutoML does not preprocess the input example. For AutoML Natural Language (Classification, Entity Extraction, and Sentiment Analysis), if the input is a document, the recognized text is returned in the document_text property.

.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;

Parameter
NameDescription
valueExamplePayload
Returns

setPreprocessedInput(ExamplePayload.Builder builderForValue)

public PredictResponse.Builder setPreprocessedInput(ExamplePayload.Builder builderForValue)

The preprocessed example that AutoML actually makes prediction on. Empty if AutoML does not preprocess the input example. For AutoML Natural Language (Classification, Entity Extraction, and Sentiment Analysis), if the input is a document, the recognized text is returned in the document_text property.

.google.cloud.automl.v1.ExamplePayload preprocessed_input = 3;

Parameter
NameDescription
builderForValueExamplePayload.Builder
Returns

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public PredictResponse.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final PredictResponse.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns Overrides