Skip to content

Commit

Permalink
samples: Update AutoML region tags to use standard product prefixes (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
alixhami authored and anguillanneuf committed Dec 5, 2022
1 parent 5bd80d5 commit f7ae372
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
*/
public class DatasetApi {

// [START automl_translation_create_dataset]
// [START automl_translate_create_dataset]
/**
* Demonstrates using the AutoML client to create a dataset
*
Expand Down Expand Up @@ -102,9 +102,9 @@ public static void createDataset(
System.out.println(String.format("\tseconds: %s", dataset.getCreateTime().getSeconds()));
System.out.println(String.format("\tnanos: %s", dataset.getCreateTime().getNanos()));
}
// [END automl_translation_create_dataset]
// [END automl_translate_create_dataset]

// [START automl_translation_list_datasets]
// [START automl_translate_list_datasets]
/**
* Demonstrates using the AutoML client to list all datasets.
*
Expand Down Expand Up @@ -151,9 +151,9 @@ public static void listDatasets(String projectId, String computeRegion, String f
System.out.println(String.format("\tnanos: %s", dataset.getCreateTime().getNanos()));
}
}
// [END automl_translation_list_datasets]
// [END automl_translate_list_datasets]

// [START automl_translation_get_dataset]
// [START automl_translate_get_dataset]
/**
* Demonstrates using the AutoML client to get a dataset by ID.
*
Expand Down Expand Up @@ -193,9 +193,9 @@ public static void getDataset(String projectId, String computeRegion, String dat
System.out.println(String.format("\tseconds: %s", dataset.getCreateTime().getSeconds()));
System.out.println(String.format("\tnanos: %s", dataset.getCreateTime().getNanos()));
}
// [END automl_translation_get_dataset]
// [END automl_translate_get_dataset]

// [START automl_translation_import_data]
// [START automl_translate_import_data]
/**
* Import sentence pairs to the dataset.
*
Expand Down Expand Up @@ -228,9 +228,9 @@ public static void importData(
Empty response = client.importDataAsync(datasetFullId, inputConfig).get();
System.out.println(String.format("Dataset imported. %s", response));
}
// [END automl_translation_import_data]
// [END automl_translate_import_data]

// [START automl_translation_delete_dataset]
// [START automl_translate_delete_dataset]
/**
* Delete a dataset.
*
Expand All @@ -252,7 +252,7 @@ public static void deleteDataset(String projectId, String computeRegion, String

System.out.println(String.format("Dataset deleted. %s", response));
}
// [END automl_translation_delete_dataset]
// [END automl_translate_delete_dataset]

public static void main(String[] args) throws Exception {
DatasetApi datasetApi = new DatasetApi();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
*/
public class ModelApi {

// [START automl_translation_create_model]
// [START automl_translate_create_model]
/**
* Demonstrates using the AutoML client to create a model.
*
Expand Down Expand Up @@ -87,9 +87,9 @@ public static void createModel(
String.format("Training operation name: %s", response.getInitialFuture().get().getName()));
System.out.println("Training started...");
}
// [END automl_translation_create_model]
// [END automl_translate_create_model]

// [START automl_translation_list_models]
// [START automl_translate_list_models]
/**
* Demonstrates using the AutoML client to list all models.
*
Expand Down Expand Up @@ -128,9 +128,9 @@ public static void listModels(String projectId, String computeRegion, String fil
System.out.println(String.format("Model deployment state: %s", model.getDeploymentState()));
}
}
// [END automl_translation_list_models]
// [END automl_translate_list_models]

// [START automl_translation_get_model]
// [START automl_translate_get_model]
/**
* Demonstrates using the AutoML client to get model details.
*
Expand Down Expand Up @@ -161,9 +161,9 @@ public static void getModel(String projectId, String computeRegion, String model
System.out.println(String.format("\tnanos: %s", model.getCreateTime().getNanos()));
System.out.println(String.format("Model deployment state: %s", model.getDeploymentState()));
}
// [END automl_translation_get_model]
// [END automl_translate_get_model]

// [START automl_translation_list_model_evaluations]
// [START automl_translate_list_model_evaluations]
/**
* Demonstrates using the AutoML client to list model evaluations.
*
Expand Down Expand Up @@ -195,9 +195,9 @@ public static void listModelEvaluations(
System.out.println(element);
}
}
// [END automl_translation_list_model_evaluations]
// [END automl_translate_list_model_evaluations]

// [START automl_translation_get_model_evaluation]
// [START automl_translate_get_model_evaluation]
/**
* Demonstrates using the AutoML client to get model evaluations.
*
Expand All @@ -222,9 +222,9 @@ public static void getModelEvaluation(

System.out.println(response);
}
// [END automl_translation_get_model_evaluation]
// [END automl_translate_get_model_evaluation]

// [START automl_translation_delete_model]
// [START automl_translate_delete_model]
/**
* Demonstrates using the AutoML client to delete a model.
*
Expand All @@ -246,9 +246,9 @@ public static void deleteModel(String projectId, String computeRegion, String mo

System.out.println("Model deletion started...");
}
// [END automl_translation_delete_model]
// [END automl_translate_delete_model]

// [START automl_translation_get_operation_status]
// [START automl_translate_get_operation_status]
/**
* Demonstrates using the AutoML client to get operation status.
*
Expand All @@ -265,7 +265,7 @@ private static void getOperationStatus(String operationFullId) throws IOExceptio

System.out.println(String.format("Operation status: %s", response));
}
// [END automl_translation_get_operation_status]
// [END automl_translate_get_operation_status]

public static void main(String[] args) throws Exception {
ModelApi modelApi = new ModelApi();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
*/
public class PredictionApi {

// [START automl_translation_predict]
// [START automl_translate_predict]

/**
* Demonstrates using the AutoML client to predict an image.
Expand All @@ -65,7 +65,7 @@ public class PredictionApi {
*/
public static void predict(
String projectId, String computeRegion, String modelId, String filePath) throws IOException {

// Instantiate client for prediction service.
PredictionServiceClient predictionClient = PredictionServiceClient.create();

Expand All @@ -88,7 +88,7 @@ public static void predict(

System.out.println(String.format("Translated Content: %s", translatedContent.getContent()));
}
// [END automl_translation_predict]
// [END automl_translate_predict]

public static void main(String[] args) throws IOException {
PredictionApi predictApi = new PredictionApi();
Expand Down

0 comments on commit f7ae372

Please sign in to comment.