Model Build
A Model Build is a trained natural language understanding model that performs intent recognition and field extraction.
Models are created asynchronously and their status can be monitored as they are built, either via the API or Status Callbacks. Once a model is built, you can query the model using the Query Resource.
All Autopilot REST API resources use the following base URL:
https://autopilot.twilio.com/v1
Each model build is unique in the sense that the training process has randomness. Two model builds using the identical sample set may provide slightly different models, hence the different results for the same queries. To reduce the effect of the randomness in training (i.e., slight differences between model builds), you can add more samples.
ModelBuild properties
Resource Properties in REST API format | |
---|---|
account_sid
|
The SID of the Account that created the ModelBuild resource. |
date_created
|
The date and time in GMT when the resource was created specified in RFC 2822 format. |
date_updated
|
The date and time in GMT when the resource was last updated specified in RFC 2822 format. |
assistant_sid
|
The SID of the Assistant that is the parent of the resource. |
sid
|
The unique string that we created to identify the ModelBuild resource. |
status
|
The status of the model build process. Can be: |
unique_name
|
An application-defined string that uniquely identifies the resource. It can be used as an alternative to the |
url
|
The absolute URL of the ModelBuild resource. |
build_duration
|
The time in seconds it took to build the model. |
error_code
|
If the |
Create a ModelBuild resource
https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/ModelBuilds
POST'ing to the Model Build list resource starts a training process that creates a new model based on the Tasks, Samples, Field Types, and Field Values for an Assistant.
When you define new Tasks, Field Types, and Fields, you should create a new Model Build so that Twilio Autopilot can train a new model using the new data.
Similarly, whenever you have a new set of Samples you should train a new model. There is no need to create a Model Build on every new Sample. We recommend creating a new Model Build once you have finished uploading all of your samples.
Model Building is an asynchronous process that returns an HTTP 201 Created
response when the Model Build is successfully enqueued for training.
Training times vary depending on the size of your dataset. You can expect longer times for larger datasets.
Parameters
Parameters in REST API format | |
---|---|
assistant_sid
Path
|
The SID of the Assistant that is the parent of the new resource. |
status_callback
Optional
|
The URL we should call using a POST method to send status information to your application. |
unique_name
Optional
|
An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the |
Example 1
Example 2
Fetch a ModelBuild resource
https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/ModelBuilds/{Sid}
Returns the Model Build instance identified by {ModelBuildSid
} or {ModelBuildUniqueName
}.
Parameters
Parameters in REST API format | |
---|---|
assistant_sid
Path
|
The SID of the Assistant that is the parent of the resource to fetch. |
sid
Path
|
The Twilio-provided string that uniquely identifies the ModelBuild resource to fetch. |
Example 1
Read multiple ModelBuild resources
https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/ModelBuilds
Returns a list of Model Builds for a given Assistant.
The list returned includes paging information.
Parameters
Parameters in REST API format | |
---|---|
assistant_sid
Path
|
The SID of the Assistant that is the parent of the resources to read. |
Example 1
Update a ModelBuild resource
https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/ModelBuilds/{Sid}
Updates the ModelBuild instance identified by {ModelBuildSid
} or {ModelBuildUniqueName
}.
Parameters
Parameters in REST API format | |
---|---|
assistant_sid
Path
|
The SID of the Assistant that is the parent of the resource to update. |
sid
Path
|
The Twilio-provided string that uniquely identifies the ModelBuild resource to update. |
unique_name
Optional
|
An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the |
Example 1
Delete a ModelBuild resource
https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/ModelBuilds/{Sid}
Deletes a Model Build identified by {ModelBuildSid
} or {ModelBuildUniqueName
}.
Parameters
Parameters in REST API format | |
---|---|
assistant_sid
Path
|
The SID of the Assistant that is the parent of the resources to delete. |
sid
Path
|
The Twilio-provided string that uniquely identifies the ModelBuild resource to delete. |
Example 1
Need some help?
We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.