Is Chatbot worth investing?

Chatbot AI (Artificial Intelligence) is still many years behind to what we see in movies. Anyone who have encounter Chatbot will find that the AI are only good to handle happy path. The true AI will be exceptions handling and problem solving. It may take a couple more years for AI to be mature in Chatbot. So, is it worth to invest in Chatbot now?

Chatbot will define Tomorrow

Although Chatbot of today does not give what we envision, it holds a lot of potential for tomorrow. Existing organisation are not structured for Chatbot or AI. By investing in a new channel like Chatbot, you will be compel to transform towards a future AI or Chatbot teams. Logic remains key driver for existing applications, not AI. With Chatbot, you can easily bridge the gap to AI.

Better Late than Never

If your organisation is conservative, they may feel that Chatbot is redundant. Other resistance could be fear of losing jobs or the need to restrict information. Soon, you will find many Chatbot equipped with AI and many other capabilities. Organisations who have been utilising Chatbot can easily gain access to AI. Thus, it is hard to find a reason not to introduce Chatbot channel into your product offerings.

There are many debates to why Chatbot is worth investing. It is correct to say current Chatbot is lacking in AI. However, you should see Chatbot as a door into AI. You should implement Chatbot to gain access to AI for the future. If it is not now, when will it be tomorrow?

ODA Chatbot Composite Bag

Composite bag in ODA (Oracle Digital Assistant) Chatbot is an interesting concept to extract values from user input. The idea of composite bag is to emulate a realistic extraction of required values from user natural input. However, there are certain things that I have encountered that will require some workarounds.

Optional Values

In the real world, there are optional and mandatory values that users require for their decision. It is like ordering a meal and deciding if you should go for dessert. In this case, dessert is your optional add on that you may have. Currently, composite bag does not prove the options to state if the values are mandatory or optional. The workaround is to let users skip or set a default value for the entities value.

Ambiguous Confusion

Enabling composite bag is straightforward if the entity field are distinct type like location, date time or number. If there are multiple entities of similar type like string, a single string user entry will resolve for all the string entities in the composite bag. If you find it hard to resolve the ambiguity, a workaround is to disable out of order extraction. This way, prompts will be used in sequence to ensure users key the right inputs.

Composite bag is a first time to natural inputs. However, there is still some tweaking if you want to allow optional user inputs. For the moment, you may only use composite bag out of order extraction for clear distinct entity type. If you have complex user inputs, you may choose to include prompts and disable out of order extraction.

ODA Chatbot Skills

ODA (Oracle Digital Assistant) Chatbot Skills are like modules or features in applications. They help to group your chatbot for specific purpose. It is like discussion of a particular topic. The topic is what you can relate this to a skill. A collection of skills are then called be Digital Assistant. I find that there is two approach to plan and group your skills. The first approach is to define skill as a task with a goal. The second approach is role based skill.

Skills as Task Oriented Design

You can design skill to be task oriented. This means each skill have a final goal in mind. The good part is that this method allows reuse of skills when you group them in Digital Assistant. You will realise that you may have many skills that are loosely coupled. This give complexity for users to and use different skills. Example, customer who wants to order a book and make payment will be two different skills and goals.

Role Based Skills

To handle the seamless flow across skills, I realise that you can design skills to be role based. This will group different skills for a role. The key advantage of this approach is the ease of managing the conversation within the role. For instance, a customer who wants to order book and make payment will be group as customer skill.

The standard approach to use skills is task driven. However, this lends complexity to make the conversation flows across skills. Thus, you can consider designing role based skills to manage all the activities for the role.

ODA Chatbot using Bucket Storage in Cloud

You can easily setup static website with storage bucket in Cloud. Do you know that you can extend this setup for your ODA (Oracle Digital Assistant) Chatbot? This is provided as a JavaScript library for the Chatbot web channel.

The Setup

The setup is much easier than I had thought. This is a standard setup for ODA Chatbot web channel.

  1. Create folder for JavaScript and css in the object storage bucket.
  2. Create index.html or any main page for linking to ODA Chatbot.
  3. Create authenticated URL with access to the all objects within the bucket.
  4. Test your URL to start the Chatbot.

The setup of ODA Chatbot using web channel is simpler using the object storage architecture. You do not need to create new server instance or worry about the server capacity. This is because object storage comes with having high availability and huge storage.

ODA: Upload to Embedded Component Service Results in Failed to fetch custom component metadata, error response: 504

Today, I hit a really $&#% issue regarding Oracle Digital Assistant (ODA) Chatbot. This has to do with custom component feature. I find this error message misleading and leads to hours of troubleshooting efforts. So, it is better to share here for our further reference.

Oracle Solution

The typical cause for this error is that your component folders contain non-component files. The directories that you name in the components array in the main JavaScript file should point to directories that contain only component files. This includes files in any subdirectories.

Say, for example, that the main JavaScript file sets the components array like the following code example. This statement tells the component service upload process to look in the components directory structure for the custom component definitions. The server will look at every file in the directory structure and try to process each one as a custom component. If there are files in that directory structure that aren’t custom components, the upload process fails because it can’t parse the file as a custom component.

If you get this error, create a separate folder, such as helpers, in the same folder that main.js is in. Then move the non-component files into it, and modify your code accordingly.

Source from Oracle
The Actual Error

The root cause I got from this error is JavaScript syntax error. While loading the custom component, the JavaScript with error is not identified as a component file. As such, it throws this error message in ODA.

Common Syntax Error

Reference to other JavaScript module must be within invoke function.

invoke: (context, done) => {

const fetch=require("node-fetch")
}

Be careful of syntax like semicolon after keepTurn. This will cause the same error message while loading of custom component.

context.transition('success')
context.keepTurn(true);

Hope these ODA tips helps and ease hours of frustration. Great thanks to Oracle Kevin for these!

Freemarker Array in ODA

Freemarker array can be confusing to use in ODA (Oracle Digital Assistant). It is hard to find documentation on how to index the content for JSON array. These are the Freemarker syntax I had found to index array for ODA. Hope this helps!

Access First Level

First level JSON array are as follow:

{"results": 
[
{
"index": 0,
"field": "Number",
"value": 1
},
{
"index": 1,
"field": "Name",
"value": “Peter”
}
]
}

The syntax to access the first level array is:

${results.value[selValue.value?number].index}

Access 2nd Level

The JSON format are:

{"results": 
“count”: 2,
“items”:
[
{
"index": 0,
"field": "Number",
"value": 1
},
{
"index": 1,
"field": "Name",
"value": “Peter”
}
]
}

The syntax to access the 2nd level array is:

${results.value.items[selValue.value?number].index}

This will help you access a specific content by index in the array with Freemarker expressions in ODA.

ODA Custom Component

Oracle Digital Assistant (ODA) custom component is a nice addition to extend the functionality of Chatbot. With custom component, you can utilise the functionality of NodeJs and integrate to backend services. However, it is not straightforward to be used for the typical users. You will need an intermediate level of development to understand and set it up. Of course, it is great if you have someone to guide you the overwhelming process. Here are some tips to get you started on custom components.

Getting Started

The best way to get started on custom components is to go through below steps.

  1. Read and understand the purpose of custom components.
  2. Do the tutorials for custom components.
  3. Modify the sample template for simple use case.
  4. Test your custom components and enable logs.
  5. As you build more custom components, you will gain confidence for complex use cases.
Moving Forward

Custom components is a good addition. However, you will need to be familiar with JavaScript and Integration of Cloud services. It will take a while before cloud providers can come up with wizard, template or even SaaS. Meanwhile, you may need a lot of patience to setup the base library of custom components for your business needs.

One method for integration to backend services is done via custom components. It take courage to take the first step to do the tutorials. Once you setup your environment for custom components, you can create simple custom components for your use case. This will build your confidence to develop more complex scenarios.

Chatbot Team

After months of Chatbot review, I find that NLP (Natural Language Processing) development is a different ball game. These are some skillset that you may want to consider to build your Chatbot team.

A new Paradigm

Chatbot is a new paradigm. Thus, it will take experienced developers to change and gat used to this approach. You will need to find someone who is patience and willing to redesign from a user centric approach. An entrenched mindset will be difficult for development of Chatbot.

Right Fit not Right Skills

If you are building a Chatbot team, do look for aptitude instead of someone with good technical skills. Thus, a person who is interested to Chatbot development is a better fit. Technical skills can get obsolete but a person who have the right learning mindset will grow with Chatbot.

Chatooth development is a new paradigm and faces resources issues in filling these roles. You should aim to build a team who is dedicated to grow and champion the usage of Chatbot. If not, it will remain another white elephant as time goes by.

Chatbot Date NLP

Chatbot NLP have an interesting feature to interpret dates with NLP (natural language processing). In traditional applications, we need to set user preferences and identify the dates format and convert it accordingly. This is a key advantage of using AI driven Chatbot.

Why NLP Inputs?

A key issue with data input is user formatting. Date is one notorious input as shown in here for OTM. NLP is a great solution to resolve this data input. With NLP, you can key in different flavors of dates and formats like below:

  • Yesterday
  • Today
  • 2 days ago
  • 2 months ago
  • 12 Aug
  • Jun 10
A New Paradigm

It will be a matter of time before we see the input forms disappearing. This will be replaced by smart Chatbot that extract data from your responses. So, there will be increased interest in NLP development. This new paradigm is more intuitive and smart. For eCommerce, it will helps to uncover impulse purchases and unarticulated needs.

A new way of NLP data input will gain popularity as Chatbot development becomes mature. This will change the way we view UI (User Interface). Of course, the initial development will be challenging as we lack NLP developers. If this is the case, why not transition your existing UI to NLP development?

Cryptic Freemarker Array in ODA

Apache Freemarker continues to be a challenge in ODA (Oracle Digital Assistant). I am trying to tackle Freemarker Array operations. It proves to be a headache to figure out how this works.

Tips

These are some tips and lesson learn from my battles with Freemarker Array operations.

  1. Check the actual JSON to determine the where the array is located e.g. root or sub items.
  2. Start with simple listview for Freemarker.
  3. Do backup and unit test often.
  4. Array location in sub items level may not be accessible directly.
  5. Index start from zero.
  6. Build your code template for Arrays because there are no many examples for ODA.
  7. Validation check in ODA does not work for Freemarker.

Array operations in ODA is one of the challenges faced during coding in ODA. While the validation do not work, you may need to test often to find the errors.