Stay organized with collectionsSave and categorize content based on your preferences.
Manage datasets
Manage existing adaptive translation datasets by using the Cloud Translation API.
You can list datasets, list files that are used by a dataset, delete all entries
from a given file, or delete datasets.
List datasets
View a list of all existing adaptive translation datasets in your project.
REST
Before using any of the request data,
make the following replacements:
PROJECT_NUMBER_OR_ID: the numeric or alphanumeric ID of
your Google Cloud project
LOCATION: The region where your source dataset is located, such
asus-central1.
HTTP method and URL:
GET https://translation.googleapis.com/v3/projects/PROJECT_ID/locations/LOCATION/adaptiveMtDatasets
To send your request, expand one of these options:
/** Lists all AdaptiveMtDatasets in a project. */privatestaticvoidlistAdaptiveMtDatasets(TranslationServiceClienttranslationServiceClient,StringprojectId){ListAdaptiveMtDatasetsRequestlistAdaptiveMtDatasetsRequest=ListAdaptiveMtDatasetsRequest.newBuilder().setParent(LocationName.of(projectId,"LOCATION").toString()).build();ListAdaptiveMtDatasetsPagedResponseresponse=translationServiceClient.listAdaptiveMtDatasets(listAdaptiveMtDatasetsRequest);System.out.println("Listing datasets:");for(AdaptiveMtDatasetdataset:response.iterateAll()){System.out.println(dataset);}}
deflist_adaptive_mt_datasets():# Create a clientclient=translate.TranslationServiceClient()# Initialize the requestrequest=translate.ListAdaptiveMtDatasetsRequest(parent="projects/PROJECT_ID/locations/LOCATION",)# Make the requestresponse=client.list_adaptive_mt_datasets(request)# Handle the responseprint(response)
List files in dataset
List files in your dataset to view which files were used to populate the
dataset. Cloud Translation outputs the file names and the number of
sentence pairs (entries) imported from each file.
REST
Before using any of the request data,
make the following replacements:
PROJECT_NUMBER_OR_ID: the numeric or alphanumeric ID of
your Google Cloud project
LOCATION: The region where your dataset is located, such asus-central1.
DATASET_ID: The unique identifier of your dataset that contains
files to list.
HTTP method and URL:
GET https://translation.googleapis.com/v3/projects/PROJECT_ID/locations/LOCATION/adaptiveMtDatasets/DATASET_ID/adaptiveMtFiles
To send your request, expand one of these options:
/** Lists all AdaptiveMtFiles in a dataset. */privatestaticvoidlistAdaptiveMtFiles(TranslationServiceClienttranslationServiceClient,StringprojectId,StringdatasetId){StringadaptiveMtDatasetName=String.format("projects/%s/locations/LOCATION/adaptiveMtDatasets/%s",projectId,datasetId);TranslationServiceClient.ListAdaptiveMtFilesPagedResponseresponse=translationServiceClient.listAdaptiveMtFiles(adaptiveMtDatasetName);System.out.println("Listing dataset files:");for(AdaptiveMtFilefile:response.iterateAll()){System.out.println(file.toString());}}
deflist_adaptive_mt_files():# Create a clientclient=translate.TranslationServiceClient()# Initialize the requestrequest=translate.ListAdaptiveMtFilesRequest(parent="projects/PROJECT_ID/locations/LOCATION/adaptiveMtDatasets/DATASET_ID")# Make the requestresponse=client.list_adaptive_mt_files(request)# Handle the responseprint(response)
Delete dataset file
Delete entries from a particular file for a given dataset. You must provide the
file's ID, which is part of the file's resource name that is returned from the
list files method.
REST
Before using any of the request data,
make the following replacements:
PROJECT_NUMBER_OR_ID: the numeric or alphanumeric ID of
your Google Cloud project
LOCATION: The region where your dataset is located, such asus-central1.
DATASET_ID: The unique identifier of your dataset that contains
files to list.
FILE_ID: The unique identifier of the file to delete, which is
given when you list dataset files.
defdelete_adaptive_mt_file():# Create a clientclient=translate.TranslationServiceClient()# Initialize the requestrequest=translate.DeleteAdaptiveMtFileRequest(name="projects/PROJECT_ID/locations/LOCATION/adaptiveMtDatasets/DATASET_ID/adaptiveMtFiles/FILE_ID")# Make the requestresponse=client.delete_adaptive_mt_file(request)# Handle the responseprint(response)
Delete datasets
Delete a dataset to remove all its data.
REST
Before using any of the request data,
make the following replacements:
PROJECT_NUMBER_OR_ID: the numeric or alphanumeric ID of
your Google Cloud project
LOCATION: The region where your source dataset is located, such
asus-central1.
DATASET_ID: The unique identifier of the dataset to delete.
defdelete_adaptive_mt_dataset():# Create a clientclient=translate.TranslationServiceClient()# Initialize the requestrequest=translate.DeleteAdaptiveMtDatasetRequest(name="projects/PROJECT_ID/locations/LOCATION/adaptiveMtDatasets/DATASET_ID")# Make the requestresponse=client.delete_adaptive_mt_dataset(request)# Handle the responseprint(response)
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,[]]