The Customer Is The Channel

The customer-centric blog of Linc Global

All Posts

How to Make a Bot Smart (Repost from Oracle Blog)

Chat Bot Intelligence - Current State

A simple chat bot can answer simple queries about - “How is the weather?”, “How are you feeling today”, “Where is the stock market today?” and so on. In most cases, the backend software in the Bot is doing a simple look-up in a database, comparing it with the user utterance and giving a reply.

In some cases, where the Bot is unable to find a match then it simply says - “Sorry, I am unable to understand it”, or something similar. If we target to build a complex Bot that can answer far more questions - perhaps everything in the world, then it becomes an impossible task (for now). To achieve such a scale and reduce complexity we will need to process all the information in the world and do a real-time comparison with the user utterance to come up with the best answer. In the search engine world, this is how it is done; - a user search query is compared to all the available documents and the best document is surfaced to the top. Users are used to typing simple keywords and if we base the technology to build a Bot on such model then this is how the conversation would look like 

Screen Shot 2019-03-04 at 7.57.08 PM

Even if the top results are used to read out the actual results, from a human perspective it does not make a good conversation since summarization of the results would still result in a complex answer to a simple human gesture.

Pure search engine based chat mechanisms are not that effective. The other mechanism is to craft standard replies to a large number of questions and put -those in some database. This method even though effective is similar to Interactive Voice Response (IVR) systems that lack human touch and remotely resemble normal human interaction. 

Human touch is achieved when simple social skills are introduced in a Bot.

Do Smooth Social Skills Provide Human Touch?

Adding simple chit-chat abilities to a bot might give some semblance of human interaction but the real intelligence is not captured by mere chit chat. In general, humans value intelligence where a nuanced interaction results in some mutually beneficial useful action.

In short, it is good to have the ability in a Bot to do small talk but it is not sufficient.

Language Grammar to the Rescue

In order to do better than smalltalk, it is important to understand language grammar, and use it to do better dialog management. Humans use language in a very nuanced way to convey relationships between the entities. Various Natural Language Processing (NLP) techniques such as Constituency parsing, Dependency parsing, Coreference resolution etc. give a  good understanding of the entities user is interested in and the action that user wants to take. Some simpler entities can be extracted using regular expressions too.

In the above example of Spacy’s Dependency parser, extracting only the verbs and the nouns gives a good indication of what the user wants

Action (Intent) - buying

Entities - a pair, jeans

A simple classifier that takes this information can build a large number of intents and the entities that the intent can operate upon. Does a large collection of intents along with the entities that it operates upon sufficient to answer user queries?

The answer is still a firm ‘No’. There are other problems that still need answers such as  how to craft dynamic replies, how to identify complex sentences, if the information provided by the user is not sufficient then how to elicit the required information from the user and so on.

The real value comes from building a conversational flow model based on initial user intent and using a variety of algorithmic techniques as shown in the next few sections.

Context and Human Brain

As per Christoph Koch from Allen Institute of Brain, recent research indicates that higher intelligence (in any species including Humans) is a side product of more connectivity between various neural regions of the brain. Going by the same result, if context can be intertwined even more effectively into more complex slot-filling algorithms then it will indicate a higher bot intelligence.

As elementary school students, we learn various sentences and grammar. We learn how to create simple sentences and convey our thoughts using some templates of commonly used sentences that can be used in responding to a well known query. For example -

Q: “How much did this <product> cost?”

A: “The price of this product is <price>”

This is a very simple mechanism which can be overloaded with more complex information retrieved from a context that “knows” about the entity that is being queried and the specific “entity” relationship that is being queried (we call this piece of code a  ‘Botlet’ at Linc)

For example, in actual code, this might look like this:  


In a more complex scenario, where a user is engaging in a dialog a more sophisticated slot-filling can be employed to ask user appropriate questions as per the requirements of a slot and the current user intent while maintaining a good conversation flow.

Slot-filling is a very common methodology in asking the correct questions. If slot-filling is combined with some randomness within a given range of sentences then it gives a semblance of intelligence.

While slot-filling is useful in identifying the questions that the Bot can ask, a component in the Bot needs to track the  ‘Conversation flow’ too, as it indicates that a conversation topic has changed and establish some ground rules on how the Bot should respond to it.

Context and Chat Bot - How to Intertwine them?

Identifying the right intent for the initial user question and then accessing the relevant context for the user to generate a sensible reply is the crux of building an intelligent chatbot.

Context can contain information about the entities extracted, past and current user behavior and sentiment, merchant level metrics and so on. A user can have hundreds of interesting context keys that are associated with him/her, and choosing the right context can become tricky.

For example, if the user has a question about finding the right product for a given category, the problem can then be divided up into these general areas –

  1. Identify user intent
  2. Extract any relevant entities from user utterance (e.g. product attributes such as color, size etc.)
  3. Search and identify the historical and current context of the user
  4. Search and identify the correct Botlet that can answer the user intent
  5. Use some kind of slot-filling mechanism that also understands the specific attribute the user is querying about, and then does a product search (as in the example below)

Can we build this in software?

The real challenge in building a chatbot is taking all the above problems and creating a workflow that resonates well with an end user. Having a ready cache of user context that can answer and intent is half of the solution. The other half relates to creating a workflow that is specific for a use case (in Linc’s case it is eCommerce). Simple workflows per use case are best handled by the experts in the area and providing simple tools for these experts is more important than creating all the possible use cases yourself. To give an example, in the case of HTML language, providing the HTML constructs and parser is sufficient as developers can use the provided tools to build their custom web pages.

Similarly, for Bots, individual small pieces of code (Botlets) that have been abstracted out for being common across various use cases and identifiable using an id are sufficient for real experts to develop bot dialog flows.

Intelligence is achieved by providing a high level of interconnectivity between context items and Botlets. Botlets are basically a syntax for creating user dialog flow (see the earlier example of price) and a domain expert can provide them.

As identified in the earlier problem decomposition, to summarize, in order to build an intelligent, generalized and scalable bot, the components below are required –

  1. Intent Classification - use a classification mechanism based on known services for the domain and the various sentences / phrases / words that fall under the various services (a Service Map). This provides an entry point for any dialog.
  2. A Context Building Mechanism - how will you get user data? Which context values are important for given use cases?
  3. An Entity Extraction Mechanism
  4. A Tool for Writing Bot Questions and Answers (Dialog flow or Botlets) - A domain expert can provide the inputs but the tool needs the capability to appropriately mix it with context.
  5. A Search mechanism that can take user intent, identify the specific Bot Question/Answer, and the context that goes along with it.

Future Directions

Combining user context into meaningful sentences which can either be questions or answers to user questions is an area of research that will provide more meaningful answers to users.

Slot-filling can be combined with Long Short-Term Memory (LSTM) based Neural architectures to provide deeper and thoughtful answers to users which can also include some personalization using contextual data.

Learn more about Oracle AI and Digital Assistants

About Sameer Yami

Sameer is the Head of Architecture and AI at Linc Global. He is responsible for crafting the 'smarts' as well as scaling the AI of Linc's Botlet Platform. He previously founded WikiSeer - a text summarization and semantic advertising company, and also worked in various senior engineering leadership roles at Ampush, Toshiba and Sun Microsystems/Netscape. Sameer has received multiple 'Top Inventor' awards and has filed over 30 patents of which 6 have been granted."

Follow Sameer Yami: Twitter; LinkedIn

Link to Original Post on the Oracle Blog

Related Posts

Turning Touchpoints into a Journey

Every interaction with your customer is important, and maximizing the effectiveness of touchpoints has been a valid business concern for some time. Research from McKinsey, however, highlights the blind spot in this kind of thinking -- true leading brands have moved from a touchpoints-focus to a focus on the holistic customer journey.

Designing a Customer Experience Strategy for Conversational Commerce

When you master conversational commerce, you’ll deliver experiences that make your customers feel as if you hired a personal assistant to help each of them.  There are several key strategies, smart brands need to think about as they go about creating their conversational commerce strategy. Don’t Forget The Data If conversational commerce is the new paradigm of customer experience, data is the engine that drives all those delightful interactions across touchpoints. Your customers are creating data every time they click, swipe, and like --it’s up to you to find it, analyze it and use it to inform customer engagement. Nordstrom, for example, uses sensors and Wi-Fi to track who comes to the store, wherein the store they shop, and how long they stay. They also incentivize their Nordstrom’s credit card and rewards program to gather data about their clients. Target is also known for its data-collecting. The mega-retailer assigns every customer a Guest ID number, which is linked to their credit card, name, or email address. This Guest ID number becomes a repository of info on a shopper’s past Target purchases and any demographic information the company has collected about them and/or bought from a third-party source. Target’s data is so accurate and fine-grained that they were even able to determine a teenage shopper was pregnant (and send her the appropriate mailer filled with baby items) long before her father ever knew. Collecting relevant data, analyzing it and using your learnings to inform which conversational channels make sense for your brand and what types of experiences your particular customers seek to have on them is the foundation of your conversational commerce efforts. Focus On The Highest-Value Activities Put your energy toward meaningful services that customers already care about. Look at service-oriented features, such as notification capability and on-demand service and support capabilities, to guide the customer journey. Don’t just focus on the “Checkout.” The main benefit of service-oriented conversational channel offerings is the ability to organically drive usage into new channels. For example, a customer might place an order on your website and learn that she can subscribe to order status updates through Facebook Messenger. What she sees as taking advantage of a perk will benefit you by encouraging her toward a channel where your chatbot can take over. ChatBots are best for organic conversations with common use cases, but also provide a sense of personalization and convenience for the shopper. Customer service should be your core use for this technology to start. Be Prepared For Bot-to-Human Handoffs The great thing about a conversation handled over text or Messenger is that the customer doesn’t have to know when they might be switching from a bot to a human. Bot design in the future will focus on what they can do, knowing what they can’t do, and designing a bridge to employee assistance that feels seamless to the customer. It’s not just the customer that will be helped by the bot, but the employee. It will provide faster information and better analytics in real time, perhaps then parsing information to pass on to the consumer. The most important aspect of innovation is convenience for the shopper. They should never have to explain their request twice. Start Simple and Grow to Brand Management You can start with bots as a single voice in the chorus of messages from your brand. The long term will have bots as representatives of your entire brand, managing relationships with your customers. You can start conversational commerce, however, with just a single entry point. You can get your customers used to interacting with you on the same channels they use to chat with their friends. You can piggyback on the culture of quick and informal communication, but be ready to meet their expectations for highly personal and meaningful results. If your bot can’t meet that expectation, your customer could walk away disappointed or annoyed. As the technology improves, and it is, even as we write this, you’ll be able to put more and more of your brand management in the hands of the bots. Authentication Giving your bot a way to confirm the customer’s identity is key to a truly intelligent communication that can leverage data from across your other channels. If this isn’t done right, your bot will see each customer as a stranger, negating the opportunity to provide personalized service. Focus On Concepts Rather Than Solutions Your customers might be on Kik today but head over to Facebook Messenger tomorrow. Focusing on the concepts of conversational commerce rather than today’s hottest medium will help you keep your sanity and provide an agile approach that can be applied to meet your customers wherever they migrate. Try not to get bogged down with the details of how to build for one particular channel, and look instead to use-cases. You can learn more about conversational commerce and engaging your customers at every touchpoint by exploring Linc’s platform and solutions pages. Or take a look at how leading brands like Lamps Plus, and others are using automated conversational commerce strategies in their businesses today, in our resources page.