Movatterモバイル変換


[0]ホーム

URL:


CN105930367A - Intelligent chatting robot control method and control device - Google Patents

Intelligent chatting robot control method and control device
Download PDF

Info

Publication number
CN105930367A
CN105930367ACN201610226768.XACN201610226768ACN105930367ACN 105930367 ACN105930367 ACN 105930367ACN 201610226768 ACN201610226768 ACN 201610226768ACN 105930367 ACN105930367 ACN 105930367A
Authority
CN
China
Prior art keywords
sentence
chat
user
users
reply
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610226768.XA
Other languages
Chinese (zh)
Other versions
CN105930367B (en
Inventor
朱定局
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
South China Normal University
Original Assignee
South China Normal University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by South China Normal UniversityfiledCriticalSouth China Normal University
Priority to CN201610226768.XApriorityCriticalpatent/CN105930367B/en
Publication of CN105930367ApublicationCriticalpatent/CN105930367A/en
Application grantedgrantedCritical
Publication of CN105930367BpublicationCriticalpatent/CN105930367B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

一种基于智能聊天机器人控制方法及控制装置,该方法包括以下步骤:获取第一用户的用户输入语句,将用户输入语句与聊天数据库中的语句进行匹配,获取聊天数据库中的匹配度最大,且最大匹配度大于预设值的第一聊天语句;若第一聊天语句存在下一聊天语句,则将下一聊天语句作为机器人输出语句反馈给第一用户;若第一聊天语句不存在下一聊天语句,则将第一用户的用户输入语句作为新话题的机器人输出语句发送到N个第二用户,接收N个第二用户返回的回复语句,将回复语句作为给第一用户的机器人输出语句反馈给第一用户。本发明还提供相应的智能聊天机器人控制装置。本发明使聊天机器人具备人工智能,提高图灵测试通过率。

A control method and control device based on an intelligent chat robot, the method comprising the following steps: acquiring a user input sentence of a first user, matching the user input sentence with a sentence in a chat database, obtaining the maximum matching degree in the chat database, and The first chat sentence whose maximum matching degree is greater than the preset value; if there is a next chat sentence in the first chat sentence, then the next chat sentence is fed back to the first user as a robot output sentence; if the first chat sentence does not exist, the next chat sentence sentence, send the user input sentence of the first user as the robot output sentence of the new topic to N second users, receive the reply sentences returned by the N second users, and use the reply sentence as the robot output sentence feedback to the first user to the first user. The invention also provides a corresponding intelligent chat robot control device. The invention enables the chat robot to have artificial intelligence and improves the passing rate of the Turing test.

Description

Translated fromChinese
智能聊天机器人控制方法及控制装置Intelligent chat robot control method and control device

技术领域technical field

本发明涉及聊天机器人技术领域,特别是涉及一种智能聊天机器人控制方法及控制装置。The invention relates to the technical field of chat robots, in particular to a control method and a control device for an intelligent chat robot.

背景技术Background technique

聊天机器人是人工智能的最重要内容之一。随着机器人技术的快速发展,用户对聊天机器人的功能要求也越来越高。如果用户与聊天机器人聊天时,分不清聊天的对象是人还是聊天机器人,则聊天机器人能通过图灵测试,说明该聊天机器人具备了人工智能。Chatbots are one of the most important things in artificial intelligence. With the rapid development of robot technology, users have higher and higher functional requirements for chatbots. If the user cannot tell whether the chatting object is a human or a chat robot when chatting with the chat robot, then the chat robot can pass the Turing test, indicating that the chat robot has artificial intelligence.

如图1所示,传统聊天机器人都是基于聊天数据库构建的,聊天数据库中的数据表一般包含两个基本字段,第一个字段是特征字符或词句,第二个字段是自动回复的内容。聊天数据库中的内容需要人工增添或导入预先人工制作好的回复文本。人工制作聊天数据库的成本非常高,而且无法罗列所有可能的自动回复的内容,因此导致了现有聊天机器人只能对用户的一些常用用户输入语句进行有效的自动回复,而如果用户的其他用户输入语句在聊天数据库不存在相应特征字符或词句时,聊天机器人则不知道如何回答,而只能进行无效的自动回答,譬如回答“哦”等,如图2所示。并且,因为聊天数据库是人工构建的,并不是人们自然聊天中产生下一聊天语句,所以有时只是构建者自己构造出来的下一聊天语句,与人们真实的聊天中产生的下一聊天语句有一定的差距,以这样的人工构造出来的下一聊天语句,很难通过图灵测试。As shown in Figure 1, traditional chatbots are built on the basis of chat databases. Data tables in chat databases generally contain two basic fields. The first field is characteristic characters or words, and the second field is the content of automatic replies. The content in the chat database needs to be manually added or imported into pre-manufactured reply texts. The cost of manually creating a chat database is very high, and it is impossible to list all possible automatic reply content, so the existing chat robot can only provide effective automatic reply to some common user input sentences of the user, and if the user other user input When the sentence does not have corresponding characteristic characters or words in the chat database, the chat robot does not know how to answer, but can only make invalid automatic answers, such as answering "Oh", etc., as shown in Figure 2. And, because the chat database is artificially built, it is not the next chat sentence generated in people's natural chat, so sometimes it is only the next chat sentence constructed by the builder himself, which has a certain difference with the next chat sentence generated in people's real chat. gap, it is difficult to pass the Turing test with such artificially constructed next chat statement.

综上所述,由于受完全聊天数据库的局限性限制,传统聊天机器人存在图灵测试通过率低的技术问题。To sum up, due to the limitations of the complete chat database, traditional chatbots have the technical problem of low Turing test pass rate.

发明内容Contents of the invention

基于此,有必要针对传统聊天机器人存在的图灵测试通过率低的技术问题,提供一种智能聊天机器人控制方法及控制装置。Based on this, it is necessary to provide an intelligent chat robot control method and control device for the technical problem of low Turing test passing rate in traditional chat robots.

根据本发明的一个方面,提供一种智能聊天机器人控制方法,包括以下步骤:According to one aspect of the present invention, a method for controlling an intelligent chat robot is provided, comprising the following steps:

获取第一用户的用户输入语句,将所述用户输入语句与聊天数据库中的语句进行匹配,获取所述聊天数据库中的匹配度最大,且最大匹配度大于预设值的第一聊天语句;Obtain the user input sentence of the first user, match the user input sentence with the sentence in the chat database, and obtain the first chat sentence with the largest matching degree in the chat database, and the maximum matching degree is greater than a preset value;

若所述第一聊天语句存在下一聊天语句,则将所述下一聊天语句作为机器人输出语句反馈给所述第一用户;If there is a next chat sentence in the first chat sentence, the next chat sentence is fed back to the first user as a robot output sentence;

若所述第一聊天语句不存在下一聊天语句,则将所述第一用户的用户输入语句作为新话题的机器人输出语句发送到N个第二用户,接收所述N个第二用户返回的回复语句,将所述回复语句作为给第一用户的机器人输出语句反馈给第一用户。If there is no next chat sentence in the first chat sentence, then the user input sentence of the first user is sent to N second users as the robot output sentence of the new topic, and the return of the N second users is received A reply sentence, which is used as a robot output sentence for the first user to feed back the reply sentence to the first user.

在其中一个实施例中,所述将所述第一用户的用户输入语句作为新话题的机器人输出语句发送到N个第二用户,接收所述N个第二用户返回的回复语句,将所述回复语句作为机器人输出语句反馈给第一用户的步骤,包括:In one of the embodiments, the user input sentence of the first user is sent as a robot output sentence of a new topic to N second users, and the reply sentences returned by the N second users are received, and the The step of feeding back the sentence as the robot output sentence to the first user includes:

将所述第一用户的用户输入语句作为新话题的机器人输出语句发送到N个第二用户,接收所述N个第二用户中最先返回的回复语句,将所述最先返回的回复语句作为机器人输出语句反馈给第一用户。Send the user input sentence of the first user as the robot output sentence of the new topic to N second users, receive the reply sentence returned first among the N second users, and send the reply sentence returned first Feedback to the first user as a robot output sentence.

在其中一个实施例中,在所述将所述第一用户的用户输入语句作为新话题的机器人输出语句发送到N个第二用户,接收所述N个第二用户中最先返回的回复语句,将所述最先返回的回复语句作为机器人输出语句反馈给第一用户的步骤之后还包括以下步骤:In one of the embodiments, after the robot output sentence of the first user's user input sentence as a new topic is sent to N second users, the reply sentence returned first among the N second users is received After the step of feeding back the first returned reply sentence as a robot output sentence to the first user, the following steps are also included:

将所述第一用户的用户输入语句和最先返回的回复语句做为连续的两个聊天语句存储到聊天数据库中。The user input sentence of the first user and the first returned reply sentence are stored in the chat database as two consecutive chat sentences.

在其中一个实施例中,所述方法还包括:In one embodiment, the method also includes:

若在预设时间内未收到所述第二用户的回复语句,则重新选取N个第三用户,将所述第一用户的用户输入语句作为新话题的机器人输出语句发送到所述第三用户,接收所述第三用户返回的回复语句,将所述回复语句作为机器人输出语句反馈给第一用户。If no reply sentence from the second user is received within the preset time, N third users are reselected, and the user input sentence of the first user is sent to the third user as a robot output sentence of a new topic. The user receives the reply sentence returned by the third user, and feeds back the reply sentence as a robot output sentence to the first user.

在其中一个实施例中,所述若所述第一聊天语句不存在下一聊天语句,则将所述第一用户的用户输入语句作为新话题的机器人输出语句发送到N个第二用户,接收所述N个第二用户返回的回复语句,将所述回复语句作为给第一用户的机器人输出语句反馈给第一用户的步骤中,所述第二用户为当前没有加入聊天的用户,其中,N的取值为当前没有加入聊天的用户数目与当前正在参与聊天的用户数目的比值。In one of the embodiments, if there is no next chat sentence in the first chat sentence, the user input sentence of the first user is sent to N second users as a robot output sentence of a new topic, and the received In the step of feeding back the reply sentence returned by the N second users as a robot output sentence for the first user to the first user, the second user is a user who does not currently join the chat, wherein, The value of N is the ratio of the number of users currently not joining the chat to the number of users currently participating in the chat.

根据本发明的另一个方面,还提供一种智能聊天机器人控制装置,包括:According to another aspect of the present invention, there is also provided an intelligent chat robot control device, comprising:

聊天数据库,用于存储经验聊天语句,所述经验聊天语句包括第一聊天语句和第一聊天语句的下一个聊天语句;Chat database, for storing experience chat sentences, described experience chat sentences include the first chat sentence and the next chat sentence of the first chat sentence;

检索匹配模块,分别与聊天数据库和选取模块连接,用于获取第一用户的用户输入语句,将所述用户输入语句与聊天数据库中的语句进行匹配,获取所述聊天数据库中的匹配度最大且匹配度大于预设值的第一聊天语句;若所述第一聊天语句存在下一聊天语句,则将所述下一聊天语句作为机器人输出语句反馈给所述第一用户;若所述第一聊天语句不存在下一聊天语句,则发送选取指令至选取模块;The search matching module is connected with the chat database and the selection module respectively, and is used to obtain the user input sentence of the first user, and matches the user input sentence with the sentence in the chat database to obtain the maximum matching degree and The first chat sentence whose matching degree is greater than the preset value; if there is a next chat sentence in the first chat sentence, the next chat sentence will be fed back to the first user as a robot output sentence; if the first chat sentence If there is no next chat sentence in the chat sentence, then send the selection instruction to the selection module;

选取模块,与所述检索匹配模块连接,用于接收选取指令,接收到选取指令后选取N个第二用户;A selection module, connected to the retrieval and matching module, is used to receive a selection instruction, and select N second users after receiving the selection instruction;

学习模块,与所述选取模块连接,用于将所述第一聊天语句作为新话题的机器人输出语句发送到N个第二用户;以及,A learning module, connected with the selection module, is used to send the first chat sentence as a robot output sentence of a new topic to N second users; and,

练习模块,用于接收所述N个第二用户返回的回复语句,将所述回复语句作为给第一用户的机器人输出语句反馈给第一用户。The exercise module is configured to receive the reply sentences returned by the N second users, and feed back the reply sentences to the first user as a robot output sentence for the first user.

在其中一个实施例中,所述练习模块接收所述N个第二用户中最先返回的回复语句,将所述最先返回的回复语句作为机器人输出语句反馈给第一用户。In one of the embodiments, the exercise module receives the first reply sentence returned by the N second users, and feeds back the first reply sentence as a robot output sentence to the first user.

在其中一个实施例中,所述智能聊天机器人控制装置还包括时限模块,所述时限模块预先记录预设时间,若在预设时间内未收到所述第二用户的回复语句,则所述时限模块发出回复超时指令至所述选取模块,所述选取模块接收到超时指令后重新选取N个第三用户。In one of the embodiments, the intelligent chat robot control device further includes a time limit module, the time limit module pre-records a preset time, if no reply statement from the second user is received within the preset time, the The time limit module sends a reply timeout instruction to the selection module, and the selection module reselects N third users after receiving the timeout instruction.

在其中一个实施例中,所述智能聊天机器人控制装置还包括存储模块,所述存储模块用于将所述第一用户的用户输入语句和最先返回的回复语句做为连续的两个聊天语句存储到聊天数据库中。In one of the embodiments, the intelligent chatting robot control device further includes a storage module, and the storage module is used to use the first user's user input sentence and the first returned reply sentence as two consecutive chat sentences stored in the chat database.

在其中一个实施例中,所述选取模块包括:In one of the embodiments, the selection module includes:

聊天统计模块,用于获取当前没有加入聊天的用户数目;The chat statistics module is used to obtain the number of users who are not currently joining the chat;

空闲统计模块,用于获取当前正在参与聊天的用户数目;The idle statistics module is used to obtain the number of users who are currently participating in the chat;

比值模块,用于计算当前没有加入聊天的用户数目与当前正在参与聊天的用户数目的比值,得到N取值;以及,The ratio module is used to calculate the ratio of the number of users currently not joining the chat to the number of users currently participating in the chat to obtain the value of N; and,

随机选取模块,用于从没有加入聊天的用户中随机选取N个第二用户。The random selection module is used to randomly select N second users from users who have not joined the chat.

上述的智能聊天机器人控制方法及智能聊天机器人控制装置实现了聊天机器人自主学习聊天,对于第一用户发送来的一个用户输入语句,当在聊天数据库中检索不到符合匹配度要求的聊天语句时将第一用户的用户输入语句作为新话题的机器人输出语句发送给N个第二用户,并将N个第二用户对机器人输出语句最先回复的用户输入语句作为给第一用户回复的机器人输出语句。与现有技术相比,本发明极大提高了聊天机器人回复的类人性、合理性及真实性,使得聊天机器人具备人工智能,大大提高了图灵测试的通过率。The above-mentioned intelligent chat robot control method and intelligent chat robot control device realize the chat robot's autonomous learning and chatting. For a user input sentence sent by the first user, when a chat sentence that meets the matching degree requirements cannot be retrieved in the chat database, it will The user input sentence of the first user is sent to N second users as the robot output sentence of the new topic, and the user input sentence that the N second users reply to the robot output sentence first is used as the robot output sentence replying to the first user . Compared with the prior art, the present invention greatly improves the human-likeness, rationality and authenticity of the chat robot's reply, makes the chat robot equipped with artificial intelligence, and greatly improves the passing rate of the Turing test.

附图说明Description of drawings

图1是现有基于聊天数据库构建的聊天机器人的聊天数据库示意图;Fig. 1 is the chat database schematic diagram of the existing chat robot based on chat database construction;

图2是现有基于聊天数据库构建的聊天机器人与用户的聊天示意图;Fig. 2 is the chatting schematic diagram of existing chat robot and user based on chat database construction;

图3是一个实施例中智能聊天机器人控制方法的流程原理图;Fig. 3 is a flow schematic diagram of an intelligent chat robot control method in an embodiment;

图4是一个实施例中应用智能聊天机器人控制方法与用户聊天的聊天示意图;Fig. 4 is a schematic diagram of chatting with a user using an intelligent chatting robot control method in an embodiment;

图5是一个实施例中智能聊天机器人控制装置的结构原理图;Fig. 5 is a schematic structural diagram of an intelligent chat robot control device in an embodiment;

图6是一个实施例中选取模块的结构原理图;Fig. 6 is a schematic diagram of the structure of the selected module in an embodiment;

图7是一个实施例中智能聊天机器人系统的结构原理图。Fig. 7 is a schematic structural diagram of an intelligent chat robot system in an embodiment.

具体实施方式detailed description

请参阅图3,一种智能聊天机器人控制方法,包括以下步骤:Please refer to Figure 3, a method for controlling an intelligent chat robot, comprising the following steps:

步骤102:获取第一用户的用户输入语句,将用户输入语句与聊天数据库中的语句进行匹配,获取聊天数据库中的匹配度最大,且最大匹配度大于预设值的第一聊天语句。Step 102: Obtain the user input sentence of the first user, match the user input sentence with the sentence in the chat database, and obtain the first chat sentence with the largest matching degree in the chat database and the maximum matching degree is greater than a preset value.

具体的,获取一个第一用户发送来的用户输入语句,从聊天数据库中检索与该用户输入语句匹配度最大,且最大匹配度大于K%的存在下一个聊天语句的第一聊天语句。Specifically, a user input sentence sent by a first user is obtained, and the first chat sentence that has the next chat sentence that has the highest matching degree with the user input sentence and the maximum matching degree is greater than K% is retrieved from the chat database.

其中,K大于0。可以理解的是假如K=0,那么就是随意地从聊天数据库中取出一个聊天语句,是毫无意义的;K的取值越大,则检索成功的可能性越小;当K太大,会导致检索失败的太多,从而使得太多的第一聊天语句需要执行自主学习聊天的步骤,会给系统带来太大压力;K越小,则得到的第一聊天语句与用户输入语句的匹配度越小;然而,如果K太小,又会导致得到的机器人输出语句往往与用户输入语句“牛头不对马嘴”;所以,K需要取恰当的值,使得用户对回复的输出聊天语句满意,同时使得系统的运行压力不会太大。在一个较佳实施例中,K的取值为50~100,优选地,K的默认取值为70。Wherein, K is greater than 0. It can be understood that if K=0, it is meaningless to take out a chat sentence from the chat database at will; the larger the value of K, the less likely the retrieval success is; There are too many retrieval failures, so that too many first chat sentences need to perform the steps of self-learning and chatting, which will bring too much pressure to the system; the smaller K is, the matching between the first chat sentences obtained and the user input sentences The smaller the degree is; however, if K is too small, the output sentence of the robot will often be "wrong" with the user input sentence; therefore, K needs to take an appropriate value so that the user is satisfied with the reply output chat sentence, At the same time, the operating pressure of the system will not be too large. In a preferred embodiment, the value of K is 50-100, preferably, the default value of K is 70.

用户的用户输入语句可以是文字,也可以是语音,甚至可以是视频。在一个较佳实施例中,检索通过调用聊天数据库的检索引擎完成。聊天数据库的所有聊天语句中与用户的用户输入语句匹配度最大的一个聊天语句的下一个聊天语句显然是该用户的该用户输入语句的最为合理的回复,语句可以表示成字符串,语句匹配度的计算可以转化为字符串匹配度或相似度的计算,可以采用已有的字符串匹配度或相似度算法,譬如Edit距离法(编辑距离,就是用来计算从原串(s)转换到目标串(t)所需要的最少的插入,删除和替换的数目。显然当一个语句编辑为另一个语句所需的最少的插入,删除和替换的数目越小,则匹配度越大)、最大公共子串LCS法(显然两个语句的最大公共子串越长,则这两个语句匹配度越大)等,在此不予赘述。The user input sentence of the user may be a text, a voice, or even a video. In a preferred embodiment, the retrieval is accomplished by invoking the retrieval engine of the chat database. Among all the chat sentences in the chat database, the next chat sentence of the chat sentence with the highest matching degree with the user's input sentence is obviously the most reasonable reply of the user's user input sentence. The sentence can be expressed as a string, and the sentence matching degree The calculation can be transformed into the calculation of string matching or similarity, and existing string matching or similarity algorithms can be used, such as the Edit distance method (edit distance, which is used to calculate the conversion from the original string (s) to the target The minimum number of insertions, deletions and replacements required by the string (t). Obviously, when a statement is edited into another statement, the minimum number of insertions, deletions and replacements is smaller, and the matching degree is greater), the maximum common The substring LCS method (obviously, the longer the maximum common substring of two sentences, the greater the matching degree of these two sentences), etc., will not be described here.

步骤104:若第一聊天语句存在下一聊天语句,则将下一聊天语句作为机器人输出语句反馈给第一用户。Step 104: If there is a next chat sentence in the first chat sentence, feed back the next chat sentence as a robot output sentence to the first user.

具体的,第一聊天语句是从聊天数据库的所有聊天语句中检索出与用户的用户输入语句匹配度满足上述步骤102中的匹配度要求的聊天语句,获取第一聊天语句后,从聊天数据库中检索第一聊天语句对应的下一聊天语句。若第一聊天语句存在下一聊天语句,则将下一聊天语句作为对第一用户的机器人输出语句发送给第一用户。将机器人输出语句输出给第一用户的方式可以是文本的方式,也可以是语音的方式,也可以是视频的方式,还可以是其他方式,譬如,以表情的方式。Specifically, the first chat sentence is to retrieve from all the chat sentences in the chat database the chat sentences whose matching degree with the user input sentence of the user satisfies the matching degree requirement in the above step 102, after obtaining the first chat sentence, from the chat database A next chat sentence corresponding to the first chat sentence is retrieved. If there is a next chat sentence in the first chat sentence, the next chat sentence is sent to the first user as a robot output sentence to the first user. The manner of outputting the robot's output sentence to the first user may be in the form of text, voice, or video, or in other ways, for example, in the form of emoticons.

步骤106:若第一聊天语句不存在下一聊天语句,则将第一用户的用户输入语句作为新话题的机器人输出语句发送到N个第二用户,接收N个第二用户返回的回复语句,将回复语句作为给第一用户的机器人输出语句反馈给第一用户。Step 106: If there is no next chat sentence in the first chat sentence, send the user input sentence of the first user as the robot output sentence of the new topic to N second users, and receive the reply sentences returned by the N second users, The reply sentence is fed back to the first user as a robot output sentence for the first user.

具体的,若第一聊天语句不存在下一聊天语句,则进行自主学习聊天,将用户输入语句作为新话题的机器人输出语句发送给N个第二用户寻求回复,并将得到的回复用户输入语句作为对第一用户的机器人输出语句发送给第一用户。如果第一聊天语句存在下一聊天语句,说明聊天数据库中存在满足匹配度要求的回复语句,因此,不需要进行自主学习聊天。当第一聊天语句不存在下一聊天语句,说明在聊天数据库中找不到对第一用户的用户输入语句合适的回复,所以需要进行自主学习聊天。Specifically, if the next chat sentence does not exist in the first chat sentence, then carry out self-learning chat, and send the user input sentence as the robot output sentence of the new topic to N second users seeking replies, and the obtained reply user input sentence Sent to the first user as a bot output statement to the first user. If there is a next chat sentence in the first chat sentence, it means that there is a reply sentence satisfying the matching degree requirement in the chat database, therefore, there is no need for self-learning chat. When there is no next chat sentence in the first chat sentence, it means that no suitable reply to the user input sentence of the first user can be found in the chat database, so self-learning chat is required.

本实施例的智能聊天机器人控制方法,在聊天数据库中检索不到符合匹配度要求的聊天语句时进行自主学习聊天,通过将第一用户的用户输入语句作为新话题的机器人输出语句发送给N个第二用户来寻求回复。该方法极大地提高了聊天机器人回复的类人性、合理性及真实性,使得聊天机器人具备人工智能,大大提高了图灵测试的通过率。In the intelligent chatting robot control method of this embodiment, when the chatting statement that meets the matching degree requirements cannot be retrieved in the chatting database, self-learning chatting is performed, and the user input statement of the first user is sent to N as the robot output statement of the new topic. A second user comes seeking a reply. This method greatly improves the human-likeness, rationality and authenticity of the chat robot's reply, makes the chat robot equipped with artificial intelligence, and greatly improves the passing rate of the Turing test.

在一个实施例中,步骤106包括:将第一用户的用户输入语句作为新话题的机器人输出语句发送到N个第二用户,接收N个第二用户中最先返回的回复语句,将最先返回的回复语句作为机器人输出语句反馈给第一用户。In one embodiment, step 106 includes: sending the user input sentence of the first user as the robot output sentence of the new topic to N second users, receiving the reply sentence returned first among the N second users, and sending the first reply sentence The returned reply sentence is fed back to the first user as a robot output sentence.

具体的,N个第二用户对机器人输出语句回复的先后次序会有不同,为了使得第一用户等待回复的时间最短,将最先回复的用户输入语句作为给第一用户回复的机器人输出语句。如果有两个以上用户同时对机器人输出语句进行了回复,则选取其中一个聊天回复语句做为给第一用户回复的机器人输出语句。具体可以根据实际需要设定选取原则,如可以随机选择其中一个聊天回复语句做为给第一用户回复的机器人输出语句,还可以选择其中最长的一个聊天回复语句做为给第一用户回复的机器人输出语句等,本实施例对此并不做具体限定。Specifically, the order in which the N second users reply to the robot output sentence will be different. In order to make the first user wait for the reply in the shortest time, the user input sentence replied first is used as the robot output sentence replying to the first user. If more than two users reply to the robot output sentence at the same time, then select one of the chat reply sentences as the robot output sentence replying to the first user. Specifically, the selection principle can be set according to actual needs. For example, one of the chat reply sentences can be randomly selected as the robot output sentence to reply to the first user, and the longest chat reply sentence among them can be selected as the reply to the first user. The robot outputs sentences and the like, which is not specifically limited in this embodiment.

在一个实施例中,步骤106之后还包括以下步骤:将第一用户的用户输入语句和最先返回的回复语句做为连续的两个聊天语句存储到聊天数据库中。In one embodiment, after step 106, the following steps are further included: storing the user input sentence of the first user and the reply sentence returned first as two consecutive chat sentences in the chat database.

具体地,将第一用户的用户输入语句和最先返回的回复语句做为连续的两个聊天语句存储到聊天数据库中,即将第一用户的用户输入语句和最先回复的用户输入语句做为经验聊天语句存储至聊天数据库中,以丰富聊天数据库的内容。Specifically, the user input sentence of the first user and the reply sentence returned first are stored in the chat database as two consecutive chat sentences, that is, the user input sentence of the first user and the user input sentence of the first reply are used as Experience chat sentences are stored in the chat database to enrich the content of the chat database.

本实施例中,为了提高以后从聊天数据库中直接检索出与用户的用户输入语句匹配的机会,将自主学习得到的聊天语句做为经验聊天语句存储至数据库以丰富聊天数据库的内容。当用户将来的某个用户输入语句与通过自主学习聊天增加到聊天数据库中的聊天语句最大匹配度大于K%时,则可以将聊天数据库中的该个聊天语句的下一个聊天语句直接作为用户的该个用户输入语句的回复,而无需再进行自主学习聊天,有助于减小系统压力且提高回复用户的速度。In this embodiment, in order to improve the chance of directly searching from the chat database to match the user input sentences of the user, the chat sentences obtained through self-learning are stored in the database as empirical chat sentences to enrich the content of the chat database. When the maximum matching degree of a certain user input sentence of the user in the future and the chat sentence added to the chat database through self-learning chat is greater than K%, the next chat sentence of the chat sentence in the chat database can be directly used as the user's The reply to the user input sentence does not need to conduct self-learning chat, which helps to reduce the pressure on the system and improve the speed of replying to the user.

在一个实施例中,步骤106还包括以下步骤:若在预设时间内未收到第二用户的回复语句,则重新选取N个第三用户,将第一用户的用户输入语句作为新话题的机器人输出语句发送到第三用户,接收第三用户返回的回复语句,将回复语句作为机器人输出语句反馈给第一用户。In one embodiment, step 106 also includes the following steps: if no reply statement from the second user is received within the preset time, re-select N third users, and use the user input statement of the first user as the new topic The robot output sentence is sent to the third user, the reply sentence returned by the third user is received, and the reply sentence is fed back to the first user as the robot output sentence.

具体的,预设时间为t秒。当N个第二用户都没有在预设时间t秒内回复,则重新选取N个第三用户进行自主学习寻求回复。当N个第二用户都没有在限定的时间t秒内回复,那么就应该重新选取其他一些用户来重新寻求回复,否则第一用户一直等不到回复语句会以为聊天机器人已经放弃聊天。进一步地,t为大于0的自然数,具体可根据实际应用情况任意设定t的取值。在其中一个实施例中,t的取值为(1~60)s。如果t越大则等待的时间越长,如果t越小则等待的时间越短。如果t太大则会让第一用户等待回复的时间太长,如果t太小则会导致另m个用户来不及回复聊天机器人,因此,t应取合适的时间长度。一个较佳实施例中,由于一般N个第二用户中任一用户敲字回复需要3秒的时间,因此,设置t的取值为3秒。然而,需要说明的是,本实施例中,t的取值为3秒只是一个实施例,并不用于限定本发明。Specifically, the preset time is t seconds. When none of the N second users reply within the preset time of t seconds, N third users are re-selected for autonomous learning to seek replies. When none of the N second users reply within the limited time t seconds, then some other users should be re-selected to seek replies again, otherwise the first user will think that the chat robot has given up chatting if he has not waited for a reply sentence. Further, t is a natural number greater than 0, and the value of t can be set arbitrarily according to actual application conditions. In one of the embodiments, the value of t is (1˜60)s. If t is larger, the waiting time is longer, and if t is smaller, the waiting time is shorter. If t is too large, the first user will wait too long for a reply, and if t is too small, it will cause the other m users to have no time to reply to the chat robot. Therefore, t should take an appropriate length of time. In a preferred embodiment, since it usually takes 3 seconds for any one of the N second users to reply by typing, the value of t is set to 3 seconds. However, it should be noted that, in this embodiment, the value of t is 3 seconds is just an embodiment, and is not used to limit the present invention.

在一个实施例中,若在预设时间t秒内有多个第二用户返回了回复语句,则接收所有第二用户返回的回复语句,并分别将第一用户的用户输入语句和接收到的各回复语句作为连续的两个聊天语句加入到聊天数据库中。本实施例中,将自主学习聊天过程中在预设时间内得到的所有第二用户回复语句均作为经验聊天语句存储至聊天数据库中丰富聊天数据库的内容。如上所述,通过将自主学习聊天得到的用户回复语句做为经验聊天语句存储至聊天数据库中,能够丰富聊天数据的内容,进而提高以后从聊天数据库中直接检索出与对用户的用户输入语句匹配的机会,减小系统压力,提高回复用户的速度。In one embodiment, if multiple second users have returned reply sentences within the preset time t seconds, all reply sentences returned by the second users will be received, and the user input sentences of the first user and the received Each reply sentence is added into the chat database as two consecutive chat sentences. In this embodiment, all second user reply sentences obtained within a preset time during the self-learning chat process are stored as experience chat sentences in the chat database to enrich the content of the chat database. As mentioned above, by storing the user reply sentences obtained by self-learning chatting in the chat database as experience chat sentences, the content of the chat data can be enriched, and then it can be directly retrieved from the chat database in the future to match the user input sentences to the user. Opportunities, reduce system pressure, and improve the speed of replying to users.

在一个实施例中,上述的第二用户为当前没有加入聊天的用户,其中,N的取值为当前没有加入聊天的用户数目与当前正在参与聊天的用户数目的比值。其中,N个第二用户的选取具体包括以下步骤:In one embodiment, the above-mentioned second user is a user who is not currently joining the chat, wherein the value of N is the ratio of the number of users who are currently not joining the chat to the number of users currently participating in the chat. Wherein, the selection of N second users specifically includes the following steps:

首先,获取当前没有加入聊天的用户数目N1。First, the number N1 of users who are not currently joining the chat is obtained.

其次,获取当前正在参与聊天的用户数目N2。Secondly, the number N2 of users who are currently participating in the chat is obtained.

之后,计算当前没有加入聊天的用户数目N1与当前正在参与聊天的用户数目N2的比值,并对比值结果向上取整,得到N,After that, calculate the ratio of the number N1 of users who are not currently joining the chat to the number N2 of users currently participating in the chat, and round up the result of the comparison value to obtain N,

最后,从没有加入聊天的用户中随机选取N个第二用户。Finally, N second users are randomly selected from the users who have not joined the chat.

进一步的,上述的第三用户为当前没有加入聊天的用户,且尚未被选取过做为第二用户的用户,在N个第三用户的选取过程中,最后从当前没有加入聊天,且尚未被选取过做为第二用户的用户中随机选取N个第三用户,其它步骤均与上述N个第二用户的选取过程相同,在此不予赘述。Further, the above-mentioned third user is a user who has not joined the chat currently and has not been selected as the second user. Randomly select N third users from the users who have been selected as the second users, and other steps are the same as the selection process of the above-mentioned N second users, which will not be repeated here.

本实施例中,为减轻系统压力并提高计算效率,设置N取值为当前没有加入聊天的用户数目N1与当前正在参与聊天的用户数目N2的比值。但是,需要说明的是,本发明并不限定于此,例如N的数量还可以随机选取,因此,以上采用N取值为当前没有加入聊天的用户数目N1与当前正在参与聊天的用户数目N2的比值只是一个实施例,并不用于限定本发明。In this embodiment, in order to reduce system pressure and improve calculation efficiency, the value of N is set to be the ratio of the number N1 of users who are not currently participating in chatting to the number N2 of users currently participating in chatting. However, it should be noted that the present invention is not limited thereto. For example, the number of N can also be randomly selected. Therefore, the value of N used above is the number N1 of users who are not currently joining the chat and the number N2 of users currently participating in the chat. The ratio is just an example and is not intended to limit the present invention.

以下结合具体实施例对应用上述的智能聊天机器人控制方法与用户聊天的过程进行详细说明。为方便说明,本实施例中以K取70,预设时间t为3秒进行说明。The following describes in detail the process of chatting with a user using the above-mentioned intelligent chat robot control method in conjunction with specific embodiments. For the convenience of description, in this embodiment, K is 70, and the preset time t is 3 seconds for description.

如图4所示,其为一实施例中应用智能聊天机器人控制方法与用户聊天的聊天示意图。As shown in FIG. 4 , it is a schematic diagram of chatting with a user using the intelligent chatting robot control method in an embodiment.

当第一用户跟智能聊天机器人说“我肚子好痛”,智能聊天机器人在聊天数据库中检索到最大匹配的聊天语句有“我肚子痛”,匹配度大于70%,从而将“我肚子痛”作为第一聊天语句。然后,从聊天数据库中检索出聊天语句为“我肚子痛,怎么办?”对应的下一聊天语句“怎么了,为什么肚子痛?着凉了吗?”回复给用户U。When the first user says "my stomach hurts" to the intelligent chat robot, the intelligent chat robot retrieves the most matching chat sentence in the chat database as "my stomach hurts", and the matching degree is greater than 70%, thus "my stomach hurts" as the first chat statement. Then, retrieve the next chat sentence corresponding to the chat sentence "I have a stomachache, what should I do?" from the chat database, "What's the matter, why does my stomach hurt? Did you catch a cold?" and reply to the user U.

当第一跟聊天机器人说“小王在找你”,智能聊天机器人在聊天数据库中没有检索到与“小王在找你”匹配度大于70%的聊天语句。此时,智能聊天机器人进行自主学习聊天,智能聊天机器人获取当前没有加入聊天的用户数目N1=3000,获取当前正在参与聊天的用户数目N2=1000,计算从没有与智能聊天机器人聊天的用户中随机选取3个第二用户,将第一用户的用户输入语句作为新话题的机器人输出语句发送到第二用户。其中一个用户最先回复“哪个小王?”,回复时间为2秒,在限定的3秒之内,所以智能聊天机器人将“哪个小王?”回复给用户U,并将“小王在找你”、“哪个小王?”作为连续的聊天语句加入到聊天数据库中,当其它两个第二用户也在3s内回复时,也将相应聊天语句加入到聊天数据库里。When the first person said "Xiao Wang is looking for you" to the chat robot, the intelligent chat robot did not retrieve a chat sentence matching more than 70% of "Xiao Wang is looking for you" in the chat database. At this time, the intelligent chat robot performs self-learning chat, the intelligent chat robot obtains the number of users who are not currently participating in the chat N1 = 3000, obtains the number of users currently participating in the chat N2 = 1000, and calculates Randomly select 3 second users from users who have not chatted with the intelligent chat robot, and send the user input sentence of the first user as the robot output sentence of the new topic to the second user. One of the users is the first to reply "Which Xiao Wang?", and the reply time is 2 seconds, within the limited 3 seconds, so the intelligent chat robot will reply "Which Xiao Wang?" to user U, and "Xiao Wang is looking for You", "Which Xiao Wang?" are added to the chat database as continuous chat sentences, and when the other two second users also reply within 3 seconds, the corresponding chat sentences are also added to the chat database.

上述的整个过程全部是智能聊天机器人自动完成的。智能聊天机器人向多用户自主学习,得到的回复给用户的语句实际上是其他用户回复给机器人的语句,所以虽然是聊天机器人与用户聊天,本质上是不同用户之间在聊天,但用户感觉到是聊天机器人在与自己聊天,所以聊天机器人的回复非常合理,非常真实,从而能够通过图灵测试;随着聊天机器人向多用户自主学习,聊天数据库会越来越丰富,第一聊天语句与用户的用户输入语句的匹配度必然越来越高,从而使得聊天机器人的回复也就越来越合理,越来越真实,越来越能提高图灵测试的通过率。The above-mentioned whole process is all automatically completed by the intelligent chat robot. Intelligent chatbots learn independently from multiple users, and the sentences they get back to users are actually sentences that other users reply to the robot. Therefore, although chatbots chat with users, they are essentially chatting between different users, but users feel It is the chat robot that is chatting with itself, so the reply of the chat robot is very reasonable and real, so that it can pass the Turing test; as the chat robot learns from multiple users independently, the chat database will become more and more abundant. The matching degree of user input sentences must be higher and higher, so that the reply of the chat robot will become more reasonable and real, and the passing rate of the Turing test will be improved more and more.

具体的,本实施例的智能聊天机器人是泛义的机器人,包括能与用户对话的一切模拟人类行为或思想以及模拟其他生物的机械,也包括有些电脑程序,譬如qq聊天机器人程序等。Specifically, the intelligent chat robot of this embodiment is a robot in a general sense, including all machines that can simulate human behavior or thought and simulate other creatures that can talk to users, and also include some computer programs, such as qq chat robot programs.

请参阅图5,基于上述的智能聊天机器人控制方法,本发明还提供一种智能聊天机器人控制装置,包括聊天数据库502、检索匹配模块504、选取模块506、学习模块508、练习模块510、时限模块512和存储模块514。其中:Please refer to Fig. 5, based on the above-mentioned intelligent chat robot control method, the present invention also provides an intelligent chat robot control device, including a chat database 502, a retrieval matching module 504, a selection module 506, a learning module 508, an exercise module 510, and a time limit module 512 and storage module 514. in:

聊天数据库502用于存储经验聊天语句,经验聊天语句包括第一聊天语句和第一聊天语句的下一个聊天语句。The chat database 502 is used for storing experience chat sentences, and the experience chat sentences include a first chat sentence and a next chat sentence of the first chat sentence.

具体的,聊天数据库502中的聊天语句是有序的,大部分聊天语句都有下一个聊天语句,只有聊天结束时的最后一个聊天语句没有下一个聊天语句。聊天数据库502可以用文本的形式对聊天数据进行分行存储,也可以采用数据表的形式进行分行存储,每个聊天语句作为文本文件或数据表中的一行,按照人类聊天的实际顺序,对聊天语句进行按序存储。一个聊天语句的前一个聊天语句则存储在该个聊天语句所在行的前一行,一个聊天语句的后一个聊天语句则存储在该个聊天语句所在行的后一行。聊天数据库502中的数据采集范围包括聊天数据,包括聊天机器人的聊天数据或人类聊天数据,这些数据可以是文本、语音、视频等信息形式,这些数据可以批量导入聊天数据库502,也可以实时增量式地追加进聊天数据库502。Specifically, the chat sentences in the chat database 502 are in order, most of the chat sentences have the next chat sentence, only the last chat sentence at the end of the chat has no next chat sentence. The chat database 502 can store the chat data in the form of text, or store the chat data in the form of a data table. Each chat statement is used as a row in a text file or a data table, and the chat statement is processed according to the actual order of human chatting. Store sequentially. The previous chat sentence of a chat sentence is stored in the line before the line where the chat sentence is located, and the next chat sentence of a chat sentence is stored in the line after the line where the chat sentence is located. The scope of data collection in the chat database 502 includes chat data, including chat data of chat robots or human chat data. These data can be in the form of information such as text, voice, video, etc. These data can be imported into the chat database 502 in batches, and can also be increased in real time. Formally added into the chat database 502.

检索匹配模块504分别与聊天数据库502和选取模块506连接,用于获取第一用户的用户输入语句,将用户输入语句与聊天数据库中的语句进行匹配,获取聊天数据库中的匹配度最大且匹配度大于预设值的第一聊天语句;若第一聊天语句存在下一聊天语句,则将下一聊天语句作为机器人输出语句反馈给第一用户;若第一聊天语句不存在下一聊天语句,则发送选取指令至选取模块。Retrieval and matching module 504 is connected with chat database 502 and selection module 506 respectively, is used to obtain the user input sentence of the first user, user input sentence and the sentence in the chat database are matched, and the matching degree in the acquisition chat database is the largest and the matching degree The first chat sentence greater than the preset value; if there is a next chat sentence in the first chat sentence, then the next chat sentence is fed back to the first user as a robot output sentence; if there is no next chat sentence in the first chat sentence, then Send the selection command to the selection module.

具体的,检索匹配模块504从聊天数据库502中检索与第一用户的用户输入语句匹配度最大且最大匹配度大于K%的第一聊天语句。一个实施例中,K的取值为50~100,在一个优选的实施例中,K的默认取值为70。Specifically, the searching and matching module 504 retrieves from the chat database 502 the first chatting statement that has the largest matching degree with the user input sentence of the first user and the maximum matching degree is greater than K%. In one embodiment, the value of K is 50-100, and in a preferred embodiment, the default value of K is 70.

本实施例中,检索匹配模块504为集成在聊天数据库502中的检索引擎,该检索引擎能进行语句的模糊匹配,支持文本、语音及视频的检索和模糊匹配,通过检索引擎可以从聊天数据库502的所有聊天语句中检索出与用户的用户输入语句匹配度最大的一个聊天语句。在一个实施例中,还可以通过云存储和云计算技术来提高聊天数据库502及其检索引擎的速度。In this embodiment, the retrieval matching module 504 is a retrieval engine integrated in the chat database 502. The retrieval engine can perform fuzzy matching of sentences, support text, voice and video retrieval and fuzzy matching, and the retrieval engine can retrieve information from the chat database 502. A chat sentence with the highest matching degree with the user input sentence is retrieved from all the chat sentences of the user. In one embodiment, the speed of the chat database 502 and its retrieval engine can also be improved through cloud storage and cloud computing technologies.

选取模块506与检索匹配模块504连接,用于接收选取指令,接收到选取指令后选取N个第二用户。The selection module 506 is connected with the retrieval and matching module 504, and is used for receiving a selection instruction, and selects N second users after receiving the selection instruction.

学习模块508与选取模块506连接,用于将第一聊天语句作为新话题的机器人输出语句发送到N个第二用户。The learning module 508 is connected with the selecting module 506, and is used for sending the first chatting sentence as a robot output sentence of a new topic to N second users.

练习模块510用于接收N个第二用户返回的回复语句,将回复语句作为给第一用户的机器人输出语句反馈给第一用户。The exercise module 510 is used to receive the reply sentences returned by N second users, and feed back the reply sentences to the first user as the robot output sentences for the first user.

具体的,练习模块510接收N个第二用户中最先返回的回复语句,将最先返回的回复语句作为机器人输出语句反馈给第一用户。Specifically, the exercise module 510 receives the reply sentence returned first from the N second users, and feeds back the reply sentence returned first as a robot output sentence to the first user.

时限模块512分别与选取模块506和练习模块510连接,时限模块512预先记录预设时间,若在预设时间内练习模块510未收到第二用户的回复语句,则时限模块512发出回复超时指令至选取模块506,选取模块506接收到超时指令后重新选取N个第三用户。The time limit module 512 is respectively connected with the selection module 506 and the exercise module 510. The time limit module 512 pre-records the preset time. If the exercise module 510 does not receive the second user's reply sentence within the preset time, the time limit module 512 sends a reply overtime command. Go to the selection module 506. The selection module 506 re-selects N third users after receiving the timeout instruction.

存储模块514分别与聊天数据502和练习模块510连接,存储模块514用于将第一用户的用户输入语句和最先返回的回复语句做为连续的两个聊天语句存储到聊天数据库502中。The storage module 514 is connected with the chat data 502 and the practice module 510 respectively, and the storage module 514 is used for storing the user input sentence of the first user and the reply sentence returned first as two consecutive chat sentences in the chat database 502 .

具体的,存储模块514将第一用户的用户输入语句和最先回复的用户输入语句做为经验聊天语句存储至聊天数据库502中,以丰富聊天数据库502的内容。进一步的,存储模块514将预设时间内得到的所有第二用户回复语句均作为经验聊天语句存储至聊天数据库中丰富聊天数据库的内容。若在预设时间t秒内有多个第二用户返回了回复语句,则联系模块510接收所有第二用户返回的回复语句,存储模块514分别将第一用户的用户输入语句和接收到的各回复语句作为连续的两个聊天语句加入到聊天数据库中。Specifically, the storage module 514 stores the user input sentence of the first user and the first replied user input sentence in the chat database 502 as experience chat sentences, so as to enrich the content of the chat database 502 . Further, the storage module 514 stores all second user reply sentences obtained within a preset time as experience chat sentences in the chat database to enrich the contents of the chat database. If multiple second users have returned reply sentences within the preset time t seconds, then the contact module 510 receives the reply sentences returned by all second users, and the storage module 514 respectively stores the user input sentences of the first user and the received The reply sentence is added to the chat database as two consecutive chat sentences.

如图6所示,在一个实施例中,上述的选取模块506包括:As shown in FIG. 6, in one embodiment, the above-mentioned selection module 506 includes:

聊天统计模块506a,用于获取当前没有加入聊天的用户数目。The chat statistics module 506a is used to obtain the number of users who do not currently join the chat.

空闲统计模块506b,用于获取当前正在参与聊天的用户数目。The idle statistics module 506b is used to obtain the number of users who are currently participating in chatting.

比值模块506c,用于计算当前没有加入聊天的用户数目与当前正在参与聊天的用户数目的比值,得到N取值。The ratio module 506c is used to calculate the ratio of the number of users currently not joining the chat to the number of users currently participating in the chat to obtain the value of N.

具体的,为避免比值结果出现小数影响选取,在一个实施例中,对比值结果向上取整,得到N取值。Specifically, in order to avoid decimals in the ratio result from affecting the selection, in one embodiment, the comparison result is rounded up to obtain the value of N.

随机选取模块506d,用于从没有加入聊天的用户中随机选取N个第二用户。The random selection module 506d is configured to randomly select N second users from users who have not joined the chat.

进一步的,随机选取模块506还用于选取N个第三用户,当N个第二用户都没有在预设时间t秒内回复时,随机选取模块506重新选取N个第三用户进行自主学习寻求回复。第三用户为当前没有加入聊天的用户,且尚未被选取过做为第二用户的用户。当选取N个第三用户时,随机选取模块506d从当前没有加入聊天,且尚未被选取过做为第二用户的用户中随机选取N个第三用户。Further, the random selection module 506 is also used to select N third users. When the N second users do not reply within the preset time t seconds, the random selection module 506 re-selects N third users for autonomous learning. Reply. The third user is a user who has not joined the chat and has not been selected as the second user. When N third users are selected, the random selection module 506d randomly selects N third users from users who have not joined the chat and have not been selected as the second users.

请参阅图7,基于上述的智能聊天机器人控制装置,本发明又提供一种智能聊天系统,包括多个用户和若干上述的基于自主学习的智能聊天机器人,智能聊天机器人与各用户之间通信连接。Please refer to Fig. 7, based on the above-mentioned intelligent chatting robot control device, the present invention provides a kind of intelligent chatting system again, comprise a plurality of users and several above-mentioned intelligent chatting robots based on self-learning, communication connection between intelligent chatting robot and each user .

本实施例的基于自主学习的智能聊天系统可以包括一个智能聊天机器人也可以包括多个智能聊天机器人,具体智能聊天机器人的结构及工作原理已有详尽描述,在此不予赘述。每个智能聊天机器人有多个用户聊天,聊天机器人与用户之间的通过互联网、移动互联网、局域网、云、物联网或社交网络通信连接。The autonomous learning-based intelligent chatting system of this embodiment may include one intelligent chatting robot or multiple intelligent chatting robots. The structure and working principle of the specific intelligent chatting robots have been described in detail, and will not be repeated here. Each intelligent chat robot has multiple users chatting, and the communication connection between the chat robot and users is through the Internet, mobile Internet, local area network, cloud, Internet of Things or social network.

在人工智能的发展中,自主学习能力是机器人转向智能的一个重要方向,当机器真正具备了自主学习的能力,机器将不再是机器。聊天机器人要想通过图灵测试,就必须使得自身的聊天语句与人类聊天语句非常像、甚至相同,然而,传统聊天机器人并没有将用户的聊天语句用于自主学习。上述的智能聊天机器人控制方法、智能聊天机器人控制装置及智能聊天系统实现了聊天机器人自主学习聊天,对于第一用户发送来的一个用户输入语句,当在聊天数据库中检索不到符合匹配度要求的聊天语句时将第一用户的用户输入语句作为新话题的机器人输出语句发送给N个第二用户,并将N个第二用户对机器人输出语句最先回复的用户输入语句作为给第一用户回复的机器人输出语句。与现有技术相比,本发明极大提高了聊天机器人回复的类人性、合理性及真实性,使得聊天机器人具备人工智能,大大提高了图灵测试的通过率。In the development of artificial intelligence, the ability of autonomous learning is an important direction for robots to turn to intelligence. When the machine truly has the ability of autonomous learning, the machine will no longer be a machine. If a chat robot wants to pass the Turing test, it must make its own chat sentences very similar or even identical to human chat sentences. However, traditional chat robots do not use users' chat sentences for autonomous learning. The above-mentioned intelligent chat robot control method, intelligent chat robot control device, and intelligent chat system realize the chat robot's autonomous learning and chatting. For a user input sentence sent by the first user, when no match matching requirement is found in the chat database When chatting sentences, send the user input sentence of the first user as the robot output sentence of the new topic to N second users, and use the user input sentence that the N second users reply first to the robot output sentence as the reply to the first user The robot output sentence. Compared with the prior art, the present invention greatly improves the human-likeness, rationality and authenticity of the chat robot's reply, makes the chat robot equipped with artificial intelligence, and greatly improves the passing rate of the Turing test.

以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The various technical features of the above-mentioned embodiments can be combined arbitrarily. For the sake of concise description, all possible combinations of the various technical features in the above-mentioned embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, should be considered as within the scope of this specification.

以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation modes of the present invention, and the descriptions thereof are relatively specific and detailed, but should not be construed as limiting the patent scope of the invention. It should be pointed out that those skilled in the art can make several modifications and improvements without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent for the present invention should be based on the appended claims.

Claims (10)

Translated fromChinese
1.一种智能聊天机器人控制方法,其特征在于,包括以下步骤:1. an intelligent chat robot control method, is characterized in that, comprises the following steps:获取第一用户的用户输入语句,将所述用户输入语句与聊天数据库中的语句进行匹配,获取所述聊天数据库中的匹配度最大,且最大匹配度大于预设值的第一聊天语句;Obtain the user input sentence of the first user, match the user input sentence with the sentence in the chat database, and obtain the first chat sentence with the largest matching degree in the chat database, and the maximum matching degree is greater than a preset value;若所述第一聊天语句存在下一聊天语句,则将所述下一聊天语句作为机器人输出语句反馈给所述第一用户;If there is a next chat sentence in the first chat sentence, the next chat sentence is fed back to the first user as a robot output sentence;若所述第一聊天语句不存在下一聊天语句,则将所述第一用户的用户输入语句作为新话题的机器人输出语句发送到N个第二用户,接收所述N个第二用户返回的回复语句,将所述回复语句作为给第一用户的机器人输出语句反馈给第一用户。If there is no next chat sentence in the first chat sentence, then the user input sentence of the first user is sent to N second users as the robot output sentence of the new topic, and the return of the N second users is received A reply sentence, which is used as a robot output sentence for the first user to feed back the reply sentence to the first user.2.根据权利要求1所述的智能聊天机器人控制方法,其特征在于,所述将所述第一用户的用户输入语句作为新话题的机器人输出语句发送到N个第二用户,接收所述N个第二用户返回的回复语句,将所述回复语句作为机器人输出语句反馈给第一用户的步骤,包括:2. The intelligent chatting robot control method according to claim 1, characterized in that, the described first user's user input sentence is sent to N second users as a robot output sentence of a new topic, and the N second users are received. A reply sentence that the second user returns, and the step of feeding back the reply sentence as a robot output sentence to the first user includes:将所述第一用户的用户输入语句作为新话题的机器人输出语句发送到N个第二用户,接收所述N个第二用户中最先返回的回复语句,将所述最先返回的回复语句作为机器人输出语句反馈给第一用户。Send the user input sentence of the first user as the robot output sentence of the new topic to N second users, receive the reply sentence returned first among the N second users, and send the reply sentence returned first Feedback to the first user as a robot output sentence.3.根据权利要求2所述的智能聊天机器人控制方法,其特征在于,在所述将所述第一用户的用户输入语句作为新话题的机器人输出语句发送到N个第二用户,接收所述N个第二用户中最先返回的回复语句,将所述最先返回的回复语句作为机器人输出语句反馈给第一用户的步骤之后还包括以下步骤:3. intelligent chatting robot control method according to claim 2, is characterized in that, in described the user input sentence of described first user is sent to N second users as the robot output sentence of new topic, receives described The reply sentence returned first among the N second users, after the step of feeding back the reply sentence returned first as a robot output sentence to the first user, also includes the following steps:将所述第一用户的用户输入语句和最先返回的回复语句做为连续的两个聊天语句存储到聊天数据库中。The user input sentence of the first user and the first returned reply sentence are stored in the chat database as two consecutive chat sentences.4.根据权利要求1所述的智能聊天机器人控制方法,其特征在于,所述方法还包括:4. intelligent chat robot control method according to claim 1, is characterized in that, described method also comprises:若在预设时间内未收到所述第二用户的回复语句,则重新选取N个第三用户,将所述第一用户的用户输入语句作为新话题的机器人输出语句发送到所述第三用户,接收所述第三用户返回的回复语句,将所述回复语句作为机器人输出语句反馈给第一用户。If no reply sentence from the second user is received within the preset time, N third users are reselected, and the user input sentence of the first user is sent to the third user as a robot output sentence of a new topic. The user receives the reply sentence returned by the third user, and feeds back the reply sentence as a robot output sentence to the first user.5.根据权利要求1所述的智能聊天机器人控制方法,其特征在于,所述若所述第一聊天语句不存在下一聊天语句,则将所述第一用户的用户输入语句作为新话题的机器人输出语句发送到N个第二用户,接收所述N个第二用户返回的回复语句,将所述回复语句作为给第一用户的机器人输出语句反馈给第一用户的步骤中,所述第二用户为当前没有加入聊天的用户,其中,N的取值为当前没有加入聊天的用户数目与当前正在参与聊天的用户数目的比值。5. intelligent chatting robot control method according to claim 1, is characterized in that, if described first chat sentence does not exist next chat sentence, then the user input sentence of described first user is used as new topic In the step of sending the robot output sentence to N second users, receiving the reply sentence returned by the N second users, and feeding back the reply sentence to the first user as the robot output sentence for the first user, the second The second user is the user who is not currently joining the chat, wherein the value of N is the ratio of the number of users who are not currently joining the chat to the number of users currently participating in the chat.6.一种智能聊天机器人控制装置,其特征在于,包括:6. An intelligent chat robot control device, characterized in that, comprising:聊天数据库,用于存储经验聊天语句,所述经验聊天语句包括第一聊天语句和第一聊天语句的下一个聊天语句;Chat database, for storing experience chat sentences, described experience chat sentences include the first chat sentence and the next chat sentence of the first chat sentence;检索匹配模块,分别与聊天数据库和选取模块连接,用于获取第一用户的用户输入语句,将所述用户输入语句与聊天数据库中的语句进行匹配,获取所述聊天数据库中的匹配度最大且匹配度大于预设值的第一聊天语句;若所述第一聊天语句存在下一聊天语句,则将所述下一聊天语句作为机器人输出语句反馈给所述第一用户;若所述第一聊天语句不存在下一聊天语句,则发送选取指令至选取模块;The search matching module is connected with the chat database and the selection module respectively, and is used to obtain the user input sentence of the first user, and matches the user input sentence with the sentence in the chat database to obtain the maximum matching degree and The first chat sentence whose matching degree is greater than the preset value; if there is a next chat sentence in the first chat sentence, the next chat sentence will be fed back to the first user as a robot output sentence; if the first chat sentence If there is no next chat sentence in the chat sentence, then send the selection instruction to the selection module;选取模块,与所述检索匹配模块连接,用于接收选取指令,接收到选取指令后选取N个第二用户;A selection module, connected to the retrieval and matching module, is used to receive a selection instruction, and select N second users after receiving the selection instruction;学习模块,与所述选取模块连接,用于将所述第一聊天语句作为新话题的机器人输出语句发送到N个第二用户;以及,A learning module, connected with the selection module, is used to send the first chat sentence as a robot output sentence of a new topic to N second users; and,练习模块,用于接收所述N个第二用户返回的回复语句,将所述回复语句作为给第一用户的机器人输出语句反馈给第一用户。The exercise module is configured to receive the reply sentences returned by the N second users, and feed back the reply sentences to the first user as a robot output sentence for the first user.7.根据权利要求6所述的智能聊天机器人控制装置,其特征在于,所述练习模块接收所述N个第二用户中最先返回的回复语句,将所述最先返回的回复语句作为机器人输出语句反馈给第一用户。7. The intelligent chatting robot control device according to claim 6, wherein the exercise module receives the reply sentence returned first among the N second users, and uses the reply sentence returned first as a robot The output sentence is fed back to the first user.8.根据权利要求6所述的智能聊天机器人控制装置,其特征在于,还包括时限模块,所述时限模块预先记录预设时间,若在预设时间内未收到所述第二用户的回复语句,则所述时限模块发出回复超时指令至所述选取模块,所述选取模块接收到超时指令后重新选取N个第三用户。8. The intelligent chatting robot control device according to claim 6, further comprising a time limit module, the time limit module pre-records the preset time, if no reply from the second user is received within the preset time statement, the time limit module sends a reply timeout instruction to the selection module, and the selection module reselects N third users after receiving the timeout instruction.9.根据权利要求6所述的智能聊天机器人控制装置,其特征在于,还包括存储模块,所述存储模块用于将所述第一用户的用户输入语句和最先返回的回复语句做为连续的两个聊天语句存储到聊天数据库中。9. The intelligent chatting robot control device according to claim 6, further comprising a storage module configured to treat the user input sentence of the first user and the first returned reply sentence as a continuous The two chat sentences of the store are stored in the chat database.10.根据权利要求6所述的智能聊天机器人控制装置,其特征在于,所述选取模块包括:10. intelligent chat robot control device according to claim 6, is characterized in that, described selecting module comprises:聊天统计模块,用于获取当前没有加入聊天的用户数目;The chat statistics module is used to obtain the number of users who are not currently joining the chat;空闲统计模块,用于获取当前正在参与聊天的用户数目;The idle statistics module is used to obtain the number of users who are currently participating in the chat;比值模块,用于计算当前没有加入聊天的用户数目与当前正在与参与聊天的用户数目的比值,得到N取值;以及,The ratio module is used to calculate the ratio of the number of users who do not currently join the chat and the number of users currently participating in the chat to obtain the value of N; and,随机选取模块,用于从没有加入聊天的用户中随机选取N个第二用户。The random selection module is used to randomly select N second users from users who have not joined the chat.
CN201610226768.XA2016-04-122016-04-12 Intelligent chat robot control method and control deviceActiveCN105930367B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201610226768.XACN105930367B (en)2016-04-122016-04-12 Intelligent chat robot control method and control device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201610226768.XACN105930367B (en)2016-04-122016-04-12 Intelligent chat robot control method and control device

Publications (2)

Publication NumberPublication Date
CN105930367Atrue CN105930367A (en)2016-09-07
CN105930367B CN105930367B (en)2020-06-09

Family

ID=56838915

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201610226768.XAActiveCN105930367B (en)2016-04-122016-04-12 Intelligent chat robot control method and control device

Country Status (1)

CountryLink
CN (1)CN105930367B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107016070A (en)*2017-03-222017-08-04北京光年无限科技有限公司A kind of interactive method and device for intelligent robot
CN109465823A (en)*2018-11-062019-03-15泰康保险集团股份有限公司Study of Intelligent Robot Control method and device, electronic equipment, storage medium
CN109760041A (en)*2017-11-102019-05-17贝斯平环球公司Cloud management system and its operating method based on chat robots
US10318927B2 (en)2017-07-172019-06-11ExpertHiring, LLCMethod and system for managing, matching, and sourcing employment candidates in a recruitment campaign
CN110019700A (en)*2017-09-132019-07-16阿里巴巴集团控股有限公司Data processing method and equipment
CN110059000A (en)*2019-03-152019-07-26深圳壹账通智能科技有限公司Chat drama test control method, device, computer equipment and storage medium
CN111027976A (en)*2019-11-132020-04-17支付宝(杭州)信息技术有限公司Method for obtaining transaction identity information of fraudulent party
CN114650263A (en)*2017-06-292022-06-21谷歌有限责任公司Proactive provision of new content to group chat participants
US11887594B2 (en)2017-03-222024-01-30Google LlcProactive incorporation of unsolicited content into human-to-computer dialogs
US11929069B2 (en)2017-05-032024-03-12Google LlcProactive incorporation of unsolicited content into human-to-computer dialogs

Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101076060A (en)*2007-03-302007-11-21腾讯科技(深圳)有限公司Chatting robot system and automatic chatting method
US20080189367A1 (en)*2007-02-012008-08-07Oki Electric Industry Co., Ltd.User-to-user communication method, program, and apparatus
CN101431573A (en)*2007-11-082009-05-13上海赢思软件技术有限公司Method and equipment for implementing automatic customer service through human-machine interaction technology
CN103390047A (en)*2013-07-182013-11-13天格科技(杭州)有限公司Chatting robot knowledge base and construction method thereof
US20140122407A1 (en)*2012-10-262014-05-01Xiaojiang DuanChatbot system and method having auto-select input message with quality response
CN105068661A (en)*2015-09-072015-11-18百度在线网络技术(北京)有限公司Man-machine interaction method and system based on artificial intelligence

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20080189367A1 (en)*2007-02-012008-08-07Oki Electric Industry Co., Ltd.User-to-user communication method, program, and apparatus
CN101076060A (en)*2007-03-302007-11-21腾讯科技(深圳)有限公司Chatting robot system and automatic chatting method
CN101431573A (en)*2007-11-082009-05-13上海赢思软件技术有限公司Method and equipment for implementing automatic customer service through human-machine interaction technology
US20140122407A1 (en)*2012-10-262014-05-01Xiaojiang DuanChatbot system and method having auto-select input message with quality response
CN103390047A (en)*2013-07-182013-11-13天格科技(杭州)有限公司Chatting robot knowledge base and construction method thereof
CN105068661A (en)*2015-09-072015-11-18百度在线网络技术(北京)有限公司Man-machine interaction method and system based on artificial intelligence

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王智慧: "基于自然语言理解的自动应答技术及应用研究", 《中国优秀硕士学位论文全文数据库信息科技辑》*

Cited By (17)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US12230272B2 (en)2017-03-222025-02-18Google LlcProactive incorporation of unsolicited content into human-to-computer dialogs
CN107016070A (en)*2017-03-222017-08-04北京光年无限科技有限公司A kind of interactive method and device for intelligent robot
US11887594B2 (en)2017-03-222024-01-30Google LlcProactive incorporation of unsolicited content into human-to-computer dialogs
CN107016070B (en)*2017-03-222020-06-02北京光年无限科技有限公司Man-machine conversation method and device for intelligent robot
US12183342B2 (en)2017-05-032024-12-31Google LlcProactive incorporation of unsolicited content into human-to-computer dialogs
US11929069B2 (en)2017-05-032024-03-12Google LlcProactive incorporation of unsolicited content into human-to-computer dialogs
CN114650263A (en)*2017-06-292022-06-21谷歌有限责任公司Proactive provision of new content to group chat participants
US10318927B2 (en)2017-07-172019-06-11ExpertHiring, LLCMethod and system for managing, matching, and sourcing employment candidates in a recruitment campaign
US11087283B2 (en)2017-07-172021-08-10ExpertHiring, LLCMethod and system for managing, matching, and sourcing employment candidates in a recruitment campaign
CN110019700A (en)*2017-09-132019-07-16阿里巴巴集团控股有限公司Data processing method and equipment
CN110019700B (en)*2017-09-132023-01-17阿里巴巴集团控股有限公司Data processing method and device
CN109760041B (en)*2017-11-102022-05-06贝斯平环球公司Chat robot-based cloud management system and operation method thereof
CN109760041A (en)*2017-11-102019-05-17贝斯平环球公司Cloud management system and its operating method based on chat robots
CN109465823A (en)*2018-11-062019-03-15泰康保险集团股份有限公司Study of Intelligent Robot Control method and device, electronic equipment, storage medium
CN110059000A (en)*2019-03-152019-07-26深圳壹账通智能科技有限公司Chat drama test control method, device, computer equipment and storage medium
CN111027976B (en)*2019-11-132022-06-14支付宝(杭州)信息技术有限公司Method for obtaining transaction identity information of fraudulent party
CN111027976A (en)*2019-11-132020-04-17支付宝(杭州)信息技术有限公司Method for obtaining transaction identity information of fraudulent party

Also Published As

Publication numberPublication date
CN105930367B (en)2020-06-09

Similar Documents

PublicationPublication DateTitle
CN105930367B (en) Intelligent chat robot control method and control device
CN107135247B (en)A kind of service system and method for the intelligent coordinated work of person to person's work
US10120955B2 (en)State tracking over machine-learned relational trees in a dialog system
CN110209897B (en) Intelligent dialogue method, device, storage medium and equipment
CN105975530B (en) Robot dialogue control method and system based on chat big data knowledge base
CN106952646A (en)A kind of robot interactive method and system based on natural language
CN105528437B (en)A kind of question answering system construction method extracted based on structured text knowledge
US9087130B2 (en)Generating snippets for prominent users for information retrieval queries
CN108846138B (en)Question classification model construction method, device and medium fusing answer information
CN103970791B (en)A kind of method, apparatus for recommending video from video library
CN101685454A (en)Human-computer interactive method and system
CN110929045B (en)Construction method and system of poetry-semantic knowledge map
WO2009039769A1 (en)Virtual pet system and virtual pet chatting method, apparatus
CN104461226A (en)Chatting method, device and system used for network
CN117312521A (en)Processing method for intelligent customer service dialogue and related products
CN108536680A (en)A kind of acquisition methods and device of house property information
Wong et al.Strategies for mixed-initiative conversation management using question-answer pairs
US20230205794A1 (en)Generating search insight data
US11055493B2 (en)Conversation system
CN110413627B (en) Information optimization method, device, server and storage medium
CN111125305A (en)Hot topic determination method and device, storage medium and electronic equipment
CN110138986A (en)Method, device and storage medium for constructing knowledge graph related to outbound process
WO2023245523A1 (en)Method and apparatus for generating training data
CN117421416B (en)Interactive search method and device and electronic equipment
CN119046430A (en)Intelligent question-answering method and device

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp