Skip to content

Commit

Permalink
Update AutoML region tags to use standard product prefixes (#1669)
Browse files Browse the repository at this point in the history
  • Loading branch information
alixhami authored Aug 29, 2018
1 parent 6a0436f commit 58522c2
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 56 deletions.
24 changes: 12 additions & 12 deletions language/automl/automl_natural_language_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand All @@ -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'
Expand All @@ -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'
Expand All @@ -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__":
Expand Down
32 changes: 16 additions & 16 deletions language/automl/automl_natural_language_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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/<projectId>/locations/<region>/operations/<operationId>'
Expand All @@ -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'
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand All @@ -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'
Expand All @@ -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'
Expand Down Expand Up @@ -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'
Expand All @@ -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__":
Expand Down
4 changes: 2 additions & 2 deletions language/automl/automl_natural_language_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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__":
Expand Down
20 changes: 10 additions & 10 deletions translate/automl/automl_translation_dataset.py
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 58522c2

Please sign in to comment.