Deploy a model and classify text using the runtime API
Once you are satisfied with how your model performs, it is ready to be deployed; and use it to classify text. Deploying a model makes it available for use through the prediction API.
- A custom text classification project with a configured Azure storage account,
- Text data that has been uploaded to your storage account.
- Labeled data and successfully trained model
- Reviewed the model evaluation details to determine how your model is performing.
See the project development lifecycle for more information.
After you have reviewed your model's performance and decided it can be used in your environment, you need to assign it to a deployment to be able to query it. Assigning the model to a deployment makes it available for use through the prediction API. It is recommended to create a deployment named
production to which you assign the best model you have built so far and use it in your system. You can create another deployment called
staging to which you can assign the model you're currently working on to be able to test it. You can have a maximum on 10 deployments in your project.
To deploy your model from within the Language Studio:
Select Deploying a model from the left side menu.
Select Add deployment to start a new deployment job.
Select Create new deployment to create a new deployment and assign a trained model from the dropdown below. You can also Overwrite an existing deployment by selecting this option and select the trained model you want to assign to it from the dropdown below.
Overwriting an existing deployment doesn't require changes to your Prediction API call but the results you get will be based on the newly assigned model.
select Deploy to start the deployment job.
After deployment is successful, an expiration date will appear next to it. Deployment expiration is when your deployed model will be unavailable to be used for prediction, which typically happens twelve months after a training configuration expires.
You can swap deployments after you've tested a model assigned to one deployment, and want to assign it to another. Swapping deployments involves taking the model assigned to the first deployment, and assigning it to the second deployment. Then taking the model assigned to second deployment and assign it to the first deployment. This could be used to swap your
staging deployments when you want to take the model assigned to
staging and assign it to
To swap deployments from within Language Studio
In Deploying a model page, select the two deployments you want to swap and select Swap deployments from the top menu.
From the window that appears, select the names of the deployments you want to swap.
To delete a deployment from within Language Studio, go to the Deploying a model page. Select the deployment you want to delete and select Delete deployment from the top menu.
Assign deployment resources
You can deploy your project to multiple regions by assigning different Language resources that exist in different regions.
To assign deployment resources in other regions in Language Studio:
- Make sure you've assigned yourself as a Cognitive Services Language Owner to the resource you used to create the project.
- Go to the Deploying a model page in Language Studio.
- Select the Regions tab.
- Select Add deployment resource.
- Select a Language resource in another region.
You are now ready to deploy your project to the regions where you have assigned resources.
Unassign deployment resources
When you unassign or remove a deployment resource from a project, you will also delete all the deployments that have been deployed to that resource's region.
To unassign or remove deployment resources in other regions using Language Studio:
- Go to the Regions tab in the Deploy a model page.
- Select the resource you'd like to unassign.
- Select the Remove assignment button.
- In the window that appears, type the name of the resource you want to remove.