From bb110cdfb87d65595db30214b97d9bd2c60cb6d6 Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Wed, 29 Aug 2018 11:13:00 -0700 Subject: [PATCH] updates region tags to use standard product prefixes --- .../automl/automl_natural_language_dataset.py | 24 +++++++------- .../automl/automl_natural_language_model.py | 32 +++++++++---------- .../automl/automl_natural_language_predict.py | 4 +-- .../automl/automl_translation_dataset.py | 20 ++++++------ translate/automl/automl_translation_model.py | 28 ++++++++-------- .../automl/automl_translation_predict.py | 4 +-- 6 files changed, 56 insertions(+), 56 deletions(-) diff --git a/language/automl/automl_natural_language_dataset.py b/language/automl/automl_natural_language_dataset.py index 7793d4a60e55..df77d54268d4 100755 --- a/language/automl/automl_natural_language_dataset.py +++ b/language/automl/automl_natural_language_dataset.py @@ -27,7 +27,7 @@ def create_dataset(project_id, compute_region, dataset_name, multilabel=False): """Create a dataset.""" - # [START automl_natural_language_create_dataset] + # [START automl_language_create_dataset] # TODO(developer): Uncomment and set the following variables # project_id = 'PROJECT_ID_HERE' # compute_region = 'COMPUTE_REGION_HERE' @@ -69,12 +69,12 @@ def create_dataset(project_id, compute_region, dataset_name, multilabel=False): print("\tseconds: {}".format(dataset.create_time.seconds)) print("\tnanos: {}".format(dataset.create_time.nanos)) - # [END automl_natural_language_create_dataset] + # [END automl_language_create_dataset] def list_datasets(project_id, compute_region, filter_): """List all datasets.""" - # [START automl_natural_language_list_datasets] + # [START automl_language_list_datasets] # TODO(developer): Uncomment and set the following variables # project_id = 'PROJECT_ID_HERE' # compute_region = 'COMPUTE_REGION_HERE' @@ -103,12 +103,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_natural_language_list_datasets] + # [END automl_language_list_datasets] def get_dataset(project_id, compute_region, dataset_id): """Get the dataset.""" - # [START automl_natural_language_get_dataset] + # [START automl_language_get_dataset] # TODO(developer): Uncomment and set the following variables # project_id = 'PROJECT_ID_HERE' # compute_region = 'COMPUTE_REGION_HERE' @@ -137,12 +137,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_natural_language_get_dataset] + # [END automl_language_get_dataset] def import_data(project_id, compute_region, dataset_id, path): """Import labelled items.""" - # [START automl_natural_language_import_data] + # [START automl_language_import_data] # TODO(developer): Uncomment and set the following variables # project_id = 'PROJECT_ID_HERE' # compute_region = 'COMPUTE_REGION_HERE' @@ -169,12 +169,12 @@ def import_data(project_id, compute_region, dataset_id, path): # synchronous check of operation status. print("Data imported. {}".format(response.result())) - # [END automl_natural_language_import_data] + # [END automl_language_import_data] def export_data(project_id, compute_region, dataset_id, output_uri): """Export a dataset to a Google Cloud Storage bucket.""" - # [START automl_natural_language_export_data] + # [START automl_language_export_data] # TODO(developer): Uncomment and set the following variables # project_id = 'PROJECT_ID_HERE' # compute_region = 'COMPUTE_REGION_HERE' @@ -200,12 +200,12 @@ def export_data(project_id, compute_region, dataset_id, output_uri): # synchronous check of operation status. print("Data exported. {}".format(response.result())) - # [END automl_natural_language_export_data] + # [END automl_language_export_data] def delete_dataset(project_id, compute_region, dataset_id): """Delete a dataset.""" - # [START automl_natural_language_delete_dataset] + # [START automl_language_delete_dataset] # TODO(developer): Uncomment and set the following variables # project_id = 'PROJECT_ID_HERE' # compute_region = 'COMPUTE_REGION_HERE' @@ -226,7 +226,7 @@ def delete_dataset(project_id, compute_region, dataset_id): # synchronous check of operation status. print("Dataset deleted. {}".format(response.result())) - # [END automl_natural_language_delete_dataset] + # [END automl_language_delete_dataset] if __name__ == "__main__": diff --git a/language/automl/automl_natural_language_model.py b/language/automl/automl_natural_language_model.py index 84c0d99e4017..354721213da5 100755 --- a/language/automl/automl_natural_language_model.py +++ b/language/automl/automl_natural_language_model.py @@ -27,7 +27,7 @@ def create_model(project_id, compute_region, dataset_id, model_name): """Create a model.""" - # [START automl_natural_language_create_model] + # [START automl_language_create_model] # TODO(developer): Uncomment and set the following variables # project_id = 'PROJECT_ID_HERE' # compute_region = 'COMPUTE_REGION_HERE' @@ -53,12 +53,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_natural_language_create_model] + # [END automl_language_create_model] def get_operation_status(operation_full_id): """Get operation status.""" - # [START automl_natural_language_get_operation_status] + # [START automl_language_get_operation_status] # TODO(developer): Uncomment and set the following variables # operation_full_id = # 'projects//locations//operations/' @@ -74,12 +74,12 @@ def get_operation_status(operation_full_id): print("Operation status: {}".format(response)) - # [END automl_natural_language_get_operation_status] + # [END automl_language_get_operation_status] def list_models(project_id, compute_region, filter_): """List all models.""" - # [START automl_natural_language_list_models] + # [START automl_language_list_models] # TODO(developer): Uncomment and set the following variables # project_id = 'PROJECT_ID_HERE' # compute_region = 'COMPUTE_REGION_HERE' @@ -114,12 +114,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_natural_language_list_models] + # [END automl_language_list_models] def get_model(project_id, compute_region, model_id): """Get model details.""" - # [START automl_natural_language_get_model] + # [START automl_language_get_model] # TODO(developer): Uncomment and set the following variables # project_id = 'PROJECT_ID_HERE' # compute_region = 'COMPUTE_REGION_HERE' @@ -152,12 +152,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_natural_language_get_model] + # [END automl_language_get_model] def list_model_evaluations(project_id, compute_region, model_id, filter_): """List model evaluations.""" - # [START automl_natural_language_list_model_evaluations] + # [START automl_language_list_model_evaluations] # TODO(developer): Uncomment and set the following variables # project_id = 'PROJECT_ID_HERE' # compute_region = 'COMPUTE_REGION_HERE' @@ -178,14 +178,14 @@ def list_model_evaluations(project_id, compute_region, model_id, filter_): for element in response: print(element) - # [END automl_natural_language_list_model_evaluations] + # [END automl_language_list_model_evaluations] def get_model_evaluation( project_id, compute_region, model_id, model_evaluation_id ): """Get model evaluation.""" - # [START automl_natural_language_get_model_evaluation] + # [START automl_language_get_model_evaluation] # TODO(developer): Uncomment and set the following variables # project_id = 'PROJECT_ID_HERE' # compute_region = 'COMPUTE_REGION_HERE' @@ -206,12 +206,12 @@ def get_model_evaluation( print(response) - # [END automl_natural_language_get_model_evaluation] + # [END automl_language_get_model_evaluation] def display_evaluation(project_id, compute_region, model_id, filter_): """Display evaluation.""" - # [START automl_natural_language_display_evaluation] + # [START automl_language_display_evaluation] # TODO(developer): Uncomment and set the following variables # project_id = 'PROJECT_ID_HERE' # compute_region = 'COMPUTE_REGION_HERE' @@ -281,12 +281,12 @@ def display_evaluation(project_id, compute_region, model_id, filter_): ) ) - # [END automl_natural_language_display_evaluation] + # [END automl_language_display_evaluation] def delete_model(project_id, compute_region, model_id): """Delete a model.""" - # [START automl_natural_language_delete_model] + # [START automl_language_delete_model] # TODO(developer): Uncomment and set the following variables # project_id = 'PROJECT_ID_HERE' # compute_region = 'COMPUTE_REGION_HERE' @@ -305,7 +305,7 @@ def delete_model(project_id, compute_region, model_id): # synchronous check of operation status. print("Model deleted. {}".format(response.result())) - # [END automl_natural_language_delete_model] + # [END automl_language_delete_model] if __name__ == "__main__": diff --git a/language/automl/automl_natural_language_predict.py b/language/automl/automl_natural_language_predict.py index 0c25e373467b..b328c7aeb63b 100755 --- a/language/automl/automl_natural_language_predict.py +++ b/language/automl/automl_natural_language_predict.py @@ -27,7 +27,7 @@ def predict(project_id, compute_region, model_id, file_path): """Classify the content.""" - # [START automl_natural_language_predict] + # [START automl_language_predict] # TODO(developer): Uncomment and set the following variables # project_id = 'PROJECT_ID_HERE' # compute_region = 'COMPUTE_REGION_HERE' @@ -62,7 +62,7 @@ def predict(project_id, compute_region, model_id, file_path): print("Predicted class name: {}".format(result.display_name)) print("Predicted class score: {}".format(result.classification.score)) - # [END automl_natural_language_predict] + # [END automl_language_predict] if __name__ == "__main__": diff --git a/translate/automl/automl_translation_dataset.py b/translate/automl/automl_translation_dataset.py index e579ac358a21..c60ef544ca26 100755 --- a/translate/automl/automl_translation_dataset.py +++ b/translate/automl/automl_translation_dataset.py @@ -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' @@ -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' @@ -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' @@ -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' @@ -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' @@ -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__": diff --git a/translate/automl/automl_translation_model.py b/translate/automl/automl_translation_model.py index 0b9b6f53acaa..77a4ed73ca9d 100755 --- a/translate/automl/automl_translation_model.py +++ b/translate/automl/automl_translation_model.py @@ -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' @@ -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' @@ -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' @@ -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' @@ -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' @@ -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' @@ -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//locations//operations/' @@ -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__": diff --git a/translate/automl/automl_translation_predict.py b/translate/automl/automl_translation_predict.py index 653cf3887125..b15e0e3096f9 100644 --- a/translate/automl/automl_translation_predict.py +++ b/translate/automl/automl_translation_predict.py @@ -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' @@ -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__":