article by Frank Nimphius, September 2019

The development of an Oracle Digital Assistant projects, like any other Chatbot project, does not begin with the technology. Instead you start with a planning phase that clearly identifies the bot's usecases, its data requirements, the intents and entities, and the conversation flow. Having a solid agreed-upon idea of what to build and in which increments to build it, as well as getting stake holder buy-in, is an important pre-requisite to a successful bot project.

The next step is to identify intents and utterances with which to train the bot. This is easier said than done and you should definitely avoid making them up. Make sure you find realistic data from real customer interactions and derive intentions and expressions from them. Like in mathematics, if the algorithm you use (the model) is wrong, then chances are bad that the end result will be correct nevertheless. So make sure that you identify good intents and utterances before you build a bot.

Once you are done and the conditions look good, you can put your ideas into action and create a first model of what your bot could become later. Oracle Digital Assistant got a new Conversation Designer added as a beta feature in September 2019. With the Conversational Designer, you can build skill conversations declaratively so that technical and non-technical people can follow and collaborate.

With the modeled conversation, you can then run a recorded simulation of your conversation design, or even generate the Oracle Digital Assistant skill, including intents, entities and the dialog flows, to perform a realistic test and demonstration to show to stake holders, 

This article is a quick start that will help you get going easily with the Oracle Digital Assistant Conversation Designer. The tutorial example teaches you about the editing environment, the dialogs, and the code generator. However, it is important that you set your expectations right from the start. The Conversation Designer is a tool aimed at business users and designers. It is not intended as a visual IDE for programmers, though developers may have a head start in using it.

Building an Order Pizza Conversation

  1. Assuming that you have access to Oracle Digital Assistant, navigate to the Skills dashboard using the Oracle Digital Assistant main menu. 

  2. Create a new skill by pressing the green New Skill tile. In the skill dialog, provide a name for the new skill. In this example, i am using "Visual Pizza" as the skill name

  3. With the skill created, ensure it is open and select the Conversation Designer icon in the left-hand menu bar (see image below). The Conversation Designer opens with a dialog for you to define at least one task.

    Note that you can create more tasks at any time later. A task becomes an intent if it is defined as a top-level task. Sub tasks, which you can create within the Conversation Designer to branch conversation flows, will not be defined as intents. So, a task is the generic term for an entry point in the dialog flow.

    In the below image, the task is Order Pizza and, since it is a top-level task, will also become the name of an intent. "I want to order" pizza.

  4. Click Create in the initial task dialog to open the Conversation Designer. 
  5. The Conversation Designer UI, which is shown in the image below, uses two actors

    User: The green user icon models user input the bot then replies to
    Bot: The blue bot icon allows you to define bot responses

    On the left hand side, you see a Tasks list. This list shows all existing top-level and sub-tasks and allows you to create new. Selecting a task and then using the two actors will model the conversation for the selected task.


     
  6. With the Order Pizza task selected, Type Hi into the message field at the bottom (the one saying "Type Here …" and press the green user actor icon on the right, 

  7. Next type Hey Frank, I am a pizza bot. What can I do for you? Then press the blue bot icon on the right. Feel free to use your own name for the welcome message. I admit that this sample does not follow conversational design best practices because it asks an open question, which you should avoid. However, in the interest of brevity I hope you forgive me this short-cut. 

  8. Type I like to order pizza and press the green user icon
  9. Next, press the big blue bot icon on the top left of the conversation mockup UI. This opens the dialog shown in the image below. 

  10. You use the dialog to build a complex card layout response that displays a pizza menu for the user to choose from. In the General tab, set the Layout field to Vertical and set the Bot's Message to Sure. Here are the pizzas I have today

    Note:
    The message is used to generate names of the entities for the data you specify for the cards. In the above case, an entity named PizzaToday will be created when the conversation mockup gets generated. You can change the name of entities later in the skill, but if you wanted a different name like "PizzaTypes" you could try a prompt like "Sure. Here are today's pizza types"
     
  11. Next. click the Cards tab to define three pizza cards to ne displayed in a carousel. Define the first card as 

    Title: Cheese
    Description: Best cheese pizza in town
    image URL: https://cdn.pixabay.com/photo/2017/09/03/10/35/pizza-2709845__340.jpg
    Actions: Order Me

    Note: The "Actions" setting define the label on the button. So you could have chosen e.g. "Order Cheese", or a similar string, too. By default, if no action is defined, clicking on the button will set the pizza order variable later to the name of the pizza (which is defined as the card's title string). If you select the menu icon to the right of the action label, then you can further define a navigation path (e.g. to a sub flow). For this first tutorial, lets not choose a navigation. 

  12. Press the plus (+) icon next to the first card (the one with the blue 1) to create a second card. Enter

    Title: Pepperoni
    Description: Best pepperoni pizza in town
    image URL:  https://cdn.pixabay.com/photo/2017/08/02/12/38/pepperoni-2571392__340.jpg
    Actions: Order Me
     
  13. Again, press the plus (+) icon to create a third card.

    Title: Supreme
    Description: Best supreme pizza in town
    image URL:  https://cdn.pixabay.com/photo/2017/07/22/22/51/big-2530144__340.jpg
    Actions: Order Me
     
  14. Select the context menu icon next to the 3rd card you created and choose Set Default as shown in the image below

  15. Press Done. The conversation designer displays the three cards and you can already switch between cards.

    Note Shown in the image below, when you select an existing user or bot message, you can re-enter the edit mode, copy the response to paste it somewhere else, delete it, or move it to a different location in the flow. 


     
  16. Next, you create a list of values for the pizza size, which is displayed in the real skill after the user selected one of the "Order Me" buttons or typed the name of a pizza. For this, press the big blue bot icon to the left of the conversation mockup. This time select the Actions tab.


    Define LargeMedium and Small as the Actions and set the Bot's Message to Which Size?. 
  17. Press Done
  18. The pizza size menu got created as shown in the image below. Again, the list of values is re-enterable so you can add more sizes if needed. 

     
  19. Again, the user message would be issued by selecting a pizza site action. This means that the next response to build is for the bot asking for the pizza crust. So press the big blue bot icon and choose Action as the response type. For the menu, type the values you see in the image below: Thin, Thick, Stuffed. Set the Bot's Message to How about the crust?.  Later you will see that this creates an entity named PizzaCrust in the generated skill. 


     
  20. Finish the bot design by creating a confirmation message. Press the big blue bot icon and select the Text response. Then type 

    Hey Frank. Your large thin pizza supreme is on its way. 

    Note:
    Don't worry about the had coded string of a large thin pizza supreme. The will be some magic be done in the generated skill code that turns this string into a dynamic string

  21. Press Done

Generating Code

To see the mockup in action, you can either use the "Preview your Task!" link or the dialog icon. The "Preview your Task!" link runs a simulator that replay the dialogs the way you edited them. The "dialog" icon (to the right of the "Preview your Task!" link) generates skill code from the mockup definition. The generated code includes intents, entities and a complete dialog flow so your mockup can be tested using the embedded skill conversation tester. 

  1. Click the dialog icon (gray icon on the right side of the "Preview your Task!" link) to start the code generator 

  2. Click Generate button in the opened dialog. 

Testing the Generated Skill

Though the sample had only a single task – Pizza Order – the code generator generated two skills: Greeting and OrderPizza. The Greeting skill is created by default for users that don't know how to work with the skill. Those users are expected to start the conversation with "hi", "hey" or similar. Experienced users may go straight to the ordering process by typing "I like to order a pizza". 

If you switch to the entities, you find entities created for the pizza type (PizzaToday), pizza size (PizzaSize) and crust (PizzaCrust). The dialog flow uses a composite bag entity (PizzaBag) to resolve all of the entities from a single dialog flow state. If you are new to composite bags in Oracle Digital Assistant, have a look at this tutorial to understand its powers.

  1. Click the Train link on top of the skill to train the skill model. Keep the default Trainer Ht setting because the training model does not have many utterances defined. 

  2. Start with testing the "unexperienced user" path and type Hi

  3. Then, type I like to order pizza and follow the prompts, which show in the order you defined them in the Conversation Designer

  4. Choose a pizza size, and then a crust
  5. Notice that the confirmation text contains the selected pizza choice and not the text you provided in the Conversation Designer. The text you added in the conversation designer got modified using Apache FreeMarker expressions to replace the pizza size, crust and type string with the selected values. 

  6. Reset the conversation tester.
  7. Type I like to order a large pizza supreme. Notice that the bot conversation skips the prompts for the pizza type and the pizza size. This is where NLP and the trained intent model come in to play.


Note: You can go back to the Conversation Designer to extend the bot conversation, or to add intents. After each change in teh Conversation Designer, make sure you re-generate the skill intents, entities and dialog flow. 

Summary

This article implemented a very simple usecase using the Conversation Designer in Oracle Digital Assistant. The target audience for the Conversation Designer are business users and bot designers who work on a conversational design for their digital assistant. If you choose your prompts wisely, then the names getting generated for the entities make it possible and easy to use the generated code as a starting point for the final skill development. Note however, that the Conversation Designer is not a development IDE. It is for prototyping and to see conversational design ideas in action. 

Related Content

Oracle Digital Assistant Conversation Designer (PDF – Training Session)

Planning and managing a conversational project

An introduction to conversational design (PDF – Training Session)

Making First Contact: Building Chatbots with Oracle Digital Assistant Technical Primer (Video)

Build Your First Skill (Tutorial

TechExchange: All 2-Minutes Oracle Digital Assistant Tech Tip Videos on YouTube

 

Author