vania-janet/multiturn-rag-retrieval-data huggingface dataset:
[Learn more](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-skill-add). 
 Skill version Versions are snapshots of a skill that you can create at key points during the development lifecycle. You can deploy one version to production, while you continue to make and test improvements that you make to another version of the skill. [Learn more](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-versions). 
 Slots A special set of fields that you can add to a dialog node that enable the assistant to collect necessary pieces of information from the customer. For example, the assistant can require a customer to provide valid date and location details before it gets weather forecast information on the customer's behalf. [Learn more](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-slots). 
 System entity Prebuilt entities that recognize references to common things like dates and numbers. You can add these to your skill and start using them immediately. [Learn more](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-system-entities). 
 Try it out A chat window that you use to test as you build. For example, from the dialog skill's Try it out pane, you can mimic the behavior of a customer and enter a query to see how the assistant responds. You can test only the current skill; you cannot test your assistant and all attached skills from end to end. [Learn more](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-tasks). 
 Web chat An integration that you can use to embed your assistant in your company website. [Learn more](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-deploy-web-chat). 
 Webhook A mechanism for calling out to an external program as part of the dialog.
To re-create a custom language model, first create a new custom model. Then add all of the previous custom model's corpora and custom words to the new model. You can then delete the previous custom model. For more information, see [Creating a custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageCreate).

Updates to multiple next-generation models for improved speech recognition
: The following next-generation models have been updated for improved speech recognition:



* Australian English telephony model (en-AU_Telephony)
* UK English telephony model (en-GB_Telephony)
* US English multimedia model (en-US_Multimedia)
* US English telephony model (en-US_Telephony)
* Castilian Spanish telephony model (es-ES_Telephony)



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

New beta grammar support for next-generation models
: Grammar support is now available as beta functionality for all available next-generation models. All next-generation models are generally available (GA) and support language model customization. For more information, see the following topics:



* For more information about the status of grammar support for next-generation models, see [Customization support for next-generation models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-supportcustom-language-support-ng).
* For more information about grammars, see [Grammars](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-customizationgrammars-intro).



New custom_acoustic_model field for supported features
: The GET /v1/models and GET /v1/models/{model_id} methods now report whether a model supports acoustic model customization.
This requires that you create a new custom language model and add your corpora, grammars, and custom words from the old model to the new model.

In general, next-generation models do not rely as heavily on custom language models. They use a different approach to transcription that minimizes the need for language model customization.

Next-generation models do not support custom acoustic models. Because of how the models transcribe audio, acoustic model customization is not necessary.

For example, the following speech recognition request uses a custom language model that is based on the en-US_NarrowbandModel. In this example, the custom model has the identifier 8acf31fa-0aa2-4ecc-a805-1f527f342dba.

curl -X POST -u "apikey:{apikey}" --header "Content-Type: audio/flac" --data-binary @audio-file.flac "{url}/v1/recognize?model=en-US_NarrowbandModel&language_customization_id=8acf31fa-0aa2-4ecc-a805-1f527f342dba"

After you re-create the custom language model with the equivalent en-US_Telephony model, simply update the model name to en-US_telephony and the language_customization_ID parameter to use the identifier of the new custom model, 636d8494-7e53-436a-8557-30d6b2a63cd7:

curl -X POST -u "apikey:{apikey}" --header "Content-Type: audio/flac" --data-binary @audio-file.flac "{url}/v1/recognize?model=en-US_Telephony&language_customization_id=636d8494-7e53-436a-8557-30d6b2a63cd7"





 Step 4: Evaluate the results of the next-generation model
See [Log limits](https://cloud.ibm.com/docs/assistant?topic=assistant-logslogs-limits) for more information.

You cannot import logs from one skill into another skill.





 Downloading a skill 

To back up actions or dialog skill data, download the skill as a JSON file, and store the JSON file.



1. Find the actions or dialog skill tile on the Skills page or on the configuration page of an assistant that uses the skill.
2. Click the ![open and close list of options](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/kebab.png) icon, and then choose Download.
3. Specify a name for the JSON file and where to save it, and then click Save.



Alternatively, you can use the /workspaces API to export a dialog skill. Include the export=true parameter with the GET workspace request. See the [API reference](https://cloud.ibm.com/apidocs/assistant/assistant-v1getworkspace) for more details.





 Uploading a skill 

To reinstate a backup copy of an actions or dialog skill that you exported from another service instance or environment, create a new skill by importing the JSON file of the skill you exported.

If the Watson Assistant service changes between the time you export the skill and import it, due to functional updates which are regularly applied to instances in cloud-hosted continuous delivery environments, your imported skill might function differently than it did before.



1. Click the Skills icon ![Skills menu icon](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/nav-skills-icon.png).
2. Click Create skill.
3. Choose to create either an actions or dialog skill, then click Next.
: Support for the Czech language is no longer classified as beta; it is now generally available. See [Supported languages](https://cloud.ibm.com/docs/assistant?topic=assistant-language-support) for more information.

Language support improvements
: The language understanding components were updated to improve the following features:



* German and Korean system entities
* Intent classification tokenization for Arabic, Dutch, French, Italian, Japanese, Portuguese, and Spanish







 4 January 2019 

IBM Cloud Functions in DC and London locations
: You can now make programmatic calls to IBM Cloud Functions from the dialog of an assistant in a service instance that is hosted in the London and Washington, DC data centers. See [Making programmatic calls from a dialog node](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-actions-client).

New methods for working with arrays
: The following SpEL expression methods are available that make it easier to work with array values in your dialog:



* JSONArray.filter: Filters an array by comparing each value in the array to a value that can vary based on user input.
* JSONArray.includesIntent: Checks whether an intents array contains a particular intent.
* JSONArray.indexOf: Gets the index number of a specific value in an array.
* JSONArray.joinToArray: Applies formatting to values that are returned from an array.



See the [array method documentation](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-methodsdialog-methods-arrays) for more details.





 13 December 2018 

London data center
: You can now create Watson Assistant service instances that are hosted in the London data center without syndication. See [Data centers](https://cloud.ibm.com/docs/assistant?topic=assistant-services-informationservices-information-regions) for more details.

Dialog node limit changes
: The dialog node limit was temporarily changed from 100,000 to 500 for new Standard plan instances. This limit change was later reversed.
You can specify how the words from a custom model are to be displayed in a speech transcript and how they are pronounced in audio. For custom models that are based on previous-generation models, you can also modify custom words that are extracted from corpora.
4. [Train the custom language model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageCreatetrainModel-language). After you add corpora and words to the custom model, you must train the model. Training prepares the custom model for use in speech recognition. The model does not use new or modified corpora or words until you train it.
5. [Use a custom language model for speech recognition](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageUse). After you train your custom model, you can use it with speech recognition requests. If the audio that is passed for transcription contains domain-specific words that are defined in the custom model's corpora and custom words, the results of the request reflect the model's enhanced vocabulary. You can use only one model at a time with a speech recognition request.



The steps for creating a custom language model are iterative. You can add corpora, add words, and train or retrain a model as often as needed. You can also add grammars to most custom language model. Grammars restrict the service's response to only those words that are recognized by a grammar.



* For more information about using grammars, see [Using grammars with custom language models](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-grammars).
* For more information about the languages and models that support grammars, see [Language support for customization](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-support).





 Create a custom language model 

You use the POST /v1/customizations method to create a new custom language model.
This documentation is for the classic Watson Assistant experience. To see the documentation for the new Watson Assistant, please go [here](https://cloud.ibm.com/docs/watson-assistant).



 Understanding dialog skill digressions 

In this tutorial, you see firsthand how digressions work.



 Learning objectives 

By the time you finish the tutorial, you will understand how:



* digressions are designed to work
* digression settings impact the flow of the dialog
* to test digression settings for a dialog





 Duration 

This tutorial takes approximately 20 minutes to complete.





 Prerequisite 

If you do not have a Watson Assistant instance, complete the Before you begin step from the [Getting Started tutorial](https://cloud.ibm.com/docs/assistant?topic=assistant-getting-startedgetting-started-prerequisites) to create one.







 Step 1: Import the Digressions showcase dialog skill 

First, import the Digression showcase dialog skill into your Watson Assistant instance.



1. Download the [digression-showcase.json](https://github.com/watson-developer-cloud/community/raw/master/watson-assistant/digression-showcase.json) file.
2. In your Watson Assistant instance, click the ![Import](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/workspace_import.png) icon.
3. Click Choose a file, and then select the digression-showcase.json file that you downloaded earlier.
4. Click Import to finish importing the dialog skill.







 Step 2: Temporarily digressing away from dialog 

Digressions allow users to break away from a dialog branch to temporarily change the topic before they return to the original dialog flow. In this step, you will start to book a restaurant reservation, then digress away to ask for the restaurant's hours.
Specifying a language for a custom model
: You use the POST /v1/customizations method to create a custom model. The method includes a language parameter that you use to identify the language of the new custom model.



* If you installed the enhanced neural voices, the language parameter is optional. By default, the service uses the en-US identifier for the language.
* If you installed the neural voices, the language parameter is required. You must specify the language for the custom model in the indicated format (for example, en-AU for Australian English).



For more information about specifying a language when you create a custom model, see [Creating a custom model](https://cloud.ibm.com/docs/text-to-speech?topic=text-to-speech-customModelscuModelsCreate).

Defect fix: Correct intonation for Spanish enhanced neural voices
: Defect fix: For the Castilian Spanish (es-ES_EnriqueV3Voice and es-ES_LauraV3Voice), Latin American Spanish (es-LA_SofiaV3Voice), and North American Spanish (es-US_SofiaV3Voice) voices, questions of all types now use the correct intonation. The voices previously did not use the correct intonation for some questions, instead pronouncing them like statements.

Defect fix: Correct multitenancy documentation
: Defect fix: The IBM Cloud Pak for Data topic [Multitenancy support](https://www.ibm.com/docs/en/cloud-paks/cp-data/4.0?topic=planning-multitenancy-support) incorrectly stated that the Speech services do not support multitenancy. The topic has been updated to state that the Speech services support the following operations:



* Install the service in separate projects
* Install the service multiple times in the same project
* Install the service once and deploy multiple instances in the same project



The documentation that is specific to the Speech services correctly stated the multitenancy support.





 1 October 2021 (Version 1.1.x) 

Version 1.1.x is out of service
Creating skill versions 

Versions help you manage the workflow of a dialog skill development project.

Create a skill version to capture a snapshot of the training data (intents and entities) and dialog in the skill at key points during the development process. Being able to save an in-progress skill at a specific point in time is especially useful as you start to fine tune your assistant. You often need to make a change and see the impact of the change in real time before you can determine whether or not the change improves or lessens the effectiveness of the assistant. Based on your findings from a test environment deployment, you can make an informed decision about whether to deploy a given change to an assistant that is deployed in a production environment.

To learn more about how versions can improve the workflow you use to build an assistant, [read this blog post](https://medium.com/ibm-watson/watson-assistant-versions-announcement-d60869b1f5f).



 Creating a version 

You can edit only one version of the dialog skill at a time. The in-progress version is called the development version.

When you save a version, any skill settings that you applied to the development version are saved also.

To create a dialog skill version, follow these steps:



1. From the header of the skill, click Save new version, and then describe the current state of the skill.

Adding a good description will help you to distinguish multiple versions from one another later.
2. Click Save.



A snapshot is taken of the current skill and saved as a new version. You remain in the development version of the skill. Any changes you make continue to be applied to the development version, not the version you saved. To access the version you saved, go to the Versions page.





 Deploying a skill version 



1. From the skill menu, click Versions.

v1.3: Click the Skills tab, and then click Versions.
2. Click the !
By creating a custom language model that complements your custom acoustic model, you can enhance speech recognition by using the two models together. When you train a custom acoustic model, you can specify a custom language model that includes transcriptions of the audio resources or a vocabulary of domain-specific words from the resources. Similarly, when you transcribe audio, the service accepts a custom language model, a custom acoustic model, or both. And if your custom language model includes a grammar, you can use that model and grammar with a custom acoustic model for speech recognition.

For more information, see [Using custom acoustic and custom language models together](/docs/speech-to-text?topic=speech-to-text-





 Upgrading custom models 

To improve the quality of speech recognition, the service occasionally updates base previous- and next-generation models. An update to a base model affects only that model. The update does not affect any other models of the same or different languages.

An update to a base model can require that you upgrade any custom models that are built on that base model to take advantage of the improvements. An update to a base model that requires an upgrade produces a new version of the base model. An update that does not require an upgrade does not produce a new version.



* For previous-generation models, all updates to a base model produce a new version of the model. When a new version of a base model is released, you must upgrade any custom language and custom acoustic models that are built on the updated base model to take advantage of the improvements.
* For next-generation models, most updates do not produce a new version of the model. These updates do not require that you upgrade your custom models. Some updates, however, do generate a new version of a base model. You must upgrade any custom language models that are built on the updated base model to take advantage of the improvements.



All updates to base models and whether they require upgrades are announced in the release notes:



* [Release notes for Speech to Text for IBM Cloud](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-release-notes)
},
body: [
params.payload.input.text
],
json: true,
};
return rp(options)
.then(res => {
params.payload.context.skills["main skill"].user_defined["language"] = res.languages[0].language;
console.log(JSON.stringify(params))
//Append "in" plus "the language code" to the input text, surrounded by parentheses.
const response = {
body : {
payload : {
input : {
text : params.payload.input.text + ' ' + '(in ' + res.languages[0].language + ')'
},
},
},
};
return response;
})
}
return {
body : params
}
};
Show more

To test the webhook, click Preview. In the preview panel, submit the text Buenos días. The assistant probably won't understand the input, and will return the response from your Anything else node. However, if you go to the Analytics page of your skill and open the User conversations page, you can see what was submitted. Check the most recent user conversation. The log will show that the user input is Buenos días (in es). The es in parentheses represents the language code for Spanish, so the webhook worked and recognized that the submitted text was a Spanish phrase.

![Shows the Analytics>User conversations page with a logged conversation with Buenos días (in es) input](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/webhook-check-language.png)





 Example 2 

This example shows you how to check the language of the incoming message, and if it's not English, translate it into English before submitting it to the assistant.
* [Upload to language-specific assistants](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-admin-language-supportadmin-language-support-multilingual-upload): In a destination assistant for another language, use the CSV files to upload translated training and responses





 Enabling multilingual download 

To enable multilingual download:



1. Open Assistant settings.
2. In the Download/Upload section, click Enable multilingual download.

Enabling multilingual might take a few minutes minute to process, but you can work elsewhere in the assistant. The Download/Upload button is disabled until this process finishes. After the multilingual download is enabled in an assistant, it can't be disabled.
3. Click Download/Upload files.
4. On the Download tab, choose Multilingual file package.
5. Select a published version, then click Download. You need at least one version for the download to be available.

Downloading your first file might take a few minutes minute to process, but you can work elsewhere in the assistant. The Download/Upload button is disabled until this process finishes.
6. When the download finishes, your .zip file contains:



* action-responses.csv
* action-training.csv
* Data (Do not edit) folder, which contains assistant.bin



If you are using dialog, the .zip file also contains:



* dialog-responses.csv
* dialog-training.csv









 Translating content 

To translate content:



1. Translate the content in the CSV files, for example, from English to French. Save files with translations as CSV UTF-8 (Comma Delimited) to account for any language-specific characters.
2. When you are finished with the translation process, create a new .zip file that includes:



* action-responses.csv with your translations. Don't change the name of the file.
* action-training.csv with your translations. Don't change the name of the file.
Planning the dialog 

Learn how to approach building a dialog.



*  Plan out the design of the dialog that you want to build before you add a single dialog node. Sketch it out on paper, if necessary.
*  Whenever possible, base your design decisions on data from real-world evidence and behaviors. Do not add nodes to handle a situation that someone thinks might occur.
*  Avoid copying business processes as-is. They are rarely conversational.
*  If people already use a process, examine how they approach it. People typically optimize the process from a conversational perspective.
*  Decide on the tone, personality, and positioning of your assistant. Consistently reflect these choices in the dialog you create.
*  Never misrepresent the assistant as being a human. If users believe the assistant is a person, then find out it's not, they are likely to distrust it.
*  Not everything has to be a conversation. Sometimes a web form works better.



Previous topic:[Dialog overview](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-build)

Next topic:[Building a conversational flow](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-overview)
url: 'https://api.us-south.language-translator.watson.cloud.ibm.com/instances/572b37be-09f4-4704-b693-3bc63869nnnn/v3/translate?version=2018-05-01',
auth: {
'username': 'apikey',
'password': 'nnn'
},
headers: {
"Content-Type":"application/json"
},
//The body includes the parameters that are required by the Language Translator service, the text to translate and the target language to translate it into.
body: {
text: [
params.payload.input.text
],
target: 'en'
},
json: true
};
return rp(options)
.then(res => {
params.payload.context.skills["actions skill"].user_defined["original_input"] = params.payload.input.text;
const response = {
body : {
payload : {
"context" : params.payload.context,
"input" : {
"text" : res.translations[0].translation,
"options" : {
"export" : true
}
},
},
},
};
return response
})
}
return {
body : params
}
};
Show more

When you test the webhook in the preview panel, you can submit Buenos días, and the assistant responds as if you said Good morning in English. In fact, when you check the Analyze page of your assistant and open Conversations, the log shows that the user input was Good morning.

You can add a postmessage webhook to translate the message's response back into the customer's native language before it is displayed.