Skip to main content

models

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

Overview

Namemodels
TypeResource
Idgoogle.translate.models

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringThe resource name of the model, in form of projects/{project-number-or-id}/locations/{location_id}/models/{model_id}
createTimestring (google-datetime)Output 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.
testExampleCountinteger (int32)Output only. Number of examples (sentence pairs) used to test the model.
trainExampleCountinteger (int32)Output only. Number of examples (sentence pairs) used to train the model.
updateTimestring (google-datetime)Output only. Timestamp when this model was last updated.
validateExampleCountinteger (int32)Output only. Number of examples (sentence pairs) used to validate the model.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_models_getselectprojectsId, locationsId, modelsIdGets a model.
projects_locations_models_listselectprojectsId, locationsIdfilter, pageSize, pageTokenLists models.
projects_locations_models_createinsertprojectsId, locationsIdCreates a Model.
projects_locations_models_deletedeleteprojectsId, locationsId, modelsIdDeletes 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.

NameDatatypeDescription
locationsIdstring
modelsIdstring
projectsIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

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;

INSERT examples

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
;

DELETE examples

Deletes a model.

DELETE FROM google.translate.models
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND modelsId = '{{ modelsId }}' --required;