It’s getting more and more evident that current times are about adaptation to the rapid flow of the technological process. Things are getting complicated from one side enabling us to get rid of difficulties from another.
Our life in the technological era is full of intricacies which we inevitably need to pass through to reach perfect simplicity. These intricacies are about enumerable ways we develop to handle information. Instead of belonging exclusively to the close scientific labs, it’s coming directly into our life as the powerful tool for making the world better place.
As new technologies are emerging we need to become more flexible about using them. For this, it’s important to stay updated and possess knowledge base.
Understanding of “how it really works” from inside is a key, especially when talking about the most rapidly developing fields. Such one is where robotic virtual assistants (chatbots) act.
With this article, you’re going to build up an essential knowledge base for effective navigation through chatbots world. We will start with the levels of chatbots’ complexity, go through the reasons of using chatbots and finally look at how to make chatbot learn from data.
Chatbot in a nutshell
Where does chatbot starts? With the response, right? Either you need to get weather forecast or information about flight tickets or other information floating somewhere in the online space, you’re messaging the service and it immediately comes up with the response. Would you care about the level of complexity chatbot possesses if it answered your question?
When you ask the service next time it will give you information without any signs of your previous talk. Why does it happen? Well, it’s simple enough. This bot doesn’t store information about its previous “states”. In this context, state means the performance of chatbot in response to the certain action (for instance, receiving a message from a user). Switching to another state is triggered by interchanging of HTTP requests.
Pretty simple, right? But can we go further from this? Sure, we will. To build more complex logic which implies some dialogue flow as a set of questions-answers between chatbot and user we need to make the bot remember previous states.
There’s scripted logic behind, however, there’s often natural language recognition elements that help the bot to recognize different inputs and refer them to the certain script.
Bots can be very different. Nowadays they are passing Turing test and act just as a human being trained on the numerous conversation examples. However, they still are incapable of acting intuitively, to express emotions and operate flexibly on the knowledge they possess. The problem about this is the lack of artificial general intelligence which, in short, is about acting like complex entity.
And scientists are still working on it. But it doesn’t mean that the chatbot relying upon hard-coded logic, NLP, computer vision, and speech recognition, cannot contribute to delivering a great product. Now you may have a somewhat clearer understanding of what average chatbot is capable of, from which you can develop a plan of fitting into your workflow.
What is chatbot able to handle?
Have you ever asked this question? Is it just a trend that you want to know about or is it really about your issues that it can help you to solve. Those are the questions we’re going to ask and answer. So let’s focus on whether you really need a chatbot or you just have heard about it too much to stay aside. First, we need to understand what kind of needs chatbot can satisfy.
Easy understandable, repetitive inquiries
When information is easily retrievable and users’ inputs are quite similar and, therefore, understandable, chatbot is a must. Why would you pay someone for doing the tasks which don’t require any knowledge when you can automate it without any negative consequences for your service? When service doesn’t have any complicated structure, but with pretty plain informational landscape instead, automation seriously helps to cut down expenses.
Users who are coming back
This is what all services are aiming at – getting users back. However, it usually implies more efforts that are considered. You have to stay on the line with your users constantly reminding about your existence on the market.
Again, with human employees, it just comes down to the repetitive work which doesn’t require any skills. You are just setting it up once and schedule its performance for further times. This is exactly what you can do with bots.
A lot of structured data to train the bot with
Problems of machine learning we’re constantly facing usually converge to handling data along the process: gathering, labeling, normalizing and so on. Sometimes it takes more time to work with data than train a model.
However, if you have permanent access to structured data and you would like to receive results of its analysis and predictions, it will be possible to develop analytical chatbot with less time and financial expenses.
Teaching your chatbot to understand what you talk about
Let’s assume that you have some data from the numerous previous conversations with your customers. Or you have invented it regarding conversations you expect your bot to have with the users. I propose you to use Microsoft LUIS in order to train your chatbot.
Click here and create LUIS application. Next what you need is to add an Entity and Entity Children (if the object is complex, however, it’s an optional point, which you can skip at the beginning).
The entity is a type of information you want your chatbot to be able to recognize. For example, here it’s the Date with the period, marked by two Entity Children: StartDate and EndDate.
Now you need to add utterance or, in other words, to feed your model with examples of the entities. For instance, you want your chatbot to recognize the dates. You mark “on 24 October” with “StartDate” entity.
But what if you don’t want to put hundreds of utterances manually? Then you need to have your data in a separate file. You go to your My Applications, choose “Import Utterances” and upload them as a text file.
Now you might want to add intents and attach an action to be called under certain circumstances.
If you think that you’re over with the training your model, go to “My Applications” and click “Export App”
You will get an information in JSON format, which you can use in the code for creating LUIS object.
We use JSON here as it’s the language understandable by humans and machines. It’s very helpful for the purposes of exchanging data between browser and server as in its basis it’s just a text. Regarding that chatbot application is first of all web application we can take full advantage of leveraging JSON format.
After you get information JSON file you can use it within many platforms and programming languages.
There’s a lot of tools widely available across the web that you can use to make all the hard work instead of you. You can interact with their services in a very superficial way (just as we did with Microsoft Cognitive Services) without digging into their essence. (To get more information on the existing platforms and tools that can be helpful for you to build smarter chatbot, jump here.)
However, if you want to create and adjust algorithmic part you need more profound knowledge of the topic.
As the bonus to the article for those who has made it through I decided to show you some of the sources that you may find helpful for learning AI.
What do I need to know to effectively teach chatbot?
In fact, machine learning, NLP, image and speech recognition (check all the strange words here) are all very popular and interconnected fields. When we talk about artificial intelligence we imply all of them together. The problem is that it takes time and energy to deep into the topic. However, if you dare to do it, it’s going to be rewarded in many yet unforeseen ways.
1.Coursera’s course in Machine Learning
It’s a Stanford course that you can either audit or pay and get a certificate (if you pass it all). This is one of the best courses I have come across. It would guide you step-by-step through the most confusing topics reminding all the time that you don’t really need to have a solid background in calculus and statistics.
In fact, what you really need is the desire to deep into the topic and explore it as wide as proposed there. The course is taught by the co-founder of Coursera and chief scientist of Baidu (the largest Chinese search engine) Andrew Ng.
Most of the code that you would come across while exploring ML would be in python. It doesn’t necessary mean that the same operations are not accessible in other programming languages. No, you can do the same in every language.
However, in python, a lot of stuff would be easily implemented (comparing to other languages). This is a brilliant source for diving into programming in Python. There you will find a bunch of tutorials on python libraries for ML, NLP, image recognition. There’s also a section for those interested in robotechnics. Don’t be afraid. Everything is going to be taught in a very gentle way.
This is the original course of California technical university that covers the large theory basis and the most important algorithms of ML and the ways of their application.
It’s a popular course that would give you an extensive basis to move forward in the practical direction with.
There’s a lot of tools available on Azure Machine Learning portal. They are very useful for the purposes of visualization and creation of comprehensive models. As new tools are emerging all the time, Microsoft is also developing its learning platform, which is called Virtual Academy.
Courses are free of charge and they cover a wide range of useful topics for developers.
If you didn’t know, Tensorflow is an open-source library for machine learning created by developers of Google Brain. There’s a lot of useful information in guide and blog sections.
If you’re interested in learning from Google Brain team, I also recommend you to check Deep Learning on Udacity.
Nowadays, even such complicated concepts as Machine Learning are made extremely easy to use. However, it doesn’t imply doing without understanding. On the contrary, the easier tools become, the more profound understanding they require to take full advantage of them.