You create a custom model by training it using a prepared dataset. AutoML Natural Language uses the items from the dataset to train the model, test it, and evaluate its performance. You review the results, adjust the training dataset as needed and train a new model using the improved dataset.
Training a model can take several hours to complete. The AutoML API enables you to check the status of training.
Since AutoML Natural Language creates a new model each time you start training, your project may include numerous models. You can get a list of the models in your project and can delete models that you no longer need.
Getting information about a model
When training is complete, you can get information about the newly created model.
The examples in this section return the basic metadata about a model. To get details about a model's accuracy and readiness, see Evaluating models.
REST
Before using any of the request data, make the following replacements:
- project-id: your project ID
- location-id: the location for the resource,
us-central1
for the Global location oreu
for the European Union - model-id: your model ID
HTTP method and URL:
GET https://automl.googleapis.com/v1/projects/project-id/locations/location-id/models/model-id
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "model": [ { "name": "projects/434039606874/locations/us-central1/models/3745331181667467569", "createTime": "2018-04-27T02:00:22.329970Z", "textClassificationModelMetadata": { }, "displayName": "a_98487760535e48319dd204e6394670" }, }
Python
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Python API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Java API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Node.js API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Go API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Additional languages
C#: Please follow the C# setup instructions on the client libraries page and then visit the AutoML Natural Language reference documentation for .NET.
PHP: Please follow the PHP setup instructions on the client libraries page and then visit the AutoML Natural Language reference documentation for PHP.
Ruby: Please follow the Ruby setup instructions on the client libraries page and then visit the AutoML Natural Language reference documentation for Ruby.
Listing models
A project can include numerous models. This section describes how to retrieve a list of the available models for a project.
To see a list of the available models using the AutoML Natural Language UI, click the lightbulb icon in the left navigation bar.
To see the models for a different project, select the project from the drop-down list in the upper right of the title bar.
REST
Before using any of the request data, make the following replacements:
- project-id: your project ID
- location-id: the location for the resource,
us-central1
for the Global location oreu
for the European Union
HTTP method and URL:
GET https://automl.googleapis.com/v1/projects/project-id/locations/location-id/models
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "model": [ { "name": "projects/434039606874/locations/us-central1/models/7537307368641647584", "displayName": "c982e11ffbd5455e8d9bee2734f01f81", "textClassificationModelMetadata": { }, "createTime": "2018-04-30T23:06:19.223230Z" }, { "name": "projects/434039606874/locations/us-central1/models/6877109870585533885", "displayName": "test_201801111318", "textClassificationModelMetadata": { }, "createTime": "2018-01-11T21:25:05.893590Z" } ] }
Python
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Python API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Java API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Node.js API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Go API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Additional languages
C#: Please follow the C# setup instructions on the client libraries page and then visit the AutoML Natural Language reference documentation for .NET.
PHP: Please follow the PHP setup instructions on the client libraries page and then visit the AutoML Natural Language reference documentation for PHP.
Ruby: Please follow the Ruby setup instructions on the client libraries page and then visit the AutoML Natural Language reference documentation for Ruby.
Deploying or undeploying a model
You must deploy a model before you can use it to make predictions. When training a model using the web UI, you have the option to automatically deploy the model when training is complete.
Deploying a model incurs charges. For more information, see the pricing page.
Inactive models are subject to automatic undeployment. An inactive model is one that has not been used for prediction in 60 days. An undeployed model is not available for use until you explicitly redeploy it using a method that will be made available in advance of any undeployments.
To see the deployment status of a model in the AutoML Natural Language UI, refer to the Deployed column on the model listing page. On the Test & Use tab, a note box appears just below the model name indicating whether the selected model is currently deployed and offering a link to change the deployment status. Click Deploy model or Remove deployment to change the model's status.
Deploy
REST
Before using any of the request data, make the following replacements:
- project-id: your project ID
- location-id: the location for the resource,
us-central1
for the Global location oreu
for the European Union - model-name: your model name
HTTP method and URL:
POST https://automl.googleapis.com/v1/projects/project-id/locations/location-id/models/model-id:deploy
To send your request, expand one of these options:
You should receive a successful status code (2xx) and an empty response.
Python
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Python API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Java API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Node.js API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Go API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Additional languages
C#: Please follow the C# setup instructions on the client libraries page and then visit the AutoML Natural Language reference documentation for .NET.
PHP: Please follow the PHP setup instructions on the client libraries page and then visit the AutoML Natural Language reference documentation for PHP.
Ruby: Please follow the Ruby setup instructions on the client libraries page and then visit the AutoML Natural Language reference documentation for Ruby.
Undeploy
REST
Before using any of the request data, make the following replacements:
- project-id: your project ID
- location-id: the location for the resource,
us-central1
for the Global location oreu
for the European Union - model-name: your model name
HTTP method and URL:
POST https://automl.googleapis.com/v1/projects/project-id/locations/location-id/models/model-id:undeploy
To send your request, expand one of these options:
You should receive a successful status code (2xx) and an empty response.
Python
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Python API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Java API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Node.js API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Go API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Additional languages
C#: Please follow the C# setup instructions on the client libraries page and then visit the AutoML Natural Language reference documentation for .NET.
PHP: Please follow the PHP setup instructions on the client libraries page and then visit the AutoML Natural Language reference documentation for PHP.
Ruby: Please follow the Ruby setup instructions on the client libraries page and then visit the AutoML Natural Language reference documentation for Ruby.
Deleting a model
The following example deletes a model.
To delete a model using the AutoML Natural Language UI:
In the AutoML Natural Language UI, click the lighbuld icon in the left navigation menu to display the list of available models.
Click the three-dot menu at the far right of the row you want to delete and select Delete model.
Click Delete in the confirmation dialog box.
REST
Before using any of the request data, make the following replacements:
- project-id: your project ID
- location-id: the location for the resource,
us-central1
for the Global location oreu
for the European Union - model-name: your model name
HTTP method and URL:
DELETE https://automl.googleapis.com/v1/projects/project-id/locations/location-id/models/model-id
To send your request, expand one of these options:
You should receive a successful status code (2xx) and an empty response.
Python
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Python API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Java API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Node.js API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Go
To learn how to install and use the client library for AutoML Natural Language, see AutoML Natural Language client libraries. For more information, see the AutoML Natural Language Go API reference documentation.
To authenticate to AutoML Natural Language, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Additional languages
C#: Please follow the C# setup instructions on the client libraries page and then visit the AutoML Natural Language reference documentation for .NET.
PHP: Please follow the PHP setup instructions on the client libraries page and then visit the AutoML Natural Language reference documentation for PHP.
Ruby: Please follow the Ruby setup instructions on the client libraries page and then visit the AutoML Natural Language reference documentation for Ruby.