vania-janet/multiturn-rag-retrieval-data huggingface dataset:
From the list of deployed models, find the model you want to view or undeploy.
4. To undeploy the model, from the last column of that row, click Undeploy model.
5. To find the model ID, see the Model ID column.



Alternatively, you can undeploy models from the Versions pages for rule-based models and machine learning models.







 Deleting a version 

If you wish to delete a specific version a same machine learning model, navigate to the Versions page and click the Delete link on the row of the version that you want to delete. Note: The Delete model version link is only active if there are no deployed models associated with it. Undeploy all associated models before deleting the a version.





 Leveraging a machine learning model in IBM Watson Explorer 

Export the trained machine learning model so it can be used in IBM Watson Explorer.



 Before you begin 

If you choose to identify relation types and annotate them, then you must define at least two relation types, and annotate instances of the relationships in the ground truth before you export the model. Defining and annotating only one relation type can cause subsequent issues in IBM Watson Explorer, release 11.0.1.0.





 About this task 

Now that the machine learning model is trained to recognize entities and relationships for a specific domain, you can leverage it in IBM Watson Explorer.

[Watch a brief video](https://www.youtube.com/watch?v=1VoS-xczBow&feature=youtu.be) that illustrates how to export a model and use it in IBM Watson Explorer.





 Procedure 

To leverage a machine learning model in IBM Watson Explorer, complete the following steps.



1. Log in as a Knowledge Studio administrator or project manager, and select your workspace.
2. Select Machine Learning Model > Versions.
3. Click Export current model.

If you have a Lite plan subscription, no export option is available.

The model is saved as a ZIP file, and you are prompted to download the file.
4. Download the file to your local system.
5. From the IBM Watson Explorer application, import the model.
Complete the following steps to create a draft version, update it, and merge the changes to the current version of your software.

You need the version locator for your software. To find it, run the ibmcloud catalog offering list --catalog "your-private-catalog" command and search for the existing version number.



1. Create a draft version of your software.

ibmcloud catalog offering create-draft --version-locator <VERSION_LOCATOR>
2. Set another category.

ibmcloud catalog offering add-category --catalog "your-private-catalog" --offering "your-software" --category "category-type"
3. Merge the draft update to your software. This action merges the update to the version of your software that's published in your account.

ibmcloud catalog offering merge-draft --version-locator <VERSION_LOCATOR_OF_DRAFT_VERSION>
4. Search for the software in the IBM Cloud catalog.

ibmcloud catalog get --public | grep your-software







 Update an existing version by using the API 

You can programmatically update a version by calling the Catalog Management API as shown in the following sample request. For detailed information about the API, see [Catalog Management API](https://cloud.ibm.com/apidocs/resource-catalog/private-catalog?code=pythonreplace-offering).



* Java
* Python
* Go
* Node



String catalogID = "{catalogID}";
String offeringID = "{offeringID}";
String label = "{label}";
String shortDesc = "{shortDesc}";
ReplaceOfferingOptions replaceOptions = new ReplaceOfferingOptions.Builder().catalogIdentifier(catalogID).id(offeringID).offeringId(offeringID).label(label).shortDescription(shortDesc).rev(revision.rev()).build();
Response<Catalog> response = service.replaceOffering(replaceOptions).execute();
Using the new models: Following the upgrade to the new base model, you are advised to evaluate the performance of the upgraded custom model by paying special attention to the customization_weight and character_insertion_bias parameters for speech recognition. When you retrain your custom model:



* The custom model uses the new default customization_weight of 0.1 for your custom model. A non-default customization_weight that you had associated with your custom model is removed.
* The custom model might no longer require use of the character_insertion_bias parameter for optimal speech recognition.



Improvements to language model customization render these parameters less important for high-quality speech recognition:



* If you use the default values for these parameters, continue to do so after the upgrade. The default values will likely continue to offer the best results for speech recognition.
* If you specify non-default values for these parameters, experiment with the default values following upgrade. Your custom model might work well for speech recognition with the default values.



If you feel that using different values for these parameters might improve speech recognition with your custom model, experiment with incremental changes to determine whether the parameters are needed to improve speech recognition.

Note: At this time, the improvements to language model customization apply only to custom models that are based on the next-generation English or Japanese base language models listed earlier. Over time, the improvements will be made available for other next-generation language models.

More information: For more information about upgrading and about speech recognition with these parameters, see



* [Improved language model customization for next-generation models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-customizationcustomLanguage-intro-ng)
* [Upgrading custom models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-upgrade)
* [Using customization weight](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageUseweight)
The following steps walk through an example of making updates to a product's readme file to show the complete process for updating an existing software version.



1. In the IBM Cloud® console, go to Manage > Catalogs > Private catalogs, and select your catalog from the list.
2. Click the name of your software product.
3. Select Private products to navigate to the list of products that are in your private catalog.
4. Click the Actions icon ![Actions icon](https://cloud.ibm.com/docs-content/v1/content/4d8c6eec891cff72b666dc24bd3211810c77fb42/icons/actions-icon-vertical.svg), and select Edit.
5. Click the Edit readme tab.
6. Click the Edit icon ![Edit icon](https://cloud.ibm.com/docs-content/v1/content/4d8c6eec891cff72b666dc24bd3211810c77fb42/icons/icon_write.svg), add a new line of text to the Introduction section, and click Update.
7. Click the Actions icon ![Actions icon](https://cloud.ibm.com/docs-content/v1/content/4d8c6eec891cff72b666dc24bd3211810c77fb42/icons/actions-icon-vertical.svg), and select Merge changes to publish the updated version to your account.







 Update an existing version by using the CLI 

Complete the following steps to create a draft version, update it, and merge the changes to the current version of your software.

You need the version locator for your software. To find it, run the ibmcloud catalog offering list --catalog "your-private-catalog" command and search for the existing version number.



1. Create a draft version of your software.

ibmcloud catalog offering create-draft --version-locator <VERSION_LOCATOR>
: You cannot deploy models directly to Discovery v2 service instances from Knowledge Studio. Instead, you must export the machine learning models from Knowledge Studio, and then import them into Discovery. The model must have been exported from Knowledge Studio after 16 July 2020. If you have a model that was exported before that date, you must reexport the model from Knowledge Studio. Only paid Knowledge Studio plans support exporting models.

For more information, see one of the following topics:



* IBM Cloud Pak® for Data: [Exporting a machine learning model](https://cloud.ibm.com/docs/watson-knowledge-studio-data?topic=watson-knowledge-studio-data-publish-mlexporting-a-machine-learning-model)
* IBM Cloud: [Deploying a machine learning model to Watson Discovery](https://cloud.ibm.com/docs/watson-knowledge-studio?topic=watson-knowledge-studio-publish-mlwks_madiscovery)



For information about how to import a model to Discovery v2, see [Importing Machine Learning models](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-domain-ml).





 Update your application to use the v2 API 

The Watson Developer SDKs support both Discovery v1 and v2.

These instructions assume that your application is using the latest version of the v1 API (version 2019-04-30).

When you port an application that currently uses the Discovery v1 API to use v2, you must plan how to address the following high-level differences between the two versions.

In addition to these high-level changes, review the differences at a per-method level to understand what else you might need to change. For more information, see [API version comparison](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-migrate-to-v2-api).



* v2 organizes data by project and collections; there is no concept of an environment. For example, compare the following requests to get a collection:

v1 [Get collection](https://cloud.ibm.com/apidocs/discoverygetcollection)
If you include the parameter force=true with the POST /v1/customizations/{customization_id}/train request, you do not need to change the model's custom words, corpora, or grammars to enable upgrading. The parameter forces the training, and thus the upgrade, of the custom model regardless of whether it is in the ready or available state. The following example shows the use of the force parameter:

IBM Cloud

curl -X POST -u "apikey:{apikey}" "{url}/v1/customizations/{customization_id}/train?force=true"



For more information about training a custom model and about monitoring a training request, see [Train the custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageCreatetrainModel-language).

To identify models that use improved language model customization, look for an (improved) date in the Language model customization column of table 2 in [Customization support for next-generation models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-supportcustom-language-support-ng). Make sure to check for a date for the version of the service that you use, IBM Cloud or IBM Cloud Pak for Data.







 Upgrading a custom acoustic model 

Follow these steps to upgrade a custom acoustic model. If the custom acoustic model was trained with a custom language model, you must perform two extra upgrade steps where indicated.



1. If the custom acoustic model was trained with a custom language model, you must first upgrade the custom language model to the latest version of the base model. For more information, see [Upgrading a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-upgradecustom-upgrade-language).
2. Ensure that the custom acoustic model is in either the ready or the available state. You can check a model's status by using the GET /v1/acoustic_customizations/{customization_id} method.
Upload the documents that you downloaded from the previous version of the workspace into this version of the workspace. For more information, see [Uploading resources from another workspace](https://cloud.ibm.com/docs/watson-knowledge-studio?topic=watson-knowledge-studio-exportimport).







 Restoring models 

At this point, all the artifacts that were used to train the model in the previous (backed up) version of the workspace are now available in this new instance.

To redeploy a machine learning model that you deployed in the previous instance, complete the following steps:



1. [Train the machine learning model](https://cloud.ibm.com/docs/watson-knowledge-studio?topic=watson-knowledge-studio-train-ml).

Do not run pre-annotators on annotated documents that you migrated to this workspace. They will lose annotations that were added by human annotators.
2. After creating the model, deploy it again. For more information, see [Using the machine learning model](https://cloud.ibm.com/docs/watson-knowledge-studio?topic=watson-knowledge-studio-publish-ml).



To redeploy a rule-based model that you deployed in the previous instance, complete the following steps:



1. [Create the rule-based model](https://cloud.ibm.com/docs/watson-knowledge-studio?topic=watson-knowledge-studio-wks_rule_train).
2. [Deploy the rule-based model](https://cloud.ibm.com/docs/watson-knowledge-studio?topic=watson-knowledge-studio-wks_rule_publish).







 Restoring incomplete annotation tasks 

If you had any annotation tasks that were created but not completed in the previous workspace, complete the following steps to re-create the incomplete annotation tasks:



1.
For more information, see [Listing version information for a custom model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-upgrade-usecustom-upgrade-use-listing).



The method also returns a status field that indicates the state of the custom model:



* pending indicates that the model was created. It is waiting either for valid training data (corpora, words, or grammars) to be added or for the service to finish analyzing data that was added.
* ready indicates that the model contains valid data and is ready to be trained. If the model contains a mix of valid and invalid resources, training of the model fails unless you set the strict query parameter to false. For more information, see [Training failures](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageCreatefailedTraining-language).
* training indicates that the model is being trained on data.
* available indicates that the model is trained and ready to use with a recognition request.
* upgrading indicates that the model is being upgraded.
* failed indicates that training of the model failed. Examine the words in the model's words resource to determine the errors that prevented the model from being trained.



Additionally, the output includes a progress field that indicates the status of a custom model's training. If you used the POST /v1/customizations/{customization_id}/train method to successfully train the model, this field has a value of 100. If the model is not completely trained and available, the field has a value of 0.

When you monitor the training or upgrading of a custom model, poll the value of the status field, not the value of the progress field. If the operation fails for any reason, the value of the status field changes to reflect the failure; the value of the progress field remains 0.



 List all custom language models example 

The following example includes the language query parameter to list all US English custom language models that are owned by the specified credentials:

IBM Cloud
[Train the machine learning model](https://cloud.ibm.com/docs/watson-knowledge-studio-data?topic=watson-knowledge-studio-data-train-ml).
2. After creating the model, deploy it again. For details, see [Using the machine learning model](https://cloud.ibm.com/docs/watson-knowledge-studio-data?topic=watson-knowledge-studio-data-publish-ml).



To redeploy a rule-based model that you deployed in the previous instance, complete the following steps:



1. [Create the rule-based model](https://cloud.ibm.com/docs/watson-knowledge-studio-data?topic=watson-knowledge-studio-data-wks_rule_train).
2. [Deploy the rule-based model](https://cloud.ibm.com/docs/watson-knowledge-studio-data?topic=watson-knowledge-studio-data-wks_rule_publish).







 Restoring incomplete annotation tasks 

If you had any annotation tasks that were created, but not completed in the previous workspace, complete the following steps to recreate the incomplete annotation tasks:



1. [Upload any documents](https://cloud.ibm.com/docs/watson-knowledge-studio-data?topic=watson-knowledge-studio-data-documents-for-annotationwks_projadd) that have not been annotated yet, but that you want to add to the ground truth to continue to improve the model.
2. From the newly imported and unannotated documents, [create annotation sets](https://cloud.ibm.com/docs/watson-knowledge-studio-data?topic=watson-knowledge-studio-data-documents-for-annotation).
3. [Recreate the annotation tasks](https://cloud.ibm.com/docs/watson-knowledge-studio-data?topic=watson-knowledge-studio-data-annotate-documentswks_hatask).
Ensure that the custom language model is in either the ready or the available state. You can check a model's status by using the GET /v1/customizations/{customization_id} method. If the model's state is ready, upgrade the model before training it on its latest data.
2. Upgrade the custom language model by using the POST /v1/customizations/{customization_id}/upgrade_model method:

IBM Cloud

curl -X POST -u "apikey:{apikey}" "{url}/v1/customizations/{customization_id}/upgrade_model"

IBM Cloud Pak for Data

curl -X POST --header "Authorization: Bearer {token}" "{url}/v1/customizations/{customization_id}/upgrade_model"

The upgrade method is asynchronous. It can take on the order of minutes to complete depending on the number of words in the model's words resource and the current load on the service.



The service returns a 200 response code if the upgrade process is successfully initiated. You can monitor the status of the upgrade by using the GET /v1/customizations/{customization_id} method to poll the model's status. Use a loop to check the status every 10 seconds.

While it is being upgraded, the custom model has the status upgrading. When the upgrade is complete, the model resumes the status that it had before upgrade (ready or available). Checking the status of an upgrade operation is identical to checking the status of a training operation. For more information, see [Monitoring the train model request](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageCreatemonitorTraining-language).

The service cannot accept requests to modify the model in any way until the upgrade request completes. However, you can continue to issue recognition requests with the existing version of the model during the upgrade.



 Upgrading a custom language model based on an improved next-generation model 

For custom language models that are based on improved next-generation models, upgrade is performed automatically when you retrain the custom model.
If the custom acoustic model was trained with a custom language model, upgrade the custom acoustic model again, this time with the previously upgraded custom language model. Use the custom_language_model_id query parameter to specify the customization ID of the custom language model.

IBM Cloud

curl -X POST -u "apikey:{apikey}" "{url}/v1/acoustic_customizations/{customization_id}/upgrade_model?custom_language_model_id={custom_language_model_id}"

IBM Cloud Pak for Data

curl -X POST --header "Authorization: Bearer {token}" "{url}/v1/acoustic_customizations/{customization_id}/upgrade_model?custom_language_model_id={custom_language_model_id}"

Once again, the upgrade method is asynchronous, and upgrading generally takes as long as the cumulative amount of audio that the model contains.

The request to upgrade the acoustic model with the language model might fail with a 400 response code and the message No input data modified since last training. If this error occurs, add the boolean force query parameter to the request and set the parameter to true. Use the parameter only to force an upgrade of a custom acoustic model in this particular situation.



The service returns a 200 response code if the upgrade process is successfully initiated. You can monitor the status of the upgrade by using the GET /v1/acoustic_customizations/{customization_id} method to poll the model's status. Use a loop to check the status periodically (for example, once a minute).

While it is being upgraded, the custom model has the status upgrading. When the upgrade is complete, the model resumes the status that it had before upgrade (ready or available). Checking the status of an upgrade operation is identical to checking the status of a training operation. For more information, see [Monitoring the train model request](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-acousticmonitorTraining-acoustic).

The service cannot accept requests to modify the model in any way until the upgrade request completes.
* To identify models that use the improved technology, look for a date in the Language model customization (improved) column of table 2 in [Customization support for next-generation models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-supportcustom-language-support-ng). Check for a date for the version of the service that you use,

IBM Cloud

or

IBM Cloud Pak for Data

. That date indicates when the next-generation model was migrated to the improved technology.
* To take advantage of the improved technology, you must upgrade any custom language models that are based on an improved next-generation model. Once a custom model is based on an improved next-generation model, the service continues to perform any necessary upgrades when the custom model is retrained. For more information, see [Upgrading a custom language model based on an improved next-generation model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-upgradecustom-upgrade-language-ng).



For language models that are based on the new technology, the following parameters have been optimized for improved speech recognition:



* The default customization_weight has changed from 0.2 to 0.1. A non-default customization_weight that you had previously associated with your custom models is removed. For more information, see [Using customization weight](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageUseweight).
* The default character_insertion_bias remains 0.0, but the models have changed in a manner that makes use of the parameter for speech recognition less necessary. For more information, see [Character insertion bias](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsinginsertion-bias).



Use the following guidelines when working with these parameters:



* If you use the default values for these parameters, continue to do so. The default values will likely continue to offer the best results for speech recognition.
Update the file as follows, substituting the unique ID of the Knowledge Studio model described in "Before you begin" for {watson_knowledge_studio_model_ID}.

It is possible to apply more than one custom model to identical fields using the API. See the example in [Integrating multiple custom models](https://cloud.ibm.com/docs/discovery?topic=discovery-integrating-with-wksintegrate-multiplecustom).

"enrichments": [
{
"source_field": "text",
"destination_field": "enriched_text",
"enrichment": "natural_language_understanding",
"options": {
"features": {
"entities": {
"sentiment": true,
"emotion": false,
"limit": 50,
"model": "{watson_knowledge_studio_model_ID}"
},
"sentiment": {
"document": true
},
"categories": {},
"concepts": {
"limit": 8
},
"relations": {
"model": "{watson_knowledge_studio_model_ID}"
}
}
}
}]
Show more



5. Save the my_config.json file.
6. Use a JSON validator, such as [JSLint](http://jslint.com) to validate and, if necessary, correct your edited JSON before you perform the next steps.
7. Update the configuration as follows. You again need the {environment_id} and {configuration_id} IDs you collected at the start of this procedure.

curl -X PUT -u "apikey":"{apikey_value}" -H "Content-Type: application/json" -d @my_config.json "{url}/v1/environments/{environment_id}/configurations/{configuration_id}?version=2019-04-30"