Επεξεργασία

Κοινή χρήση μέσω


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.

Prerequisites

See the project development lifecycle for more information.

Deploy model

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:

  1. Select Deploying a model from the left side menu.

  2. Select Add deployment to start a new deployment job.

    A screenshot showing the deployment button

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

    Note

    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.

    A screenshot showing the deployment screen

  4. select Deploy to start the deployment job.

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

Swap deployments

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 production and staging deployments when you want to take the model assigned to staging and assign it to production.

To swap deployments from within Language Studio

  1. In Deploying a model page, select the two deployments you want to swap and select Swap deployments from the top menu.

  2. From the window that appears, select the names of the deployments you want to swap.

Delete deployment

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:

  1. Make sure you've assigned yourself as a Cognitive Services Language Owner to the resource you used to create the project.
  2. Go to the Deploying a model page in Language Studio.
  3. Select the Regions tab.
  4. Select Add deployment resource.
  5. 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:

  1. Go to the Regions tab in the Deploy a model page.
  2. Select the resource you'd like to unassign.
  3. Select the Remove assignment button.
  4. In the window that appears, type the name of the resource you want to remove.

Next steps