Skip to content

Commit 89f23cd

Browse files
committed
fixing entity-extraction tests
1 parent d46c962 commit 89f23cd

21 files changed

+236
-17
lines changed

language/entity-extraction/src/main/java/com/google/cloud/language/automl/entity/extraction/samples/CreateDataset.java

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.google.cloud.language.automl.entity.extraction.samples;
1818

1919
// [START automl_natural_language_entity_create_dataset]
20+
2021
import com.google.cloud.automl.v1beta1.AutoMlClient;
2122
import com.google.cloud.automl.v1beta1.Dataset;
2223
import com.google.cloud.automl.v1beta1.LocationName;

language/entity-extraction/src/main/java/com/google/cloud/language/automl/entity/extraction/samples/CreateModel.java

+17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1+
/*
2+
* Copyright 2019 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.google.cloud.language.automl.entity.extraction.samples;
218

319
// [START automl_natural_language_entity_create_model]
20+
421
import com.google.api.gax.longrunning.OperationFuture;
522
import com.google.cloud.automl.v1beta1.AutoMlClient;
623
import com.google.cloud.automl.v1beta1.LocationName;

language/entity-extraction/src/main/java/com/google/cloud/language/automl/entity/extraction/samples/DeleteDataset.java

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.google.cloud.language.automl.entity.extraction.samples;
1818

1919
// [START automl_natural_language_entity_delete_dataset]
20+
2021
import com.google.cloud.automl.v1beta1.AutoMlClient;
2122
import com.google.cloud.automl.v1beta1.DatasetName;
2223
import com.google.protobuf.Empty;

language/entity-extraction/src/main/java/com/google/cloud/language/automl/entity/extraction/samples/DeleteModel.java

+17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1+
/*
2+
* Copyright 2019 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.google.cloud.language.automl.entity.extraction.samples;
218

319
// [START automl_natural_language_entity_delete_model]
20+
421
import com.google.api.gax.longrunning.OperationFuture;
522
import com.google.cloud.automl.v1beta1.AutoMlClient;
623
import com.google.cloud.automl.v1beta1.ModelName;

language/entity-extraction/src/main/java/com/google/cloud/language/automl/entity/extraction/samples/DeployModel.java

+17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1+
/*
2+
* Copyright 2019 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.google.cloud.language.automl.entity.extraction.samples;
218

319
// [START automl_natural_language_entity_deploy_model]
20+
421
import com.google.api.gax.longrunning.OperationFuture;
522
import com.google.cloud.automl.v1beta1.AutoMlClient;
623
import com.google.cloud.automl.v1beta1.DeployModelRequest;

language/entity-extraction/src/main/java/com/google/cloud/language/automl/entity/extraction/samples/DisplayEvaluation.java

+17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1+
/*
2+
* Copyright 2019 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.google.cloud.language.automl.entity.extraction.samples;
218

319
// [START automl_natural_language_entity_display_evaluation]
20+
421
import com.google.cloud.automl.v1beta1.AutoMlClient;
522
import com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest;
623
import com.google.cloud.automl.v1beta1.ModelEvaluation;

language/entity-extraction/src/main/java/com/google/cloud/language/automl/entity/extraction/samples/ExportData.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.google.cloud.language.automl.entity.extraction.samples;
1818

1919
// [START automl_natural_language_entity_export_data]
20+
2021
import com.google.cloud.automl.v1beta1.AutoMlClient;
2122
import com.google.cloud.automl.v1beta1.DatasetName;
2223
import com.google.cloud.automl.v1beta1.GcsDestination;
@@ -28,7 +29,7 @@
2829
class ExportData {
2930

3031
// Export data to Google Cloud Storage
31-
static void exportData(
32+
static void exportData(
3233
String projectId, String computeRegion, String datasetId, String gcsUri)
3334
throws IOException, InterruptedException, ExecutionException {
3435
// String projectId = "YOUR_PROJECT_ID";

language/entity-extraction/src/main/java/com/google/cloud/language/automl/entity/extraction/samples/GetDataset.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.google.cloud.language.automl.entity.extraction.samples;
1818

1919
// [START automl_natural_language_entity_get_dataset]
20+
2021
import com.google.cloud.automl.v1beta1.AutoMlClient;
2122
import com.google.cloud.automl.v1beta1.Dataset;
2223
import com.google.cloud.automl.v1beta1.DatasetName;
@@ -27,7 +28,7 @@
2728
class GetDataset {
2829

2930
// Get a given dataset
30-
static void getDataset(String projectId, String computeRegion, String datasetId)
31+
static void getDataset(String projectId, String computeRegion, String datasetId)
3132
throws IOException {
3233
// String projectId = "YOUR_PROJECT_ID";
3334
// String computeRegion = "YOUR_COMPUTE_REGION";

language/entity-extraction/src/main/java/com/google/cloud/language/automl/entity/extraction/samples/GetModel.java

+17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1+
/*
2+
* Copyright 2019 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.google.cloud.language.automl.entity.extraction.samples;
218

319
// [START automl_natural_language_entity_get_model]
20+
421
import com.google.cloud.automl.v1beta1.AutoMlClient;
522
import com.google.cloud.automl.v1beta1.Model;
623
import com.google.cloud.automl.v1beta1.ModelName;

language/entity-extraction/src/main/java/com/google/cloud/language/automl/entity/extraction/samples/GetModelEvaluation.java

+20-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1+
/*
2+
* Copyright 2019 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.google.cloud.language.automl.entity.extraction.samples;
218

319
// [START automl_natural_language_entity_get_model_evaluation]
20+
421
import com.google.cloud.automl.v1beta1.AutoMlClient;
522
import com.google.cloud.automl.v1beta1.ModelEvaluation;
623
import com.google.cloud.automl.v1beta1.ModelEvaluationName;
@@ -11,10 +28,10 @@
1128
import java.text.SimpleDateFormat;
1229
import java.util.List;
1330

14-
class GetModelEvaluation {
31+
class GetModelEvaluation {
1532

16-
// Get a given Model Evaluation
17-
static void getModelEvaluation(
33+
// Get a given Model Evaluation
34+
static void getModelEvaluation(
1835
String projectId, String computeRegion, String modelId, String modelEvaluationId)
1936
throws IOException {
2037
// String projectId = "YOUR_PROJECT_ID";

language/entity-extraction/src/main/java/com/google/cloud/language/automl/entity/extraction/samples/GetOperationStatus.java

+17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1+
/*
2+
* Copyright 2019 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.google.cloud.language.automl.entity.extraction.samples;
218

319
// [START automl_natural_language_entity_get_operation_status]
20+
421
import com.google.cloud.automl.v1beta1.AutoMlClient;
522
import com.google.longrunning.Operation;
623
import java.io.IOException;

language/entity-extraction/src/main/java/com/google/cloud/language/automl/entity/extraction/samples/ImportData.java

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.google.cloud.language.automl.entity.extraction.samples;
1818

1919
// [START automl_natural_language_entity_import_data]
20+
2021
import com.google.cloud.automl.v1beta1.AutoMlClient;
2122
import com.google.cloud.automl.v1beta1.DatasetName;
2223
import com.google.cloud.automl.v1beta1.GcsSource;

language/entity-extraction/src/main/java/com/google/cloud/language/automl/entity/extraction/samples/ListDatasets.java

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.google.cloud.language.automl.entity.extraction.samples;
1818

1919
// [START automl_natural_language_entity_list_datasets]
20+
2021
import com.google.cloud.automl.v1beta1.AutoMlClient;
2122
import com.google.cloud.automl.v1beta1.Dataset;
2223
import com.google.cloud.automl.v1beta1.ListDatasetsRequest;

language/entity-extraction/src/main/java/com/google/cloud/language/automl/entity/extraction/samples/ListModelEvaluations.java

+17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1+
/*
2+
* Copyright 2019 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.google.cloud.language.automl.entity.extraction.samples;
218

319
// [START automl_natural_language_entity_list_model_evaluations]
20+
421
import com.google.cloud.automl.v1beta1.AutoMlClient;
522
import com.google.cloud.automl.v1beta1.ListModelEvaluationsRequest;
623
import com.google.cloud.automl.v1beta1.ModelEvaluation;

language/entity-extraction/src/main/java/com/google/cloud/language/automl/entity/extraction/samples/ListModels.java

+17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1+
/*
2+
* Copyright 2019 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.google.cloud.language.automl.entity.extraction.samples;
218

319
// [START automl_natural_language_entity_list_models]
20+
421
import com.google.cloud.automl.v1beta1.AutoMlClient;
522
import com.google.cloud.automl.v1beta1.ListModelsRequest;
623
import com.google.cloud.automl.v1beta1.LocationName;

language/entity-extraction/src/main/java/com/google/cloud/language/automl/entity/extraction/samples/ListOperationsStatus.java

+18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1+
/*
2+
* Copyright 2019 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.google.cloud.language.automl.entity.extraction.samples;
218

319
// [START automl_natural_language_entity_list_operations_status]
20+
421
import com.google.cloud.automl.v1beta1.AutoMlClient;
522
import com.google.cloud.automl.v1beta1.LocationName;
623
import com.google.longrunning.ListOperationsRequest;
@@ -12,6 +29,7 @@ class ListOperationsStatus {
1229
public static void main(String[] args) throws IOException {
1330
ListOperationsStatus.listOperationsStatus("java-docs-samples-testing", "us-central1", "");
1431
}
32+
1533
// List all operation statuses for a given project based on the filter expression
1634
static void listOperationsStatus(String projectId, String computeRegion, String filter)
1735
throws IOException {

language/entity-extraction/src/main/java/com/google/cloud/language/automl/entity/extraction/samples/Predict.java

+17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1+
/*
2+
* Copyright 2019 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.google.cloud.language.automl.entity.extraction.samples;
218

319
// [START automl_natural_language_entity_predict]
20+
421
import com.google.cloud.automl.v1beta1.AnnotationPayload;
522
import com.google.cloud.automl.v1beta1.ExamplePayload;
623
import com.google.cloud.automl.v1beta1.ModelName;

language/entity-extraction/src/main/java/com/google/cloud/language/automl/entity/extraction/samples/UndeployModel.java

+17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
1+
/*
2+
* Copyright 2019 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.google.cloud.language.automl.entity.extraction.samples;
218

319
// [START automl_natural_language_entity_undeploy_model]
20+
421
import com.google.api.gax.longrunning.OperationFuture;
522
import com.google.cloud.automl.v1beta1.AutoMlClient;
623
import com.google.cloud.automl.v1beta1.ModelName;

0 commit comments

Comments
 (0)