Skip to content

Commit

Permalink
Update AutoML region tags to use standard product prefixes [(#1669)](G…
Browse files Browse the repository at this point in the history
  • Loading branch information
alixhami authored and busunkim96 committed Sep 15, 2020
1 parent fcf79db commit 623628a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
Expand Up @@ -27,7 +27,7 @@

def create_dataset(project_id, compute_region, dataset_name, source, target):
"""Create a dataset."""
# [START automl_translation_create_dataset]
# [START automl_translate_create_dataset]
# TODO(developer): Uncomment and set the following variables
# project_id = 'PROJECT_ID_HERE'
# compute_region = 'COMPUTE_REGION_HERE'
Expand Down Expand Up @@ -75,12 +75,12 @@ def create_dataset(project_id, compute_region, dataset_name, source, target):
print("\tseconds: {}".format(dataset.create_time.seconds))
print("\tnanos: {}".format(dataset.create_time.nanos))

# [END automl_translation_create_dataset]
# [END automl_translate_create_dataset]


def list_datasets(project_id, compute_region, filter_):
"""List Datasets."""
# [START automl_translation_list_datasets]
# [START automl_translate_list_datasets]
# TODO(developer): Uncomment and set the following variables
# project_id = 'PROJECT_ID_HERE'
# compute_region = 'COMPUTE_REGION_HERE'
Expand Down Expand Up @@ -117,12 +117,12 @@ def list_datasets(project_id, compute_region, filter_):
print("\tseconds: {}".format(dataset.create_time.seconds))
print("\tnanos: {}".format(dataset.create_time.nanos))

# [END automl_translation_list_datasets]
# [END automl_translate_list_datasets]


def get_dataset(project_id, compute_region, dataset_id):
"""Get the dataset."""
# [START automl_translation_get_dataset]
# [START automl_translate_get_dataset]
# TODO(developer): Uncomment and set the following variables
# project_id = 'PROJECT_ID_HERE'
# compute_region = 'COMPUTE_REGION_HERE'
Expand Down Expand Up @@ -159,12 +159,12 @@ def get_dataset(project_id, compute_region, dataset_id):
print("\tseconds: {}".format(dataset.create_time.seconds))
print("\tnanos: {}".format(dataset.create_time.nanos))

# [END automl_translation_get_dataset]
# [END automl_translate_get_dataset]


def import_data(project_id, compute_region, dataset_id, path):
"""Import sentence pairs to the dataset."""
# [START automl_translation_import_data]
# [START automl_translate_import_data]
# TODO(developer): Uncomment and set the following variables
# project_id = 'PROJECT_ID_HERE'
# compute_region = 'COMPUTE_REGION_HERE'
Expand All @@ -191,12 +191,12 @@ def import_data(project_id, compute_region, dataset_id, path):
# synchronous check of operation status
print("Data imported. {}".format(response.result()))

# [END automl_translation_import_data]
# [END automl_translate_import_data]


def delete_dataset(project_id, compute_region, dataset_id):
"""Delete a dataset."""
# [START automl_translation_delete_dataset]]
# [START automl_translate_delete_dataset]]
# TODO(developer): Uncomment and set the following variables
# project_id = 'PROJECT_ID_HERE'
# compute_region = 'COMPUTE_REGION_HERE'
Expand All @@ -217,7 +217,7 @@ def delete_dataset(project_id, compute_region, dataset_id):
# synchronous check of operation status
print("Dataset deleted. {}".format(response.result()))

# [END automl_translation_delete_dataset]
# [END automl_translate_delete_dataset]


if __name__ == "__main__":
Expand Down
Expand Up @@ -27,7 +27,7 @@

def create_model(project_id, compute_region, dataset_id, model_name):
"""Create a model."""
# [START automl_translation_create_model]
# [START automl_translate_create_model]
# TODO(developer): Uncomment and set the following variables
# project_id = 'PROJECT_ID_HERE'
# compute_region = 'COMPUTE_REGION_HERE'
Expand All @@ -54,12 +54,12 @@ def create_model(project_id, compute_region, dataset_id, model_name):
print("Training operation name: {}".format(response.operation.name))
print("Training started...")

# [END automl_translation_create_model]
# [END automl_translate_create_model]


def list_models(project_id, compute_region, filter_):
"""List all models."""
# [START automl_translation_list_models]
# [START automl_translate_list_models]
# TODO(developer): Uncomment and set the following variables
# project_id = 'PROJECT_ID_HERE'
# compute_region = 'COMPUTE_REGION_HERE'
Expand Down Expand Up @@ -92,12 +92,12 @@ def list_models(project_id, compute_region, filter_):
print("\tnanos: {}".format(model.create_time.nanos))
print("Model deployment state: {}".format(deployment_state))

# [END automl_translation_list_models]
# [END automl_translate_list_models]


def get_model(project_id, compute_region, model_id):
"""Get model details."""
# [START automl_translation_get_model]
# [START automl_translate_get_model]
# TODO(developer): Uncomment and set the following variables
# project_id = 'PROJECT_ID_HERE'
# compute_region = 'COMPUTE_REGION_HERE'
Expand Down Expand Up @@ -129,12 +129,12 @@ def get_model(project_id, compute_region, model_id):
print("\tnanos: {}".format(model.create_time.nanos))
print("Model deployment state: {}".format(deployment_state))

# [END automl_translation_get_model]
# [END automl_translate_get_model]


def list_model_evaluations(project_id, compute_region, model_id, filter_):
"""List model evaluations."""
# [START automl_translation_list_model_evaluations]
# [START automl_translate_list_model_evaluations]
# TODO(developer): Uncomment and set the following variables
# project_id = 'PROJECT_ID_HERE'
# compute_region = 'COMPUTE_REGION_HERE'
Expand All @@ -152,14 +152,14 @@ def list_model_evaluations(project_id, compute_region, model_id, filter_):
for element in client.list_model_evaluations(model_full_id, filter_):
print(element)

# [END automl_translation_list_model_evaluations]
# [END automl_translate_list_model_evaluations]


def get_model_evaluation(
project_id, compute_region, model_id, model_evaluation_id
):
"""Get model evaluation."""
# [START automl_translation_get_model_evaluation]
# [START automl_translate_get_model_evaluation]
# TODO(developer): Uncomment and set the following variables
# project_id = 'PROJECT_ID_HERE'
# compute_region = 'COMPUTE_REGION_HERE'
Expand All @@ -180,12 +180,12 @@ def get_model_evaluation(

print(response)

# [END automl_translation_get_model_evaluation]
# [END automl_translate_get_model_evaluation]


def delete_model(project_id, compute_region, model_id):
"""Delete a model."""
# [START automl_translation_delete_model]
# [START automl_translate_delete_model]
# TODO(developer): Uncomment and set the following variables
# project_id = 'PROJECT_ID_HERE'
# compute_region = 'COMPUTE_REGION_HERE'
Expand All @@ -204,12 +204,12 @@ def delete_model(project_id, compute_region, model_id):
# synchronous check of operation status.
print("Model deleted. {}".format(response.result()))

# [END automl_translation_delete_model]
# [END automl_translate_delete_model]


def get_operation_status(operation_full_id):
"""Get operation status."""
# [START automl_translation_get_operation_status]
# [START automl_translate_get_operation_status]
# TODO(developer): Uncomment and set the following variables
# operation_full_id =
# 'projects/<projectId>/locations/<region>/operations/<operationId>'
Expand All @@ -225,7 +225,7 @@ def get_operation_status(operation_full_id):

print("Operation status: {}".format(response))

# [END automl_translation_get_operation_status]
# [END automl_translate_get_operation_status]


if __name__ == "__main__":
Expand Down
Expand Up @@ -27,7 +27,7 @@

def predict(project_id, compute_region, model_id, file_path):
"""Translate the content."""
# [START automl_translation_predict]
# [START automl_translate_predict]
# project_id = 'PROJECT_ID_HERE'
# compute_region = 'COMPUTE_REGION_HERE'
# model_id = 'MODEL_ID_HERE'
Expand Down Expand Up @@ -61,7 +61,7 @@ def predict(project_id, compute_region, model_id, file_path):

print(u"Translated content: {}".format(translated_content.content))

# [END automl_translation_predict]
# [END automl_translate_predict]


if __name__ == "__main__":
Expand Down

0 comments on commit 623628a

Please sign in to comment.