Yesterday’s big news in the world of chatbots was Google acquiring Api.ai, a company which allows developers to integrate natural language processing and understanding into their applications. Think of it like talking to someone, but instead, that someone is now your phone, and it actually understands what you’re saying. Services like Api.ai and Wit.ai are capable of processing human speech patterns and filtering useful data like intent and context from it.

Now that Api.ai is owned by Google, the battle between Api.ai and Wit.ai will probably intensify, as Wit.ai has been Facebook’s property since January 5th of last year. In this article, I will describe the outcome of an independent test I ran last week, without any knowledge of the acquirement of Api.ai by Google. It should provide a semi-realistic scenario for the bots and their capabilities at the moment.

The test itself is pretty simple because it only focussed on intent, not on the context of the conversation. Both platforms are also capable of recognizing context but that was not necessary for our project, for which I initially ran this test. The basic idea is this:

I have 4 phrases which could be said within the same conversation

Every phrase has 3 variations, which should be recognized as the base phrase

The bot will learn the base phrase first, then we start testing that set

If it recognizes the base phrase, no points, if it doesn’t, points will be subtracted

If the bot recognizes a variation correctly, it earns an extra point

A phrase variation will be learned after testing it, for better recognition results

Next to intent recognition, there is another important feature of both services, which is entity recognition. This allows us to define a set of words or patterns, which, from then on, are known as a named entity. In this test, I made (or reused) 3 types of entities: pizza_size, pizza_type, and address. With both services, the address entity was predefined so I didn’t have to think of every possible way to define a location or address. This is how I defined pizza_size and pizza_type

The purpose of these entities is to provide additional data, next to our intent. Imagine you want to order a pizza from a bot, you can simply walk through every step in the process, but giving a compound answer would be way faster. Something like “I’d like a large barbecue chicken pizza” not only gives us your intent, but also the size and type, making a separate step no longer necessary.

But now, no more delays! On to the actual test, or actually, the test results. Both interfaces were sufficiently understandable and both services provided enough tutorials to get every test up and running within about 10 minutes of registering an account, so I won’t get into that here. You can read the table as follows:

Base phrases are shown in bold and are the first of their set

Base phrases can only earn 0 or -1 point, -1 meaning it was not correctly recognized although I learned it that exact phrase

Phrase variations in the same set are shown between the bolder lines, underneath the emphasized base phrases

Phrase variations can earn 0 or 1 point, 0 points meaning it did not recognize the variation as the base phrase, 1 point meaning the variation was recognized with the same intent or entities as the base phrase

As you can see, pointwise, they are pretty close, but both have their respective pros and cons, which are mostly down to their base functionality and accuracy of their provided entity models. If you were to ask me, right here, right now, which of the two is my favorite, I would say Wit.ai. It has a bit of a learning curve to it but other than that, it’s great, especially for the integration with Messenger, which is our target platform. This, of course, is no surprise as Wit.ai was bought by Facebook for over a year and a half ago. Out of the box, the support for compound answers is way better than Api.ai and they have a good system of building conversational bots, for which you can even write plugin code.

We chose Wit.ai for our project but your project may be very different. I encourage you to setup a test like this one for your specific purpose and come to your own conclusion. Both of them will probably undergo significant improvements to try and get the larger market share as both are owned by big tech companies and now that chatbots are on such a rise to power.

Cheers!