diff --git a/language/automl/README.md b/language/automl/README.md
index 97e17bee204..dfaa84b790c 100644
--- a/language/automl/README.md
+++ b/language/automl/README.md
@@ -3,13 +3,13 @@
-[Google Cloud Natural Language API][language] provides feature detection for images.
+[Google Cloud AutoML Natural Language API][language] provides feature detection for images.
This API is part of the larger collection of Cloud Machine Learning APIs.
This sample Java application demonstrates how to access the Cloud Natural Language AutoML API
using the [Google Cloud Client Library for Java][google-cloud-java].
-[language]: https://cloud.google.com/language/docs/
+[language]: https://cloud.google.com/language/automl/docs/
[google-cloud-java]: https://github.com/GoogleCloudPlatform/google-cloud-java
## Set the environment variables
@@ -46,7 +46,7 @@ mvn exec:java -Dexec.mainClass="com.google.cloud.language.samples.DatasetApi" -D
#### Import data
```
-mvn exec:java -Dexec.mainClass="com.google.cloud.language.samples.DatasetApi" -Dexec.args="import_data gs://java-docs-samples-testing/happiness.csv"
+mvn exec:java -Dexec.mainClass="com.google.cloud.language.samples.DatasetApi" -Dexec.args="import_data [dataset-id] gs://java-docs-samples-testing/happiness.csv"
```
### Model API
diff --git a/translate/automl/README.md b/translate/automl/README.md
index e2248a17de7..d0416587814 100644
--- a/translate/automl/README.md
+++ b/translate/automl/README.md
@@ -3,12 +3,15 @@
-[Google Cloud Translate API][translate] provides feature AutoML.
+[Google Cloud AutoML Translation API][translate] provides feature AutoML.
This API is part of the larger collection of Cloud Machine Learning APIs.
This sample Java application demonstrates how to access the Cloud Translate AutoML API
using the [Google Cloud Client Library for Java][google-cloud-java].
+[translate]: https://cloud.google.com/translate/automl/docs/
+[google-cloud-java]: https://github.com/GoogleCloudPlatform/google-cloud-java
+
## Set the environment variables
PROJECT_ID = [Id of the project]
@@ -43,7 +46,7 @@ mvn exec:java -Dexec.mainClass="com.google.cloud.translate.samples.DatasetApi" -
#### Import data
```
-mvn exec:java -Dexec.mainClass="com.google.cloud.translate.samples.DatasetApi" -Dexec.args="import_data gs://java-docs-samples-testing/en-ja.csv"
+mvn exec:java -Dexec.mainClass="com.google.cloud.translate.samples.DatasetApi" -Dexec.args="import_data [dataset-id] gs://java-docs-samples-testing/en-ja.csv"
```
### Model API
diff --git a/translate/automl/src/main/java/com/google/cloud/translate/automl/PredictionApi.java b/translate/automl/src/main/java/com/google/cloud/translate/automl/PredictionApi.java
index d3b1170897f..38e68fb811a 100644
--- a/translate/automl/src/main/java/com/google/cloud/translate/automl/PredictionApi.java
+++ b/translate/automl/src/main/java/com/google/cloud/translate/automl/PredictionApi.java
@@ -47,8 +47,8 @@
/**
* Google Cloud AutoML Translate API sample application. Example usage: mvn package exec:java
- * -Dexec.mainClass ='com.google.cloud.vision.samples.automl.PredictionApi' -Dexec.args='predict
- * [modelId] [path-to-image] [scoreThreshold]'
+ * -Dexec.mainClass ='com.google.cloud.translate.automl.PredictionApi' -Dexec.args='predict
+ * [modelId] [file-path]'
*/
public class PredictionApi {
@@ -61,16 +61,10 @@ public class PredictionApi {
* @param computeRegion the Region name.
* @param modelId the Id of the model which will be used for text classification.
* @param filePath the Local text file path of the content to be classified.
- * @param translationAllowFallback set to true to use a Google translation.
* @throws IOException on Input/Output errors.
*/
public static void predict(
- String projectId,
- String computeRegion,
- String modelId,
- String filePath,
- boolean translationAllowFallback)
- throws IOException {
+ String projectId, String computeRegion, String modelId, String filePath) throws IOException {
// Instantiate client for prediction service.
PredictionServiceClient predictionClient = PredictionServiceClient.create();
@@ -87,9 +81,6 @@ public static void predict(
// Additional parameters that can be provided for prediction
Map params = new HashMap<>();
- if (translationAllowFallback) {
- params.put("translation_allow_fallback", "True");//Allow Google Translation Model
- }
PredictResponse response = predictionClient.predict(name, payload, params);
TextSnippet translatedContent = response.getPayload(0).getTranslation().getTranslatedContent();
@@ -104,20 +95,16 @@ public static void main(String[] args) throws IOException {
}
public static void argsHelper(String[] args, PrintStream out) throws IOException {
- ArgumentParser parser = ArgumentParsers.newFor("PredictionApi")
- .build()
- .defaultHelp(true)
- .description("Prediction API Operation");
+ ArgumentParser parser =
+ ArgumentParsers.newFor("PredictionApi")
+ .build()
+ .defaultHelp(true)
+ .description("Prediction API Operation");
Subparsers subparsers = parser.addSubparsers().dest("command");
Subparser predictParser = subparsers.addParser("predict");
predictParser.addArgument("modelId");
predictParser.addArgument("filePath");
- predictParser
- .addArgument("translationAllowFallback")
- .nargs("?")
- .type(Boolean.class)
- .setDefault(Boolean.FALSE);
String projectId = System.getenv("PROJECT_ID");
String computeRegion = System.getenv("REGION_NAME");
@@ -126,12 +113,7 @@ public static void argsHelper(String[] args, PrintStream out) throws IOException
try {
ns = parser.parseArgs(args);
if (ns.get("command").equals("predict")) {
- predict(
- projectId,
- computeRegion,
- ns.getString("modelId"),
- ns.getString("filePath"),
- ns.getBoolean("translationAllowFallback"));
+ predict(projectId, computeRegion, ns.getString("modelId"), ns.getString("filePath"));
}
} catch (ArgumentParserException e) {
parser.handleError(e);
diff --git a/vision/automl/README.md b/vision/automl/README.md
index 24a73c48ece..67109fe0f4f 100644
--- a/vision/automl/README.md
+++ b/vision/automl/README.md
@@ -3,13 +3,13 @@
-[Google Cloud Vision API][vision] provides feature detection for images.
+[Google Cloud AutoML Vision API][vision] provides feature detection for images.
This API is part of the larger collection of Cloud Machine Learning APIs.
This sample Java application demonstrates how to access the Cloud Vision API
using the [Google Cloud Client Library for Java][google-cloud-java].
-[vision]: https://cloud.google.com/vision/docs/
+[vision]: https://cloud.google.com/vision/automl/docs/
[google-cloud-java]: https://github.com/GoogleCloudPlatform/google-cloud-java
## Set the environment variables
@@ -45,14 +45,14 @@ mvn exec:java -Dexec.mainClass="com.google.cloud.vision.samples.automl.DatasetAp
#### Import data
```
-mvn exec:java -Dexec.mainClass="com.google.cloud.vision.samples.automl.DatasetApi" -Dexec.args="import_data gs://java-docs-samples-testing/flower_traindata.csv"
+mvn exec:java -Dexec.mainClass="com.google.cloud.vision.samples.automl.DatasetApi" -Dexec.args="import_data [dataset-id] gs://java-docs-samples-testing/flower_traindata.csv"
```
### Model API
#### Create Model
```
-mvn exec:java -Dexec.mainClass="com.google.cloud.vision.samples.automl.ModelApi" -Dexec.args="create_model test_model"
+mvn exec:java -Dexec.mainClass="com.google.cloud.vision.samples.automl.ModelApi" -Dexec.args="create_model [dataset-id] test_model [training-budget] "
```
#### List Models
@@ -77,7 +77,7 @@ mvn exec:java -Dexec.mainClass="com.google.cloud.vision.samples.automl.ModelApi"
#### Delete Model
```
-mvn exec:java-Dexec.mainClass="com.google.cloud.vision.samples.automl.ModeltApi" -Dexec.args="delete_model [model-id]"
+mvn exec:java-Dexec.mainClass="com.google.cloud.vision.samples.automl.ModelApi" -Dexec.args="delete_model [model-id]"
```
### Predict API