Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AutoML region tags to use standard product prefixes #1200

Merged
merged 1 commit into from
Aug 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
*/
public class DatasetApi {

// [START automl_natural_language_create_dataset]
// [START automl_language_create_dataset]
/**
* Demonstrates using the AutoML client to create a dataset
*
Expand Down Expand Up @@ -101,9 +101,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_natural_language_create_dataset]
// [END automl_language_create_dataset]

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

// [START automl_natural_language_get_dataset]
// [START automl_language_get_dataset]
/**
* Demonstrates using the AutoML client to get a dataset by ID.
*
Expand Down Expand Up @@ -181,9 +181,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_natural_language_get_dataset]
// [END automl_language_get_dataset]

// [START automl_natural_language_import_data]
// [START automl_language_import_data]
/**
* Import labeled items.
*
Expand Down Expand Up @@ -217,9 +217,9 @@ public static void importData(
Empty response = client.importDataAsync(datasetFullId, inputConfig).get();
System.out.println(String.format("Dataset imported. %s", response));
}
// [END automl_natural_language_import_data]
// [END automl_language_import_data]

// [START automl_natural_language_export_data]
// [START automl_language_export_data]
/**
* Demonstrates using the AutoML client to export a dataset to a Google Cloud Storage bucket.
*
Expand Down Expand Up @@ -247,9 +247,9 @@ public static void exportData(
Empty response = client.exportDataAsync(datasetFullId, outputConfig).get();
System.out.println(String.format("Dataset exported. %s", response));
}
// [END automl_natural_language_export_data]
// [END automl_language_export_data]

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

System.out.println(String.format("Dataset deleted. %s", response));
}
// [END automl_natural_language_delete_dataset]
// [END automl_language_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 @@ -52,7 +52,7 @@
*/
public class ModelApi {

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

// [START automl_natural_language_get_operation_status]
// [START automl_language_get_operation_status]
/**
* Demonstrates using the AutoML client to get operation status.
*
Expand All @@ -111,9 +111,9 @@ public static void getOperationStatus(String operationFullId) throws IOException

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

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

// [START automl_natural_language_get_model]
// [START automl_language_get_model]
/**
* Demonstrates using the AutoML client to get model details.
*
Expand Down Expand Up @@ -184,9 +184,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_natural_language_get_model]
// END automl_language_get_model]

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

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

System.out.println(response);
}
// [END automl_natural_language_get_model_evaluation]
// [END automl_language_get_model_evaluation]

// [START automl_natural_language_display_evaluation]
// [START automl_language_display_evaluation]
/**
* Demonstrates using the AutoML client to display model evaluation.
*
Expand Down Expand Up @@ -317,9 +317,9 @@ public static void displayEvaluation(
}
}
}
// [END automl_natural_language_display_evaluation]
// [END automl_language_display_evaluation]

// [START automl_natural_language_delete_model]
// [START automl_language_delete_model]
/**
* Demonstrates using the AutoML client to delete a model.
*
Expand All @@ -341,7 +341,7 @@ public static void deleteModel(String projectId, String computeRegion, String mo

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

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 @@ -46,7 +46,7 @@
*/
public class PredictionApi {

// [START automl_natural_language_predict]
// [START automl_language_predict]
/**
* Demonstrates using the AutoML client to classify the text content
*
Expand Down Expand Up @@ -85,7 +85,7 @@ public static void predict(
"Predicted Class Score :" + annotationPayload.getClassification().getScore());
}
}
// [END automl_natural_language_predict]
// [END automl_language_predict]

public static void main(String[] args) throws IOException {
PredictionApi predictionApi = new PredictionApi();
Expand Down
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