Sunday 15 April 2018

Ontologies

I have been reading a lot about Ontologies lately. Looking at the job offers of companies involved in the creation of Intelligent Assistants, such as Amazon Echo or IBM Watson, this seems to be a favoured approach of managing Knowledge .

As a matter of fact, I see two approaches on creating chatbots. The Machine Learning approach is doable only when you have a lot of labelled data - I mean REALLY a lot. However, bots have been around for decades, and what were people doing before that ? Among other things, they were creating Ontologies.

Ontology is a concept that comes from the philosophy and has especially investigated by Wittgenstein, but in Computer Science it is  a formal naming and definition of the types, properties, and interrelationships of the entities that really exist in a particular domain of discourse.

Ontologies are one of the many tools for dealing with Semantics - the traditional way of processing language before Machine Learning became cool. Now many people are blinded by successes in Machine Learning in fields such as Automatic Translation, but these are possible only if you have an outrageous amount of data.

If your domain knowledge is your starting point, you should identify the relevant Concepts and possibly the many Labels to identify them. Relations may be important, but more than that it can be useful to establish Rules and Facts.
Now you can derive Questions from Facts -  the art of creating questions.
Facts, Concepts and Rules can be established reading literature about the domain.

For chatbots, you will probably are not going to need Taxonomies (as you will most likely be limited to one domain, unless you are Amazon). Semantic relations, along of course with Facts, will be more valuable if you need to recognize and act on entities.

However, you can still use Machine Learning for ontologies. Assuming you managed to gather a lot of documents related to the domain, you can use techniques ranging from Word2Vec up to recognizing relations to noun chunks. The generation of a full-fledged ontology from a collection of documents, however, is hindered by the same problem described before - data would need to be labelled.

Last, but not the least, you can look at many of the existing ontologies, or possibly even at Linked Data.

For instance, the DBPedia is a trove of structured information.  The IBM computer who won Jeopardy used Linked Data - but for a limited-knowledge chatbot it might be an over kill. Anyway, this deserves a post in itself.

Sunday 8 April 2018

The art of creating questions

Especially if the main purpose of your bot is to answer questions, and no matter whether you go the rule-based or the machine-learning path, or both, you will be faced with the problem on how to generate a data-set of questions that your bot is supposed to answer to.

In the ideal case you would have already a dataset of conversations dumped from a live chat software. However, you might find yourself in the situation of having to bootstrap your bot with a limited sets of questions. It is the so-called cold-start problem, which often causes chatbots to suck.

In fact, you need great variants of questions that include the wide domain knowledge of that industry e.g. ‘internet does not work’ is the same as ‘my browser is not loading’. Today, these variances are mostly manually generated - besides reducing coverage for user questions this can be cost prohibitive. New ways to auto create these variances at scale are becoming available though it would take some time for this intelligence to have domain context.

It goes without saying that, first of foremost, you have to build a pipeline to clean up the data - to be used both while training and while predicting. So that the database of questions that you build is going to be clean.

After that, the effort of creating an initial database of questions is probably going to be manual. A focused small group of experts knowing the business domain and with good analytical skills is probably your best bet to build a questions database.

The process might look like this: domain experts would gather documents related to each of the type of questions your bot is supposed to be able to answer to. They would also search on forums and questions site (such as quora / reddit) to find out how users may formulate questions that can be answered to each answer. Ideally, they would also be able to extrapolate rules.

 You need reading from the domain or literature. and/or create an ontology.


Saturday 7 April 2018

Rule-based bot and Machine-learning based bots

Sometimes people like to boast they have "Artificial Intelligence" when in reality they have a bunch of "If-Else-conditions". When it comes to bots, they might be Rule-based or AI-based.

In a Rule-based approach, a bot answers questions based on some rules on which it is trained on. One of such languages is AIML (Artificial Intelligence Markup Language)

Machine-learning based bots are of two types:

Retrieval based models are trained on a set of questions and their possible outcomes. The bot cannot generate new answers.

Generative models can generate the answers and not always replies with one of the answers from a set of answers.

Machine learning bots have many pitfalls and when in doubt, a rule-based approach should be preferred.

 Now, when to use rule-based bots and when to use AI-based bots? A rule based bot only understands a pre-defined set of options, while an AI-bot can understand the intent - obviously.

Rule-based bots can be developed quickly and are cheaper to build. Therefore most bots in the market are actually rule-based.

In case of rule-based bots it has to be decided in what format to keep the rules. AIML ( Artificial Intelligence Markup Language) is a possibility, here is a tutorial.

Monday 2 April 2018

Live chat software

Chatbots are often supposed to be used for customer service. However, an indispensable part of customer service is live chat software, which gives customer service representatives a platform to deal with end users' queries. Ideally, chatbots would be integrated seamlessly with live chat platforms and be the first line to answer users queries.

Let's have a look ato some of these platforms. An overview is given by G2 Crowd.
Purechat is not mentioned in this list, but it caught my attention, because it is the platform behind Bloovery. With this tool you can answer customers' queries, search and tag conversations, create canned responses. The most challenging feature, that is, suggestions to agents on how to answer to users' queries, is supposedly offered by Livechatinc, along with interesting ways to use canned responses and tags.


An interesting webinar showing some live features can be found here. It is from CreativeVirtual, a company which deserves further investigation.
The most interesting takeaways are the live demos and a demonstration of the importance of letting agents maintain a knowledge system. This is because they use a hybrid approach of human curation of content and self-learning allowing the system to keep control over the reliability of virtual agent responses.

They do mention bootstrapping systems with several layers of natural language knowledge, starting from the general language, going on to the business domain and at last leveraging the knowledge of the organization.
They promise that they are able to integrate Virtual Assistants with Live Chat, which both use the same knowledge base, but note that all their solutions make clear that you start from a chatbot which can be replaced during the conversation by a human and not the other way round. They offer services in several languages as well.


Zendesk seeems to aggressively combine artificial intelligence with livechat. Bold360 seems to aggressively push in Germany. More on these later.

An overview of Facebook Chatbots

Facebook chatbots


Let's try 30 of the most successful Facebook bots to chat with.


These are obviously very focused bots which may follow you through an order.
I guess Wingstop, at Pizza Hut and Domino's hut could help you with an order,  but I could not test those, as I am not located in the US.

The bots that seem to work better are those that drive the conversation using multiple choices. Kayak's bot could actually help me book a flight or a hotel room. Burberry's bot made a good job of informing me about its limitations and allowed me to navigate through its knowledge base - I especially liked it led me to its FAQs without trying to pretend to be smarter than it is. Flight Bot seems to do a good job providing information about flights and airports. Bloovery helps you order flowers.

I actually liked the Qwazou bot most, because it allowed me to discover other bots, without needing more than a multiple-choice interface. I ended up wasting time playing a chatbot adventure game and finding out about a crappy implentation of a Zork chatbot

Some other chatbots I tried were just glorified search engines which could not understand anything more complex than search by terms. This included, for instance Techcrunch , and HealthTap. They were even doing a poor job at that, unable to return relevant results apart from the most basic queries.

That does not mean they can not be useful as that. Some people might prefer a chat interface rather than search in a website, however, that is not what I was expecting.

The Whole Foods bot, anyway, led me to a useful risotto recipe. Beerbot helped me find a beer I might like.

And there were also some bots that just did not work or told me to come back later - isn't high availability the main point of chatbots ?


Sunday 1 April 2018

Converting FAQs into chatbots

From FAQ to BOT



We read here that as companies are exploring the use chatbots for customer service, one of the first candidates of “content” that come to mind to “botify” are the existing FAQs 

Howevertools that promise to just absorb an FAQ section of a website and convert that into a conversational bot fail with simple real-world examples.

Why? 

  • Humans don't communicate in question-answer pairs - real world communication is messier than that.
  • A chatbot that just covers FAQ scan easily get frustrating.
  • FAQs on websites can make you log in and after that they can give your personalized answer If chatbots do the same, they produce friction and a break of medium.
  • Chatbots must be able to understand questions in more than one form, unlike FAQs on web sites
  • Websites are much more rich in content than chatbots
  • FAQS are an additional source of help, while users can throw everything at a chatbot, that must be able to hold a conversation

QnA Maker

There is already a tool that promises to turn your FAQs into bots : QnA Maker.
It is easy to get started, uploading one's FAQs and adding alternate wordings for the same questions.
It is not incredibly smart, to be honest.
This article describes the process in more depth - I will get back to it later.

Pesabot and Bottr offer a similar service.

Chatbots vs Intelligent Assistants

From Hype to Disillusionment


Like any other trend, the chatbot trend has been subjected to hype. In April 2016, Techcrunch had published an overly optimistic article about Facebook Messenger and the chatbot technology, which was about to make humans obsolete.

As of October 2017, it seems that we have already entered a phase of disillusionment.
In fact,

The problem is mainly due to the approach most companies took. They were focusing too much on the so-called intelligent assistant using AI technologies like Natural Language Processing to make chatbot understand every user request. However, the state of art of NLP is nowhere near to get enough accuracy which resulted in massive user deception.

Media Reaction


In fact, as this other article points out, Facebok chatbots often bombed and delivered disappointed experiences. It is instructive to see how quickly things can become hyped and then fail to deliver.


According to The Guardian:

Please, Facebook, don't make me speak to your awful chatbots

Unable to parse any instruction that doesn’t fit their (entirely undocumented) expectations, slow to respond when they are given the correct command, and ultimately useful only for tasks which are trivial to perform through the old apps or websites.



The Techcrunch's take :

Facebook's new chatbots still need work

Trying to use the bots for simple tasks — like finding out if it would rain or buying a black shirt — was frustrating, disappointing and ultimately far less efficient than simply visiting the company’s website itself. 


And for Gizmodo :

Facebook Chatbots are Frustrating and Useless

The problem is that most Messenger chatbots are dull conversationalists, so most of my chats sound unnatural, punctuated by moments of frustrating silence. I spent more time trying to guess what these little bots wanted to hear then actually talking to them.  

Brown ... highlights the almost never-ending complexity of getting robots to converse. “If people think that they’re talking to a person, they’re more likely to be casual or natural,” Brown says. “It makes the problem of receiving that information dramatically more difficult.”


Still, chatbots have not died. The ones that seem to deliver are those that are focused on a specific use case and are conscious about being bots, and not Intelligent Assistants - that's a different game