27
27
28
28
def create_model (project_id , compute_region , dataset_id , model_name ):
29
29
"""Create a model."""
30
- # [START automl_natural_language_create_model ]
30
+ # [START automl_language_create_model ]
31
31
# TODO(developer): Uncomment and set the following variables
32
32
# project_id = 'PROJECT_ID_HERE'
33
33
# compute_region = 'COMPUTE_REGION_HERE'
@@ -53,12 +53,12 @@ def create_model(project_id, compute_region, dataset_id, model_name):
53
53
print ("Training operation name: {}" .format (response .operation .name ))
54
54
print ("Training started..." )
55
55
56
- # [END automl_natural_language_create_model ]
56
+ # [END automl_language_create_model ]
57
57
58
58
59
59
def get_operation_status (operation_full_id ):
60
60
"""Get operation status."""
61
- # [START automl_natural_language_get_operation_status ]
61
+ # [START automl_language_get_operation_status ]
62
62
# TODO(developer): Uncomment and set the following variables
63
63
# operation_full_id =
64
64
# 'projects/<projectId>/locations/<region>/operations/<operationId>'
@@ -74,12 +74,12 @@ def get_operation_status(operation_full_id):
74
74
75
75
print ("Operation status: {}" .format (response ))
76
76
77
- # [END automl_natural_language_get_operation_status ]
77
+ # [END automl_language_get_operation_status ]
78
78
79
79
80
80
def list_models (project_id , compute_region , filter_ ):
81
81
"""List all models."""
82
- # [START automl_natural_language_list_models ]
82
+ # [START automl_language_list_models ]
83
83
# TODO(developer): Uncomment and set the following variables
84
84
# project_id = 'PROJECT_ID_HERE'
85
85
# compute_region = 'COMPUTE_REGION_HERE'
@@ -114,12 +114,12 @@ def list_models(project_id, compute_region, filter_):
114
114
print ("\t nanos: {}" .format (model .create_time .nanos ))
115
115
print ("Model deployment state: {}" .format (deployment_state ))
116
116
117
- # [END automl_natural_language_list_models ]
117
+ # [END automl_language_list_models ]
118
118
119
119
120
120
def get_model (project_id , compute_region , model_id ):
121
121
"""Get model details."""
122
- # [START automl_natural_language_get_model ]
122
+ # [START automl_language_get_model ]
123
123
# TODO(developer): Uncomment and set the following variables
124
124
# project_id = 'PROJECT_ID_HERE'
125
125
# compute_region = 'COMPUTE_REGION_HERE'
@@ -152,12 +152,12 @@ def get_model(project_id, compute_region, model_id):
152
152
print ("\t nanos: {}" .format (model .create_time .nanos ))
153
153
print ("Model deployment state: {}" .format (deployment_state ))
154
154
155
- # [END automl_natural_language_get_model ]
155
+ # [END automl_language_get_model ]
156
156
157
157
158
158
def list_model_evaluations (project_id , compute_region , model_id , filter_ ):
159
159
"""List model evaluations."""
160
- # [START automl_natural_language_list_model_evaluations ]
160
+ # [START automl_language_list_model_evaluations ]
161
161
# TODO(developer): Uncomment and set the following variables
162
162
# project_id = 'PROJECT_ID_HERE'
163
163
# compute_region = 'COMPUTE_REGION_HERE'
@@ -178,14 +178,14 @@ def list_model_evaluations(project_id, compute_region, model_id, filter_):
178
178
for element in response :
179
179
print (element )
180
180
181
- # [END automl_natural_language_list_model_evaluations ]
181
+ # [END automl_language_list_model_evaluations ]
182
182
183
183
184
184
def get_model_evaluation (
185
185
project_id , compute_region , model_id , model_evaluation_id
186
186
):
187
187
"""Get model evaluation."""
188
- # [START automl_natural_language_get_model_evaluation ]
188
+ # [START automl_language_get_model_evaluation ]
189
189
# TODO(developer): Uncomment and set the following variables
190
190
# project_id = 'PROJECT_ID_HERE'
191
191
# compute_region = 'COMPUTE_REGION_HERE'
@@ -206,12 +206,12 @@ def get_model_evaluation(
206
206
207
207
print (response )
208
208
209
- # [END automl_natural_language_get_model_evaluation ]
209
+ # [END automl_language_get_model_evaluation ]
210
210
211
211
212
212
def display_evaluation (project_id , compute_region , model_id , filter_ ):
213
213
"""Display evaluation."""
214
- # [START automl_natural_language_display_evaluation ]
214
+ # [START automl_language_display_evaluation ]
215
215
# TODO(developer): Uncomment and set the following variables
216
216
# project_id = 'PROJECT_ID_HERE'
217
217
# compute_region = 'COMPUTE_REGION_HERE'
@@ -281,12 +281,12 @@ def display_evaluation(project_id, compute_region, model_id, filter_):
281
281
)
282
282
)
283
283
284
- # [END automl_natural_language_display_evaluation ]
284
+ # [END automl_language_display_evaluation ]
285
285
286
286
287
287
def delete_model (project_id , compute_region , model_id ):
288
288
"""Delete a model."""
289
- # [START automl_natural_language_delete_model ]
289
+ # [START automl_language_delete_model ]
290
290
# TODO(developer): Uncomment and set the following variables
291
291
# project_id = 'PROJECT_ID_HERE'
292
292
# compute_region = 'COMPUTE_REGION_HERE'
@@ -305,7 +305,7 @@ def delete_model(project_id, compute_region, model_id):
305
305
# synchronous check of operation status.
306
306
print ("Model deleted. {}" .format (response .result ()))
307
307
308
- # [END automl_natural_language_delete_model ]
308
+ # [END automl_language_delete_model ]
309
309
310
310
311
311
if __name__ == "__main__" :
0 commit comments