| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent dac16c0 commit fc941e6
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,7 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | 28 | def create_dataset(project_id, compute_region, dataset_name, multilabel=False): | |
| 29 | 29 | """Create a dataset.""" | |
| 30 | - # [START automl_natural_language_create_dataset] | ||
| 30 | + # [START automl_language_create_dataset] | ||
| 31 | 31 | # TODO(developer): Uncomment and set the following variables | |
| 32 | 32 | # project_id = 'PROJECT_ID_HERE' | |
| 33 | 33 | # compute_region = 'COMPUTE_REGION_HERE' | |
@@ -69,12 +69,12 @@ def create_dataset(project_id, compute_region, dataset_name, multilabel=False): | |||
| 69 | 69 | print("\tseconds: {}".format(dataset.create_time.seconds)) | |
| 70 | 70 | print("\tnanos: {}".format(dataset.create_time.nanos)) | |
| 71 | 71 | ||
| 72 | - # [END automl_natural_language_create_dataset] | ||
| 72 | + # [END automl_language_create_dataset] | ||
| 73 | 73 | ||
| 74 | 74 | ||
| 75 | 75 | def list_datasets(project_id, compute_region, filter_): | |
| 76 | 76 | """List all datasets.""" | |
| 77 | - # [START automl_natural_language_list_datasets] | ||
| 77 | + # [START automl_language_list_datasets] | ||
| 78 | 78 | # TODO(developer): Uncomment and set the following variables | |
| 79 | 79 | # project_id = 'PROJECT_ID_HERE' | |
| 80 | 80 | # compute_region = 'COMPUTE_REGION_HERE' | |
@@ -103,12 +103,12 @@ def list_datasets(project_id, compute_region, filter_): | |||
| 103 | 103 | print("\tseconds: {}".format(dataset.create_time.seconds)) | |
| 104 | 104 | print("\tnanos: {}".format(dataset.create_time.nanos)) | |
| 105 | 105 | ||
| 106 | - # [END automl_natural_language_list_datasets] | ||
| 106 | + # [END automl_language_list_datasets] | ||
| 107 | 107 | ||
| 108 | 108 | ||
| 109 | 109 | def get_dataset(project_id, compute_region, dataset_id): | |
| 110 | 110 | """Get the dataset.""" | |
| 111 | - # [START automl_natural_language_get_dataset] | ||
| 111 | + # [START automl_language_get_dataset] | ||
| 112 | 112 | # TODO(developer): Uncomment and set the following variables | |
| 113 | 113 | # project_id = 'PROJECT_ID_HERE' | |
| 114 | 114 | # compute_region = 'COMPUTE_REGION_HERE' | |
@@ -137,12 +137,12 @@ def get_dataset(project_id, compute_region, dataset_id): | |||
| 137 | 137 | print("\tseconds: {}".format(dataset.create_time.seconds)) | |
| 138 | 138 | print("\tnanos: {}".format(dataset.create_time.nanos)) | |
| 139 | 139 | ||
| 140 | - # [END automl_natural_language_get_dataset] | ||
| 140 | + # [END automl_language_get_dataset] | ||
| 141 | 141 | ||
| 142 | 142 | ||
| 143 | 143 | def import_data(project_id, compute_region, dataset_id, path): | |
| 144 | 144 | """Import labelled items.""" | |
| 145 | - # [START automl_natural_language_import_data] | ||
| 145 | + # [START automl_language_import_data] | ||
| 146 | 146 | # TODO(developer): Uncomment and set the following variables | |
| 147 | 147 | # project_id = 'PROJECT_ID_HERE' | |
| 148 | 148 | # compute_region = 'COMPUTE_REGION_HERE' | |
@@ -169,12 +169,12 @@ def import_data(project_id, compute_region, dataset_id, path): | |||
| 169 | 169 | # synchronous check of operation status. | |
| 170 | 170 | print("Data imported. {}".format(response.result())) | |
| 171 | 171 | ||
| 172 | - # [END automl_natural_language_import_data] | ||
| 172 | + # [END automl_language_import_data] | ||
| 173 | 173 | ||
| 174 | 174 | ||
| 175 | 175 | def export_data(project_id, compute_region, dataset_id, output_uri): | |
| 176 | 176 | """Export a dataset to a Google Cloud Storage bucket.""" | |
| 177 | - # [START automl_natural_language_export_data] | ||
| 177 | + # [START automl_language_export_data] | ||
| 178 | 178 | # TODO(developer): Uncomment and set the following variables | |
| 179 | 179 | # project_id = 'PROJECT_ID_HERE' | |
| 180 | 180 | # compute_region = 'COMPUTE_REGION_HERE' | |
@@ -200,12 +200,12 @@ def export_data(project_id, compute_region, dataset_id, output_uri): | |||
| 200 | 200 | # synchronous check of operation status. | |
| 201 | 201 | print("Data exported. {}".format(response.result())) | |
| 202 | 202 | ||
| 203 | - # [END automl_natural_language_export_data] | ||
| 203 | + # [END automl_language_export_data] | ||
| 204 | 204 | ||
| 205 | 205 | ||
| 206 | 206 | def delete_dataset(project_id, compute_region, dataset_id): | |
| 207 | 207 | """Delete a dataset.""" | |
| 208 | - # [START automl_natural_language_delete_dataset] | ||
| 208 | + # [START automl_language_delete_dataset] | ||
| 209 | 209 | # TODO(developer): Uncomment and set the following variables | |
| 210 | 210 | # project_id = 'PROJECT_ID_HERE' | |
| 211 | 211 | # compute_region = 'COMPUTE_REGION_HERE' | |
@@ -226,7 +226,7 @@ def delete_dataset(project_id, compute_region, dataset_id): | |||
| 226 | 226 | # synchronous check of operation status. | |
| 227 | 227 | print("Dataset deleted. {}".format(response.result())) | |
| 228 | 228 | ||
| 229 | - # [END automl_natural_language_delete_dataset] | ||
| 229 | + # [END automl_language_delete_dataset] | ||
| 230 | 230 | ||
| 231 | 231 | ||
| 232 | 232 | if __name__ == "__main__": | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,7 +27,7 @@ | |||
| 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("\tnanos: {}".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("\tnanos: {}".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__": | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,7 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | 28 | def predict(project_id, compute_region, model_id, file_path): | |
| 29 | 29 | """Classify the content.""" | |
| 30 | - # [START automl_natural_language_predict] | ||
| 30 | + # [START automl_language_predict] | ||
| 31 | 31 | # TODO(developer): Uncomment and set the following variables | |
| 32 | 32 | # project_id = 'PROJECT_ID_HERE' | |
| 33 | 33 | # compute_region = 'COMPUTE_REGION_HERE' | |
@@ -62,7 +62,7 @@ def predict(project_id, compute_region, model_id, file_path): | |||
| 62 | 62 | print("Predicted class name: {}".format(result.display_name)) | |
| 63 | 63 | print("Predicted class score: {}".format(result.classification.score)) | |
| 64 | 64 | ||
| 65 | - # [END automl_natural_language_predict] | ||
| 65 | + # [END automl_language_predict] | ||
| 66 | 66 | ||
| 67 | 67 | ||
| 68 | 68 | if __name__ == "__main__": | |
| Back | FazBrowse Home | New Git URL |
0 commit comments