Menu

Expand
Rate this page:

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
sid<AC> Not PII

The SID of the Account that created the ModelBuild resource.

date_created
date_time<iso8601> Not PII

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

date_updated
date_time<iso8601> Not PII

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

assistant_sid
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

unique_name
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.

build_duration
integer? Not PII

The time in seconds it took to build the model.

error_code
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
Parameters in REST API format
assistant_sid
Path
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
        
        
        

        Create a Model Build

        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
              Parameters in REST API format
              assistant_sid
              Path
              get sid_like<UA> Not PII

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

              sid
              Path
              get sid_like<UG> Not PII

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

              Example 1
                    
                    
                    

                    Fetch a Model Build

                    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
                    Parameters in REST API format
                    assistant_sid
                    Path
                    get sid_like<UA> Not PII

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

                    Example 1
                          
                          
                          

                          Read: List all Model Builds for an Assistant

                          Update a ModelBuild resource

                          post
                          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
                          post sid_like<UA> Not PII

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

                          sid
                          Path
                          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
                                
                                
                                

                                Update a Model Build

                                Delete a ModelBuild resource

                                delete
                                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
                                delete sid_like<UA> Not PII

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

                                sid
                                Path
                                delete sid_like<UG> Not PII

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

                                Example 1
                                      
                                      
                                      

                                      Delete a Model Build

                                      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 by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

                                            
                                            
                                            

                                            Thank you for your feedback!

                                            Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                                            Sending your feedback...
                                            🎉 Thank you for your feedback!
                                            Something went wrong. Please try again.

                                            Thanks for your feedback!

                                            thanks-feedback-gif