article by Frank Nimphius, November 2019

 

Starting Oracle Digital Assistant 19.4.1, you have two options to handle questions in a bot conversation. 

  • QnA Module – the QnA module in Oracle Digital Assistant allows you to upload frequently asked question documents that consist of one or many questions associated with a single answer. The QnA module uses elastic search to find the best matching answer or answers to a question. Dependent on how you configure the QnA module routing, bot users may get multiple hits for a question. Multiple possible answers to a question are shown in a carousel layout for the user to browse and select the answer she feels is the most relevant. 

    QnA modules are referenced from the System.QnA component that you add to a state in the skill dialog flow. The decision whether or not QnA is called, is then made by the intent engine through the System.Intent component. Again, depending on your configuration settings, the QnA module can be queried parallel to the intent model or only if the intent model does not resolve an intent for the user message. 
  • QnA intent – The new QnA intent allows you to return a defined an answer for a resolved intent. Intents that have a response defined will not be resolved by the System.Intent component, which means there is no need for you to create a dialog flow state to return the response. QnA intents are kind of a "QnA light" in that they don't require any dialog flow settings and in that they only return a single answer, which sometimes is a customer requirement. The QnA intent is documented in the ODA product documentation. 

This article provides a quick tutorial for you to try the new QnA intent. I assume you have access to Oracle Digital Assistant 19.4.1 or later and also assume you understand how to import skills using the Oracle Digital Assistant skill dashboard. 

Exploring the QnA Intent Feature

T o follow the instructions in this article,  download the QnAIntents sample skill and import it to your Oracle Digital Assistant skills. Open the imported QnAIntents skill and notice the three intents. Each of these intents has a state defined in the dialog flow to handle it. The CancelPasta intent handling state returns a response for saying that users need to call the pasta shop to cancel an order. The OrderPasta intent involves multiple dialog flow state for the user to select a pasta to order. 

Like with good magicians, it is important you check that there are no cards hidden in the sleeves. So quickly select the QnA module menu item that is highlighted in the image below. Like in the image, the skill should show no QnA module being provided for this sample. 

Next, train the skill pressing the Train button on the upper right. Select Trainer HT for training the skill. Once the skill finishes training, press the conversation tester icon (the triangle icon in the left menu). Then type I like to order pasta to show the PastaOrder intent in action. Press the Reset button in the header of the conversation tester. 

Next, type When are you open? or what are your opening times. As shown in the image below, the skill does not understand the question and instead welcomes you introducing itself and how it wants to be used. 

The goal in the following is to support messages that are no real intents but questions. For this, as shown in the image below, you 

  1. Click the + Intent button
  2. Define the Conversation Name as Opening Hours and the Name as OpeningHours
  3. In the Examples field ass utterances like shown in the image. 
  4. Click the Edit icon next to the Answer field and enter the message you see in the image below
  5. When you navigate out of the answer field, the field turns read-only (though you can edit it by pressing the edit icon again). 
  6. The icon next to the edit icon is the Resource bundle icon. Click the icon to navigate to the resource bundle panel
  7. In the resource bundle panel. select the Q&A tab to see the message you entered as the answer to the opening hours question. Using message bundles, the answer can be translated for use in a multi language environment.
  8. Switch back to the intent panel by selecting the Intents menu item (highlighted in the image below)

Alternative to typing questions and answers, you can upload them from a CSV file. So before you try the Import intents option, download a sample CSV file. Next, expand the More menu list and select Import intents. Navigate to the downloaded CSV file, select it and choose Open to import it.

The CSV file contained three more QnA intents. 

Before you can try the QnA intents, navigate to the Settings panel (highlighted in the image below) and set the Training Model to Trainer Tm and enable the Optimize for Answers Intents option (as shown in the image). Enabling the "Optimize for Answers Intents" option uses a new intent model in Oracle Digital Assistant, which is the "unified intent model" that works for regular and QnA intents. 

With the above settings, click the Train button on top of the skill and make sure Trainer Tm is selected. With the "Optimize for Answer Intents" option selected, the underlying model training takes a bit longer than normal. So be patient. 

Once the skill finishes training, open the conversation tester again. You can try I like to order pasta to see that the regular intent still works as expected, or go straight to testing the QnA intents. So in the Message field type What are your opening times? or Where can I park? . Note that the questions don't need to match the example utterances you added when creating the QnA intent or the utterances of the imported CSV file. The NLP engine will do its job in determining the intent and then to display the define intent response if the resolved intent is a QnA intent. 

Note: Before you wonder what is better, the QnA module or the QnA intent, have a closer look at both of them. Understand their strength ad weaknesses and compare them to your use cases. You will find that there are use cases for both of them. I like the idea though to look at QnA intents as QnA light (though a damn smart QnA)

Related Content

TechExchange Quick-Tip: How To Implement a textReceived Action Transition Behavior in QnA

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

TechExchange Quick-Tip: How-to add the user query string to the Q&A optionsLabel property on the System.Intent component

TechExchange: Options for Working With Message Bundles in Oracle Intelligent Bots

 

Author