The translator | VFT if Chile
Edit | Natalie
AI Front Line introduction:This article gives an overview of the development and application trend of chatbot, and provides comprehensive suggestions and ideas for developers who want to start such development from the aspects of development framework, platform and back-end AI services.






Please pay attention to the wechat official account “AI Front”, (ID: AI-front)
Chatbots: How are they doing?

Ai is on the rise! While machines are unlikely to rebel against their creators, humans, in the distant future, the use of machine-based prediction and decision making is becoming more common in information technology as a fast-moving trend. The hype around AI is everywhere: driverless cars, intelligent image processing (Prisma, for example) and all sorts of novel applications in communications, such as conversational AI, or chatbots.

The chatbot industry is expanding rapidly, but the technology is still young. While the use of conversational robots is still somewhat illusory, somewhat akin to the old-school word game “I Smell a Wumpus,” the technology has evolved into an important business tool. Chatbots offer a new, simpler and more user-friendly interface that is ideal for browsing messages and receiving services. IT experts, as well as industry giants including Google, Microsoft and Facebook, believe the technology will play an important role in the future.

To realize the great potential of conversational AI tools (or “chatbots,” if you want to call them too long), we must first master some basic information and understand the technology stack. This paper will discuss the various technologies that can be used for related development, the similarities and differences between them, and the pros and cons of each.

But before we go any further, let’s take a closer look at chatbots and their technical topologies.

Why, how, and when to use a chatbot?

There are already a variety of chatbots for different business tasks, ranging from advertising to team-building, but they generally share some core functions.

Personal assistant robot

Business matters often require professional organizational help, but not everyone has the budget to hire a secretary to handle basic tasks. The good news is that chatbots can help. Properly programmed, they can track our schedules and alert us to upcoming activities. Such robots are more practical because they are very simple based on function and can use a variety of very fast communication platforms, such as messaging systems as their interfaces.

Customer support robot

Chatbots could also perform more complex tasks, such as making connections with real customers on behalf of a business. Even for human employees, customer support workflows are largely predictable and scripted, making them easy to implement in a robotic manner. At this point, typical robot behavior algorithms can be used to accept user queries, analyze and obtain relevant information, find similar cases in the database, and then respond with preset answers.

Teamwork robot

Bots to support teams of developers are extremely popular right now for a number of reasons. Such robots can be seamlessly integrated into the development environment to keep an eye on and examine the different needs of software engineers with regard to goals such as software quality. However, such robots can only solve very specific tasks, so there is no need for extremely complex commercial robots in this case. These bots typically feature some kind of very simple “scorer,” but also include sentient chatbots that provide the necessary support for development servers and create reports for submission of information and simple work schedules.

Publisher/news bot

Publisher-type robots can constantly collect information of interest on a daily basis. Many large news organizations (WSJ, NYT) and tech media (TechCrunch, MIT Technology Review) share content via key platforms such as Facebook Messenger in the convenient form of brief text messages. The idea behind the bot is simple: it collects subscription information from users, arranges the delivery of relevant news, and then handles other requests related to the user (such as unsubscribe, change the topic you subscribe to, browse around, etc.).

Entertainment robot

Entertainment robots are currently less common and have specific uses: for example, managing event/movie/theater ticket bookings through a conversational style workflow. Some bots can also provide a fully immersive experience for entertainment sites via text messages. The Fandango Facebook Bot, for example, lets users watch trailers for new movies, read reviews and find nearby theaters. Great!!!!

Travel robot

There’s another type of robot that’s very popular and growing rapidly: travel assistance robots. By using the customer-facing chatbot, users can take onerous tasks, such as choosing the best way to travel, and turn what would otherwise be a tedious process into a casual conversation within a chat app. Travel robots can not only obtain and confirm booking information, but also notify users of important times, such as ticketing, boarding, flight status changes, and collect all kinds of valuable feedback from customers.

Chatbots are the new User interface: The latest vision for robotics

In any case, chatbots are just programs, but designed to communicate with human users using text (chat platforms) in the traditional way of conversation. It waits for the user to say something and then responds as programmed. So chatbots today are essentially simple algorithms: they accept and understand input, and provide relevant responses as output.

Chatbots are far more complex than this, however, because they can control the power of contextual situations, which can be local (for example, applicable to only one conversation) or global (for example, can persist over many conversations and cover areas outside the linguistic context. For example, the robot that orders pizza can process the user’s latest order, location, time zone, etc.). While the former can often be implemented using temporary memory such as cookies or sessions, the latter requires storing information in a database or accessing other internal services via an API.

After introducing the concept of context, a brief mention of Web application-related terms (cookies, sessions, databases, for example) is needed to form a complete chatbot. Chatbots need to share a lot of information with Web apps, which are responsible for hosting Web pages that are viewed online (they also need to receive and respond to requests, so they share standard tools like databases). So chatbots are strictly a Web application.

So chatbots are actually a new type of interface for all kinds of information and services. This interface is compact, easily accessible, and very simple. This allows you to expand your service from your home (your website) to a variety of platforms that you can access at any time without advertising or marketing to users (previously, users would see an AD in a chat message, click on a link to go to the AD page, and order the product; Now the mechanism is: the user sees an AD in the chat message and orders the product directly through the conversation).

How do chatbots understand tasks?

The internals of chatbots may seem simple, but they’re actually not that easy to implement.

The robot must first understand what the user is saying. There are many ways to do this: pattern matching of user input, or classifying user intentions using natural language processing (NLP) techniques. The former is very simple and intuitive, but as the scope and scale of input increases, the maintenance difficulty increases significantly. The latter can be interpreted using machine learning techniques, but it is more difficult to implement (at least without using platforms where the technology is already applied). A series of samples must be prepared in order to classify the various possible intentions and to determine the actual purpose of a particular input from the various possibilities.

Fortunately, there are many platforms that already implement this logic, so we don’t have to worry about these issues and can just use the services they provide. However, we still need to familiarize ourselves with the main NLP classifications and their nature:

  • Entity refers to a special mapping relationship between the combination of words contained in natural language and the implied intention represented by standardized parsing in human conversation (oral or written). This is somewhat similar to the extracted variable, for example DateTime if specified as “Christmas” might mean “December 25, 2017”.

  • Intents, as distinct from entities, are a general feature that maps a user’s message to a related robot action (predictive workflow). For example, the sentence “what’s the weather like today?” can be mapped directly to the “weather_inquery” intent as per the full text, but not to anything else.

  • An Action is a step that the robot can perform and respond to as a result of the relevant intent. Often this may be a traditional function, with optional arguments to obtain more detailed information from the caller (context context).

Depending on the platform, the context can vary, and there are no strict rules in terms of form or topology. But context is mostly in the form of key/value maps that keep track of the latest meaning of entities and distinguish between the meaning/intent contained in different phrases.

Different types of robots: open/closed domain, generation-based/retrievation-based

Having said that chatbots are actually made up of some type of Web interface, it’s also important to note that this is actually an ARTIFICIAL intelligence application, so a taxonomic approach naturally comes into play.

Now that we’ve introduced the methods robots use to understand language, let’s take a look at the topologies of various robots, regardless of their specific types and responses.

First of all, can according to the operating range (is strictly limited to a closed domain, such as weather or pizza robot, robot or for various types of general dialogue), and in response to user input to the calculation (will retrieve predefined response content directly, or according to the result of input information to generate the corresponding response). Categorize conversational AI into different types.

Either way, it is important to make a strict distinction between static and dynamic responses when it comes to retrieving-style responses. The former is the simplest, somewhat akin to applying a ready-made template directly, with an answer for every piece of information entered. The latter is more like a knowledge base, returning a range of possible responses based on relevance scores.

For a chatbot that fits into a closed domain, it only needs to communicate around a limited number of issues, such as booking a hotel/restaurant/flight, buying a pizza, buying shoes, etc. Obviously, the input is also limited, and a robot tasked with ordering enough pizza doesn’t need to think about the political, psychological, or philosophical issues a user might have to address.

Open-world robots focus on conversations with the user themselves, but don’t need to fully understand every word the user says, retrieve entities and intentions, or track context. The robots only try to simulate real life conversations, and their main purpose is to entertain users or answer general questions like FAQs.

How to build a chatbot?

Now that you know the basics, you can start thinking about building one. But before you start, you need to decide which platform or tool you want to use.

If you want to get up and running quickly, but aren’t ready to write your own code, it’s recommended to start with a chatbot generator that doesn’t require programming. These apps are aimed at non-technical users and are very easy to use. There is no need to worry too much about the technical details, just some purely conceptual work (though there is still a learning curve). This approach is best suited for building simple robots, but not for complex commercial applications, where the biggest drawback is the lack, or total absence, of natural language processing, which is required for complex robots. There are many similar platforms, such as Chatfuel, ManyChat, Octane AI, Massively AI.

If you want to do more complex development, you need to use robot frameworks and AI services.

The framework contains abstractions of various common functions within the chatbot workflow, often packaged for ease of use. Chatbot frameworks are similar to other software frameworks, such as Web application frameworks, in that they give us all the tools we need. Often such frameworks are implemented for a particular programming language. In addition, some robot frameworks provide a hosted and even interactive development environment to further simplify the robot creation process.

AI services, another standalone cloud platform, typically provide guIs needed to create chatbot logic in an interactive manner, with machine-learning-driven natural language processing capabilities, and communicate through RESTful apis.

Another relatively novel approach is to integrate chatbots and interactive voice response (IVR) systems directly into a Web services build tool or framework. One of the most recent achievements in this area, for example, is the Customer Experience Platform (CXP) solution developed by Aspect, which can be used to build Web services. This allows us to easily create data-powered websites and deliver them to users through a text – and voice-based robot interface. Details on this approach can be found here.

Main robot frameworks: Botkit, Microsoft Bot Framework, Rasa NLU

As mentioned above, a framework is really a library for a specific programming language. The three main frameworks will be described below: Botkit for Node.js, suitable for. NET (also works with Node.js, but the rest of this article will focus on. NET, especially C#) Microsoft Bot Framework and Bot Builder SDK, and Rasa NLU for Python.

Botkit

Let’s start with Botkit. The framework is designed to help busy users quickly and easily build robots tailored to their needs without getting too deep into specific technical details. The framework sends and receives messages through a unified interface. The framework was originally intended primarily for Slack, but has been extended to support connectivity to multiple messaging platforms. The framework provides intuitive workflows, is organized in a concise manner, is well documented, and provides plenty of examples of online chatbots that users can quickly get started and further develop their bots.

Note, however, that the framework does not include natural language processing capabilities, but it can be implemented through middleware that connects to existing or homegrown services.

The framework library contains a number of core functions and connectors that support a variety of platforms. Core functions are implemented in the form of event listeners, such as.on_message_receive and.hears. The implementation of the connector depends on the platform to which it is connected.

Botkit is very simple to use. First you need to install Botkit, which can be done with an NPM installation: NPM install -save Botkit. Then create a file contains code (see here [https://github.com/howdyai/botkit/blob/master/console_bot.js] to see the most basic console robot sample), and use the node. Js operation: The node my_bot. Js.

Microsoft Bot Framework

Microsoft is keen to keep up with technological trends and has given us a whole new way to develop chatbots. The Microsoft Bot Framework is extremely versatile and provides an easy-to-use build SDK that contains two main components: The Bot Connector SDK itself is the framework for the integration, along with the most basic robot logic and LUIS. Ai, which is mainly used for natural language processing to make the robot feel more human.

While LUIS. Ai is more of a feature than a component, the framework itself can be used directly without the help of this feature, and can be quite impressive on its own. This suite of tools is robust and offers nearly unlimited potential for integration (e.g., with Messenger, Skype, etc.). The development environment and simple test for interactive development provides the necessary tools, users can also develop their own robot published review and accept the Microsoft, if approved can also be incorporated into the Bot Directory (https://bots.botframework.com/), and is used by more people.

Rasa NLU

While not a framework specifically tailored for chatbot construction, Rasa NLU is a convenient back-end solution. Botkit and Microsoft Bot connect to a variety of messaging platforms, while Rasa NLU is more like a natural language processing service that provides processing capabilities in the user’s local environment. In addition, Rasa provides a Python interface to integrate entity extractors directly into applications developed in Python. The technology can also run as a service in other frameworks and expose REST API endpoints.

See the table below for the pros and cons of each of these tools.

Outstanding AI services:
Wit. Ai, Api. ai, LUIS. Ai, IBM Watson

As mentioned above, AI services are a cloud-based solution for natural language processing needs to develop intelligent robots and predict complex streaming conversations. This service provides the UI needed for the construction and training of predictive models, using machine learning techniques to understand the entities contained in the language.

Take a look at some of the biggest names in the field.

Wit.ai

The Wit. Ai platform allows developers to easily build applications that can communicate by voice or text, according to the website. The technology was recently acquired by Facebook and incorporated into Facebook’s Bot API.

Wit. Ai helps users easily construct robot behavior without considering internal logic, and enables registrable robot operations in multiple languages.

In Wit. Ai, the key concept used to define behavior is called “story”. For example, these stories represent the basic skeleton of any possible dialogue. A “story” can contain a set of related intents, and intents themselves are user-defined entities that contain various features that are not used to define the entire process.

It is good practice to then train machine learning models for natural language processing from samples. Just tell Wit. Ai what input it needs to accept, and when the user sends a similar request, it can respond accordingly.

Wit. Ai provides a powerful mechanism for understanding language entities. Another nice feature of the platform is the ability to assign roles to entities, which further facilitates server-side processing.

To interact with the server side, Wit. Ai also implements the “Bot sends” command and allows for custom robot actions, such as API calls, through integration with Webhook.

Api.ai

Api.ai is another platform that can help us build robots that support natural language processing.

Unlike Wit. Ai, which relies heavily on intentions for prediction, API.ai consists of two important concepts: intentions and context contexts (Wit. Ai also has context contexts, but for different purposes). Intent acts as a bridge linking user requests to corresponding actions. “Context situations,” in the form of string values, can be used to distinguish between requests and intentions with subtle variations.

The basic workflow of APi.ai is also different from Wit. Ai. When api.ai receives a user request, it first matches it with an intent (if no matching intent is found, the default intent is used) and then invokes the appropriate action. The matching process of intents can be limited by a list of context situations to ensure that there is always a matching intent (matching can produce or remove context situations), creating a workflow similar to an application with different states.

Similar to Wit. Ai, api.ai can also extract intent. More importantly, the platform comes with an implementation of a slot-filling system (a method for extracting entities from user-supplied information by requesting information from the user, associating it with acquired entities and continuing to ask the user for missing entities).

Server-side logic also includes Webhooks, while apI.ai is basically calling various services and getting responses. It is important to note here that server-side code can modify the context and therefore affect the results of the prediction flow.

Microsoft Language Understanding Intelligent Service

LUIS is something of a newcomer to the AI services space, announced by Microsoft at the 2016 Microsoft Build conference.

Similar to its competitors, LUIS offers an entity recognition and training system that can distinguish the meaning of segmentation with hierarchical entities (somewhat similar to the “roles” in Wit. Ai).

LUIS needs to predict the actions to be performed by intents and uses the same logic as api.ai.

The training process is also done through the UI, so the user can be trained in a flexible way. The user request log can further train the model by helping users easily interpret and correct the interpretation.

LUIS also has the ability to perform operations, gathering the desired intents and contexts to perform a series of chain operations. The platform is currently in beta and can only be used for simple testing. Another beta feature of the platform is a specially designed conversation support that helps us sort through requests and group questions to provide a simpler conversation for users via bots.

IBM Watson

IBM Watson is a cognitive cloud service that enables a variety of functions including natural language processing, speech recognition, emotion analysis and conversation. Some may remember (or have forgotten) that IBM Watson, as a cognitive supercomputer system, beat humans at Jeopardy. Ever wonder if there’s any relationship between them? Yes, there was. IBM took the power of that supercomputer and brought it to the cloud, creating a huge platform that could help us do all sorts of things.

The downside of the platform, however, is that it offers so many features that users can be confused and spend a lot of time deciding which features to use. Even if the features are identified, it can take a lot of resources to get started.

The service is also very expensive (about 2 cents per API call), so it may not be suitable for beginners. But IBM Watson is still a good solution for enterprise environments with broad and well-defined use cases.

Some important information about these tools is summarized in the following table:

conclusion

Chatbots are rising fast and still improving, becoming closer to the end user and integrating with more existing technologies. Understanding their nature, functions, and how they work can help us develop more effective robots that improve product marketing, advertising, and the overall consumer experience.

Chatbots can now be built on multiple platforms, which is both exciting and daunting, but each platform is designed for a different use case and includes a different role in the bot development process. With further advances in deep learning, we can also expect conversational AI to take advantage of this technology in an unwilling future, taking even greater steps towards the ultimate goal of passing the Turing Test.

Read the original text in English:

A Comparative Analysis of ChatBots APIs

https://medium.com/activewizards-machine-learning-company/a-comparative-analysis-of-chatbots-apis-f9d240263e1d