vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Using a custom model for speech synthesis 

Once you create a custom model and populate it with custom entries, you use it by passing its customization ID (GUID) with the customization_id query parameter of the HTTP GET or POST /v1/synthesize method or the WebSocket /v1/synthesize method. When you include a customization ID, you must call a synthesize method with credentials for the instance of the service that owns the specified custom model.



 Examples of using a custom model 

The first two examples generate a custom pronunciation for IEEE that is based on entries from the indicated custom model. The custom pronunciation is used instead of the default pronunciation from the service's regular pronunciation rules.



* The HTTP GET /v1/synthesize method:

IBM Cloud

curl -X GET -u "apikey:{apikey}" --header "Accept: audio/flac" --output ieee.flac "{url}/v1/synthesize?text=IEEE&customization_id={customization_id}"

IBM Cloud Pak for Data

curl -X GET --header "Authorization: Bearer {token}" --header "Accept: audio/flac" --output ieee.flac "{url}/v1/synthesize?text=IEEE&customization_id={customization_id}"
* The HTTP POST /v1/synthesize method:

IBM Cloud

curl -X POST -u "apikey:{apikey}" --header "Content-Type: application/json" --header "Accept: audio/flac" --data "{"text":"IEEE"}" --output ieee.flac "{url}/v1/synthesize?customization_id={customization_id}"

IBM Cloud Pak for Data
Managing grammars 

The customization interface includes the POST /v1/customizations/{customization_id}/grammars/{grammar_name} method for adding a grammar to a custom language model. For more information, see [Add a grammar to the custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-grammarAddaddGrammar). The interface also includes the following methods for listing and deleting grammars for a custom language model.

For more information about the languages and models that support grammars and their level of support (generally available or beta), see [Language support for customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-support).



 Listing grammars for a custom language model 

The customization interface provides two methods for listing information about the grammars for a custom language model:



* The GET /v1/customizations/{customization_id}/grammars method lists information about all grammars for a custom model.
* The GET /v1/customizations/{customization_id}/grammars/{grammar_name} method lists information about a specified grammar for a custom model.



Both methods return the same information about a grammar. The information includes the name of the grammar and, for custom models based on previous-generation models, the number of out-of_vocabulary_words that are recognized by the grammar. The response also includes the status of the grammar, which is important for checking the service's analysis of the grammar when you add it to a custom model:



* being_processed indicates that the service is still processing the grammar in response to a POST /v1/customizations/{customization_id}/grammars/{grammar_name} request.
* analyzed indicates that the service has successfully processed the grammar and added it to the custom model.
* undetermined means that the service encountered an error while processing the grammar. The information that is returned for the grammar includes an error message that offers guidance for correcting the error.
The following example returns information about the en-US_LisaV3Voice and the specified custom model:

IBM Cloud

curl -X GET -u "apikey:{apikey}" "{url}/v1/voices/en-US_LisaV3Voice?customization_id=64f4807f-a5f1-5867-924f-7bba1a84fe97"

IBM Cloud Pak for Data

curl -X GET --header "Authorization: Bearer {token}" "{url}/v1/voices/en-US_LisaV3Voice?customization_id=64f4807f-a5f1-5867-924f-7bba1a84fe97"

The attributes of the additional customization field provide metadata information such as the GUID, name, language, and description of the custom model. They also show the credentials of the model's owner, the date and time at which the model was created, and the date and time of its last modification.

{
"name": "en-US_LisaV3Voice",
"language": "en-US",
"gender": "female",
"url": "{url}/v1/voices/en-US_LisaV3Voice",
"description": "Lisa: American English female voice.",
"customizable": true,
"supported_features": {
"voice_transformation": false,
"custom_pronunciation": true
},
"customization": {
"customization_id": "64f4807f-a5f1-5867-924f-7bba1a84fe97",
"owner": "297cfd08-330a-22ba-93ce-1a73f454dd98",
"created": "2017-09-16T17:12:31.743Z",
"name": "Customization test",
"language": "en-US",
Usage notes for customization 

To use customization with the IBM Watson® Speech to Text service, you need to be aware of topics such as custom model ownership, limits on the number of custom models that you can create, and information security and request logging. These topics are common to all supported languages and model types.



 Ownership of custom models 

A custom model is owned by the instance of the Speech to Text service whose credentials are used to create it. To work with the custom model in any way, you must use credentials for that instance of the service with methods of the customization interface. Credentials that are created for other instances of the service cannot view or access the custom model.

All credentials that are obtained for the same instance of the Speech to Text service share access to all custom models created for that service instance. To restrict access to a custom model, create a separate instance of the service and use only the credentials for that service instance to create and work with the model. Credentials for other service instances cannot affect the custom model.

An advantage of sharing ownership across credentials for a service instance is that you can cancel a set of credentials, for example, if they become compromised. You can then create new credentials for the same service instance and still maintain ownership of and access to custom models created with the original credentials.





 Maximum number of custom models 

You can create no more than 1024 custom language models and no more than 1024 custom acoustic models per owning service credentials. If you try to create more than 1024 custom models of either type, the service returns an error. You do not lose any existing models, but you cannot create any more until your model count is below the limit of 1024 for the type of custom model that you are trying to create.





 Information security 

You can associate a customer ID with data that is added or updated for custom language and custom acoustic models. You associate a customer ID with corpora, custom words, grammars, and audio resources by passing the X-Watson-Metadata header with the following methods. If necessary, you can then delete the data by using the DELETE /v1/user_data method.



* POST /v1/customizations/{customization_id}/corpora/{corpus_name}
* instance_id, which is the unique identifier of a service instance.
* resolver_id, which is the unique identifier of a custom resolver.
* rule_id, which is the unique identifier of a forwarding rule.
* X-Correlation-ID, which is a string that uniquely identifies a request.



3. When all variables are initiated, delete your custom resolver forwarding rule:

curl -X DELETE https://api.dns-svcs.cloud.ibm.com/v1/instances/2be5d4a7-78f0-4c62-a957-41dc15342777/custom_resolvers/ddbe7a53-7971-46dc-b021-420335c31562/forwarding_rules/80b7d905-b2fd-416f-9e0c-b2e554125a4c -H 'Authorization: Bearer xxxxxx'
<customizations>
<customization name='CAP_CREATE_TEMP_TABLES' value='no'/>
<customization name='CAP_SELECT_TOP_INTO' value='no'/>
<customization name='CAP_QUERY_TOP_N' value='yes'/>
<customization name='CAP_QUERY_TOPSTYLE_TOP' value='no'/>
<customization name='CAP_QUERY_TOPSTYLE_ROWNUM' value='no'/>
<customization name='CAP_QUERY_TOPSTYLE_LIMIT' value='yes'/>
<customization name='CAP_QUERY_SUBQUERIES_WITH_TOP' value='no'/>
<customization name='CAP_QUERY_GROUP_BY_DEGREE' value='no'/>
<customization name='CAP_JDBC_SUPPRESS_ENUMERATE_DATABASES' value='yes'/>
<customization name='CAP_JDBC_SUPPRESS_ENUMERATE_SCHEMAS' value='yes'/>
</customizations>
</connection-customization>
Show more



* Store the content in a .tdc file in the following folder: Windows: C:DocumentsMy Tableau RepositoryDatasourcesibmcloudsql-jdbc.tdcMac: /My Tableau Repository/Datasources/ibmcloudsql-jdbc.tdc

If further customization is needed in future, check out [capabilities](https://help.tableau.com/current/pro/desktop/en-us/jdbc_capabilities.htm) that can be turned on and off.



4. Start Tableau Desktop. Go to Connect > To a Server > More.
5. On the next page, you see a list of supported connectors. Select Other Databases (JDBC).
6. On the raised input form enter the following information:



* URL: jdbc:ibmcloudsql:{CRN of your Data Engine service instance}?targetcosurl={COS location for results}
Command options 

--id (string)
: The v4 UUID that uniquely identifies the secret group. Required.

The value must match regular expression /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.

--metadata ([CollectionMetadata](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-secrets-manager-cli-v1cli-collection-metadata-example-schema-v1))
: The metadata that describes the resource array. Required.

--resources ([SecretGroupMetadataUpdatable]](https://cloud.ibm.com/docs/secrets-manager?topic=secrets-manager-secrets-manager-cli-v1cli-secret-group-metadata-updatable-example-schema-v1))
: A collection of resources. Required.





 Examples 

ibmcloud secrets-manager secret-group-metadata-update --id=exampleString --metadata='{"collection_type": "application/vnd.ibm.secrets-manager.secret.group+json", "collection_total": 1}' --resources='[{"name": "updated-secret-group-name", "description": "Updated description for this group."}]'







 ibmcloud secrets-manager secret-group-delete 

Delete a secret group by specifying the ID of the secret group.

Note: To delete a secret group, it must be empty. If you need to remove a secret group that contains secrets, you must first delete the secrets that are associated with the group.

ibmcloud secrets-manager secret-group-delete --id ID



 Command options 

--id (string)
: The v4 UUID that uniquely identifies the secret group. Required.
A successful PATCH api/v2/keys/key_ID request returns the key's metadata, including the ID of the key ring that the key now belongs to.

{
"metadata": {
"collectionType": "application/vnd.ibm.kms.key+json",
"collectionTotal": 1
},
"resources": [
{
"type": "application/vnd.ibm.kms.key+json",
"id": "02fd6835-6001-4482-a892-13bd2085f75d",
"name": "test-root-key",
"aliases":
"alias-1",
"alias-2"
],
"description": "A test root key",
"state": 1,
"extractable": false,
"keyRingID": "new-key-ring",
"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/f047b55a3362ac06afad8a3f2f5586ea:12e8c9c2-a162-472d-b7d6-8b9a86b815a6:key:02fd6835-6001-4482-a892-13bd2085f75d",
"imported": false,
"creationDate": "2020-03-12T03:37:32Z",
"createdBy": "...",
"algorithmType": "AES",
"algorithmMetadata": {
"bitLength": "256",
"mode": "CBC_PAD"
},
"algorithmBitSize": 256,
"algorithmMode": "CBC_PAD",
"lastUpdateDate": "2020-03-12T03:37:32Z",
"keyVersion": {
"en-US_BroadbandModel.v2020-01-16"
],
"owner": "297cfd08-330a-22ba-93ce-1a73f454dd98",
"name": "Example model",
"description": "Example custom language model",
"base_model_name": "en-US_BroadbandModel",
"status": "pending",
"progress": 0
},
{
"customization_id": "8391f918-3b76-e109-763c-b7732fae4829",
"created": "2017-12-02T18:51:37.291Z",
"updated": "2017-12-02T20:02:10.624Z",
"language": "en-US",
"dialect": "en-US",
"versions":
"en-US_BroadbandModel.v2017-11-15"
],
"owner": "297cfd08-330a-22ba-93ce-1a73f454dd98",
"name": "Example model two",
"description": "Example custom language model two",
"base_model_name": "en-US_BroadbandModel",
"status": "available",
"progress": 100
}
]
}
Show more





 List a specific custom language model example 

The following example returns information about the custom model that has the specified customization ID:

IBM Cloud

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

IBM Cloud Pak for Data

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

The response duplicates the information from the previous example:

{
key_ring_ID Optional. The unique identifier of the key ring that the key belongs to. If unspecified, Hyper Protect Crypto Services will search for the key in every key ring that is associated with the specified instance. Therefore, it is suggested to specify the key ring ID for a more optimized request.<br><br>Note: The key ring ID of keys that are created without an x-kms-key-ring header is: default. For more information, see [Managing key rings](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-managing-key-rings). 
 correlation_ID Optional. The unique identifier that is used to track and correlate transactions. 



A successful GET /v2/keys request returns a collection of keys that are available in your Hyper Protect Crypto Services instance.

{
"metadata": {
"collectionType": "application/vnd.ibm.kms.key+json",
"collectionTotal": 2
},
"resources": [
{
"id": "02fd6835-6001-4482-a892-13bd2085f75d",
"type": "application/vnd.ibm.kms.key+json",
"name": "Root-key",
"state": 1,
"crn": "crn:v1:bluemix:public:hs-crypto:us-south:a/f047b55a3362ac06afad8a3f2f5586ea:12e8c9c2-a162-472d-b7d6-8b9a86b815a6:key:02fd6835-6001-4482-a892-13bd2085f75d",
"createdBy": "...",
"creationDate": "2020-03-11T16:30:06Z",
Can be found in the Applications tab. 
 appid.applications.create Create an application. Can be found in the Applications tab. 
 appid.application.read View the application. Can be found in the Applications tab. 
 appid.application.update Update the application. Can be found in the Applications tab. 
 appid.application-scopes.read View the application scopes. Can be found in the Applications tab. 
 appid.application-scopes.update Update the application scopes. Can be found in the Applications tab. 
 appid.theme-text.read View the theme texts of the login widget. Can be found in the Login Customization tab. 
 appid.theme-text.update Update the theme texts of the login widget footnote. Can be updated in the Login Customization tab. 
 appid.theme-color.read View the theme color of the login widget header. Can be found in the Login Customization tab. 
 appid.theme-color.update Update the theme color of the login widget header. Can be Updated in the Login Customization tab. 
 appid.media.read View the image that is shown in the login widget. Can be found in the Login Customization tab. 
 appid.media.update Update the image that is shown in the login widget. Can be updated in the Login Customization tab. 
 appid.ui-configuration.read View the login widget UI configuration, which includes header color and image. Can be found in the Login Customization tab. 
 appid.ui-languages.read View a list of supported languages. Must be viewed from the API. 
 appid.ui-languages.update Update your supported languages. Must be updated through the API. 
 appid.saml-metadata.read View the App ID SAML metadata. Can be found in the Identity Providers > SAML 2.0 Federation tab. 
 ppid.cloud-directory-user.read View a Cloud Directory user. Can be found in the Cloud Directory > Users > View user details tab.
"id": "4fec84ef-baf9-405d-bf3b-9d5a60e068f7"
},
"deprecation_at": "2023-03-01T06:11:28+05:30",
"obsolescence_at": "2023-12-31T06:11:28+05:30"
}'
<-- </section "id="section-ifv-import-schedule-ilm-status-change-API" "> --><-- </section "class="ph" id="section-image-from-volume-vpc-api" "> --><-- <section "id="section-ifv-next-steps-api" "> --> Next steps Use your image from a volume]] when you create an instance. Manage your image from a volume]] ! ! ! !
* If the sounds_like field is invalid:



* The POST /v1/customizations/{customization_id}/words method adds an error field to the word in the model's words resource.
* The PUT /v1/customizations/{customization_id}/words/{word_name} method fails with a 400 response code and an error message. The service does not add the word to the words resource.





* Specify only the display_as field:



* The service sets the display_as field to the specified value. The service does not attempt to set the sounds_like field to a pronunciation of the word.



* Specify both the sounds_like and display_as fields:



* If the sounds_like field is valid, the service sets the sounds_like and display_as fields to the specified values.
* If the sounds_like field is invalid, the service responds as it does in the case where the sounds_like field is specified but the display_as field is not.









 Additional transcription efforts 

For custom language models that are based on next-generation models, the service makes additional efforts to ensure the most effective transcription:



* For sounds-like pronunciations for custom words, the service uses the reverse of the sounds-like as well as its definition in a custom word. For example, given a sounds_like field of I triple E for the word IEEE, the service also effectively uses a reverse sounds-like of IEEE for the "word" I triple E. This enhances the application of sounds-like pronunciations for speech recognition. (Note that it is not possible for users to create custom words that contain spaces.)
* For acronyms that are parsed from corpora or defined as custom words, the service makes additional speech recognition efforts. An acronym is any word that consists of two or more consecutive uppercase letters. If the acronym contains one or more vowels, the service attempts to recognize the acronym as a series of individual characters and as a pronounced word.

For example, the acronym NASA can be read as four individual letters or pronounced as a word that sounds like nassa. The service checks for both during speech recognition. This enhances its ability to represent acronyms correctly in a transcript.









 Validating a words resource for next-generation models
Because the model has not been modified since its creation, the two times in the example are the same.

The output also includes a words array that lists the model's custom words and a prompts array that lists the model's custom prompts. Because the model has yet to be updated, the arrays in the example are empty.





 Querying all custom models 

To see information about all of the custom models that you own, use the GET /v1/customizations method:

IBM Cloud

curl -X GET -u "apikey:{apikey}" "{url}/v1/customizations"

IBM Cloud Pak for Data

curl -X GET --header "Authorization: Bearer {token}" "{url}/v1/customizations"

The method returns a JSON array that includes an object for each custom model owned by the requester. The owner's credentials are shown in the owner field.

{
"customizations": [
{
"customization_id": "64f4807f-a5f1-5867-924f-7bba1a84fe97",
"owner": "297cfd08-330a-22ba-93ce-1a73f454dd98",
"created": "2016-07-15T19:15:17.926Z",
"name": "Test",
"language": "en-US",
"description": "Customization test",
"last_modified": "2016-07-15T19:15:17.926Z"
},
{
"customization_id": "63f5807f-a4f2-5766-914e-7abb1a84fe97",
"owner": "297cfd08-330a-22ba-93ce-1a73f454dd98",
"created": "2016-07-15T18:12:31.743Z",
"name": "Test Two",
: The following language model customization methods can now return the following HTTP error codes:



* The DELETE /v1/customizations/{customization_id} method now returns HTTP response code 401 if you attempt to delete a nonexistent custom model.
* The DELETE /v1/customizations/{customization_id}/corpora/{corpus_name} method now returns HTTP response code 400 if you attempt to delete a nonexistent corpus.







 8 March 2017 

Asynchronous HTTP interface is now generally available
: The asynchronous HTTP interface is now generally available (GA). Prior to this date, it was beta functionality.





 1 December 2016 

New beta speaker labels feature
: The service now offers a beta speaker labels feature for narrowband audio in US English, Spanish, or Japanese. The feature identifies which words were spoken by which speakers in a multi-person exchange. The sessionless, session-based, asynchronous, and WebSocket recognition methods each include a speaker_labels parameter that accepts a boolean value to indicate whether speaker labels are to be included in the response. For more information about the feature, see [Speaker labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-speaker-labels).

Beta language model customization now available for Japanese
: The beta language model customization interface is now supported for Japanese in addition to US English. All methods of the interface support Japanese. For more information, see the following sections:



* For more information, see [Creating a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageCreate) and [Using a custom language model for speech recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageUse).
* RESOLVER_ID is the ID of custom resolver.
* -t, --type is the type of the forwarding rule. Valid values: "zone".
* -d, --description is the descriptive text of the custom resolver forwarding rule.
* -match is the matching zone.
* --dns-svcs is the upstream DNS servers to be forwarded to.
* -i, --instance is the instance name or ID. If this is not set, the context instance specified by dns instance-target INSTANCE is used instead.
* --output specifies output format. Currently, JSON is the only supported format.







 Adding custom resolver forwarding rules using the API 

To create a custom resolver forwarding rule using the API, follow these steps:



1. Set up your API environment with the correct variables.
2. Store the following values in variables to be used in the API command:



* instance_id, which is the unique identifier of a service instance.
* resolver_id, which is the unique identifier of a custom resolver.
* X-Correlation-ID, which is a string that uniquely identifies a request.



3. When all variables are initiated, create your custom resolver forwarding rule:

{
"description": "forwarding rule",
"type": "zone",
"match": "example.com",
"forward_to": [
"161.26.0.7"
]
}
: The language model customization interface now includes a GET /v1/customizations/{customization_id}/corpora/{corpus_name} method that lists information about a specified corpus. The method is useful for monitoring the status of a request to add a corpus to a custom model. For more information, see [Listing corpora for a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageCorporalistCorpora).

New count field for methods that list words for custom language models
: The JSON response that is returned by the GET /v1/customizations/{customization_id}/words and GET /v1/customizations/{customization_id}/words/{word_name} methods now includes a count field for each word. The field indicates the number of times the word is found across all corpora. If you add a custom word to a model before it is added by any corpora, the count begins at 1. If the word is added from a corpus first and later modified, the count reflects only the number of times it is found in corpora. For more information, see [Listing custom words from a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageWordslistWords).

For custom models that were created prior to the existence of the count field, the field always remains at 0. To update the field for such models, add the model's corpora again and include the allow_overwrite parameter with the POST /v1/customizations/{customization_id}/corpora/{corpus_name} method.

New sort parameter for methods that list words for custom language models
: The GET /v1/customizations/{customization_id}/words method now includes a sort query parameter that controls the order in which the words are to be listed. The parameter accepts two arguments, alphabetical or count, to indicate how the words are to be sorted. You can prepend an optional + or - to an argument to indicate whether the results are to be sorted in ascending or descending order.