vania-janet/multiturn-rag-retrieval-data huggingface dataset:
For more information, see [Interim results](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-interiminterim-results).

In the following examples, the results show the service's response for the same input audio submitted both with and without interim results. The audio speaks the phrase "one two ...pause... three four," with a one-second pause between the words "two" and "three." The pause is long enough to represent separate utterances. An utterance is a component of the input audio that elicits a response, usually as a result of extended silence. For more information, see [Understanding speech recognition results](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-basic-response).

If your results include multiple final results, concatenate the transcript elements of the final results to assemble the complete transcription of the audio. For more information, see [The result_index field](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-basic-responseresponse-result-index).



 Example request without interim results 

The client disables interim results by setting the interim_results parameter to false or by omitting the parameter from a request (the default argument for the parameter is false). The client receives a single JSON object in response only after it sends a stop message.

The response object can contain multiple final results for separate utterances of the audio. The service does not send the single response object until it receives a stop message to indicate that audio transmission for the request is complete. The structure and format of the service's response is the same regardless of whether you use a previous- or next-generation model.

{
"result_index": 0,
"results": [
{
"alternatives":
{
"confidence": 0.99,
"transcript": "one two "
}
],
"final": true
},
{
"alternatives":
{
IBM can train a custom voice with as little as one hour of training data.

To request a custom voice or for more information, complete and submit this [IBM Request Form](https://form.asana.com/?k=CBuXK1uwlAf5ek6FwB6mcg&d=8612789739828).
* How do I use the Tune by Example feature?

Tune by Example lets you control exactly how specified text is spoken by the service. You provide text and spoken audio to add a custom prompt to a custom model. The spoken audio can stress different syllables or words, introduce pauses, and generally make the synthesized audio sound more natural and appropriate for its context. When you synthesize the prompt, the service duplicates the qualities of the recorded speech with its voices.

You can further enhance the quality of a prompt by creating an optional speaker model that contains a sample of a speaker's voice. The service leverages the sample audio to train itself on the voice, which can help it produce higher-quality prompts for that speaker.

For more information, see [Understanding Tune by Example](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-tbe-intro).
* What limits exist for a custom model?

The following limits apply to all custom models:



* A word in a custom entry can contain a maximum of 49 characters.
* A translation in a custom entry can contain a maximum of 499 characters.
* A custom model can include a maximum of 20,000 custom entries.
* A custom model can include a maximum of 1000 custom prompts.



For more information, see [Rules for creating custom entries](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-rules).
* Where can I find plans and pricing information?

IBM Cloud

The Text to Speech service offers multiple pricing plans. For more information about pricing, see the Text to Speech service in the [IBM Cloud Catalog](https://cloud.ibm.com/catalog/text-to-speech).



Watson Assistant
For more information about the parameters, their allowable values, and their effect on the quality and latency of speech recognition, see [Speech activity detection](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detection).

Activity Tracker now supported for customization interfaces
: The service now supports the use of Activity Tracker events for all customization operations. IBM Cloud Activity Tracker records user-initiated activities that change the state of a service in IBM Cloud. You can use this service to investigate abnormal activity and critical actions and to comply with regulatory audit requirements. In addition, you can be alerted about actions as they happen. For more information, see [Activity Tracker events](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-at-events).

Defect fix: Correct generation of processing metrics with WebSocket interface
: Defect fix: The WebSocket interface now works seamlessly when generating processing metrics. Previously, processing metrics could continue to be delivered after the client sent a stop message to the service.





 18 December 2019 

New beta Italian models available
: The service now offers beta broadband and narrowband models for the Italian language:



* it-IT_BroadbandModel
* it-IT_NarrowbandModel



These language models support acoustic model customization. They do not support language model customization. Because they are beta, these models might not be ready for production use and are subject to change. They are initial offerings that are expected to improve in quality with time and usage.

For more information, see the following sections:



* [Supported previous-generation language models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-modelsmodels-supported)
* [Language support for customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-support)



New end_of_phrase_silence_time parameter for speech recognition
: For speech recognition, the service now supports the end_of_phrase_silence_time parameter.
If present, the model is used for every natural language query that is submitted for the project. The model is used whether you limit the search to one collection or all of the collections. For this reason, it is important that your training data represents queries that are likely to be answered by all of the collections in your project. To stop a project from using the relevancy training model, you can delete the model by using the API.

Relevancy training does not run continuously. Training occurs only when you initiate it. At most one trained relevancy model is used at a time per project. If you retrain a model, the existing model is used until the new model is successfully trained, at which time the new model replaces the old model.

The set of documents that constitute the training data are used only during the training process. If a subsequent change is made to a document that was used to train the model, it does not change the trained model and does not trigger a new training session. Keep in mind that if many of the documents in your project change, it might be time to retrain the model to use the features from the updated documents.

Stop words and query expansions that you add to a collection do not affect the relevancy training model directly. However, they can change which documents are returned from a search, which affects the documents that are ranked by the relevancy model. The model ranks the top 100 documents that are returned for a query. Changes that you make to stop words or query expansions do not initiate a relevancy training update. If you add artifacts that drastically change the documents that are returned by search, consider retraining the model.

If documents that were used previously to train the model are removed from a collection, you must remove any references to them from the training data before you start to retrain the model. The model expects both the documents and queries from training data pairs to continue to exist. To remove these references, delete the training queries that returned the deleted documents. If the queries continue to be relevant, you can add them back to the training data and pair them with other documents.
To protect your privacy, do not use personal data, such as your name or location, as a description for your secret group.

The maximum length is 1024 characters. The minimum length is 0 characters. The value must match regular expression /(.?)/.

--labels ([]string)
: Labels that you can use to search secrets in your instance. Only 30 labels can be created.

Label can be between 2-30 characters, including spaces.

To protect your privacy, do not use personal data, such as your name or location, as a label for your secret.

The list items must match regular expression /(.?)/. The maximum length is 30 items. The minimum length is 0 items.

--custom-metadata (generic map)
: The secret metadata that a user can customize.

--expiration-date (strfmt.DateTime)
: The date when the secret material expires. The date format follows the RFC 3339 format.

--ttl (string)
: The time-to-live (TTL) or lease duration to assign to credentials that are generated.

For iam_credentials secrets, the TTL defines for how long each generated API key remains valid. The value can be either an integer that specifies the number of seconds, or the string representation of a duration, such as 120m or 24h.

The minimum duration is 1 minute. The maximum is 90 days.

The maximum length is 10 characters. The minimum length is 2 characters. The value must match regular expression /^[0-9]+[s,m,h,d]{0,1}$/.

--rotation ([RotationPolicy](https://cloud.ibm.com/docs/secrets-manager-cli-plugin?topic=secrets-manager-cli-plugin-secrets-manager-clicli-rotation-policy-example-schema))
: This field indicates whether Secrets Manager rotates your secrets automatically.





 Example
* For more information about obtaining word timings, see [Generating word timings](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-timing).
* For more information about the WebSocket interface and its parameters, see the [API & SDK reference](https://cloud.ibm.com/apidocs/text-to-speech).



The snippets of example code that follow are written in JavaScript and are based on the HTML5 WebSocket API. For more information about the WebSocket protocol, see the Internet Engineering Task Force (IETF) [Request for Comment (RFC) 6455](https://tools.ietf.org/html/rfc6455).



 Open a connection 

You call the /v1/synthesize method over the WebSocket Secure (WSS) protocol to open a connection to the service. The method is available at the following endpoint:

wss://api.{location}.text-to-speech.watson.cloud.ibm.com/instances/{instance_id}/v1/synthesize

where {location} indicates where your application is hosted:



* us-south for Dallas
* us-east for Washington, DC
* eu-de for Frankfurt
* au-syd for Sydney
* jp-tok for Tokyo
* eu-gb for London
* kr-seo for Seoul



And {instance_id} is the unique identifier of the service instance.

The examples in the documentation abbreviate wss://api.{location}.text-to-speech.watson.cloud.ibm.com/instances/{instance_id} to {ws_url}. So all WebSocket examples call the method as {ws_url}/v1/synthesize.

A WebSocket client calls the /v1/synthesize method with the following query parameters to establish an authenticated connection with the service:

access_token (required string)
: Pass a valid access token to authenticate with the service.
Consequently, a consumer group is deleted when the last committed offset for that group expires.

If you want to explicitly delete a group at a time you choose, you can use the [deleteConsumerGroups() API](http://kafka.apache.org/23/javadoc/org/apache/kafka/clients/admin/AdminClient.htmldeleteConsumerGroups-java.util.Collection).





 How long are messages retained? 

By default, messages are retained in Kafka for up to 24 hours and each partition is capped at 1 GB. If the 1 GB cap is reached, the oldest messages are discarded to stay within the limit.

You can change the time limit for message retention when you create a topic using either the user interface or the administration API. The time limit is a minimum of an hour and a maximum of 30 days.

For information about restrictions on the settings allowed when you create topics using a Kafka client or Kafka Streams, see [How do I use Kafka APIs to create and delete topics?](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-faqstopic_admin)





 What is Event Streams's availability behavior? 

If you write Event Streams apps, use this information to understand what normal Event Streams availability behavior is and what your apps are expected to handle.



 APIs 

As part of the regular operation of Event Streams, the nodes of the Kafka clusters are occasionally restarted. In some cases, your apps will be aware as the cluster reassigns resources. Write your apps to be resilient to these changes and to be able to reconnect and retry operations.







 What is Event Streams's maximum message size? 

Event Streams's maximum message size is 1 MB, which is the Kafka default.





 What are Event Streams's replication settings? 

Event Streams is configured to provide strong availability and durability. The following configuration settings apply to all topics and cannot be changed:



* replication.factor = 3
* min.insync.replicas = 2







 What are the restrictions and defaults for topics and partitions?
service.deleteSession(deleteSessionOptions).execute();

service.delete_session(
assistant_id = assistant_id,
session_id = session_id
)

service
.deleteSession({
assistant_id: assistantId,
session_id: sessionId,
})

If you do not explicitly delete the session, it will be automatically deleted after the configured timeout interval. The timeout duration depends on your plan.



To see examples of the v2 APIs in the context of a simple client application, see [Building a custom client using the API](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-api-client).





 Handle the v2 response format 

Your application might need to be updated to handle the v2 runtime response format, depending on which parts of the response your application needs to access:



* Output for all response types (such as text and option) are still returned in the output.generic object. Application code for handling these responses should work without modification.
* Detected intents and entities are now returned as part of the output object, rather than at the root of the response JSON.
* The conversation context is now organized into two objects:



* The global context contains system-level context data that is shared by all skills in the assistant.
* The skill context contains any user-defined context variables that are used by your dialog skill.



However, keep in mind that state data, including conversation context, is now maintained by the assistant, so your application might not need to access the context at all (see [Let the assistant maintain state](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-api-migrationapi-migration-state)).



Refer to the v2 [API Reference ](https://cloud.ibm.com/apidocs/assistant/assistant-v2message) for complete documentation of the v2 response format.





 Let the assistant maintain state 

For most applications, you can now remove any code included for maintaining state.
Suppose the user speaks one of the names from the grammar's rules, Yon See. The service returns a response that indicates a very high level of confidence in the match.

{
"result_index": 0,
"results": [
{
"alternatives":
{
"confidence": 0.92,
"transcript": "Yon See"
}
],
"final": true
}
]
}

Now suppose that the user speaks two names separated by enough silence, at least 0.8 seconds, to indicate that they are separate utterances: Yon See [1.0 seconds of silence] Yi Wen Tan. In this case, the service sends two separate responses with a different confidence score for each result.

{
"result_index": 0,
"results": [
{
"alternatives":
{
"confidence": 0.92,
"transcript": "Yon See"
}
],
"final": true
}
]
},
{
"result_index": 1,
"results": [
{
"alternatives":
{
"confidence": 0.83,
"transcript": "Yi Wen Tan"
}
],
"final": true
}
]
}
Show more

Now consider the case where the user instead says something like Yon See [1.0 seconds of silence] Young Says He. For the first phrase, Yon See, the service sends a positive match with a confidence score, similar to the previous examples. For the second phrase, Young Says He, the service can have one of two possible responses:



* It might send no response, indicating that the phrase does not match one of the grammar's rules.
* It might instead send a response with a low confidence score, indicating that the phrase is acoustically similar to one of the rules but is not a likely match.



Other factors and parameters can also effect grammar recognition:
Use the parameter to suppress word insertions from music, coughing, and other non-speech events that can adversely affect the quality of speech recognition.
* [Background audio suppression](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-detectiondetection-parameters-suppression) suppresses background audio based on its volume to prevent it from being transcribed as speech. Use the parameter to suppress side conversations or background noise from speech recognition.







 Speech audio parsing 



* [End of phrase silence time](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsingsilence-time) specifies the duration of the pause interval at which the service splits a transcript into multiple final results in response to silence. If the service detects pauses or extended silence before it reaches the end of the audio stream, its response can include multiple final results. You can increase or decrease the pause interval to affect the results that you receive.
* [Split transcript at phrase end](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsingsplit-transcript) directs the services to split a transcript into multiple final results for semantic features such as sentences. The service bases its understanding of semantic features on the base language model that you use with a request. Custom language models and grammars can also influence how and where the service splits a transcript.
* [Character insertion bias](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-parsinginsertion-bias) specifies whether a next-generation model is to favor shorter or longer strings as it develops hypotheses during speech recognition. As it develops transcription hypotheses, the service optimizes how it parses audio to balance between competing strings of different lengths. You can indicate that the service is to bias its analysis toward shorter or longer strings.







 Speaker labels 



* [Speaker labels](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-speaker-labels) identify different speakers from the audio of a multi-participant exchange.
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).



It is a best practice to preserve this information in a format that you can use to re-create your custom language models in the event of a failure. Actively maintaining the information about your custom models and their data, and preparing the calls listed in the following section ahead of time, can enable you to recover as quickly as possible.





 Restoring custom language models 

If you need to recover from a disaster, you can use the backup information to re-create your custom language models and their data:



1. To re-create your custom language models, use the POST /v1/customizations method. For more information, see [Create a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageCreatecreateModel-language).
2. To add the corpus text files to your custom models, use the POST /v1/customizations/{customization_id}/corpora/{corpus_name} method. For more information, see [Add a corpus to the custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageCreateaddCorpus).
3. To add the grammar files to your custom models, use the POST /v1/customizations/{customization_id}/grammars/{grammar_name} method. 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).
4. To add multiple words to your custom models, use the POST /v1/customizations/{customization_id}/words method. To add single words to your custom models, use the PUT /v1/customizations/{customization_id}/words/{word_name} method.
Understanding reserved disk usage 

Learn how the usable storage of an Event Streams instance is used by the topics and partitions that are created and the configuration settings that you apply.

First of all, it's important to note that the defined storage of an Event Streams instance is usable storage. That means that you do not need to worry about storage used by replicas (as all topics have their replication factor set to 3) that is not taken from the usable storage. This keeps things simple and you can plan how to map the retention of those messages to storage usage.



 Understanding how Kafka stores data 

Kafka allows users to configure retention limits on topics.

The retention.bytes configuration is the total number of bytes allocated for messages for each partition of the topic. If it is exceeded, Kafka deletes oldest messages. So for example, if you are generally sending in 200 MB a day of messages to a single partition topic, and you want to keep them for 5 days, set retention.bytes to 1 GB (200 MB x 5 days).

If this was over 10 partitions, then you would set retention.bytes = 100 MB (1 GB / 10 partitions).

Internally Kafka splits each partition into log segments. This again is a property that you can set, log.segment.size, the default is 512 MB. When we mentioned that Kafka deletes the oldest messages, it really deletes the oldest log segment. For this reason, Kafka needs to keep space for one extra log segment, in addition to the number of log segments required to satisfy the retention.bytes configuration.

See the following examples.

retention.bytes = 1 GB
log.segment.size = 512 MB
Kafka needs approximately 1.5 GB per partition for the topic storage.

retention.bytes = 100 MB
log.segment.size = 512 MB
Kafka needs approximately 1 GB per partition for the topic storage.

More storage is needed per partition for indexes. For each log segment, Kafka also stores two indexes. Their sizes are defined by segment.index.size, which is also configurable and has a default of 10 MB.