vania-janet/multiturn-rag-retrieval-data huggingface dataset:
For more information, see [Defining the webhook](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-webhooksdialog-webhooks-create).

For example, if you call the Language Translator service, you must provide values for the following parameters:



Parameter example

 Key Value Description 
 model_id en-es Identifies the input and output languages. In this example, the request is for text in English (en) to be translated into Spanish (es). 
 text How are you? This parameter contains the text string that you want the service to translate. You can hard code this value, pass a context variable, such as $saved_text, or pass the user input to the service directly, by specifying ` ` as this value. 




In more complex use cases, you might collect information during a conversation with a user about their travel plans, for example. You can collect dates and destination information and save it in context variables that you can pass to an external application as parameters.



Travel parameters example

 Key Value 

 depart_date $departure 
 arrive_date $arrival 
 origin $origin 
 destination $destination 



7. Any response made by the callout is saved to the return variable. You can rename the variable that is automatically added to the Return variable field for you. If the callout results in an error, this variable is set to null.

The generated variable name has the syntax webhook_result_n, where the appended _n is incremented each time you add a webhook callout to a dialog node. This naming convention ensures that context variable names are unique across the dialog skill. If you change the name, be sure to use a unique name.
8. In the conditional responses section, two response conditions are added automatically, one response to show when the webhook callout is successful and a return variable is sent back. And one response to show when the callout fails. You can edit these responses, and add more conditional responses to the node.
After you configure the search, you can send test queries to see the search results that get returned from Discovery by using the Preview pane of the search skill.

To test the full experience that customers will have when they ask questions that are either answered by the dialog or trigger a search, use the Preview button for your assistant.

You cannot test the full end-to-end user experience from the dialog "Try it out" pane. The search skill is configured separately and attached to an assistant. The dialog skill has no way of knowing the details of the search, and therefore cannot show search results in its "Try it out" pane.

Configure at least one integration channel to test the search skill. In the channel, enter queries that trigger the search. If you initiate any type of search from your dialog, test the dialog to ensure that the search is triggered as expected. If you are not using search response types, test that a search is triggered only when no existing dialog nodes can address the user input. And any time a search is triggered, ensure that it returns meaningful results.





 Sending more requests to the search skill 

If you want the dialog skill to respond less often and to send more queries to the search skill instead, you can configure the dialog to do so.

You must add both a dialog skill and search skill to your assistant for this approach to work.

Follow this procedure to make it less likely that the dialog will respond by resetting the confidence level threshold from the default setting of 0.2 to 0.5. Changing the confidence level threshold to 0.5 instructs your assistant to not respond with an answer from the dialog unless the assistant is more than 50% confident that the dialog can understand the user's intent and can address it.



1. From the Dialog page of your dialog skill, make sure that the last node in the dialog tree has an anything_else condition.

Whenever this node is processed, the search skill is triggered.
2. Add a folder to the dialog. Position the folder before the first dialog node that you want to de-emphasize. Add the following condition to the folder:
: The technology preview user interface was replaced with the Watson Assistant standard user interface. If you used an Actions page to create actions and steps for your skill previously, you cannot access the Actions page anymore. Instead, use the Intents and Dialog pages to work with your skill.





 16 March 2020 

Instructions updated for Slack integrations
: The steps required to set up a Slack integration have changed to reflect permission assignment changes that were made by Slack. For more information, see [Integrating with Slack](https://cloud.ibm.com/docs/assistant?topic=assistant-deploy-slack).

Order of response types is preserved
: Previously, if you included a response type of Search skill in a list of response types for a dialog node, the search results were displayed last despite its placement in the list. This behavior was changed to show the search results in the appropriate order, namely in the sequence in which the search skill response type is listed for the dialog node.





 10 March 2020 

Contextual entity support is generally available
: You can add contextual entities to English-language dialog skills. For more information about contextual entities, see [Creating entities](https://cloud.ibm.com/docs/assistant?topic=assistant-entitiesentities-annotations-overview).

French language support added for autocorrection
: Autocorrection helps your assistant understand what your customers want. It corrects misspellings in the input that customers submit before the input is evaluated. With more precise input, your assistant can more easily recognize entity mentions and understand the customer's intent. See [Correcting user input](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-runtime-spell-check) for more details.

The new system entities are used by new skills
: For new English, Brazilian Portuguese, Czech, Dutch, French, German, Italian, and Spanish dialog skills, the new system entities are enabled automatically. If you decide to turn on a system entity and add it to your dialog, it's the new and improved version of the system entity that is used.
You can train a custom acoustic model with a custom language model, and you can use both types of model during speech recognition. Acoustic model customization is a beta interface that is available only for US English, Japanese, and Spanish.



* For more information about the languages that are supported by the customization interface and the level of support that is available for each language, see [Language support for customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-support).
* For more information about the service's customization interface, see [Understanding customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-customization).
* For more information about creating a custom acoustic model, see [Creating a custom acoustic model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-acoustic).
* For more information about using a custom acoustic model, see [Using a custom acoustic model for speech recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-acousticUse).
* For more information about all methods of the customization interface, see the [API & SDK reference](https://cloud.ibm.com/apidocs/speech-to-text).



New beta customization_weight parameter for custom language models
: For language model customization, the service now includes a beta feature that sets an optional customization weight for a custom language model. A customization weight specifies the relative weight to be given to words from a custom language model versus words from the service's base vocabulary. You can set a customization weight during both training and speech recognition. For more information, see [Using customization weight](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageUseweight).

Updates to Japanese broadband model for improved speech recognition
: The ja-JP_BroadbandModel language model was upgraded to capture improvements in the base model. The upgrade does not affect existing custom models that are based on the model.
curl -X POST --header "Authorization: Bearer {token}" "{url}/v1/acoustic_customizations/{customization_id}/train?custom_language_model_id={customization_id}"







 Using custom language and custom acoustic models for speech recognition 

You can specify both a custom language model and a custom acoustic model with any speech recognition request. If your audio contains domain-specific OOV words, acoustic model customization alone cannot reliably produce those words during speech recognition. Using a custom language model that contains OOV words from the domain of the audio is the only way to expand the service's base vocabulary.

Using a custom language model can improve transcription accuracy regardless of whether you trained the custom acoustic model with the custom language model:



* Using both custom language and custom acoustic models during training improves the quality of the custom acoustic model.
* Using both types of model during speech recognition improves transcription quality.



If a custom language model includes grammars, you can also use the custom language model and one of its grammars with a custom acoustic model during speech recognition.

For a speech recognition request, use the acoustic_customization_id and language_customization_id parameters to pass the GUIDs of the custom acoustic and custom language models for the request. Both custom models must be owned by the credentials that are passed with the request, both must be based on the same base model (for example, en-US_BroadbandModel), and both must be in the available state.

For more information about the effects of custom model upgrading on speech recognition with both types of custom models, see [Considerations for using custom acoustic and custom language models together](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-upgrade-usecustom-upgrade-use-recognition-both).



 Example of using both custom language and custom acoustic models 

The following example request passes both custom acoustic and custom language models to the HTTP POST /v1/recognize method:

IBM Cloud
Once you add audio resources to the custom model, you must train the model. Training prepares the custom acoustic model for use in speech recognition. The training time depends on the cumulative amount of audio data that the model contains.

You can specify a helper custom language model during training of your custom acoustic model. A custom language model that includes transcriptions of your audio files or OOV words from the domain of your audio files can improve the quality of the custom acoustic model. For more information, see [Training a custom acoustic model with a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-useBothuseBothTrain).
4. After you train your custom model, you can use it with recognition requests. If the audio passed for transcription has acoustic qualities that are similar to the audio of the custom model, the results reflect the service's enhanced understanding. You can use only one custom acoustic model at a time with a speech recognition request. For more information, see [Using a custom acoustic model for speech recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-acousticUse).

You can pass both a custom acoustic model and a custom language model in the same recognition request to further improve recognition accuracy. For more information, see [Using custom language and custom acoustic models for speech recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-useBothuseBothRecognize).



The steps for creating a custom acoustic model are iterative. You can add or delete audio and retrain a model as often as needed. You must retrain a model for any changes to its audio to take effect.



 Create a custom acoustic model 

You use the POST /v1/acoustic_customizations method to create a new custom acoustic model. The method accepts a JSON object that defines the attributes of the new custom model as the body of the request. The new custom model is owned by the instance of the service whose credentials are used to create it.
You cannot transcribe speech from a multimedia file that contains both audio and video. To transcribe speech from a video file, you must separate the audio data from the video data. For more information, see [Transcribing speech from video files](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-audio-formatsaudio-formats-video).





 How can I improve transcription accuracy? 

The Speech to Text service offers a customization interface that provides many features and options to improve the speech recognition capabilities of the supported base language models:



* If you are transcribing audio for a specific domain, you can create custom language models to expand and tailor a base model's vocabulary to include domain-specific terminology. When you use custom language models, you can also create and incorporate custom grammars to restrict the words that the service can recognize from your model's vocabulary. Language model customization is supported for both previous- and next-generation models. For more information, see [Creating a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageCreate) and [Adding a grammar to a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-grammarAdd).
* If you are transcribing audio with unique characteristics (such as speaker accents, telephone conversations, or background noise), you can create a custom acoustic model to adapt a base model for your environment and speakers. Acoustic model customization is supported only for previous-generation models. For more information, see [Creating a custom acoustic model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-acoustic).
* You can also use custom acoustic and custom language models together. If transcriptions or related corpora are available for your audio, you can use that data to create a complementary custom language model to further improve the quality of speech recognition based on your custom acoustic model. Grammars are supported only for previous-generation models.
When you open a skill by clicking the skill tile from the assistant page, the development version of the skill is displayed. Even if you associated a later version with the assistant, when you access the skill, its development version opens.





 Downloading a skill version 

You can download a dialog skill version in JSON format. You might want to download a skill version if you want to use a specific version of a dialog skill in a different instance of the Watson Assistant service, for example. You can download the version from one instance and import it to another instance as a new dialog skill.

To download a dialog skill version, complete the following steps:



1. From the skill menu, click Versions.

v1.3: Click the Skills tab, and then click Versions.
2. Click the ![Click to view actions](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/kebab-react.png) icon from the version you want to download, and then choose Export.
3. Specify a name for the JSON file and where to save it, and then click Save.
* Specify a new default voice for your installation of Text to Speech for IBM Cloud Pak for Data by using the defaultTTSVoice property in the Speech services custom resource. For more information, see [Installing Watson Text to Speech](https://www.ibm.com/docs/en/cloud-paks/cp-data/4.0?topic=speech-installing-watson-text).







 Multilingual speech synthesis 

The service does not support multilingual speech synthesis at this time. All synthesis is based on the language of the voice that is specified by the voice parameter. Depending on the language and the word in question, you might be able to use customization to approximate the pronunciation of a word in a language that is different from the voice of the request. For more information, see [Creating a custom model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-voicescustomize-model).

If you decide to use customization to emulate pronunciation in a different language, use the HTTP GET /v1/pronunciation method to see the pronunciation of the word in the other language. The method returns the phonemes that the service uses to pronounce the word in that language. For more information, see [Phonetic translation](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customIntrophonetic).

You can adjust the phonemes that the method returns to match as closely as possible the phonemes that are available in your language. You can then create a custom model that includes a custom word with that translation and use that model with your synthesis request. Becuase two different languages might not support the same phonemes, it might not be possible to match exactly the sounds and pronunciation of one language with the phonetic symbols of another language.

The Speech Synthesis Markup Language (SSML) <speak> element includes an xml:lang element, but that element applies to the entire request, and the service does not support its use as a way of specifying a different language for speech synthesis.
For more information, see [Using a grammar for speech recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-grammarUse).



These steps are iterative. You can add grammars, as well as corpora and custom words, to a custom language model as often as needed. You must train the custom model on any new data resources (grammars, corpora, or custom words) that you add. When you use it for speech recognition, a custom model reflects the data on which it was last trained.

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



 Create a custom language model 

To use a grammar with speech recognition, you must add it to a custom language model. You can use an existing custom language model, or you can create a new custom model by using the POST /v1/customizations method. For information about creating a new custom model, see [Create a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageCreatecreateModel-language).

A custom language model can contain corpora and custom words as well as grammars. During speech recognition, you can use the custom model with or without its grammars. However, when you use a grammar, the service recognizes only words from the specified grammar.





 Add a grammar to the custom language model 

You use the POST /v1/customizations/{customization_id}/grammars/{grammar_name} method to add a grammar file to a custom model.

customization_id (required string)
: Specify the customization ID of the custom model to which the grammar is to be added.

grammar_name (required string)
: Specify a name for the grammar. Use a localized name that matches the language of the custom model and reflects the contents of the grammar.



* Include a maximum of 128 characters in the name.
For more information about all available next-generation models, see [Next-generation languages and models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-models-ng).

Important: Custom language models based on certain next-generation models must be re-created
: Important: If you created custom language models based on certain next-generation models, you must re-create the custom models. Until you re-create the custom language models, speech recognition requests that attempt to use the custom models fail with HTTP error code 400.

You need to re-create custom language models that you created based on the following versions of next-generation models:



* For the en-AU_Telephony model, custom models that you created from en-AU_Telephony.v2021-03-03 to en-AU_Telephony.v2021-10-04.
* For the en-GB_Telephony model, custom models that you created from en-GB_Telephony.v2021-03-03 to en-GB_Telephony.v2021-10-04.
* For the en-US_Telephony model, custom models that you created from en-US_Telephony.v2021-06-17 to en-US_Telephony.v2021-10-04.
* For the en-US_Multimedia model, custom models that you created from en-US_Multimedia.v2021-03-03 to en-US_Multimedia.v2021-10-04.



To identify the version of a model on which a custom language model is based, use the GET /v1/customizations method to list all of your custom language models or the GET /v1/customizations/{customization_id} method to list a specific custom language model. The versions field of the output shows the base model for a custom language model. For more information, see [Listing custom language models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-manageLanguageModelslistModels-language).

To re-create a custom language model, first create a new custom model.
You can change how someone reacts to your system based simply on how you phrase a response. Changing one line of text can prevent you from having to write multiple lines of code to implement a complex programmatic solution.
* Back up your skill frequently. See [Downloading a skill](https://cloud.ibm.com/docs/assistant?topic=assistant-skill-tasksskill-tasks-download).







 Tips for capturing information from user input 

It can be difficult to know the syntax to use in your dialog node to accurately capture the information you want to find in the user input. Here are some approaches you can use to address common goals.



* Returning the user's input: You can capture the exact text uttered by the user and return it in your response. Use the following SpEL expression in a response to repeat the text that the user specified back in the response:

You said: <? input.text ?>.

If autocorrection is on, and you want to return the user's original input before it was corrected, you can use <? input.original_text ?>. But, be sure to use a response condition that checks whether the original_text field exists first.
* Determining the number of words in user input: You can perform any of the supported String methods on the input.text object. For example, you can find out how many words there are in a user utterance by using the following SpEL expression:

input.text.split(' ').size()

See [Expression language methods for String](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-methodsdialog-methods-strings) to learn about more methods you can use.
* Dealing with multiple intents: A user enters input that expresses a wish to complete two separate tasks. I want to open a savings account and apply for a credit card. How does the dialog recognize and address both of them? See the [Compound questions](https://sodoherty.ai/2017/02/06/compound-questions/) entry from Simon O'Doherty's blog for strategies you can try. (Simon is a developer on the Watson Assistant team.)