Skip to main content

datasets

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

Overview

Namedatasets
TypeResource
Idgoogle.translate.datasets

Fields

NameDatatypeDescription
namestringThe resource name of the dataset, in form of projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}
createTimestringOutput only. Timestamp when this dataset was created.
displayNamestringThe name of the dataset 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.
exampleCountintegerOutput only. The number of examples in the dataset.
sourceLanguageCodestringThe BCP-47 language code of the source language.
targetLanguageCodestringThe BCP-47 language code of the target language.
testExampleCountintegerOutput only. Number of test examples (sentence pairs).
trainExampleCountintegerOutput only. Number of training examples (sentence pairs).
updateTimestringOutput only. Timestamp when this dataset was last updated.
validateExampleCountintegerOutput only. Number of validation examples (sentence pairs).

Methods

NameAccessible byRequired ParamsDescription
projects_locations_datasets_getSELECTdatasetsId, locationsId, projectsIdGets a Dataset.
projects_locations_datasets_listSELECTlocationsId, projectsIdLists datasets.
projects_locations_datasets_createINSERTlocationsId, projectsIdCreates a Dataset.
projects_locations_datasets_deleteDELETEdatasetsId, locationsId, projectsIdDeletes a dataset and all of its contents.
projects_locations_datasets_export_dataEXECdatasetsId, locationsId, projectsIdExports dataset's data to the provided output location.
projects_locations_datasets_import_dataEXECdatasetsId, locationsId, projectsIdImport sentence pairs into translation Dataset.

SELECT examples

Lists datasets.

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

INSERT example

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

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

DELETE example

Deletes the specified datasets resource.

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