AI Computer Chat – Interacting with your computer through stories

Should an Artificial Intelligence Computer Chat use complex logical algorithms, or alternatively a big data base of possible scenarios and solutions?

How can stories and scripts be incorporated to teach the computer to understand us? This article is a bit more technical than usual for this blog, but I promise to avoid using formulas or complicated calculations, so basically I’ll keep being reader friendly for everyone.  

Bots are designed to understand human language, while we conduct a flowing conversation with them. Similar to how we would speak with another human. As we know, this is a very complicated matter, as every sentence we use has many contexts, layers and stratums. What is the best way to teach computers to comprehend complex nuances? I’ll begin with the most simple example, using only two options.

The old school method

Let’s suppose we have a bot that can make two kinds of coffee, espresso and cappuccino. In the easiest and most desired scenario, if one is to ask for coffee, the bot’s immediate response would be to ask “espresso or cappuccino?” as can be seen in the diagram. Based on the answer, the bot will prepare the coffee which in return can work out well for everyone.

However, the problem comes with the fact that people are unpredictable. Sometimes a question can be met with a question, for example, “which is more expensive, espresso or a cappuccino?” It is possible that sometimes we answer, and then we change our minds, and at other times we can ask for a completely out of context thing for example: “can I have a double shot espresso?” or to answer in different words like “Espresso please” or “Hmmmm I’ll have an espresso”. A human is able to understand that, but how can a bot know the difference between “espresso please” or “Hmmmm I’ll have an espresso”?  

If the bot designer is seeking to construct an effective AI Computer Chat (Artificial Intelligence bot) by using the above method, it is necessary for them to create a huge amount of conversation options, so that the bot can be enabled to predict every possible scenario and phrase. The question that rises here is  – is it possible for someone to predict all the options exist? Of course not.

There is absolutely no chance, and even if there was, all the calculations in the world would not enable an AI Computer Chat to understand things that are easy to a 3 years old child. Those of you who have read “The Hitchhiker’s Guide to The Galaxy”, must remember the scene where the spaceship’s computer was not able to initiate the defence system against intruders, because all of its resources were occupied trying to figure out how to make a cup of tea…


Let’s try to use a different method in order to deal with the problem, which is to teach the Smart AI Chat (bot) to focus on the keywords and ignore the rest. example: a bot which is capable of turning the air conditioner on or off according to the requirement. With this sort of Smart AI Chat for example, if the command is “adjust the temperature in the bedroom to 21 degrees for 5 hours, and then turn it off, the AI Computer Chat system will recognise and operate only according to the key words. But it might get the term turn off confused, and turn the air-conditioning off immediately instead of after five hours.

Image recognition

Every person who has a profound knowledge of computers or Smart AI Chat systems, will probably find the above examples amusing as they belong to the initial developments of modern computers. Nowadays, artificial intelligence is growing and getting more sophisticated and holds the ability to amaze us at times. These abilities are implemented, for example, in the field of image recognition which is a whole new dimension. The first aim is for computers to be able to recognise objects, like glasses for example. So according to the old method, all options would have to be predesigned for all kinds of glasses, using all perspectives, from each and every angle. If an image was completely similar to one of the images in the computer’s reserve, only then would the computer recognise that the objects are glasses. This of course, is non-realistic as there are endless possibilities. So what are the options to resolve it?

David’s house problem

Assumingly there is a guy named David, who wants to buy a house in a certain city, where many of his friends already reside. Let’s make another assumption that he is very social and prefers to walk every time he visits a friend. Lately, he has leg aches, so he is looking to buy a house in a location that will reduce his monthly walking distance. Marked in red squares in the map below are David’s friends’ houses. We would like to ask the computer: what is the best location in which David should buy a house?

If David only had two friends, the programmer would be able to embed a graphic formula in the AI Computer Chat, that would calculate the centre point in a straight line between the two houses. But seeing that the houses are spread similarly to the image, it will be very complicated (or sometimes impossible) to find a mathematical equation that could calculate the ideal point, for which the sum of the distances between the houses will be minimal. So what can be the solution?

Gradient descent

The computer might not be too smart, but it can make many calculations in a flash. For this purpose, one of the classic methods – the “Gradient descent” can be used. In this method the AI Computer Chat could create a random point B on the map and calculates the sum of the distances from all the friends’ houses. Then the computer creates a few more nearby points around the same point – in different directions, and measures in which point of all, the sum of distance to all the houses will be the lowest. This is the new and improved point B. It repeats the process again, and finds an additional and improved point B. This is quite a simple game, and it clearly demonstrates how a computer Smart AI Chat can reach exact results, even without the programmer having to insert a complex mathematical formula into it.

Artificial intelligence is a complicated field, it is vast and immense. This basic method of finding the optimum location to buy a house for David is a small glance into the way it works. If, for example, we would like the computer to recognize glasses, we can insert a huge variety of real images of glasses (from Google perhaps), and program it in a way to familiarize it with the glasses. After a few thousand, or millions of images, the computer will be able to recognise glasses of any kind, with any background and will most likely be accurate.

Tell stories to an Interactive AI Chat (bot)

Everything I have explained so far (on a basic level) was meant to bring the readers to the point where they can understand the meaning of the sentence, “tell stories to the computer”. The word “stories” can also be replaced with scenarios or scripts. Let’s assume that I would like to construct an Interactive AI Chat (bot) that sells ski packages. I do not need to programme a code to explain the computer how to understand each word or sentence. I only need to feed the computer with as many scenarios that might occur during the sales process, and the computer will create the code on its own.

Even after I have taught the Interactive AI Chat computer few scenarios, it is most likely to still make many mistakes as to the understanding and implementation. Let’s say I have written “I am looking for a high end ski resort”, it might interpret that I am looking for a high priced ski resort, instead of high altitude. I will then correct it, and by this way, it would improve its code repeatedly, dozen, hundred or thousands of time – the code will gradually become optimal and would reach high percentages of accuracy. This is important as we would like a smarter AI Chat Bot, which is able to deal with cases in which the users change their mind, express their general opinion, or use unexpected wording.

If we look back at the coffee machine, the user might say “I’d like two cappuccinos and one espresso”, and then “actually, no, not espresso, please change it to tea”. The AI Chat Bot should know how to handle that. 

Organisational memory

The “stories” or “scripts” method has an additional and huge advantage! We live in a scary dynamic world, where the AI Chat Bot technology is evolving rapidly. Each technology that you invest money and time in, might become irrelevant in a short span of time. If we use the script method, no matter how much technology changes, the scripts that characterise the business will stay the same.  This way, the precious information we collected through organisational evolution on “how to sell a ski package?”, will not be lost, but be useful for re-implantation into new technologies and languages that will be developed.

Do you remember the diagram method in the beginning of the article? Well, this method requires you to go back if any change is made, program a new code, and replace the existing one. In the story and script method, considering the business is developing and the bot needs to be updated, you can just add new scripts. There is no need to constantly look back and cancel/change functions that been created in the past. This way the wisdom that was accumulated remains useful. It contributes to the AI Chat Bot improvement in the long term.

Your email address will not be published. Required fields are marked *