( projectId = 'YOUR_PROJECT_ID', location = 'us-central1', modelId = 'YOUR_MODEL_ID' )
| 15 | 'use strict'; |
| 16 | |
| 17 | function main( |
| 18 | projectId = 'YOUR_PROJECT_ID', |
| 19 | location = 'us-central1', |
| 20 | modelId = 'YOUR_MODEL_ID' |
| 21 | ) { |
| 22 | // [START automl_language_entity_extraction_list_model_evaluations] |
| 23 | // [START automl_language_sentiment_analysis_list_model_evaluations] |
| 24 | // [START automl_language_text_classification_list_model_evaluations] |
| 25 | // [START automl_translate_list_model_evaluations] |
| 26 | // [START automl_vision_classification_list_model_evaluations] |
| 27 | // [START automl_vision_object_detection_list_model_evaluations] |
| 28 | /** |
| 29 | * TODO(developer): Uncomment these variables before running the sample. |
| 30 | */ |
| 31 | // const projectId = 'YOUR_PROJECT_ID'; |
| 32 | // const location = 'us-central1'; |
| 33 | // const modelId = 'YOUR_MODEL_ID'; |
| 34 | |
| 35 | // Imports the Google Cloud AutoML library |
| 36 | const {AutoMlClient} = require('@google-cloud/automl').v1; |
| 37 | |
| 38 | // Instantiates a client |
| 39 | const client = new AutoMlClient(); |
| 40 | |
| 41 | async function listModelEvaluations() { |
| 42 | // Construct request |
| 43 | const request = { |
| 44 | parent: client.modelPath(projectId, location, modelId), |
| 45 | filter: '', |
| 46 | }; |
| 47 | |
| 48 | const [response] = await client.listModelEvaluations(request); |
| 49 | |
| 50 | console.log('List of model evaluations:'); |
| 51 | for (const evaluation of response) { |
| 52 | console.log(`Model evaluation name: ${evaluation.name}`); |
| 53 | console.log(`Model annotation spec id: ${evaluation.annotationSpecId}`); |
| 54 | console.log(`Model display name: ${evaluation.displayName}`); |
| 55 | console.log('Model create time'); |
| 56 | console.log(`\tseconds ${evaluation.createTime.seconds}`); |
| 57 | console.log(`\tnanos ${evaluation.createTime.nanos / 1e9}`); |
| 58 | console.log( |
| 59 | `Evaluation example count: ${evaluation.evaluatedExampleCount}` |
| 60 | ); |
| 61 | // [END automl_language_sentiment_analysis_list_model_evaluations] |
| 62 | // [END automl_language_text_classification_list_model_evaluations] |
| 63 | // [END automl_translate_list_model_evaluations] |
| 64 | // [END automl_vision_classification_list_model_evaluations] |
| 65 | // [END automl_vision_object_detection_list_model_evaluations] |
| 66 | console.log( |
| 67 | `Entity extraction model evaluation metrics: ${evaluation.textExtractionEvaluationMetrics}` |
| 68 | ); |
| 69 | // [END automl_language_entity_extraction_list_model_evaluations] |
| 70 | |
| 71 | // [START automl_language_sentiment_analysis_list_model_evaluations] |
| 72 | console.log( |
| 73 | `Sentiment analysis model evaluation metrics: ${evaluation.textSentimentEvaluationMetrics}` |
| 74 | ); |
no test coverage detected