Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now

Menu

Expand
Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

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

ModelBuild properties

Names in PHP format
accountSid
sid<AC> Not PII

The SID of the Account that created the ModelBuild resource.

dateCreated
date_time<iso8601> Not PII

The date and time in GMT when the resource was created specified in RFC 2822 format.

dateUpdated
date_time<iso8601> Not PII

The date and time in GMT when the resource was last updated specified in RFC 2822 format.

assistantSid
sid<UA> Not PII

The SID of the Assistant that is the parent of the resource.

sid
sid<UG> Not PII

The unique string that we created to identify the ModelBuild resource.

status
enum:status Not PII

The status of the model build process. Can be: enqueued, building, completed, or failed

uniqueName
string Not PII

An application-defined string that uniquely identifies the resource. It can be used as an alternative to the sid in the URL path to address the resource.

url
url Not PII

The absolute URL of the ModelBuild resource.

buildDuration
integer? Not PII

The time in seconds it took to build the model.

errorCode
integer? Not PII

If the status for the model build is failed, this value is a code to more information about the failure. This value will be null for all other statuses. See error code dictionary for a description of the error.

Create a ModelBuild resource

post
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
Names in None format
assistant_sid
Required
post sid_like<UA> Not PII

The SID of the Assistant that is the parent of the new resource.

status_callback
Optional
post url Not PII

The URL we should call using a POST method to send status information to your application.

unique_name
Optional
post string Not PII

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 sid in the URL path to address the resource.

Example 1
        
        
        
        
        Example 2
              
              
              
              
              Specifying a unique name for your Model Builds will help you track your Assistant's machine learning models over time.

              Create a Model Build and specify a unique name

              Specifying a unique name for your Model Builds will help you track your Assistant's machine learning models over time.

              Fetch a ModelBuild resource

              get
              https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/ModelBuilds/{Sid}

              Returns the Model Build instance identified by {ModelBuildSid} or {ModelBuildUniqueName}.

              Parameters
              Names in None format
              assistant_sid
              Required
              get sid_like<UA> Not PII

              The SID of the Assistant that is the parent of the resource to fetch.

              sid
              Required
              get sid_like<UG> Not PII

              The Twilio-provided string that uniquely identifies the ModelBuild resource to fetch.

              Example 1
                    
                    
                    
                    

                    Read multiple ModelBuild resources

                    get
                    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
                    Names in None format
                    assistant_sid
                    Required
                    get sid_like<UA> Not PII

                    The SID of the Assistant that is the parent of the resources to read.

                    Example 1
                          
                          
                          
                          

                          Update a ModelBuild resource

                          post
                          https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/ModelBuilds/{Sid}

                          Updates the ModelBuild instance identified by {ModelBuildSid} or {ModelBuildUniqueName}.

                          Parameters
                          Names in None format
                          assistant_sid
                          Required
                          post sid_like<UA> Not PII

                          The SID of the Assistant that is the parent of the resource to update.

                          sid
                          Required
                          post sid_like<UG> Not PII

                          The Twilio-provided string that uniquely identifies the ModelBuild resource to update.

                          unique_name
                          Optional
                          post string Not PII

                          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 sid in the URL path to address the resource.

                          Example 1
                                
                                
                                
                                

                                Delete a ModelBuild resource

                                delete
                                https://autopilot.twilio.com/v1/Assistants/{AssistantSid}/ModelBuilds/{Sid}

                                Deletes a Model Build identified by {ModelBuildSid} or {ModelBuildUniqueName}.

                                Parameters
                                Names in None format
                                assistant_sid
                                Required
                                delete sid_like<UA> Not PII

                                The SID of the Assistant that is the parent of the resources to delete.

                                sid
                                Required
                                delete sid_like<UG> Not PII

                                The Twilio-provided string that uniquely identifies the ModelBuild resource to delete.

                                Example 1
                                      
                                      
                                      
                                      
                                      Rate this page:

                                      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 browsing the Twilio tag on Stack Overflow.