datasets
Creates, updates, deletes, gets or lists a datasets
resource.
Overview
Name | datasets |
Type | Resource |
Id | google.translate.datasets |
Fields
The following fields are returned by SELECT
queries:
- projects_locations_datasets_get
- projects_locations_datasets_list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | The resource name of the dataset, in form of projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id} |
createTime | string (google-datetime) | Output only. Timestamp when this dataset was created. |
displayName | string | The 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. |
exampleCount | integer (int32) | Output only. The number of examples in the dataset. |
sourceLanguageCode | string | The BCP-47 language code of the source language. |
targetLanguageCode | string | The BCP-47 language code of the target language. |
testExampleCount | integer (int32) | Output only. Number of test examples (sentence pairs). |
trainExampleCount | integer (int32) | Output only. Number of training examples (sentence pairs). |
updateTime | string (google-datetime) | Output only. Timestamp when this dataset was last updated. |
validateExampleCount | integer (int32) | Output only. Number of validation examples (sentence pairs). |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | The resource name of the dataset, in form of projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id} |
createTime | string (google-datetime) | Output only. Timestamp when this dataset was created. |
displayName | string | The 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. |
exampleCount | integer (int32) | Output only. The number of examples in the dataset. |
sourceLanguageCode | string | The BCP-47 language code of the source language. |
targetLanguageCode | string | The BCP-47 language code of the target language. |
testExampleCount | integer (int32) | Output only. Number of test examples (sentence pairs). |
trainExampleCount | integer (int32) | Output only. Number of training examples (sentence pairs). |
updateTime | string (google-datetime) | Output only. Timestamp when this dataset was last updated. |
validateExampleCount | integer (int32) | Output only. Number of validation examples (sentence pairs). |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
projects_locations_datasets_get | select | projectsId , locationsId , datasetsId | Gets a Dataset. | |
projects_locations_datasets_list | select | projectsId , locationsId | pageSize , pageToken | Lists datasets. |
projects_locations_datasets_create | insert | projectsId , locationsId | Creates a Dataset. | |
projects_locations_datasets_delete | delete | projectsId , locationsId , datasetsId | Deletes a dataset and all of its contents. | |
projects_locations_datasets_import_data | exec | projectsId , locationsId , datasetsId | Import sentence pairs into translation Dataset. | |
projects_locations_datasets_export_data | exec | projectsId , locationsId , datasetsId | Exports dataset's data to the provided output location. |
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 |
---|---|---|
datasetsId | string | |
locationsId | string | |
projectsId | string | |
pageSize | integer (int32) | |
pageToken | string |
SELECT
examples
- projects_locations_datasets_get
- projects_locations_datasets_list
Gets a Dataset.
SELECT
name,
createTime,
displayName,
exampleCount,
sourceLanguageCode,
targetLanguageCode,
testExampleCount,
trainExampleCount,
updateTime,
validateExampleCount
FROM google.translate.datasets
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND datasetsId = '{{ datasetsId }}' -- required;
Lists datasets.
SELECT
name,
createTime,
displayName,
exampleCount,
sourceLanguageCode,
targetLanguageCode,
testExampleCount,
trainExampleCount,
updateTime,
validateExampleCount
FROM google.translate.datasets
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- projects_locations_datasets_create
- Manifest
Creates a Dataset.
INSERT INTO google.translate.datasets (
data__name,
data__displayName,
data__sourceLanguageCode,
data__targetLanguageCode,
projectsId,
locationsId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ sourceLanguageCode }}',
'{{ targetLanguageCode }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: datasets
props:
- name: projectsId
value: string
description: Required parameter for the datasets resource.
- name: locationsId
value: string
description: Required parameter for the datasets resource.
- name: name
value: string
description: >
The resource name of the dataset, in form of `projects/{project-number-or-id}/locations/{location_id}/datasets/{dataset_id}`
- name: displayName
value: string
description: >
The 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.
- name: sourceLanguageCode
value: string
description: >
The BCP-47 language code of the source language.
- name: targetLanguageCode
value: string
description: >
The BCP-47 language code of the target language.
DELETE
examples
- projects_locations_datasets_delete
Deletes a dataset and all of its contents.
DELETE FROM google.translate.datasets
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND datasetsId = '{{ datasetsId }}' --required;
Lifecycle Methods
- projects_locations_datasets_import_data
- projects_locations_datasets_export_data
Import sentence pairs into translation Dataset.
EXEC google.translate.datasets.projects_locations_datasets_import_data
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@datasetsId='{{ datasetsId }}' --required
@@json=
'{
"inputConfig": "{{ inputConfig }}"
}';
Exports dataset's data to the provided output location.
EXEC google.translate.datasets.projects_locations_datasets_export_data
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@datasetsId='{{ datasetsId }}' --required
@@json=
'{
"outputConfig": "{{ outputConfig }}"
}';