<commit_before># AutoML Sample

<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=vision/beta/cloud-client/README.md">
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>

[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/automl/docs/
[google-cloud-java]: https://github.com/GoogleCloudPlatform/google-cloud-java

## Set the environment variables

GOOGLE_CLOUD_PROJECT = [Id of the project]
REGION_NAME = [Region name]
## Build the sample

Install [Maven](http://maven.apache.org/).

Build your project with:

```
mvn clean package
```

### Dataset API

#### Create a new dataset
```
mvn exec:java -Dexec.mainClass="com.google.cloud.vision.samples.automl.DatasetApi" \
-Dexec.args="create_dataset test_dataset"
```

#### List datasets
```
mvn exec:java -Dexec.mainClass="com.google.cloud.vision.samples.automl.DatasetApi" \
-Dexec.args="list_datasets"
```

#### Get dataset
```
mvn exec:java -Dexec.mainClass="com.google.cloud.vision.samples.automl.DatasetApi" \
-Dexec.args="get_dataset [dataset-id]"
```

#### Import data
```
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<commit_msg>fix wrong path to training example data (#1452)<commit_after># AutoML Sample

<a href="https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/java-docs-samples&page=editor&open_in_editor=vision/beta/cloud-client/README.md">
<img alt="Open in Cloud Shell" src ="http://gstatic.com/cloudssh/images/open-btn.png"></a>

[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/automl/docs/
[google-cloud-java]: https://github.com/GoogleCloudPlatform/google-cloud-java

## Set the environment variables

GOOGLE_CLOUD_PROJECT = [Id of the project]
REGION_NAME = [Region name]
## Build the sample

Install [Maven](http://maven.apache.org/).

Build your project with:

```
mvn clean package
```

### Dataset API

#### Create a new dataset
```
mvn exec:java -Dexec.mainClass="com.google.cloud.vision.samples.automl.DatasetApi" \
-Dexec.args="create_dataset test_dataset"
```

#### List datasets
```
mvn exec:java -Dexec.mainClass="com.google.cloud.vision.samples.automl.DatasetApi" \
-Dexec.args="list_datasets"
```

#### Get dataset
```
mvn exec:java -Dexec.mainClass="com.google.cloud.vision.samples.automl.DatasetApi" \
-Dexec.args="get_dataset [dataset-id]"
```

#### Import data
```
mvn exec:java -Dexec.mainClass="com.google.cloud.vision.samples.automl.DatasetApi" \
-Dexec.args="import_data [dataset-id] gs://cloud-ml-data/img/flower_photos/train_set.csv"
```

### Model API

#### Create Model
{'fraction_non_alphanumeric': 0.1524479624743477, 'fraction_numerical': 0.0011726766344180592, 'mean_word_length': 5.214936247723133, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1425664', 'n_tokens_mistral': 1126, 'n_tokens_neox': 1099, 'n_words': 244}