All Things Techie With Huge, Unstructured, Intuitive Leaps

Putting An EQ And IQ Into My Chatbot

In my previous article, I outlined the genesis of my chatbot that is under construction as a side project. Friends of ours had to buy a new car and they were dissatisfied, intimidated, fed-up and emotionally drained when dealing with a high-pressure smarmy new car salesperson. They wanted to talk to a computer to negotiate for a new car, so I got out my SDK and made my chatbot. I can see my chatbot being used online in new car dealer websites as well as kiosk-based at the new car showroom.

The first entry into the chatbot field for an open source framework was ALICE, and it used AIML, or Artificial Intelligence Markup Language, is an XML dialect for creating natural language software agents. It was created by Dr. Richard Wallace in 2001 and it is quite low tech compared to some of the proprietary chatbox frameworks out there. However, chatbot frameworks are like an artists tubes of paint and a canvas. The skill that goes into making it, often times transcends the simplicity of the framework.

Here is a simple schematic diagram (ignoring the framework internals that digest the AIML) of how a chatbot works:

The predicate is like a key word. Examples of predicates are "Hello, Calendar, Time" or any other topic. The input is parsed for a predicate which is the main topic of the input. The predicate is then matched with the AIML predicates loaded into memory that have already been defined. If the predicate exists, the bot retrieves the response to that predicate and spits it out. If it is not retrieved, then a "Not Understood" predicate is accessed and the response can be as simple as "Sorry, I don't understand" or as complex as "I know about 23,000 different subjects, but I never had heard of the word <predicate>. Do you want to talk about something else?". That's the simplistic AIML usage.

More complexity in the input is where the skill and artistry comes in. One can write "intelligent AIML" using recursion and recursive tags, known as Symbolic Reduction AI. A good example is given in the documentation as follows. When you have simple AIML and someone types in "Hello" as do 99% of people do when talking to an AI chatbot, then the response is "Hello, how may I help you?". Easy!

When someone types in "You may say that again, Chatty McChatface!" there are four predicates. The first one is the name of the entity "Chatty McChatface". The second predicate is "again" meaning repetition. The third predicate is "may say" and the fourth predicate is "say that" -- whatever was being talked about. So with skill, complexity can be built into a simplistic framework. Although the mechanism is simplistic, the symbolic reduction can make an AIML chatbot work as well as a casual conversation on the street with ... say a Trump supporter. What adds the complexity, is the construct. To understand recursion, you must first understand recursion.

When you have a chatbot that is negotiating with someone, asking them to make the second biggest purchase of their life, you have to have both an EQ and an IQ built into the chatbot. First of all, you are moving away from pure chat, into an interaction that requires assessment, calculation and response, all tempered with the cognitive emotional factors and parameters of the inputs and outputs. The bot has to satisfy opposite strategies and goals simultaneously. It has to get the best price for the car dealer while getting the lowest price for the consumer.

To balance these opposite forces, the chatbot must have a few Emotional and Intelligence attributes. It has to know when it is crossing the line from hard negotiating to nickel-and-diming the buyer. It has to recognize when the buyer is getting frustrated. It must judge the fuzzy concept of "good enough -- let's do the deal while everyone is still happy". So that is where I must put smarts into my chatbot.

One of the ways of doing that, is to tee of the predicates into an NLP machine (Natural Language Processing) where the cognitive and emotional factors can be assessed. And since you want the machine to get better and better at negotiating and selling a car, you need some sort of AI network -- either RNNs, CNNs, ANNs or hybrid types of Artificial Neural Networks that watch the combination of predicates and responses like an overseer, and override the response in the AIML with a custom response. And then that series of events must be serialized, fed back into the machine as a new behavior and constantly assessed for validity and results. That is the task at hand, and it is an exciting challenge for me.

The only thing that will ruin this, is if the car makers decided to go to a fixed-price model with a no-dicker sticker. Then Chatty McChatface will be unemployed like the thousands of sales people that it previously made redundant. It's a Brave New World out there.

No comments:

Post a Comment