Categories
APIs Platforms Tools

Do-it-yourself NLP versus wit, LUIS, or api.ai

 

NPL_bot_

 

Alex and I have been building bots for about 1.5 years and have talked to hundreds of bot devs through our BotsBerlin meetup, which now has over 1,000 members. Something we get asked a lot is whether it’s worth investing in building your own NLP engine, or whether it makes sense to use a third party service like wit.ai, LUIS, or api.ai.

What does a chatbot’s NLP engine do?

Let’s say you’re building a restaurant bot. These tools will help you take a sentence typed by a human, and turn them into structured data, for example:

 

NLP Module chatbots

 

Do you build yours or use third-party tools? Let us know in our DE Survey.

The structure on the right is something computers can actually work with, and you can pass this on to the business logic of your bot. For example, you would probably query the Foursquare API and fetch a list of restaurants. If there are some popular restaurants matching those constraints, you would probably suggest those to your user. If not, you might suggest a Chinese restaurant instead.

NLP-api-chatbots

Foursquare has already done the hard work of finding matching restaurants, so the trickiest part of building this MVP is finding a way to generate structured data from natural language. The great thing about tools like wit, LUIS, and api.ai is that they make this part so easy that you can build an MVP like the above in an afternoon. In our experience, 3rd party tools are an excellent way to build quick prototypes. You could just as quickly build a bot to find videos with the YouTube API, or products from Product Hunt.

Reasons to do it yourself

If your restaurant bot is a runaway success, you will inevitably want to become independent. We see that the more advanced bot teams are all developing their own NLP. Data from the Developer Economics surveys, which polled the opinions of thousands of developers interested in chatbots, are pointing towards a democratisation of chatbots through open source projects (there’s a live survey out now if you want to contribute to this knowledge pool).
Here are three real-life examples of why people switch.

API constraints

databot was a Slack app we built at the start of 2016. Databot would connect your data warehouse to your Slack, so you could ask

what was the ROI like for October’s facebook ads?

and databot would generate the corresponding SQL query and answer your question.

We started off using wit.ai, which would always default to guessing that October referred to the following October, not the previous one. So we had a lot of fun with our date library to build a workaround. Of course wit could add a feature to let you customise this default, but that’s missing the more general point. If you use an API you are have to live with someone else’s engineering decisions, and that friction tends to grow as your project matures.

Data ownership

We talked to a startup building a commerce bot, specifically one which let you look for presents for friends and family and find good deals, e.g. “my sister likes running and craft coffee and I want to spend around $30”. For them, gathering the data around people’s purchasing intentions is core to the value of their business, and they want to make sure it belongs to them. Moreover, for privacy sensitive verticals like insurance, health, and banking, sending every message to a 3rd party is not an option, users and businesses just aren’t comfortable with it.

Performance

Admithub is an education startup. This team actually has one of the most technically advanced NLP modules I’ve seen, it can recognise thousands of intents. Their bot helps university students by updating them about events and deadlines, and can answer questions ranging from “when are housing applications due?” to “can I have a salamander in my dorm room”.

AdmitHub found very quickly that third party tools weren’t up to this task (they tend to optimise for the small data use case, performing well even when a developer is getting started and there are only a few examples). Most also failed to handle misspelled words, which are common when chatting with teenagers. While simple bots are generalizable, sophisticated bots are all complicated in their own way. Every algorithm has trade-offs, and a one-size-fits-all approach can let you down when your use case becomes more advanced.

Bonus: Control your own fate

Ultimately, technological independence is compelling for many teams. It’s great to use free tools developed by big tech companies, but they may not stay free (Microsoft have started charging for LUIS) and they may disappear with little notice (like Parse did).

The rise of do-it-yourself NLP

{wit,LUIS,api}.ai are wonderful tools that make prototyping very quick. But from talking to dozens of bot teams, I’m convinced that everyone will eventually become independent. Early indications from the state of AI survey are that virtually all businesses are uncomfortable relying on APIs for their AI, and that doesn’t surprise me given the examples I’ve just talked about. The engineering case is that web APIs just aren’t the solution to every problem in programming. The business case is that you really want to own your data and be independent.

In 2017 we will see the bots that have traction moving away from 3rd party NLP services. The biggest drawback, until now, has been the engineering investment and machine learning talent required to build a custom NLP engine. It makes no sense every bot team to reinvent the same things, so at LASTMILE we decided to open source ours. You can find out more at rasa.ai

 

Are you involved in ML and/or AI? Take the Developer Economics Survey and shape the future of ML/AI development.

Categories
Platforms

The Rise of the Chat Bots?

Developers struggling to get noticed on the app stores, or hoping to capitalise on the growth of enterprise messaging, are looking to a new way to reach their users – via a chat interface. The logic of reaching users where they spend the most time seems sound, and that is clearly in messaging apps. Does the typical consumer or business user really want to be taken back to the days of the command line interface though? Is this the next big market, or will it just be a trendy niche? [tweetable]Natural Language Processing (NLP) technology seems to be the key to mass market adoption[/tweetable]. Can that interface scale across thousands or millions of apps, or will it be dominated by a few key players and use cases?

the_rise_of_the_chat_bots

An old idea

[tweetable]Chat bots – apps that communicate via a textual, conversational interface are nothing new[/tweetable]. A convincing conversational computer program has been a goal of artificial intelligence research since Alan Turing proposed his famous test in 1950. As long as there have been chat-rooms, including the bulletin board systems that dominated the Internet before the invention and adoption of the web, there have been chat bots. Even commercial scale and conversational access to internet services are far from recent developments. The SmarterChild bot on AOL Instant Messenger and MSN Messenger (now Windows Live Messenger) had 10 million active users and processed 1 billion messages per day. It provided access to news, weather, sports, a personal assistant, calculator etc.

New scale & changing habits

Why the renewed excitement in chat bots? Two reasons – mobile messaging scale and enterprise messaging growth. Third party mobile messaging apps are rapidly heading towards 2 billion active users globally. These apps are typically the most used on any mobile device. Following the model of Asian messaging apps WeChat and LINE, the owners of other messaging apps want to turn them into platforms. At the same time, Slack is attempting to create a platform out of their enterprise messaging product. [tweetable]The impressive growth of Slack in the enterprise, where people are actually happy to pay for software[/tweetable], means a lot of entrepreneurs would like to ride their coattails to success. There are two separate markets here, with a common interface and some common technology.

Better technology for smarter chat bots

It’s the improvement in that common technology, particularly for NLP, that leads many people to think it might be different this time. Conversational interfaces might finally be able to deliver a great experience. However, there are some tradeoffs here for developers. One appealing aspect of a textual interface is that it can be much less effort to develop than a mobile app UI. Unfortunately NLP research has been disproportionately focused on English so far – the technology isn’t as good in other languages, so these interfaces automatically have a more limited audience. The more sophisticated the NLP, the more work involved in developing the interface. Using a 3rd party NLP service can significantly reduce this effort but also removes a key source of differentiation if your product is only a chat bot. Without NLP a bot is either focused on a very specific task or only for power users – mass market consumers aren’t going to want to memorise a lot of specific command syntax. At the other end of the NLP sophistication spectrum, is it going to be viable trying to compete with the likes of Google and Facebook as the best way to access mass market services?

Will Facebook own the consumer market?

Telegram’s bot platform might seem interesting as it reduces the need for NLP (and typing) with dynamic custom keyboards but their reach is a tiny fraction of the likes of Facebook Messenger or WhatsApp. Unfortunately [tweetable]Facebook doesn’t have a good record as a developer platform provider[/tweetable], which they managed to prove again recently, if such a reminder were needed, by announcing they’re shutting down Parse after promising developers their backends were in safe hands. Indeed chat bots on the big consumer messaging platforms may have some success at first but it’s likely to be the platform owners that take the lion’s share of the revenue in the end. These platforms will probably be great for businesses to reduce marketing and customer support costs with chat bots and they’ll be paying Facebook (and possibly others) for the privilege of talking to their customers in this way. There are probably also good opportunities for smaller developers to help companies build these bots.

An opportunity to differentiate enterprise services

The enterprise opportunity is different. As a growing number of companies reduce their email usage and build workflows around chat in apps like Slack and HipChat, the most natural way to access some premium services will be through chat (at least for some use cases). For example, when discussing past sales, or future sales projections, it would be much more natural to ask an accounting, or forecasting SaaS tool to give you a chart for the relevant period than to switch away to another application to look that up. However, as with most of the obvious examples you could imagine, it’s unlikely that these services would operate entirely through a chat interface. It doesn’t make much sense to enter all of your accounting data via chat or build your sales forecasting model that way. As such, chat bots become just one of many interfaces to a cloud service. There are opportunities for new services to get discovered, or existing services to gain market share, by being early to support chat interfaces but 100% chat-based is unlikely to be a giant new market.

Evolution not revolution

In most cases, consumer or enterprise, conversational interfaces are just another channel. Much like mobile apps are just another channel for many services. They can be a channel that increases convenience or reduces friction for some key use cases. This also follows mobile but their increased convenience and usability lead to a massive increase in total use. The change messaging platforms will bring is nowhere near the same scale as the shift to mobile. The things that were really interesting on mobile were the ones that couldn’t be done, or were too inconvenient to bother with on desktop platforms. What new possibilities do conversational interfaces bring on mobile platforms? What mass market use cases haven’t already been tried (and widely under-used) by Apple with Siri? The most interesting areas are probably those that involve some element of discovery – when you don’t know which app to go to – or embrace the asynchronous nature of messaging. That said, how do you discover a new chat bot to help if you don’t know what you’re looking for? What business models would work for a purely conversational interface? The chat bots may be on the rise, but it’s likely this is more of an evolutionary step than a revolutionary one.