- HTTP request
- Path parameters
- Request body
- Response body
- Authorization Scopes
- ExamplePayload
- Image
- TextSnippet
- AnnotationPayload
- TranslationAnnotation
- ClassificationAnnotation
Perform a prediction.
HTTP request
POST https://automl.googleapis.com/v1beta1/{name}:predict
Path parameters
Parameters | |
---|---|
name |
Name of the model requested to serve the prediction. Authorization requires the following Google IAM permission on the specified resource
|
Request body
The request body contains data with the following structure:
JSON representation | |
---|---|
{
"payload": {
object( |
Fields | |
---|---|
payload |
Required. Payload to perform a prediction on. The payload must match the problem type that the model was trained to solve. |
params |
Additional domain-specific parameters, any string must be up to 25000 characters long.
An object containing a list of |
Response body
If successful, the response body contains data with the following structure:
Response message for PredictionService.Predict
.
Currently, this is only used to return an image recognition prediction result. More prediction output metadata might be introduced in the future.
JSON representation | |
---|---|
{
"payload": [
{
object( |
Fields | |
---|---|
payload[] |
Prediction result. |
metadata |
Additional domain-specific prediction response metadata. An object containing a list of |
Authorization Scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
ExamplePayload
Example data used for training or prediction.
JSON representation | |
---|---|
{ // Union field |
Fields | ||
---|---|---|
Union field payload . Required. Input only. The example data. payload can be only one of the following: |
||
image |
An example image. |
|
textSnippet |
Example text. |
Image
A representation of an image.
JSON representation | |
---|---|
{ "thumbnailUri": string, // Union field |
Fields | ||
---|---|---|
thumbnailUri |
Output only. HTTP URI to the thumbnail image. |
|
Union field data . Input only. The data representing the image. For Predict calls [image_bytes][] must be set, as other options are not currently supported by prediction API. You can read the contents of an uploaded image by using the [content_uri][] field. data can be only one of the following: |
||
imageBytes |
Image content represented as a stream of bytes. Note: As with all A base64-encoded string. |
|
inputConfig |
An input config specifying the content of the image. |
TextSnippet
A representation of a text snippet.
JSON representation | |
---|---|
{ "content": string, "mimeType": string, "contentUri": string } |
Fields | |
---|---|
content |
Required. The content of the text snippet as a string. Up to 250000 characters long. |
mimeType |
The format of the source text. For example, "text/html" or "text/plain". If left blank the format is automatically determined from the type of the uploaded content. The default is "text/html". Up to 25000 characters long. |
contentUri |
Output only. HTTP URI where you can download the content. |
AnnotationPayload
Contains annotation information that is relevant to AutoML.
JSON representation | |
---|---|
{ "annotationSpecId": string, "displayName": string, // Union field |
Fields | ||
---|---|---|
annotationSpecId |
Output only . The resource ID of the annotation spec that this annotation pertains to. The annotation spec comes from either an ancestor dataset, or the dataset that was used to train the model in use. |
|
displayName |
Output only. The value of |
|
Union field detail . Output only . Additional information about the annotation specific to the AutoML solution. detail can be only one of the following: |
||
translation |
Annotation details for translation. |
|
classification |
Annotation details for content or image classification. |
TranslationAnnotation
Annotation details specific to translation.
JSON representation | |
---|---|
{
"translatedContent": {
object( |
Fields | |
---|---|
translatedContent |
Output only . The translated content. |
ClassificationAnnotation
Contains annotation details specific to classification.
JSON representation | |
---|---|
{ "score": number } |
Fields | |
---|---|
score |
Output only. A confidence estimate between 0.0 and 1.0. A higher value means greater confidence that the annotation is positive. If a user approves an annotation as negative or positive, the score value remains unchanged. If a user creates an annotation, the score is 0 for negative or 1 for positive. |