article by Grant Ronald, July 2019
(updated with new sample files on September 2019)
Experience has shown that whilst you might invest considerable effort in training your chatbot to handle requests from users about your business domain intents, much of the traffic to a public chatbot is what we generally regard as small talk. “Are you a bot”, “tell me joke”, “Do you like football”. For right or wrong, the success of your bot is, in part, measured by how it handles ALL possible interactions: even the ones in which the user is being deliberately challenging! This article and sample provide a smalltalk skill whose job is exclusively to understand these small talk topics.
Note: The sample skill you can download for this article require Oracle Digital Assistant 19.1.5 or later
How does it work
The concept is very simple and easy to extend to meet your own business requirements. The example proves a main skill (link GR_SmallTalkMainSkill) and a secondary smalltalk skill (link GR_SmalltalkSkill). The main skill represents the primary business skill and for the purposes of the example has two business intents: one for ordering pizza the other for banking.
The smalltalk skill contains only intents and utterances which relate to the small talk topics to be handled. This includes intents such as the following:
- Questioning if the user is speaking to a bot
- Who built you
- Flirting
- Sports questions
- Weather
- Jokes
- Responding to input that the bot is being helpful
- Responding to input that the bot is not being helpful
- Conversational "filler" terms such as "great", "sure", "thanks" etc.
- What is the time
- Swearing
- Opening such as "can I ask you a question"
You can tailor these intents and utterances as you require – whether adding or removing, or even reclassifying (for example you might decide that flirting and explicit sexual utterances be dealt with differently).
What happens is when the main skill fails to resolve a user input to either pizza or banking; it resolves it to the unresolvedIntent. This then calls a second instance of System.Intent which specifies a property botName (shown in line 88 in the image below) to point to the small talk skill.
This calls the small talk skill to resolve the user input separately against the intents within that skill.
The System.Intent then uses the intent names from the small talk skill to appropriately route the response within the main skill. Thus the conversation flow is always handled by the main skill. As you can see below, there is a state within the main skill for each of the possible actions. In this sample, the bot responses are read from a map meaning that the skill will chose a random response and so the user will see different messages each time (see line 139 in the image below)
Further good practice is that the skill, after responding to the small talk, will attempt to get the conversation “back on track” by executing a closing statement which guides the user to ask about the business domain topics (see lines 153 – 160 in the image below).
Alternate methods
One alternative method you could consider is to use a separate skill with it’s own dialog flow to handle the small talk and to configure the business domain skill and the small talk skill under a digital assistant. This is a good possible solution however, at the time of writing the current functionality of a digital assistant in the case of a disambiguation is to present a dialog to the user to chose which skill to execute. So in the case of an input such as “You sound nice do you want to go out for pizza” the user could be presented with a disambiguation dialog to choose between pizza ordering or the flirting skill. Ideally the small talk skill should not be exposed to the user via this method. (see bug: 29783782 )
Downloads
Related Content
TechExchange Quick-Tip: How To Create Randomized Bot Responses Using Resource Bundles in Oracle Digital Assistant
Randomizing Responses from your Bot with Oracle Digital Assistant (version 2.0)