vania-janet/multiturn-rag-retrieval-data huggingface dataset:
You can use regular expressions to check for values to condition against. To find a matching string, for example, you can use the String.find method. See [Methods](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-methods) for more details.







 Responses 

The dialog response defines how to reply to the user.

You can reply in the following ways:



* [Simple text response](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-overviewdialog-overview-simple-text)
* [Rich responses](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-overviewdialog-overview-multimedia)
* [Conditional responses](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-overviewdialog-overview-multiple)





 Simple text response 

If you want to provide a text response, simply enter the text that you want your assistant to display to the user.

!![Shows a node that shows a user ask, Where are you located, and the dialog response is, We have no brick and mortar stores But, with an internet connection, you can shop us from anywhere.](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/response-simple.png)

To include a context variable value in the response, use the syntax $variable_name to specify it. See [Context variables](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-runtime-contextdialog-runtime-context-variables) for more information. For example, if you know that the $user context variable is set to the current user's name before a node is processed, then you can refer to it in the text response of the node like this:

Hello $user
[A sample dialog tree with example content](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/dialog-depiction.png) 



The dialog skill itself is defined in text, but you can integrate it with Watson Speech to Text and Watson Text to Speech services that enable users to interact with your assistant verbally.

![Out-of-the-box training data](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/oob.png) If you want to get started quickly, add prebuilt training data to your dialog skill so your assistant can start helping your customers with the basics.





 Search skill 

A search skill leverages information from existing corporate knowledge bases or other collections of content authored by subject matter experts to address unanticipated or more nuanced customer inquiries.

See [Creating assistants](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-assistant-add) to get started.
If customers ask about one of these topics in the meantime, the anything_else node is triggered to explain that the assistant can't help with the current request, but can help them with other things.



 Irrelevance detection 

A new irrelevance detection algorithm was introduced with version 1.5.0. The irrelevance detection model helps your dialog skill recognize subjects that you do not want it to address, even if you haven't explicitly taught it about what to ignore. This enhanced model helps your skill recognize irrelevant inputs earlier in the development process.

To learn more about the benefits of the new algorithm, read the [Why Zero-Effort Irrelevance is Relevant](https://medium.com/ibm-watson/enhanced-offtopic-90b2dadf0ef1) blog post.

The new algorithm is enabled automatically for any English-language skills that you import or create.

To test the new detection mechanism in the Try it out pane, submit one or more utterances that have absolutely nothing to do with your training data. The new mechanism helps your skill to correctly recognize that the test utterances do not map to any of the intents defined in your training data, and classifies them as being Irrelevant.





 How irrelevance detection works 

The algorithmic models that help your assistant understand what your users say are built from two key pieces of information:



* Subjects you want the assistant to address. For example, questions about order shipments for an assistant that manages product orders.

You teach your assistant about these subjects by defining intents and providing lots of sample user utterances that articulate the intents so your assistant can recognize these and similar requests as examples of input for it to handle.
* Subjects you want the assistant to ignore. For example, questions about politics for an assistant that makes pet grooming appointments exclusively.

You teach your assistant about subjects to ignore by marking utterances that discuss subjects which are out of scope for your application as being irrelevant. Such utterances become counterexamples for the model.



The best way to build an assistant that understands your domain and the specific needs of your customers is to take the time to build good training data, especially data that includes counterexamples.
per conversation: The total messages received during the selected time period divided by the total conversations during the selected time period, as shown in the corresponding graph.
* Max. conversations: The maximum number of conversations for a single data point within the selected time period.
* Weak understanding: The number of individual messages with weak understanding. These messages are not classified by an intent, and do not contain any known entities. Reviewing unrecognized messages can help you to identify potential dialog problems.







 Graphs and statistics 

Detailed graphs provide additional information. Click a data point on the graphs to see more detail.

![Single data point](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/oview-point.png)



* Containment: Number of conversations in which the assistant is able to satisfy the customer's request without human intervention.



* The volume graph shows the total number of conversations per day and how many of the conversations were contained and not contained.
* The trend graph shows the percentage of daily conversations that were contained. This graph helps you to see if the assistant is getting better or worse at containing conversations over time.



![Shows the two containment metrics for volume and trend](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/containment-metric.png)

The containment metric requires that your dialog flag requests for external support when they occur. For more information, see [Measuring containment](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-supportdialog-support-containment).
* Coverage: Number of conversations in which the assistant is confident that it can address a customer's request.
If customers ask about one of these topics in the meantime, the anything_else node is triggered to explain that the assistant can't help with the current request, but can help them with other things.



 Irrelevance detection 

The irrelevance detection feature helps your dialog skill recognize subjects that you do not want it to address, even if you haven't explicitly taught it about what to ignore. This feature helps your skill recognize irrelevant inputs earlier in the development process.

To test irrelevance detection in the "Try it out" pane, submit one or more utterances that have absolutely nothing to do with your training data. Irrelevance deteciton helps your skill to correctly recognize that the test utterances do not map to any of the intents defined in your training data, and classifies them as being Irrelevant.

The algorithmic models that help your assistant understand what your users say are built from two key pieces of information:



* Subjects you want the assistant to address. For example, questions about order shipments for an assistant that manages product orders.

You teach your assistant about these subjects by defining intents and providing lots of sample user utterances that articulate the intents so your assistant can recognize these and similar requests as examples of input for it to handle.
* Subjects you want the assistant to ignore. For example, questions about politics for an assistant that makes pet grooming appointments exclusively.

You teach your assistant about subjects to ignore by marking utterances that discuss subjects which are out of scope for your application as being irrelevant. Such utterances become counterexamples for the model.



The best way to build an assistant that understands your domain and the specific needs of your customers is to take the time to build good training data.





 Counterexample limits 

The maximum number of counterexamples that you can create for any plan type is 25,000.
Advanced tasks 

Learn about APIs and other tools you can use to access and analyze log data.



 API 

You can use the /logs API to list events from the transcripts of conversations that occurred between your users and your assistant. For conversations created by using the v2 /message API, use the instance-level endpoint to [list log events in all workspaces](https://cloud.ibm.com/apidocs/assistant-data-v2listalllogs), and then filter by Assistant ID. For more information about filtering logs, see [Filter query reference](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-filter-reference).

The number of days that logs are stored differs by service plan type. See [Log limits](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-logslogs-limits) for details.

For a Python script you can run to export logs and convert them to CSV format, download the export_logs_py.py file from the [Watson Assistant GitHub)](https://github.com/watson-developer-cloud/community/blob/master/watson-assistant/export_logs_py.py) repository.





 Logs-related terminology 

First, review the definitions of terms that are associated with Watson Assistant logs:



* Assistant: An application - sometimes referred to as a 'chat bot' - that implements your Watson Assistant content.
* Assistant ID: The unique identifier of an assistant.
* Conversation: A set of messages consisting of the messages that an individual user sends to your assistant, and the messages your assistant sends back.
* Conversation ID: Unique identifier that is added to individual message calls to link related message exchanges together. App developers using the V1 version of the Watson Assistant API add this value to the message calls in a conversation by including the ID in the metadata of the context object.
* Customer ID: A unique ID that can be used to label customer data such that it can be subsequently deleted if the customer requests the removal of their data.
To train the dialog skill to recognize your intents, you supply lots of examples of user input and indicate which intents they map to.

A content catalog is provided that contains prebuilt common intents you can add to your application rather than building your own. For example, most applications require a greeting intent that starts a dialog with the user. You can add the General content catalog to add an intent that greets the user and does other useful things, like end the conversation.
* [Dialog](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-dialog-build): A dialog is a branching conversation flow that defines how your application responds when it recognizes the defined intents and entities. You use the dialog editor in the tool to create conversations with users, providing responses based on the intents and entities that you recognize in their input.

![Diagram of a basic implementation that uses intent and dialog only.](https://cloud.ibm.com/docs-content/v1/content/a2b18c153837bce00a5b4de496e4b4ca64bbf56e/assistant-data/images/basic-impl.png)



To enable your dialog skill to handle more nuanced questions, define entities and reference them from your dialog.



* [Entities](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-entities); An entity represents a term or object that is relevant to your intents and that provides a specific context for an intent. For example, an entity might represent a city where the user wants to find a business location, or the amount of a bill payment. In the tool, the name of an entity is always prefixed with the @ character.

You can train the skill to recognize your entities by providing entity term values and synonyms, entity patterns, or by identifying the context in which an entity is typically used in a sentence. To fine tune your dialog, go back and add nodes that check for entity mentions in user input in addition to intents.



![Diagram of a more complex implementation that uses intent, entity, and dialog.]
You created a simple conversation with two intents and a dialog to recognize them.







 Next steps 

This tutorial is built around a simple example. For a real application, you need to define some more interesting intents, some entities, and a more complex dialog that uses them both. When you have a polished version of the assistant, you can make API calls to it from your client application.



* Complete follow-on tutorials that build more advanced dialogs:



* Add standard nodes with the [Building a complex dialog](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-tutorial) tutorial.
* Learn about slots with the [Adding a node with slots](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-tutorial-slots) tutorial.



* Check out more [sample apps](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-sample-apps) to get ideas.



When you're ready to deploy your assistant, see [Deploying](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-deploy-custom-app).
From the "Try it out" pane, enter a test utterance that you think is a good candidate for disambiguation, meaning two or more of your dialog nodes are configured to address utterances like it.2. If the response does not contain a list of dialog node options for you to choose from as expected, first check that you added summary information to the node name (or external node name) field for each of the nodes.3. If disambiguation is still not triggered, it might be that the confidence scores for the nodes are not as close in value as you thought.
<-- <ul> -->

* To see the confidence scores of the top three intents that were detected in the input, hover over the eye icon in the "Try it out" pane.
* To see the confidence scores of all the intents that are detected in the user input, temporarily add <? intents ?> to the end of the node response for a node that you know will be triggered.

This SpEL expression shows the intents that were detected in the user input as an array. The array includes the intent name and the level of confidence that your assistant has that the intent reflects the user's intended goal.
* To see which entities, if any, were detected in the user input, you can temporarily replace the current response with a single text response that contains the SpEL expression, <? entities ?>.

This SpEL expression shows the entities that were detected in the user input as an array. The array includes the entity name, location of the entity mention within the user input string, the entity mention string, and the level of confidence that your assistant has that the term is a mention of the entity type specified.
* To see details for all of the artifacts at once, including other properties, such as the value of a given context variable at the time of the call, you can inspect the entire API response. See Viewing API call details]]!
Service returns an array of intents, including Customer_Care_Cancel_Account and eCommerce_Cancel_Product_Order.Service returns an array of intents_ including Customer_Care_Cancel_Account and eCommerce_Cancel_Product_Order_.] ! ! ! !
In the text field, type Hello and then press Enter. The output indicates that the General_Greetings intent was recognized, and the appropriate response (Good day to you.) is displayed.
3. Try the following input:



* bye
* howdy
* see ya
* good morning
* sayonara



Your browser does not support the video tag.

Watson can recognize your intents even when your input doesn't exactly match the examples that you included. The dialog uses intents to identify the purpose of the user's input regardless of the precise wording used, and then responds in the way you specify.







 Result of building a dialog 

That's it. You created a simple conversation with two intents and a dialog to recognize them.







 Step 5: Integrate the assistant 

Now that you have an assistant that can participate in a simple conversational exchange, test it.



1. Click the Assistants icon ![Assistants menu icon](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/nav-ass-icon.png) to open a list of your assistants.
2. Find the My first assistant assistant, and open it.
3. Test your assistant with Preview.

![Preview button](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/preview-button.png)
4. Copy the URL from Share this link and use it in a new tab. You can start submitting message to see how your assistant responds.

With a Lite plan, you can use the service for free. With other plans, you are charged for messages that you submit from the preview link. You can review metrics about the test user conversations from the Analytics page.
Now that the assistant can recognize questions about a subject, let's give it access to data from which it can retrieve accurate answers.

In Discovery, create a Conversational Search project type. This project type is optimized for retrieving answers during dialog-driven interactions. For example, unlike other project types, it does not apply prebuilt enrichments that aren't needed.



1. Open a new web browser page.

Keep the Watson Assistant page open in a separate tab so you can switch between the two applications.
2. From the Discovery Plus plan service page in IBM Cloud, click Launch Discovery.
3. From the My Projects page, click New Project.
4. Name your project Federal Reserve research, and then click the Conversational Search tile.

Zoom

![Shows the project type options](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/discovery-data/images/tut-convo-project.png)

Figure 18. Project type options
5. Click Next.



You'll configure the data source for the project in the next step.





 Step 4: Connect to a website 

We want the virtual assistant to be able to answer questions about the latest working papers from the US Federal Reserve, so we will connect our project to the Federal Reserve Economic Data website that hosts the working papers.



1. From the Select data source page, click Web crawl, and then click Next.

Zoom

![Shows the data source options](https://cloud.ibm.com/docs-content/v1/content/f16b1f78a92498247223b337bd9303c2758b9ba8/discovery-data/images/tut-convo-web-crawl-0.png)

Figure 19. Data source options
2. In the Collection name field, add FRED papers.

Zoom

!
For details, see [Defining entities](https://cloud.ibm.com/docs/assistant?topic=assistant-entities) and search for Enabling system entities.
* You can now view a history of conversations with users on the Improve page. You can use this to understand your bot's behavior. For details, see [Improving your skill](https://cloud.ibm.com/docs/assistant?topic=assistant-logs).
* You can now import entities from a comma-separated value (CSV) file, which helps with when you have a large number of entities. For details, see [Defining entities](https://cloud.ibm.com/docs/assistant?topic=assistant-entities) and search for Importing entities.







 20 September 2016 

New version 2016-09-20
: To take advantage of the changes in a new version, change the value of the version parameter to the new date. If you're not ready to update to this version, don't change your version date.



* version 2016-09-20: dialog_stack changed from an array of strings to an array of JSON objects.







 29 August 2016 

Updates
: This release includes the following updates:



* You can move dialog nodes from one branch to another, as siblings or peers. For details, see [Moving a dialog node](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-tasksdialog-tasks-move-node).
* You can expand the JSON editor window.
* You can view chat logs of your bot's conversations to help you understand it's behavior. You can filter by intents, entities, date, and time. For details, see [Improving your skill](https://cloud.ibm.com/docs/assistant?topic=assistant-logs).







 11 July 2016 

General Availability
: This General Availability release enables you to work with entities and dialogs to create a fully functioning bot.





 18 May 2016 

Experimental release
: This Experimental release of the Watson Assistant introduces the user interface and enables you to work with workspaces, intents, and examples.
Example 

{
"input": {
"text": "agent ",
"integrations": {
"voice_telephony": {
"speech_to_text_result": {
"result_index": 0,
"stopTimestamp": "2021-09-29T17:43:31.036Z",
"transaction_ids": {
"x-global-transaction-id": "43dd6ce0-139a-4d76-95aa-86e03fcfc434",
"x-dp-watson-tran-id": "6e60695e-fed7-4efe-a376-0888b027d30f"
},
"results": [
{
"final": true,
"alternatives":
{
"transcript": "agent ",
"confidence": 0.78
}
]
}
],
"transactionID": "43dd6ce0-139a-4d76-95aa-86e03fcfc434",
"startTimestamp": "2021-09-29T17:43:29.436Z"
},
"is_dtmf": false,
"barge_in_occurred": false
}
}
},
"context": {
"skills": {
"main skill": {
"user_defined": {},
"system": {}
}
},
"integrations": {
"voice_telephony": {
"private": {
"sip_to_uri": "sip:watson-conversation@10.10.10.10",
"sip_from_uri": "sip:10.10.10.11",
"sip_request_uri": "sip:test@10.10.10.10:5064;transport=tcp"
},
* When you create a dialog, two nodes are now added to it for you: 1) a Welcome node at the start the dialog tree that contains the greeting to display to the user and 2) an Anything else node at the end of the tree that catches any user inquiries that are not recognized by other nodes in the dialog and responds to them. See [Creating a dialog](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-build) for more details.
* When you are testing a dialog in the "Try it out" pane, you can now find and resubmit a recent test utterance by pressing the Up key to cycle through your previous inputs.
* Experimental Korean language support for 5 system entities (@sys-date, @sys-time, @sys-currency, @sys-number, @sys-percentage) is now available. There are known issues for some of the numeric entities, and limited support for informal language input.
* An Overview page is available from the Improve tab. The page provides a summary of interactions with your bot. You can view the amount of traffic for a given time period, as well as the intents and entities that were recognized most often in user conversations. For additional information, see [Using the Overview page](https://cloud.ibm.com/docs/assistant?topic=assistant-logs-overview).







 27 April 2017 

System entities
: The following system entities are now available as beta features in English only:



* sys-location: Recognizes references to locations, such as towns, cities, and countries, in user utterances.
* sys-person: Recognizes references to people's names, first and last, in user utterances.



For more information, see the [System entities reference](https://cloud.ibm.com/docs/assistant?topic=assistant-system-entities).

Fuzzy matching for entities
: Fuzzy matching for entities is a beta feature that is now available in English. You can turn on fuzzy matching per entity to improve the ability of your assistant to recognize terms in user input with syntax that is similar to the entity, without requiring an exact match.