Building chat robot with machine learning (2) concept

Time:2020-1-17

This is the second part of a series of chat robots built by machine learning, which helps us understand the related concepts of chat robots.

What is a chat robot?

Chat robot is a program, which will respond to human’s words. Its carrier can be a web page, a desktop application and an app.
People use words or voice to communicate with them, and they also use words or voice to feed back to people.
If you put a speaker appearance on such a program, it’s a smart speaker; an animal appearance, it’s a machine pet; a high simulation girl appearance, it’s a robot partner ~. It can chat with you 24 hours a day, and it’s willing to listen to what you want to say and say what you want to hear.

What are the common ways of chat robots?

Based on hard coding:

A set of rule logic is pre-set. When a keyword is encountered, one of a group of replies is randomly selected for reply. For example, there is an idea on the Internet:
Building chat robot with machine learning (2) concept
It has the advantages of simple implementation, quite a sense of four or two thousand kilograms, and the disadvantage is that it is easy to overturn, such as the following situations:
Building chat robot with machine learning (2) concept

Based on template:

How about pre setting a series of question templates, such as XXX? When is XXX on? After matching to the template, extract XXX to the knowledge map to find out the answer. The advantage of this method is that only one kind of template needs to be prepared for the same query, such as “how about XXX? When is XXX on XXX in can match the name of any movie. The disadvantage is to implement a corresponding query logic for each query.

One question one answer:

Pre set a series of question and answer pairs, find the corresponding intention classification directly according to the user’s questions, such as whether to ask in the field of film or in the field of computer, then match a series of questions in the current field through the semantic understanding algorithm according to the questions, and return the answers to the questions with the highest score. The advantage of this method is controllable and accurate reply, and the disadvantage is that it needs a lot of questions and answers.

Based on build:

Without any preset question template or question answer pairs, the corresponding answers are automatically generated from the questions according to the pre trained sequence model. This method does not need to prepare the corpus in advance, but the syntax of the generated sentences is often wrong and uncontrollable (sometimes unexpected words, such as uncivilized, anti-human or politically sensitive words).

In this series, we will build a chat robot based on the third method, that is, “one question one answer”.

The next article “building a chat robot with machine learning (3) design” will introduce our idea of building a chat robot.

OK, that’s all for this article. Thank you for reading o.

This blog content comes from the public number “programmers one by one”. Welcome to scan code to pay attention to o (o).

Building chat robot with machine learning (2) concept

Recommended Today

Vs code usage

Common shortcut keys: Shift + Alt + F on Windows format code Shift + option + F on MAC format code Shift + Alt + a block comment Common plug-ins: [plug in installation method] Markdown Preview Enhanced Preview markdown in real time, which is necessary for users Path Intellisense Automatically prompt file path, support various […]