Skip to main content

models

Creates, updates, deletes, gets or lists a models resource.

Overview

Namemodels
TypeResource
Idgoogle.translate.models

Fields

NameDatatypeDescription
namestringThe resource name of the model, in form of projects/{project-number-or-id}/locations/{location_id}/models/{model_id}
createTimestringOutput only. Timestamp when the model resource was created, which is also when the training started.
datasetstringThe dataset from which the model is trained, in form of projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}
displayNamestringThe 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.
sourceLanguageCodestringOutput only. The BCP-47 language code of the source language.
targetLanguageCodestringOutput only. The BCP-47 language code of the target language.
testExampleCountintegerOutput only. Number of examples (sentence pairs) used to test the model.
trainExampleCountintegerOutput only. Number of examples (sentence pairs) used to train the model.
updateTimestringOutput only. Timestamp when this model was last updated.
validateExampleCountintegerOutput only. Number of examples (sentence pairs) used to validate the model.

Methods

NameAccessible byRequired ParamsDescription
projects_locations_models_getSELECTlocationsId, modelsId, projectsIdGets a model.
projects_locations_models_listSELECTlocationsId, projectsIdLists models.
projects_locations_models_createINSERTlocationsId, projectsIdCreates a Model.
projects_locations_models_deleteDELETElocationsId, modelsId, projectsIdDeletes a model.

SELECT examples

Lists models.

SELECT
name,
createTime,
dataset,
displayName,
sourceLanguageCode,
targetLanguageCode,
testExampleCount,
trainExampleCount,
updateTime,
validateExampleCount
FROM google.translate.models
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new models resource.

/*+ create */
INSERT INTO google.translate.models (
locationsId,
projectsId,
name,
displayName,
dataset
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ displayName }}',
'{{ dataset }}'
;

DELETE example

Deletes the specified models resource.

/*+ delete */
DELETE FROM google.translate.models
WHERE locationsId = '{{ locationsId }}'
AND modelsId = '{{ modelsId }}'
AND projectsId = '{{ projectsId }}';