A first glimpse to the Oracle Intelligent Bot Cloud Service

Quick Look at Oracle's Cloud Chatbots Platform

Chatbots have become an important platform to interact with our users using a well known tool: chat.

We are not only talking about making this type of platform available in channels like Facebook, what we really want is the automatization of tasks so users can use it with confidence. We want this tool to become a transactional tool not only informative. In the future it might be predictive and have interactions with backend systems and API’s.

This article is a quick view at the new chatbot platform provided by Oracle. We will be reviewing some details about chatbots that will work as an introduction for new and more extensive articles to come in the near future.

First of all we need to understand that chatbots are a Cloud based platform. Here are a couple of reasons why:
  1. First of all, Oracle has become a Cloud based company, and there is no turning back. Not only Oracle but the rest of the industry is now Cloud based.
  2. Chatbots are a platform that seems to work perfectly in the Cloud. Due to the type of interactions they have it makes perfect sense they are a Cloud based platform. I am talking about interactions with, APIs, Facebook, Web Portals, etc.

Having said that let's start with an overall review. The case we are going to review is based in a lab that I had access to and training provided by Oracle to me and the rest of my team.

Once we are in this is the first screen:

We can see a board with all of the bots that have been created so far in this platform. We can create a new one by clicking in the ‘New Bot’ button.

Once we click on it we will have to introduce some basic information like name of the chat and a brief description. In this particular case we will create a very simple bot for a financial institution that will provide their customers the ability to check bank account statements.

Then we will see the following screen:

  1. First option it’s called Intents. In this option we will record some questions in order to gather information about a certain topic in order for the chatbot to acquire information in order to fulfil the requirement. Moving ahead we will configure more of these.
  2. Second part is to configure Entities that will be used by the Intents. Let’s configure the scenario where the customer wants to check his/her bank account balance. Intent could be: I want to know the balance of my check account. Entity will be Account. We will configure the Entities in the following section:

  1. 3.  Third option is Flows. This one will help us establishing the interaction in our conversation. We will do this using  a language (YAML https://en.wikipedia.org/wiki/YAML) that will allow us to describe our conversation. By default the following will be created:

  1. Fourth option is called Components. This section will allow you to configure the components that will be used in the Flow for specific actions.
  2. Next option is Settings that will allow us to:
    1. Connect our newly created bot to Facebook or other channel.
    2. Connect our bot to personalized components like APIs.
Following steps are required to create a bot:
  1. Create an Intent: We will call it Balances
  2. Create an Entity: Account type will be the name.
  3. Create a Flow
  4. Train the Bot
  5. Test it
CREATING MY FIRST INTENT
For the purpose of this article we will create the Intents one by one but the platform also allow you to import from a plain text. This helps when you have to load a bulk of Intents.
We will click  on the Intent button and will create our first intent and will name it Balances, just like the following image shows:

Once created we will be able to create different questions or statements that will help the bot understand what the customer needs. We will create the following:

In order to create one we will write on the text box called ‘Enter your example utterances’.

CREATING MY FIRST ENTITY
Now we are going to create our first entity called AccountType.

Below this screen you will be able to configure your entity. We will configure three types of account:
  1. Savings
  2. Checking
  3. Credit

In order to do this we will create the following configurations clicking the green button:

Afterwards the following dialog box will appear:

It is extremely important to use synonyms. Synonyms will allow the bot to create the relationships with entities and intents without having to create extra entities.
You will enter Checking and Check as synonym. Will do the same for Savings and Save,

Finally please create Credit Card and AMEX and VISA as synonyms. Configuration should look as follows:
Now we have to associate our Intent with the recently created Entity. We will have to go back to our Intents section

 and in the upper right section will click on the green button called Entity.

Following screen will now appear:

We will select AccountType just like shows in the image. Then we will see this:
Now we have created our first Entity and also we have already associate it with our previously created Intent.
Now we need to create a conversation flow.
CREATING MY FIRST CONVERSATION FLOW
In this version of the Oracle Intelligent Bot the conversation flows will be created using YAML but in the upcoming versions a much more friendly and graphic editor will be available. Right now we will use the options available to create our Flow using YAML.
We will click on the Flows button and we can see that there is already a default YAML created flow.

For the article purposes we will be using an already made flow. As I mentioned at the beginning this is part of a lab class provided by Oracle. In the upcoming articles we will be creating our own using YAML. But for now we will be using the flow we used during the Lab class.
You can copy and paste it from here just first copy it to a text file so you don’t carry any formatting.

metadata:
  platformVersion: "1.0"
main: true
name: "MyFirstBotFlow"
context:
   variables:
     accountType: "AccountType"
     iResult: "nlpresult"
states:
  intent:
    component: "System.Intent"
    properties:
      variable: "iResult"
      confidence_threshold: 0.4
    transitions:
      actions:
        Balances: "startBalances"
        Intent.None: "unresolved"
  startBalances:
    component: "System.SetVariable"
    properties:
      variable: "accountType"
      value: "${iResult.value.entityMatches['AccounType'][0]}"
    transitions: {}
  askBalancesAccountType:
    component: "System.List"
    properties:
      options: "${accountType.type.enumValues}"
      prompt: "For which account do you want your balance?"
      variable: "accountType"
    transitions: {}
  printBalance:
    component: "System.Output"
    properties:
       text: "Balance for ${accountType.value} is $300"
    transitions:
       return: "printBalance"
  unresolved:
    component: "System.Output"
    properties:
      text: "Unable to resolve intent!"
    transitions:
      return: "unresolved"

Now we are going to describe some of the variables included in the YAML.
The iResult variable will contain information and values that the natural language process engine generates and at the same time helps to determine the intents and triggers the execution of the flow. This variable takes its value from System.Intent that represents engine instance and the algorithm.
Another variable we can see is confidenceThreshold which is a very important variable since it defines the precision value that the engine will use in order to determine what is going to be executed once the intent has been evaluated. What we just mentioned is important because for each user intent the engine and the algorithm will evaluate them and a score will be assigned, the score that is higher than the confidenceThreshold is what is going to get executed. Increasing or decreasing this value will impact on the accuracy the bot has to resolve the input from the user.
To validate this we have to click on this button:


 You can find it in the upper right section of the Flow screen. We have to see the following message:

The YAML that was copied and pasted can be interpret as follows:
Code contains the entity of AccoutType that we previously created as an entity variable. If we include the AccountType in the startBalance state conversation will continue in the askBalanceAccountType section and then in the printBalances section that displays the balance. If AccountType is not specified then balancesAccountType will be executed that will proceed to ask which type of account you want to see the balance of using the values configured on the Entity. Once the type of account is selected it will show the balance.
We will review this once we test the bot.
Before we do that we need to click on Train so the bot can be trained with the Intents, entities and flow:  

Once we click Train we are ready to test it.

TESTING MY FIRST INTERACTION WITH A BOT
The Play button is located in the upper right part of the screen. Click on it:

The following screen will appear on the right side of the screen:

In the screen above you can see the yellow noted text box, that is where we will type: What’s my balance.

Then we will see the following:

You can see that the reply includes the type of accounts we configured in our entity.
Click on Checking:
And it will respond the balance we configured in the Flow.
Finally please click on the Intent tab that shows on this same test interface.


Type: What is the balance on my Amex?


You can see how the bot associated Amex with the AccountType. This was possible because of the synonyms we configured initially.

One thing that is important to mention is that this platform has great capability of connecting with other backend services and APIs. This is inherited from the Mobile Cloud Services. As I have mentioned before, bots feed predominantly from APIs. You can see this information on the following presentation I did some months ago: https://www.slideshare.net/rolandocarrasco/la-importancia-de-las-apis-en-los-chatbots
This was only a quick view of the platform. I will be writing a lot about this platform. In following articles, we will show:
  1. Creating a new chatbot
  2. Will write our own YAML
  3. We will perform an API - chatbot integration through the components.
So, stay alert for the upcoming articles.