Getting started

In this short tutorial, we introduce the Conversation tool and go through the process of creating your first conversation.

Log in, create the service, and launch the tool

You create your free instance of Watson services through IBM® Bluemix®, so you need a free Bluemix account to get started. (Bluemix is IBM's cloud platform. For details, see What is Bluemix?)

  1. Go to the Conversation service on Bluemix and either sign up for a free account or log into your Bluemix account. bm-conv-signup.png

  2. After you log in, type conversation-tutorial in the Service name field, click Create, and then click Launch tool.

    Create the service instanceact

Create a workspace

Your first step in the Conversation tool is to create a workspace.

A workspace is a container for the artifacts that define the conversation flow for an application.

  1. In the Conversation tool, click Create.

  2. Give your workspace the name Conversation example and click Create. Youʼll land on the Intents tab of your new workspace.

    Create a workspace

Create intents

An intent represents the purpose of a user's input. You can think of intents as the actions your users might want to perform with your application.

For this example, we're going to keep things simple and define only two intents: one for saying hello, and one for saying goodbye.

  1. Make sure you're on the Intents tab. (You should already be there, if you just created the workspace.)

  2. Click Create new.

  3. Name the intent hello.

  4. Type hello as a User example and press Enter.

    Examples tell the Conversation service what kinds of user input you want to match the intent. The more examples you provide, the more accurate the service can be at recognizing user intents.

  5. Add four more examples and click Create to finish creating the #hello intent:

    • good morning
    • greetings
    • hi
    • howdy

    Create an intent

  6. Create another intent named #goodbye with these five examples:

    • bye
    • farewell
    • goodbye
    • I'm done
    • see you later

Result

You've created two intents, #hello and #goodbye, and provided example user input to train Watson to recognize these intents in your users' input.

tool-intents-list-fullscreen.png

Build a dialog

A dialog defines the flow of your conversation in the form of a logic tree. Each node of the tree has a condition that triggers it, based on user input.

We'll create a simple dialog that handles our #hello and #goodbye intents, each with a single node.

Adding a start node

  1. In the Conversation tool, click the Dialog tab.

  2. Click Create. You'll see one node.

  3. Type conversation_start in the Enter a condition field of this node. Then select the conversation_start (create new condition).

  4. Add the response, Welcome to the Conversation example!. Click anywhere outside the dialog node to save your changes.

    Create a dialog node

    The dialog editor also added a node with the condition anything_else, which handles user input that doesn't match any other nodes. Don't worry about this node for now.

Result

You created a dialog node that is triggered by the condition conversation-start, which is a special condition that indicates that the user has started a new conversation. Your node specifies that when a new conversation starts, the system should respond with the welcome message.

Testing the start node

You can test your dialog at any time to verify the dialog. Let's test it now.

  • Click the Ask Watson icon to open the "Try it out" pane. You should see your welcome message.

    Testing the dialog node

Adding nodes to handle intents

Now let's add nodes to handle our intents between the conversation_start node and the anything_else node.

  1. Click the + icon below the conversation_start node. This creates a node that is evaluated when conversation_start is false.

  2. Type #hello in the Enter a condition field of this node. Then select the #hello (create new condition) option.

  3. Add the response, Good day to you..

  4. Click the + icon below this new #hello node to create another node. This time, specify #goodbye as the condition, and OK! See you later. as the response.

    Adding nodes for intents

Testing intent recognition

You built a simple dialog to recognize and respond to both hello and goodbye inputs. Let's see how well it works.

  1. Click the Ask Watson icon to open the "Try it out" pane. There's that reassuring welcome message.

  2. At the bottom of the pane, type Hello and press Enter. The output indicates that the #hello intent was recognized, and the appropriate response (Good day to you.) appears.

  3. Try the following input:

    • goodbye
    • howdy
    • see ya
    • good morning
    • sayonara

    Testing the final dialog

Watson can recognize your intents even when your input doesn't exactly match the examples 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

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

Download the completed workspace

You can download the finished example workspace. Import the workspace into the Conversation tool to compare against what you created.

What to do next

This was a simple example. For a real application, you'll need to define some more interesting intents, some entities, and a more complex dialog.