vania-janet/multiturn-rag-retrieval-data huggingface dataset:
* To download all intents, meaning the intents listed on this and any additional pages, do not select any individual intents. Instead, click the Download all intents icon. ![Download all intents icon](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/download-all.png)
* To download the intents that are listed on the current page only, select the checkbox in the header. This action selects all of the intents on the current page. Click the Download icon. ![Download icon](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/download.png)
* To download one or more specific intents, select the intents that you want to download, and then click the Download icon. ![Download icon](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/download.png).



2. Specify the name and location in which to store the CSV file that is generated, and then click Save.







 Uploading intents and examples 

If you have a large number of intents and examples, you might find it easier to upload them from a comma-separated value (CSV) file than to define them one by one. Be sure to remove any personal data from the user examples that you include in the file.

Alternatively, you can upload a file with raw user utterances (from call center logs, for example) and let Watson find candidates for user examples from the data.
Overview: Editing actions 

Like a human personal assistant, the assistant you build helps your customers complete tasks and answer questions. You build your assistant by defining actions.

An action represents a discrete outcome that you want your assistant to be able to accomplish in response to a user's request. An action comprises the interaction between a customer and the assistant about a particular question or request. This interaction begins with the user input that starts the action (for example, I want to withdraw money). It might then include more exchanges as the assistant gathers more information, and it ends when the assistant carries out the request or answers the customer's question.



 Creating and editing an action 

To see how actions work and how you build one, let's go through an example.

When you create a new action from scratch, Watson Assistant prompts you for an example of the customer input that starts the action. This text is also used as the default name for the action, but you can edit the action name later.

Zoom

![New action](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/new-action-prompt.png)

New action

Type I want to withdraw money and then click Save to create the action.

Initially, you need to specify only one example of typical user input that starts the action. You can add more examples of user input later. For more information, see [Understanding your users' questions or requests](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-understand-questions).





 Using the action editor 

After you create the action, the action editor opens.

Zoom

![Action editor showing newly created action](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/action-editor-new-action.png)

Action editor
* If you [downloaded intents from the classic experience](https://cloud.ibm.com/docs/watson-assistant?topic=watson-assistant-migrate-intents-entitiesmigrate-intents-download), the format for each line in the file is as follows:

<phrase>,<intent>

Where <phrase> is the text of a user example phrase, and <intent> is the name of the intent. For example:

Tell me the current weather conditions.,weather_conditions
Is it raining?,weather_conditions
What's the temperature?,weather_conditions

Only one intent can be uploaded per action, so the <intent> information listed in the second column of the CSV file must be the same.



2. Go to Customer starts with at the start of the action.
3. Click the Upload icon ![Upload icon](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/upload-icon.png).
4. Select a file from your computer.

The file is validated and uploaded, and the system trains itself on the new data.







 Downloading phrases 

You can download your example phrases to a CSV file, so you can then upload and reuse them in another Watson Assistant application.



1. Go to Customer starts with at the start of the action.
2. Click the Download icon ![Download icon](https://cloud.ibm.com/docs-content/v1/content/ca9232b3702768f24bb897f48f10778fcda28718/watson-assistant/images/download-icon.png).

Your example phrases are downloaded to a CSV file.









 Asking clarifying questions 

When your assistant finds that more than one action might fulfill a customer's request, it can automatically ask for clarification.
$toppings_array.getRandomItem() ?> is a great choice"
}
],
"response_type": "text",
"selection_policy": "sequential"
}
]
}
}

Result: "ham is a great choice!" or "onion is a great choice!" or "olives is a great choice!"

Note: The resulting output text is randomly chosen.





 JSONArray.indexOf(value) 

This method returns the index number of the element in the array that matches the value you specify as a parameter or -1 if the value is not found in the array. The value can be a String ("School"), Integer(8), or Double (9.1). The value must be an exact match and is case sensitive.

For example, the following context variables contain arrays:

{
"context": {
"array1": ["Mary","Lamb","School"],
"array2": [8,9,10],
"array3": [8.1,9.1,10.1]
}
}

The following expressions can be used to determine the array index at which the value is specified:

<? $array1.indexOf("Mary") ?> returns 0
<? $array2.indexOf(9) ?> returns 1
<? $array3.indexOf(10.1) ?> returns 2

This method can be useful for getting the index of an element in an intents array, for example. You can apply the indexOf method to the array of intents generated each time user input is evaluated to determine the array index number of a specific intent.

intents.indexOf("General_Greetings")

If you want to know the confidence score for a specific intent, you can pass the earlier expression in as the index value to an expression with the syntax intents[index].confidence. For example:

intents[intents.indexOf("General_Greetings")].confidence





 JSONArray.join(String delimiter)
Current values are Definition, Disclaimer, Exclusion, Obligation, and Right.
* party: A string that identifies the party to whom the sentence applies.



* provenance_ids: An array of one or more hashed values that you can send to IBM to provide feedback or receive support.



* categories: An array that lists the functional categories into which the element falls; in other words, the subject matter of the element.



* label: A string that lists the identified category. For a list of categories, see [Categories](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-contracts-schemacontracts-categories).
* provenance_ids: An array of one or more hashed values that you can send to IBM to provide feedback or receive support.



* attributes: An array that identifies document attributes. Each object in the array consists of three elements:



* type: The type of attribute. Possible values are Currency, DateTime, Duration, Location, Number, Organization, Percentage, and Person as described at [Attributes](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-contracts-schemacontracts-attributes).
* text: The text that is associated with the attribute.
* location: The location of the attribute as defined by its begin and end indexes.





* effective_dates: An array that identifies the date or dates on which the document becomes effective.



* confidence_level: The confidence level of the identification of the effective date. Possible values include High, Medium, and Low.
* text: An effective date, which is listed as a string.
* text_normalized: The normalized form of the effective date, which is listed as a string. This element is optional; that is, the service output lists it only if normalized text exists.
* location: The location of the date as defined by its begin and end indexes.
* provenance_ids: An array that contains zero or more keys. Each key is a hashed value that you can send to IBM to provide feedback or receive support.
* To delete all intents, meaning the intents listed on this and any additional pages, do not select any individual intents. Instead, click the Delete all intents icon. ![Delete option](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/delete-c10.png)
* To delete the intents that are listed on the current page only, select the checkbox in the header. This action selects all of the intents that are listed on the current page. Click Delete.
* To delete one or more specific intents, select the intents that you want to delete, and then click Delete.

![Shows that an intent was selected and the delete icon is in focus](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/intent-delete.png)
Add a yes intent 

Before you perform an action on the user's behalf, you must get confirmation that you are taking the proper action. Add a #yes intent to the dialog that can recognize when a user agrees with what your assistant is proposing.



1. Click the Intents tab.
2. Click Create intent.
3. Enter yes in the Intent name field, and then click Create intent.
4. Add the following user examples:

Yes
Correct
Please do.
You've got it right.
Please do that.
that is correct.
That's right
yeah
Yup
Yes, I'd like to go ahead with that.

![Shows that the #yes intent was added.](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/gs-ass-yes-intent-added.png)
5. Click the Close![Close arrow](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/close_arrow.png) icon to finish adding the yes intent.







 Add dialog nodes that can manage requests to cancel an order 

Now, add a dialog node that can handle requests to cancel a cake order.



1. Click the Dialog tab.
2. Find the menu node. Click the More![More options](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/kabob.png) icon on the menu node, and then select Add node below.
3. Start to type cancel_order into the If assistant recognizes field of this node.
Add a yes intent 

Before you perform an action on the user's behalf, you must get confirmation that you are taking the proper action. Add a #yes intent to the dialog that can recognize when a user agrees with what your assistant is proposing.



1. Click the Intents tab.
2. Click Create intent.
3. Enter yes in the Intent name field, and then click Create intent.
4. Add the following user examples:

Yes
Correct
Please do.
You've got it right.
Please do that.
that is correct.
That's right
yeah
Yup
Yes, I'd like to go ahead with that.

![Shows that the #yes intent was added.](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/gs-ass-yes-intent-added.png)
5. Click the Close![Close arrow](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/close_arrow.png) icon to finish adding the yes intent.







 Add dialog nodes that can manage requests to cancel an order 

Now, add a dialog node that can handle requests to cancel a cake order.



1. Click the Dialog tab.
2. Find the menu node. Click the More![More options](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/kebab.png) icon on the menu node, and then select Add node below.
3. Start to type cancel_order into the If assistant recognizes field of this node.
* To be more restrictive about which terms are identified as airports in the input when fuzzy matching is enabled, you can specify this expression in a node condition, for example: @airport && @airport.confidence > 0.7. The node will only execute if your assistant is 70% confident that the input text contains an airport reference.



In this example, the user input is Are there places to exchange currency at JFK, Logan, and O'Hare?



* To capture multiple occurrences of an entity type in user input, use syntax like this:

"context":{
"airports":"@airport.values"
}

To later refer to the captured list in a dialog response, use this syntax: You asked about these airports: <? $airports.join(', ') ?>. It is displayed like this: You asked about these airports: JFK, Logan, O'Hare.
* To capture the literal values for multiple entity mentions, use the following syntax:

entities['myEntityName'].literal]









 Accessing intents 

The intents array contains one or more intents that were recognized in the user input, sorted in descending order of confidence.

Each intent has one property only: the confidence property. The confidence property is a decimal percentage that represents your assistant's confidence in the recognized intent.

While testing your dialog, you can see details of the intents that are recognized in user input by specifying this expression in a dialog node response:

<? intents ?>

For the user input, Hello now, your assistant finds an exact match with the #greeting intent. Therefore, it lists the #greeting intent object details first. The response also includes the top 10 other intents that are defined in the skill regardless of their confidence score. (In this example, its confidence in the other intents is set to 0 because the first intent is an exact match.) The top 10 intents are returned because the "Try it out" pane sends the alternate_intents:true parameter with its request. If you are using the API directly and want to see the top 10 results, be sure to specify this parameter in your call.
* "targets" : arrayoptional - A comma-separated array of target strings to evaluate sentiment of within the document.







 relations 

The relations enrichment extracts known relationships between identified entities within the document. Optionally, a Knowledge Studio custom model can be specified to extract custom relationships.



* "model" : string - optional - When specified, the custom model is used to extract relations instead of the public model. This option requires a Knowledge Studio custom model to be associated with your instance of Discovery. See [Integrating with Watson Knowledge Studio](https://cloud.ibm.com/docs/discovery?topic=discovery-integrating-with-wks) for more information.









 Normalization 

The normalizations array is an array of JSON operation objects that are used to clean the ingested JSON after the enrichments are applied and before it is stored.

"normalizations": [
{
"operation": "remove",
"source_field": "enriched_title.entities.text"
},
{
"operation": "copy",
"source_field": "enriched_title.sentiment.document.score",
"destination_field": "titlescore"
}
]

{: codeblock}}

The operation object options are listed [here](https://cloud.ibm.com/docs/discovery?topic=discovery-configrefoperations)





 Field name requirements 

Field names cannot contain spaces. The following characters and strings are reserved and cannot be used in field names:

. , ? :
id
score
highlight
result_metadata

The characters _, +, and - cannot be used to prefix the field_name

Do not append numerical characters 0 - 9 to a field name, for example extracted-content2. These field names are indexed but cannot be queried.
v1 [cURL](https://cloud.ibm.com/apidocs/assistant/assistant-v1listintents)[node](https://cloud.ibm.com/apidocs/assistant/assistant-v1?code=nodelistintents)[java](https://cloud.ibm.com/apidocs/assistant/assistant-v1?code=javalistintents)[python](https://cloud.ibm.com/apidocs/assistant/assistant-v1?code=pythonlistintents) 
 Create intent Create a new intent. v1 [cURL](https://cloud.ibm.com/apidocs/assistant/assistant-v1createintent)[node](https://cloud.ibm.com/apidocs/assistant/assistant-v1?code=nodecreateintent)[java](https://cloud.ibm.com/apidocs/assistant/assistant-v1?code=javacreateintent)[python](https://cloud.ibm.com/apidocs/assistant/assistant-v1?code=pythoncreateintent) 
 Get intent Get information about an intent, optionally including all intent content. v1 [cURL](https://cloud.ibm.com/apidocs/assistant/assistant-v1getintent)[node](https://cloud.ibm.com/apidocs/assistant/assistant-v1?code=nodegetintent)[java](https://cloud.ibm.com/apidocs/assistant/assistant-v1?code=javagetintent)[python](https://cloud.ibm.com/apidocs/assistant/assistant-v1?code=pythongetintent) 
 Update intent Update an existing intent with new or modified data. You must provide component objects defining the content of the updated intent.
No way

![Shows the no intent](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/slots-no-intent.png)





1. Return to the Dialog tab, and then click to edit the node with slots. Click Add slot to add a fourth slot, and then specify the following values for it:



Confirmation slot details

 Check for Save it as If not present, ask 

 `(#yes || #no) && slot_in_focus` $confirmation I'm going to reserve you a table for $guests on $date at $time. Should I go ahead? 



This condition checks for either answer. You will specify what happens next depending on whether the user answer Yes or No by using conditional slot responses. The slot_in_focus property forces the scope of this condition to apply to the current slot only. This setting prevents random statements that could match against a yes or no intent that the user might make from triggering this slot.

For example, the user might be answering the number of guests slot, and say something like, Yes, there will be 5 of us. You do not want the Yes included in this response to accidentally fill the confirmation slot. By adding the slot_in_focus property to the condition, a yes or no indicated by the user is applied to this slot only when the user is answering the prompt for this slot specifically.
2. Click the Edit slot![Edit slot](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/edit-slot.png) icon. From the Options!
Using applications and plans to organize work 

Applications and plans let you organize logically related IBM Planning Analytics with Watson for IBM Cloud® assets such as books, views, and websheets in containers.

An application contains related assets that are grouped in sections. These sections might reflect the structure of your organization, planning and budgeting requirements, or any other relevant grouping of assets. While an application contains logically related assets, there are no implied or required actions associated with the assets or sections in an application.

A plan contains assets that are grouped in steps. These steps can represent discrete tasks or contributions that must be completed in a planning or budgeting process. While steps can be ordered in a plan, there is no requirement for contributors to complete the steps sequentially; they can be completed in any order. Steps can also be assigned a due date for contributions.

Access to sections in an application or steps in a plan are controlled by Planning Analytics with Watson user group assignments. When a user group is assigned to a section or step, the security for the contained assets is updated to include the user group.

Application and plan security is applied only to Planning Analytics with Watson user groups and roles. There are no links or dependencies to TM1 object security. It is the responsibility of the Planning Analytics with Watson administrator to ensure that the Planning Analytics with Watson user groups have the requisite TM1® security permissions to view and edit assets.

When you log in to Planning Analytics with Watson, your applications and plans are visible on the Your Applications tab at the bottom of the Home page. Applications are identified by the Application ![Application icon](https://cloud.ibm.com/docs-content/v1/content/6f93007fb5e94d4955b919a5b90a98fbc17451af/planning-analytics/images/paw_application_icon.jpg) icon, while plans show the Plan !
About 

With IBM Watson® Natural Language Understanding, developers can analyze semantic features of text input, including categories, concepts, emotion, entities, keywords, metadata, relations, semantic roles, and sentiment.



 Features 

Send requests to the API with text, HTML, or a public URL, and specify one or more of the following features to analyze:



 Categories 

Categorize your content using a five-level classification hierarchy. View the complete list of categories [here](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-categories-hierarchy). For example:

Input

> url: "www.cnn.com"

Response

> /news
> /art and entertainment
> /movies and tv/television
> /news
> /international news





 Concepts 

Identify high-level concepts that aren't necessarily directly referenced in the text. For example:

Input

> text: "Natural Language Understanding uses natural language processing to analyze text."

Response

> Linguistics
> Natural language processing
> Natural language understanding





 Emotion 

Analyze emotion conveyed by specific target phrases or by the document as a whole. You can also enable emotion analysis for entities and keywords that are automatically detected by the service. For example:

Input

> text: "I love apples, but I hate oranges."
> targets: "apples", and "oranges"

Response

> "apples": joy
> "oranges": anger





 Entities 

Find people, places, events, and other types of entities mentioned in your content. View the complete list of entity types and subtypes [here](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural-language-understanding-entity-type-systems). For example:

Input

> text: "IBM is an American multinational technology company headquartered in Armonk, New York, United States, with operations in over 170 countries."

Response

> IBM: Company
> Armonk: Location
> New York: Location
> United States: Location





 Keywords
[Try it](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/ask_watson.png) icon to open the Try it out pane.
2. Enter, I want to learn more about your restaurant.

Your assistant indicates that the about_restaurant intent is recognized, and returns a response with the image and text that you specified for the dialog node.

![Shows the Try it out pane recognizing the #about_restaurant intent and showing the image and text response.](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/gs-ass-test-about-restaurant.png)



Congratulations! You have added a custom intent, and a dialog node that knows how to handle it.

The about_restaurant intent is designed to recognize a variety of general questions about the restaurant. You added a single node to capture such questions. The response is long, but it is a single statement that can potentially answer questions about all of the following topics:



* The restaurant owners
* The restaurant history
* The philosophy
* The number of sites
* The days of operation
* The meals served
* The fact that the restaurant bakes cakes to order



For general, low-hanging fruit types of questions, a single, general answer is suitable.







 Step 4: Manage cake orders 

Customers place orders in person, over the phone, or by using the order form on the website. After the order is placed, users can cancel the order through the virtual assistant. First, define an entity that can recognize order numbers. Then, add an intent that recognizes when users want to cancel a cake order.



 Adding an order number pattern entity 

You want the assistant to recognize order numbers, so you will create a pattern entity to recognize the unique format that the restaurant uses to identify its orders.