models
Creates, updates, deletes, gets or lists a models
resource.
Overview
Name | models |
Type | Resource |
Id | google.translate.models |
Fields
The following fields are returned by SELECT
queries:
- projects_locations_models_get
- projects_locations_models_list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | The resource name of the model, in form of projects/{project-number-or-id}/locations/{location_id}/models/{model_id} |
createTime | string (google-datetime) | Output only. Timestamp when the model resource was created, which is also when the training started. |
dataset | string | The dataset from which the model is trained, in form of projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id} |
displayName | string | The name of the model to show in the interface. The name can be up to 32 characters long and can consist only of ASCII Latin letters A-Z and a-z, underscores (_), and ASCII digits 0-9. |
sourceLanguageCode | string | Output only. The BCP-47 language code of the source language. |
targetLanguageCode | string | Output only. The BCP-47 language code of the target language. |
testExampleCount | integer (int32) | Output only. Number of examples (sentence pairs) used to test the model. |
trainExampleCount | integer (int32) | Output only. Number of examples (sentence pairs) used to train the model. |
updateTime | string (google-datetime) | Output only. Timestamp when this model was last updated. |
validateExampleCount | integer (int32) | Output only. Number of examples (sentence pairs) used to validate the model. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | The resource name of the model, in form of projects/{project-number-or-id}/locations/{location_id}/models/{model_id} |
createTime | string (google-datetime) | Output only. Timestamp when the model resource was created, which is also when the training started. |
dataset | string | The dataset from which the model is trained, in form of projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id} |
displayName | string | The name of the model to show in the interface. The name can be up to 32 characters long and can consist only of ASCII Latin letters A-Z and a-z, underscores (_), and ASCII digits 0-9. |
sourceLanguageCode | string | Output only. The BCP-47 language code of the source language. |
targetLanguageCode | string | Output only. The BCP-47 language code of the target language. |
testExampleCount | integer (int32) | Output only. Number of examples (sentence pairs) used to test the model. |
trainExampleCount | integer (int32) | Output only. Number of examples (sentence pairs) used to train the model. |
updateTime | string (google-datetime) | Output only. Timestamp when this model was last updated. |
validateExampleCount | integer (int32) | Output only. Number of examples (sentence pairs) used to validate the model. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
projects_locations_models_get | select | projectsId , locationsId , modelsId | Gets a model. | |
projects_locations_models_list | select | projectsId , locationsId | filter , pageSize , pageToken | Lists models. |
projects_locations_models_create | insert | projectsId , locationsId | Creates a Model. | |
projects_locations_models_delete | delete | projectsId , locationsId , modelsId | Deletes a model. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
locationsId | string | |
modelsId | string | |
projectsId | string | |
filter | string | |
pageSize | integer (int32) | |
pageToken | string |
SELECT
examples
- projects_locations_models_get
- projects_locations_models_list
Gets a model.
SELECT
name,
createTime,
dataset,
displayName,
sourceLanguageCode,
targetLanguageCode,
testExampleCount,
trainExampleCount,
updateTime,
validateExampleCount
FROM google.translate.models
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND modelsId = '{{ modelsId }}' -- required;
Lists models.
SELECT
name,
createTime,
dataset,
displayName,
sourceLanguageCode,
targetLanguageCode,
testExampleCount,
trainExampleCount,
updateTime,
validateExampleCount
FROM google.translate.models
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- projects_locations_models_create
- Manifest
Creates a Model.
INSERT INTO google.translate.models (
data__name,
data__displayName,
data__dataset,
projectsId,
locationsId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ dataset }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: models
props:
- name: projectsId
value: string
description: Required parameter for the models resource.
- name: locationsId
value: string
description: Required parameter for the models resource.
- name: name
value: string
description: >
The resource name of the model, in form of `projects/{project-number-or-id}/locations/{location_id}/models/{model_id}`
- name: displayName
value: string
description: >
The name of the model to show in the interface. The name can be up to 32 characters long and can consist only of ASCII Latin letters A-Z and a-z, underscores (_), and ASCII digits 0-9.
- name: dataset
value: string
description: >
The dataset from which the model is trained, in form of `projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}`
DELETE
examples
- projects_locations_models_delete
Deletes a model.
DELETE FROM google.translate.models
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND modelsId = '{{ modelsId }}' --required;