26
26
import com .google .cloud .automl .v1 .AutoMlClient ;
27
27
import com .google .cloud .automl .v1 .ModelEvaluation ;
28
28
import com .google .cloud .automl .v1 .ModelEvaluationName ;
29
-
30
29
import java .io .IOException ;
31
30
32
31
class GetModelEvaluation {
@@ -41,14 +40,14 @@ static void getModelEvaluation() throws IOException {
41
40
42
41
// Get a model evaluation
43
42
static void getModelEvaluation (String projectId , String modelId , String modelEvaluationId )
44
- throws IOException {
43
+ throws IOException {
45
44
// Initialize client that will be used to send requests. This client only needs to be created
46
45
// once, and can be reused for multiple requests. After completing all of your requests, call
47
46
// the "close" method on the client to safely clean up any remaining background resources.
48
47
try (AutoMlClient client = AutoMlClient .create ()) {
49
48
// Get the full path of the model evaluation.
50
49
ModelEvaluationName modelEvaluationFullId =
51
- ModelEvaluationName .of (projectId , "us-central1" , modelId , modelEvaluationId );
50
+ ModelEvaluationName .of (projectId , "us-central1" , modelId , modelEvaluationId );
52
51
53
52
// Get complete detail of the model evaluation.
54
53
ModelEvaluation modelEvaluation = client .getModelEvaluation (modelEvaluationFullId );
@@ -59,38 +58,41 @@ static void getModelEvaluation(String projectId, String modelId, String modelEva
59
58
System .out .format ("\t seconds: %s\n " , modelEvaluation .getCreateTime ().getSeconds ());
60
59
System .out .format ("\t nanos: %s" , modelEvaluation .getCreateTime ().getNanos () / 1e9 );
61
60
System .out .format (
62
- "Evalution Example Count: %d\n " , modelEvaluation .getEvaluatedExampleCount ());
61
+ "Evalution Example Count: %d\n " , modelEvaluation .getEvaluatedExampleCount ());
63
62
// [END automl_language_sentiment_analysis_get_model_evaluation]
64
63
// [END automl_language_text_classification_get_model_evaluation]
65
64
// [END automl_translate_get_model_evaluation]
66
65
// [END automl_vision_classification_get_model_evaluation]
67
66
// [END automl_vision_object_detection_get_model_evaluation]
68
- System .out .format ("Entity Extraction Model Evaluation Metrics: %s\n " ,
69
- modelEvaluation .getTextExtractionEvaluationMetrics ());
67
+ System .out .format (
68
+ "Entity Extraction Model Evaluation Metrics: %s\n " ,
69
+ modelEvaluation .getTextExtractionEvaluationMetrics ());
70
70
// [END automl_language_entity_extraction_get_model_evaluation]
71
71
72
72
// [START automl_language_sentiment_analysis_get_model_evaluation]
73
- System .out .format ("Sentiment Analysis Model Evaluation Metrics: %s\n " ,
74
- modelEvaluation .getTextSentimentEvaluationMetrics ());
73
+ System .out .format (
74
+ "Sentiment Analysis Model Evaluation Metrics: %s\n " ,
75
+ modelEvaluation .getTextSentimentEvaluationMetrics ());
75
76
// [END automl_language_sentiment_analysis_get_model_evaluation]
76
77
77
78
// [START automl_language_text_classification_get_model_evaluation]
78
79
// [START automl_vision_classification_get_model_evaluation]
79
- System .out .format ("Classification Model Evaluation Metrics: %s\n " ,
80
- modelEvaluation .getClassificationEvaluationMetrics ());
80
+ System .out .format (
81
+ "Classification Model Evaluation Metrics: %s\n " ,
82
+ modelEvaluation .getClassificationEvaluationMetrics ());
81
83
// [END automl_language_text_classification_get_model_evaluation]
82
84
// [END automl_vision_classification_get_model_evaluation]
83
85
84
86
// [START automl_translate_get_model_evaluation]
85
87
System .out .format (
86
- "Translate Model Evaluation Metrics: %s\n " ,
87
- modelEvaluation .getTranslationEvaluationMetrics ());
88
+ "Translate Model Evaluation Metrics: %s\n " ,
89
+ modelEvaluation .getTranslationEvaluationMetrics ());
88
90
// [END automl_translate_get_model_evaluation]
89
91
90
-
91
92
// [START automl_vision_object_detection_get_model_evaluation]
92
- System .out .format ("Object Detection Model Evaluation Metrics: %s\n " ,
93
- modelEvaluation .getImageObjectDetectionEvaluationMetrics ());
93
+ System .out .format (
94
+ "Object Detection Model Evaluation Metrics: %s\n " ,
95
+ modelEvaluation .getImageObjectDetectionEvaluationMetrics ());
94
96
// [START automl_language_entity_extraction_get_model_evaluation]
95
97
// [START automl_language_sentiment_analysis_get_model_evaluation]
96
98
// [START automl_language_text_classification_get_model_evaluation]
0 commit comments