CN111611354A - Man-machine conversation control method, device, server and readable storage medium - Google Patents

Man-machine conversation control method, device, server and readable storage medium Download PDF

Info

Publication number
CN111611354A
CN111611354A CN201910140016.5A CN201910140016A CN111611354A CN 111611354 A CN111611354 A CN 111611354A CN 201910140016 A CN201910140016 A CN 201910140016A CN 111611354 A CN111611354 A CN 111611354A
Authority
CN
China
Prior art keywords
question
reply
training
model
data
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
CN201910140016.5A
Other languages
Chinese (zh)
Other versions
CN111611354B (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.)
Beijing Didi Infinity Technology and Development Co Ltd
Original Assignee
Beijing Didi Infinity Technology and Development Co Ltd
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 Beijing Didi Infinity Technology and Development Co Ltd filed Critical Beijing Didi Infinity Technology and Development Co Ltd
Priority to CN201910140016.5A priority Critical patent/CN111611354B/en
Publication of CN111611354A publication Critical patent/CN111611354A/en
Application granted granted Critical
Publication of CN111611354B publication Critical patent/CN111611354B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the application provides a man-machine conversation control method, a man-machine conversation control device, a server and a readable storage medium, and firstly, whether a received target problem is a small talk problem or not is judged; then, when the question is a cold-talk question, generating a first question reply by a preset question-answer matching rule, and generating a second question reply by a preset text generating rule; finally, it is determined whether to adopt the first question reply or the second question reply as the reply to the target question, according to the probabilities that the first question reply and the second question reply are used to reply to the target question. Different answers to the target question are generated by adopting two different question answering modes, and a better answer is selected as the answer to the target question according to the probability that the different answers correspondingly answer the target question, so that the answer to the cold-talk question has flexibility, and the better answer can be selected from different answers.

Description

Man-machine conversation control method, device, server and readable storage medium
Technical Field
The application relates to the technical field of human-computer interaction, in particular to a human-computer conversation control method, a human-computer conversation control device, a server and a readable storage medium.
Background
With the development of computer technology and network technology, human-computer interaction robots are increasingly used to provide intelligent services for users, such as customer services or information query services.
A common human-computer interaction robot needs to simultaneously process a business problem and a small and speech problem, and two different knowledge base systems are generally corresponding to the two problems, so that great difference exists in problem processing models and methods. For the problem of small speech, it is necessary to determine whether the input problem belongs to the problem of small speech and then to process it accordingly after it is determined to be a problem of small speech.
When the existing man-machine interactive robot processes the cold talk problem, the answer to the cold talk problem can be generated based on two methods of question-answer matching and text generation. The question-answer matching is to match the text similarity between the input small-talk problem and the small-talk problems of all categories stored in the knowledge base of the man-machine interactive robot, thus determining the reply to the input small-talk problem. Text generation adopts a deep learning mode to take the input cold talk problem as the input of a deep learning system, and outputs specific cold talk back after deep learning. However, the methods generated by the two modes have advantages and disadvantages, and the method based on question-answer matching has the characteristics of controllable reply and lack of flexibility; the text generation-based method has the characteristics that reply diversity is realized, but the reply lacks evaluation criteria. How to make a human-computer interaction robot have both flexibility and available evaluation criteria in handling the problem of small size becomes a technical problem to be solved by those skilled in the art.
Disclosure of Invention
In view of the above, it is an object of the embodiments of the present application to provide a man-machine conversation control method, apparatus, server, and readable storage medium that can give a problem reply to a small-talk problem in two different ways, and select a better problem reply as a reply to the small-talk problem.
According to an aspect of embodiments of the present application, there is provided an electronic device that may include one or more storage media and one or more processors in communication with the storage media. One or more storage media store machine-readable instructions executable by a processor. When the electronic device is operated, the processor is communicated with the storage medium through the bus, and the processor executes the machine readable instructions to execute the man-machine interaction control method.
According to another aspect of the embodiments of the present application, there is provided a human-machine interaction control method applied to an interactive robot, the method including: when a target problem of a user is received, judging whether the received target problem is a cold talk problem or not; when the target question is a cold-talk question, obtaining a first question reply corresponding to the target question from a knowledge base of the interactive robot according to a preset question-answer matching rule, and adopting the first question reply as a first probability of replying the target question; when the target question is a cold-talk question, generating a second question reply corresponding to the target question according to a preset text generation rule, and calculating a second probability of adopting the second question reply as a reply of the target question according to an evaluation rule of a preset question reply; and comparing the first probability with the second probability, and selecting the first question reply or the second question reply as a reply to the target question according to the comparison result.
In some embodiments of the present application, the comparing the first probability and the second probability, and selecting the first question answer or the second question answer as the answer to the target question according to the comparison result includes: when the first probability is greater than a second probability, answering the first question as a reply to the target question; when the first probability is less than a second probability, answering the second question as a reply to the target question; optionally one of the first question reply and the second question reply as a reply to the target question when the first probability is equal to a second probability.
In some embodiments of the present application, before the interactive robot includes a human-computer conversation reply model and determines whether a received target problem is a small talk problem, the method further includes: training the human-computer conversation reply model, wherein the human-computer conversation reply model comprises a long-short term memory network (LSTM) structure, a small-talk problem judgment sub-model, a multi-classification sub-model, a text generation sub-model and a text evaluation sub-model; the training of the human-computer dialogue reply model comprises: and randomly inputting the training data of each sub-model into the LSTM structure for training, and inputting the training result after the LSTM structure training into each corresponding sub-model for training until the man-machine conversation reply model is converged.
In some embodiments of the present application, the step of training the human-machine dialog reply model further includes: calculating a loss function value of the man-machine conversation reply model after each training by adopting a cross entropy loss function; comparing the loss function value with a preset threshold value; if the loss function value is not smaller than the preset threshold value, judging that the human-computer conversation reply model is not converged; and if the loss function value is larger than the preset threshold value, judging that the human-computer conversation reply model is converged.
In some embodiments of the present application, before randomly inputting the training data of each sub-model into the LSTM structure for training, the step of training the human-machine dialog reply model further comprises: and adjusting the data volume of training data for training the cold-talk problem judging submodel, the multi-classification submodel, the text generating submodel and the text evaluation submodel according to the data volume of the training data of the cold-talk problem judging submodel, the multi-classification submodel, the text generating submodel and the text evaluation submodel.
In some embodiments of the present application, the step of training the human-machine dialog reply model further includes: in each training process, optimizing the parameters of the sub-model corresponding to the training data randomly input into the man-machine conversation reply model and the parameters of the LSTM structure by adopting an optimizer, wherein the optimizer comprises an Adam optimizer.
In some embodiments of the present application, the interactive robot performs man-machine conversation control using a trained man-machine conversation reply model, wherein the small-talk problem determination submodel is used to determine whether a received target problem is a small-talk problem; when the target question is a cold-talk question, adopting the multi-classification submodel to obtain a first question reply corresponding to the target question and a first probability of the first question reply serving as a reply of the target question, wherein the multi-classification submodel is used for training a question-answer matching rule; and when the target question is a cold-talk question, generating a second question reply corresponding to the target question by adopting the text generation submodel, and calculating a second probability of the second question reply serving as a reply of the target question by adopting the text evaluation submodel, wherein the text generation submodel is used for training a text generation rule, and the text evaluation submodel is used for training an evaluation rule of the question reply.
In some embodiments of the present application, before training the human-machine dialog reply model, the method further comprises the step of processing training data of the human-machine dialog reply model, the step comprising: acquiring training data of the man-machine conversation reply model; cleaning the training data; and coding the cleaned training data to obtain a vocabulary, wherein the vocabulary comprises words and symbols required by the data.
In some embodiments of the present application, the step of obtaining the training data of the human-computer conversation reply model includes: acquiring marked cold talk problem, and using the acquired cold talk problem as training data of the multi-classification submodel, wherein each type of cold talk problem comprises a plurality of similar problems, and each problem comprises a corresponding category; taking the training data of the multi-classification submodel as a positive case, taking a preset number of similar problems selected from business problems as a negative case, and composing the training data of the small-talk problem judgment submodel by the positive case and the negative case, wherein each positive case and negative case corresponds to a label identifying whether the small-talk problem is generated or not; using the cold-data as training data of the text generation submodel, wherein the cold-data comprises question and answer pairs; positive example sentences are randomly sampled from the cold-spoken data and the traffic data, sentences composed of randomly extracted words are used as negative example sentences, and the positive example sentences and the negative example sentences are used as training data of the text evaluation submodel, wherein the number of the positive example sentences and the negative example sentences with the same word number is the same.
In some embodiments of the present application, the step of subjecting the training data to a washing process includes: filtering the training data to remove data with a non-preset format in the training data; the filtered training data is subjected to data sorting, and the training data of each sub-model is sorted into a corresponding format required by each sub-model; and dividing the training data of each sub-model into a training data set and a testing data set according to a preset proportion.
In some embodiments of the present application, the step of filtering the training data to remove data in a non-preset format from the training data includes: and filtering data in a non-preset format contained in the training data in a regular expression matching mode, and converting the font of the training data into a preset font.
In some embodiments of the present application, the step of encoding the training data after the cleaning process to obtain the vocabulary includes: counting characters or symbols in the training data after cleaning; and sequencing the words or symbols in the vocabulary table according to the word frequency of the counted words or symbols to obtain the vocabulary table.
According to another aspect of the embodiments of the present application, there is provided a human-machine interaction control apparatus applied to an interactive robot, the apparatus including: the judging module is used for judging whether the received target problem is a small talk problem or not when the target problem of the user is received; an obtaining module, configured to obtain a first question reply corresponding to the target question from a knowledge base of the interactive robot according to a preset question-answer matching rule when the target question is a cold-speech question, and use the first question reply as a first probability of replying to the target question; a generating module, configured to generate a second question reply corresponding to the target question according to a preset text generation rule when the target question is a cold conversation question, and calculate a second probability of adopting the second question reply as a reply to the target question according to an evaluation rule of a preset question reply; and the selection module is used for comparing the first probability with the second probability and selecting the first question reply or the second question reply as a reply to the target question according to a comparison result.
According to another aspect of embodiments of the present application, a readable storage medium is provided, on which a computer program is stored, and the computer program, when executed by a processor, may perform the steps of the human-machine interaction control method described above.
Based on any one of the above aspects, in the embodiment of the present application, first, it is determined whether a received target problem is a cold talk problem; then, when the question is a cold-talk question, generating a first question reply by a preset question-answer matching rule, and generating a second question reply by a preset text generating rule; finally, it is determined whether to adopt the first question reply or the second question reply as the reply to the target question, according to the probabilities that the first question reply and the second question reply are used to reply to the target question. Different answers to the target question are generated by adopting two different question answering modes, and a better answer is selected as the answer to the target question according to the probability that the different answers correspondingly answer the target question, so that the answer to the cold-talk question has flexibility, and simultaneously, the better answer can be selected from different answers by adopting available evaluation criteria.
In order to make the aforementioned objects, features and advantages of the embodiments of the present application more comprehensible, embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
FIG. 1 is a schematic interaction block diagram of a human-computer interaction system provided by an embodiment of the present application;
FIG. 2 illustrates a schematic diagram of exemplary hardware and software components of an electronic device that may implement the user terminal and the server of FIG. 1 provided by an embodiment of the present application;
FIG. 3 is a flow chart of a human-machine conversation control method provided by an embodiment of the present application;
FIG. 4 is a diagram illustrating a model structure of a human-machine dialog reply model provided by an embodiment of the present application;
FIG. 5 is a block diagram of functional modules of a human-machine dialog control device according to an embodiment of the present application;
fig. 6 shows a second functional block diagram of the human-computer dialog control device according to the embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some of the embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and steps without logical context may be performed in reverse order or simultaneously. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that in the embodiments of the present application, the term "comprising" is used to indicate the presence of the features stated hereinafter, but does not exclude the addition of further features.
In order to solve the technical problems in the background art, embodiments of the present application provide a method, an apparatus, a server, and a readable storage medium for controlling a human-computer conversation, wherein first, it is determined whether a received target problem is a small talk problem; then, when the question is a cold-talk question, generating a first question reply by a preset question-answer matching rule, and generating a second question reply by a preset text generating rule; finally, it is determined whether to adopt the first question reply or the second question reply as the reply to the target question, according to the probabilities that the first question reply and the second question reply are used to reply to the target question. Different answers to the target question are generated by adopting two different question answering modes, and a better answer is selected as the answer to the target question according to the probability that the different answers correspondingly answer the target question, so that the answer to the cold-talk question has flexibility, and simultaneously, the better answer can be selected from different answers by adopting available evaluation criteria.
FIG. 1 is a block diagram of a human-computer interaction system 100 according to an alternative embodiment of the present application. The human-computer interaction system 100 includes a user terminal 110, a server 120, and a network 130. User terminal 110 is communicatively coupled to server 120 via network 130.
The user terminal 110 may run any software capable of providing a man-machine conversation service (e.g., drip travel, mobbing, naughty, etc.), and the user terminal 110 queries a service problem or small talk problem through an interface provided by the man-machine conversation service software. User terminal 110 may comprise a mobile device, a tablet computer, a laptop computer, or a built-in device in a motor vehicle, etc., or any combination thereof. In some embodiments, the mobile device may include a smart home device, a wearable device, a smart mobile device, a virtual reality device, an augmented reality device, or the like, or any combination thereof. In some embodiments, the smart home devices may include smart lighting devices, control devices for smart electrical devices, smart monitoring devices, smart televisions, smart cameras, or walkie-talkies, or the like, or any combination thereof. In some embodiments, the wearable device may include a smart bracelet, a smart lace, smart glass, a smart helmet, a smart watch, a smart garment, a smart backpack, a smart accessory, and the like, or any combination thereof. In some embodiments, the smart mobile device may include a smartphone, a Personal Digital Assistant (PDA), a gaming device, a navigation device, or a point of sale (POS) device, or the like, or any combination thereof. In some embodiments, the virtual reality device and/or the augmented reality device may include a virtual reality helmet, virtual reality glass, a virtual reality patch, an augmented reality helmet, augmented reality glass, an augmented reality patch, or the like, or any combination thereof. For example, the virtual reality device and/or augmented reality device may include various virtual reality products and the like. In some embodiments, the built-in devices in the motor vehicle may include an on-board computer, an on-board television, and the like.
The server 120 may be a single server or a group of servers. The set of servers may be centralized or distributed (e.g., server 120 may be a distributed system). The server 120 runs an interactive robot, and in some embodiments, the interactive robot responds to a question input by the user terminal 110 after receiving the question, and sends the response to the question to the user terminal 110 for display, and the interactive robot may include a knowledge base for storing pairs of questions and corresponding answers, and may further include a human-machine conversation response model for generating a response according to the question. In some embodiments, the server 120 may be local or remote to the user terminal 110. In some embodiments, the server 120 may be implemented on a cloud platform; by way of example only, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud (community cloud), a distributed cloud, an inter-cloud, a multi-cloud, and the like, or any combination thereof.
The network 130 may be used for the exchange of information and/or data. In some embodiments, one or more components (e.g., user terminal 110 and server 120) in human machine interaction system 100 may send information and/or data to other components. For example, the user terminal 110 may obtain a reply to the query question from the server 120 via the network 130. In some embodiments, the network 130 may be any type of wired or wireless network, or combination thereof. Merely by way of example, the Network 130 may include a wired Network, a Wireless Network, a fiber optic Network, a telecommunications Network, an intranet, the internet, a Local Area Network (LAN), a Wide Area Network (WAN), a Wireless Local Area Network (WLAN), a Metropolitan Area Network (MAN), a Wide Area Network (WAN), a Public Switched Telephone Network (PSTN), a bluetooth Network, a ZigBee Network, or a Near Field Communication (NFC) Network, among others, or any combination thereof. In some embodiments, the network 130 may include one or more network access points. For example, network 130 may include wired or wireless network access points, such as base stations and/or network switching nodes, through which one or more components of human machine interaction system 100 may connect to network 130 to exchange data and/or information.
In some embodiments, the user terminal 110, the server 120 may be implemented on an electronic device 200 having one or more components shown in fig. 2 in this application.
Fig. 2 illustrates a schematic diagram of exemplary hardware and software components of an electronic device 200 that may implement the concepts of the present application according to some embodiments of the present application.
The electronic device 200 may be a general-purpose computer or a special-purpose computer, both of which may be used to implement the human-machine interaction control method of the present application. Although only one computer is shown, for convenience, the page loading functionality described herein may also be implemented in a distributed manner on multiple similar platforms to balance processing load.
In the present embodiment, the electronic device 200 may include a network port 210 connected to a network, one or more processors 220 for executing program instructions, a communication bus 230, and a storage medium 240 of a different form, such as a disk, ROM, or RAM, or any combination thereof. Illustratively, the electronic device 200 may also include program instructions stored in ROM, RAM, or other types of non-transitory storage media, or any combination thereof. According to the program instructions, the man-machine conversation control method provided by the application can be realized. The electronic device 200 also includes an Input/Output (I/O) interface 250 between the computer and other Input/Output devices (e.g., keyboard, display screen).
For ease of illustration, only one processor is depicted in the electronic device 200. However, it should be noted that the electronic device 200 in the present application may also comprise a plurality of processors, and thus the steps performed by one processor described in the present application may also be performed by a plurality of processors 220 in combination or individually. For example, if the processor 220 of the electronic device 200 executes step a and step B, it should be understood that step a and step B may also be executed by two different processors 220 together or executed in one processor 220 separately. For example, a first processor performs step a and a second processor performs step B, or the first processor and the second processor perform steps a and B together.
Fig. 3 illustrates a flow diagram of a human-machine conversation control method of some embodiments of the present application, which may be performed by the server 120 shown in fig. 1. It should be understood that, in other embodiments, the order of some steps in the human-machine interaction control method described in this embodiment may be interchanged according to actual needs, or some steps may be omitted or deleted. The detailed steps of the man-machine interaction control method are described as follows.
Step S110, when receiving the target problem of the user, judges whether the received target problem is a small talk problem.
The user inputs the target question through the user terminal 110, and the user terminal 110 transmits the input target question to the server 120.
After receiving the target problem, the server 120 determines whether the target problem is a small speech problem. Specifically, the server 120 may find whether the target problem exists in pre-stored small-talk problems, and if so, determine that the target problem is a small-talk problem; otherwise, the target problem is judged to be a service problem, the subsequent flow is continued when the target problem is a cold conversation problem, and the service problem processing flow is carried out when the target problem is a service problem.
Step S120, a first question reply corresponding to the target question is obtained from a knowledge base of the interactive robot according to preset question-answer matching, and the first question reply is adopted as a first probability of reply of the target question.
In the embodiment of the application, a question and answer pair is stored in a knowledge base of the interactive robot, a target question is matched with a stored question in a text similarity manner, the text similarity between the target question and the question stored in the knowledge base is calculated, an answer corresponding to the question with the largest text similarity is used as a first question reply to the target question, and the text similarity between the target question and the question can be used as a first probability.
Step S130, generating a second question reply corresponding to the target question according to a preset text generation rule, and calculating a second probability that the second question reply is adopted as a reply of the target question.
In the embodiment of the application, the target question is processed through a preset text generation rule, a second question reply corresponding to the target question is generated, and a second probability that the second question reply is adopted as the reply of the target question is calculated through an evaluation rule of a pre-configured question reply.
Step S140, comparing the first probability and the second probability, and selecting the first question reply or the second question reply as a reply to the target question according to the comparison result.
Specifically, in the embodiment of the present application, when the first probability is greater than the second probability, the first question reply is taken as a reply to the target question;
when the first probability is smaller than the second probability, the second question reply is used as a reply to the target question;
and when the first probability is equal to the second probability, selecting one of the first question reply and the second question reply as a reply to the target question.
In this embodiment of the application, the man-machine conversation control method may be implemented by a man-machine conversation reply model in the interactive robot.
Referring to fig. 4, the human-computer dialogue reply model includes a Long-Short term memory network LSTM (Long-Short terminal memory) structure, a small-talk problem determination submodel, a multi-classification submodel, a text generation submodel, and a text evaluation submodel. Wherein, the output end of LSTM structure is connected with the input end of the small speech problem judging sub-model, the multi-classification sub-model, the text generating sub-model and the text evaluating sub-model.
The embodiment of the application adopts the trained human-computer conversation reply model to realize the human-computer conversation control.
Specifically, a small-talk problem judgment submodel can be adopted to judge whether a received target problem is a small-talk problem or not;
when the target question is a cold-talk question, a multi-classification submodel is adopted to obtain a first question reply corresponding to the target question and a first probability that the first question reply is used as the reply of the target question, wherein the multi-classification submodel is used for training a question-answer matching rule so as to obtain the first question reply corresponding to the target question from a knowledge base of the interactive robot according to the target question and obtain the first probability that the first question reply is used as the reply of the target question through calculation;
and when the target question is a cold-talk question, generating a second question reply corresponding to the target question by adopting a text generation sub-model, and calculating a second probability of the second question reply serving as the reply of the target question by adopting a text evaluation sub-model, wherein the text generation sub-model is used for training a text generation rule, and the text evaluation sub-model is used for training an evaluation rule of the question reply.
Before implementing the human-computer conversation control by using the trained human-computer conversation reply model, the human-computer conversation control method may further include a step of training the human-computer conversation reply model, the step including:
and randomly inputting the training data of each sub-model into the LSTM structure for training, inputting the training result into the corresponding sub-model from the output end of the LSTM structure after the LSTM structure training is finished, and then training the sub-models until the man-machine conversation reply model is converged.
In the embodiment of the application, when the man-machine conversation reply model is trained, the thought of multitask training is adopted to train the four sub-models simultaneously, so that the training effect of each sub-model can be effectively improved, the internal fusion degree between the sub-models in the whole man-machine conversation reply model is enhanced, and the improvement of the relevance of man-machine conversation control is facilitated.
Specifically, for example, if the randomly input training data is training data of a multi-classification submodel, the LSTM structure inputs the training result after training the training data into the multi-classification submodel to train the multi-classification submodel. I.e. the LSTM structure is trained every time training data is entered randomly. The small-talk problem judgment submodel, the multi-classification submodel, the text generation submodel and the text evaluation submodel are trained only when the input training data are the training data of the corresponding submodel; that is, only one of the small-magnitude problem judgment submodel, the multi-classification submodel, the text generation submodel and the text evaluation submodel is trained by training data input at random each time.
After training of the human-computer dialogue reply model is completed by randomly inputting training data each time, whether the human-computer dialogue reply model after the training is converged or not is judged. The specific way to determine whether the human-computer dialogue reply model converges is as follows:
firstly, calculating a loss function value of a human-computer dialogue reply model after each training by adopting a cross entropy loss function;
secondly, comparing the loss function value of the man-machine conversation reply model obtained by calculation with a preset threshold value;
finally, if the loss function value is not smaller than a preset threshold value, judging that the man-machine conversation reply model is not converged; and if the loss function value is larger than the preset threshold value, judging that the man-machine conversation reply model is converged.
In this embodiment of the present application, before randomly inputting data of each sub-model into the LSTM structure for training, the step of training the human-computer dialogue reply model may further include:
according to the data volume of training data of the cold-talk problem judging submodel, the multi-classification submodel, the text generating submodel and the text evaluating submodel, the data volume of training data for training the cold-talk problem judging submodel, the multi-classification submodel, the text generating submodel and the text evaluating submodel is adjusted.
In the embodiment of the present application, the specific adjustment manner may be to adjust the data amount of training data of the small speech problem determination submodel, the multi-classification submodel, the text generation submodel, and the text evaluation submodel to be consistent. Because each training is training data randomly selected and input from the training data of all the submodels, the training data volume of each submodel is unified, so that the fact that each submodel in the whole training man-machine conversation reply model is uniformly trained can be guaranteed, the training result of the man-machine conversation reply model can be guaranteed, model convergence can be accelerated, and the model training speed is increased.
Specifically, the following describes, by way of example, a process of adjusting the data amount of training data of the training small-speech problem determination submodel, the multi-classification submodel, the text generation submodel, and the text evaluation submodel.
If the amount of training data of the small-size problem determination submodel is 200 pieces, the amount of training data of the multi-classification submodel is 300 pieces, the amount of training data of the text generation submodel is 300 pieces, and the amount of training data of the text evaluation submodel is 800 pieces. The data size of training data of a cold-talk problem judgment submodel, a multi-classification submodel, a text generation submodel and a text evaluation submodel can be unified into 300 pieces. For the sub-model for judging the cold-talk problem, 100 training data can be randomly selected from the existing 200 training data, and the training data of the sub-model for judging the cold-talk problem is formed by the randomly selected 100 training data and the existing 200 data; for the text evaluation submodel, 300 pieces of training data may be randomly selected from 800 pieces of training data as the text evaluation submodel.
In this embodiment of the present application, the step of training the human-computer interaction reply model may further include:
and in each training process of the man-machine conversation reply model, optimizing the parameters of the sub-model corresponding to the training data randomly input into the man-machine conversation reply model each time and the parameters of the LSTM structure by adopting an optimizer, wherein the optimizer comprises an Adam optimizer.
And optimizing the parameters of the submodel corresponding to the input training data and the parameters of the LSTM structure in each training process by adopting an Adam optimizer, so that each training is ensured to be the parameters for training the human-computer conversation reply model towards the direction of converging the human-computer conversation reply model.
In this embodiment of the present application, before training the human-computer conversation reply model, the method may further include a step of processing training data of the human-computer conversation reply model. The method comprises the following steps:
firstly, training data of a human-computer dialogue reply model is obtained.
Specifically, training data of a small-talk problem judgment submodel, a multi-classification submodel, a text generation submodel and a text evaluation submodel are respectively acquired.
The way of acquiring the training data of the multi-classification submodel may be:
and acquiring the marked cold talk problem, and using the acquired cold talk problem as training data of the multi-classification sub-model, wherein the marked cold talk problem can be manually marked. Among the already labeled cold-talk problems, each type of cold-talk problem includes a plurality of similar problems, each including a corresponding category. For example, for a cold-talk problem of "hello", it can correspond to a plurality of similar problems including "hello", etc., and if "hello" corresponds to a category of the cold-talk problem being the first category, then the categories of the similar problems of "hello", etc. are also the first category.
The mode of acquiring training data of the small-talk problem judgment submodel can be as follows:
the small-talk problem judging submodel is a binary model, and training data of the small-talk problem judging submodel comprises two parts, namely a positive case and a negative case. Specifically, all the similar problems in the small-talk problem determination submodel may be taken as positive examples, a preset number of similar problems selected from all the service problems may be taken as negative examples, and training data of the small-talk problem determination submodel may be composed of the positive examples and the negative examples. Wherein, each positive case and negative case corresponds to a label identifying whether or not a problem is small and small, specifically, each problem in the positive case corresponds to a label of "yes", and each problem in the negative case corresponds to a label of "no".
The method for acquiring the training data of the text generation submodel may be:
and using the cold-data as training data of a text generation submodel, wherein the cold-data comprises a question and answer pair. The cold data packets are mainly derived from the cold data packets in the multi-classification submodel, and may include public cold data packets, which may be collected by different interactive robots.
The method for acquiring the training data of the text evaluation submodel may be as follows:
the text evaluation submodel may be a two-class model, and the training data of the text evaluation submodel includes positive examples of sentences and negative examples of sentences. Wherein, the regular sentence can be randomly sampled from the reply of the cold data and the service data, and the regular sentence is a normal general sentence; a negative example sentence may be composed of randomly extracted words, which is a randomly generated sentence. In the training data of the text evaluation submodel, the number of positive example sentences and negative example sentences having the same number of words is the same. The training data of the text evaluation submodel ensures that the positive example sentences and the negative example sentences with the same word number have the same number, so that the text evaluation submodel is not influenced by the word number of the sentences in the training process.
And then, cleaning the acquired training data of the man-machine conversation reply model.
The data cleaning process includes three parts, namely data filtering, data sorting and data segmentation, and each part is described in detail below.
And in the data filtering process, removing data in a non-preset format in the training data of each sub-model. Specifically, the data in the non-preset format included in the training data of each sub-model may be filtered in a regular expression matching manner. For example, the data in the preset format may be letters, Chinese characters, punctuation marks and the like, and when the training data of the multi-classification submodel is "hello, &%", the "&%" in the training data may be removed through the regular expression, and the filtered training data is "hello,". Also used in the data filtering process to convert the font of the training data for each sub-model to a predetermined font may be converting traditional font to simplified font, e.g., "how today is"? "convert to" how do the physical condition today? ". In the embodiment of the present application, the dialect can also be converted into mandarin in the process of data filtering process, for example, the "good your!in Shanghai! "convert to" hello! ". It should be understood that the above description is only an example of several specific filtering manners in the data filtering process, and in the embodiment of the present application, the data filtering process may also include other more filtering manners.
And in the data sorting process, sorting the obtained training data of each submodel according to different data requirement formats of each submodel, and preparing for inputting the training data corresponding to each submodel. Specifically, a cold-talk problem judgment submodel, a multi-classification submodel and a text evaluation submodel belong to classification models, and training data of each cold-talk problem judgment submodel, multi-classification submodel and text evaluation submodel correspond to specific categories; the text generation submodel belongs to a generation model, and training data of the text generation submodel may be composed of pairs of questions and answers.
In the data segmentation process, the training data of each sub-model is divided into a training data set and a test data set according to a preset ratio (for example, 4: 1). The training data of each submodel is segmented into a training data set and a testing data set, each submodel is trained by the aid of the training data set, each trained submodel is tested by the aid of the testing data set, and training results of each submodel are evaluated in the man-machine conversation reply model training process.
And finally, coding the cleaned training data to obtain a vocabulary.
When the human-computer dialogue reply model is trained, training data needs to be input into the human-computer dialogue reply model for training after being coded. For example, if the code corresponding to the training data "hello" is "01", the input training data "hello" is converted into "01" and then input into the human-computer interaction reply model for training. Therefore, a vocabulary table can be obtained by coding the cleaned training data, and before the training data is input into the man-machine conversation reply model for training, the vocabulary table can be searched to obtain the codes corresponding to the training data.
Specifically, in the process of coding the training data after the cleaning processing to obtain the vocabulary:
firstly, counting characters or symbols in training data after cleaning;
and then, according to the word frequency of the counted words or symbols, sequencing the words or symbols in the vocabulary table to obtain the vocabulary table.
In the process of training the human-computer dialogue reply model, the training data input into the human-computer dialogue reply model is input into the human-computer dialogue reply model for training after being coded. For this purpose, a vocabulary including all words and symbols of the training data is created, and the corresponding codes of the input data can be obtained by looking up the table each time the data is input. In the process of creating the vocabulary table, the training data can be counted, the words and the symbols in the training data are put into the vocabulary table in a descending mode according to the word frequency of the words and the symbols in the training data, and the size of the vocabulary table is controlled according to the situation. For example, words and symbols with a word frequency of 2 or more are put into the vocabulary table, and words and symbols with a word frequency of 2 or less are discarded. The calculation amount in the training process of the man-machine conversation reply model can be reduced by controlling the size of the vocabulary.
After the training of the human-computer conversation reply model is completed, the model structure and parameters of the human-computer conversation reply model are stored, online deployment and switching of the human-computer conversation reply model can be realized by adopting TensorFlow Serving, and the human-computer conversation control method of the embodiment of the application can be realized through the deployed human-computer conversation reply model. Among them, TensorFlowserving is a high performance open source library for machine learning model serving.
The man-machine conversation control method provided by the above embodiment, first, judges whether the received target problem is a small talk problem; then, when the question is a cold-talk question, generating a first question reply by a preset question-answer matching rule, and generating a second question reply by a preset text generating rule; finally, it is determined whether to adopt the first question reply or the second question reply as the reply to the target question, according to the probabilities that the first question reply and the second question reply are used to reply to the target question. Different answers to the target question are generated by adopting two different question answering modes, and a better answer is selected as the answer to the target question according to the probability that the different answers correspondingly answer the target question, so that the answer to the cold-talk question has flexibility, and simultaneously, the better answer can be selected from different answers by adopting available evaluation criteria. Furthermore, when the man-machine conversation reply model is trained, the thought of multitask training is adopted to train the four sub-models simultaneously, the training effect of each sub-model can be effectively improved, the internal fusion degree between the sub-models in the whole man-machine conversation reply model is enhanced, and the trained man-machine conversation reply model is adopted to realize the man-machine conversation control method, so that the relevance between questions and answers in the man-machine conversation control process is improved.
Fig. 5 shows a block diagram of a human machine dialog control device 400 according to some embodiments of the present application, the functions performed by the human machine dialog control device 400 corresponding to the steps performed by the above-described method. The apparatus may be understood as the server 200 or a processor of the server 200, or may be understood as a component that is independent from the server 200 or the processor and implements the functions of the present application under the control of the server 200, as shown in fig. 5, the human-machine conversation control apparatus 400 may include a determining module 450, an obtaining module 460, a generating module 470 and a selecting module 480.
The determining module 450 is configured to determine whether the received target problem is a small-talk problem when the target problem is received.
It is understood that the determining module 450 can be used to execute the step S110, and the detailed implementation of the determining module 450 can refer to the content related to the step S110.
An obtaining module 460, configured to obtain a first question response corresponding to the target question from a knowledge base of the interactive robot according to a preset question-answer matching rule when the target question is a cold-spoken question, and use the first question response as a first probability of a reply to the target question. It is understood that the obtaining module 460 can be used to perform the step S120, and for the detailed implementation of the obtaining module 460, reference can be made to the content related to the step S120.
The generating module 470 may be configured to generate a second question response corresponding to the target question according to a preset text generation rule when the target question is a cold-spoken question, and calculate a second probability that the second question response is used as a response of the target question. It is understood that the generating module 470 can be used to execute the step S130, and for the detailed implementation of the generating module 470, reference can be made to the contents related to the step S130.
The selecting module 480 may be configured to compare the first probability with the second probability, and select the first question reply or the second question reply as a reply to the target question according to a comparison result. It is understood that the selection module 480 may be configured to perform the step S140, and for a detailed implementation of the selection module 480, reference may be made to the contents related to the step S140.
In a possible implementation, the selection module 480 may be further specifically configured to:
when the first probability is greater than the second probability, the first question reply is taken as a reply to the target question;
when the first probability is smaller than the second probability, the second question reply is used as a reply to the target question;
and when the first probability is equal to the second probability, selecting one of the first question reply and the second question reply as a reply to the target question.
In a possible implementation, the interactive robot includes a human-computer dialogue reply model including a long-short term memory network LSTM structure, a small talk problem determination submodel, a multi-classification submodel, a text generation submodel, and a text evaluation submodel. The interactive robot can adopt a trained human-computer conversation reply model to carry out human-computer conversation control, wherein,
a judging module 450 for judging whether the received target problem is a small talk problem by using a small talk problem judging submodel;
an obtaining module 460, configured to obtain a first question reply corresponding to the target question and a first probability that the first question reply is a reply to the target question by using a multi-classification submodel when the target question is a cold conversation question, wherein the multi-classification submodel is used for training a question-answer matching rule;
and a generating module 470, configured to generate a second question response corresponding to the target question by using the text generation sub-model when the target question is a cold-fast question, and calculate a second probability that the second question response is a response of the target question by using the text evaluation sub-model, where the text generation sub-model is used to train a text generation rule, and the text evaluation sub-model is used to train an evaluation rule of the question response.
Referring to fig. 6, in a possible implementation, the human-machine conversation control apparatus 400 may further include:
the training module 430 is used for training a man-machine conversation reply model, wherein the man-machine conversation reply model comprises a long-short term memory network (LSTM) structure, a small talk problem judgment sub-model, a multi-classification sub-model, a text generation sub-model and a text evaluation sub-model;
the training module 430 is specifically configured to:
and randomly inputting the training data of each sub-model into an LSTM structure for training, and inputting the training result after the LSTM structure training into each corresponding sub-model for training until the man-machine conversation reply model is converged.
In one possible implementation, the training module 430 may further be configured to:
calculating a loss function value of the human-computer dialogue reply model after each training by adopting a cross entropy loss function;
comparing the loss function value with a preset threshold value;
if the loss function value is not smaller than the preset threshold value, judging that the man-machine conversation reply model is not converged;
and if the loss function value is larger than the preset threshold value, judging that the man-machine conversation reply model is converged.
In one possible implementation, the training module 430 may further be configured to:
according to the data volume of training data of the cold-talk problem judging submodel, the multi-classification submodel, the text generating submodel and the text evaluating submodel, the data volume of training data for training the cold-talk problem judging submodel, the multi-classification submodel, the text generating submodel and the text evaluating submodel is adjusted.
In one possible implementation, the training module 430 may further be configured to:
in each training process, optimizing the parameters of the sub-model corresponding to the training data randomly input into the man-machine conversation reply model and the parameters of the LSTM structure by adopting an optimizer, wherein the optimizer comprises an Adam optimizer.
Referring to fig. 6 again, the human-machine interaction control device 400 may further include: a data acquisition module 410, a data cleansing module 420, and a data encoding module 430.
The data acquisition module 410 may be used to acquire training data for a human-machine dialog reply model.
Specifically, the data acquisition module 410 is configured to:
acquiring marked cold talk problem, and using the acquired cold talk problem as training data of a multi-classification submodel, wherein each type of cold talk problem comprises a plurality of similar problems, and each problem comprises a corresponding category;
taking training data of a multi-classification submodel as a positive case, taking a preset number of similar problems selected from business problems as a negative case, and forming training data of a small-talk problem judgment submodel by the positive case and the negative case, wherein each positive case and negative case correspond to a label identifying whether the small-talk problem is generated or not;
using the cold-data as training data of a text generation submodel, wherein the cold-data comprises question and answer pairs;
positive example sentences are randomly sampled from the cold-spoken data and the traffic data, sentences composed of randomly extracted words are used as negative example sentences, and the positive example sentences and the negative example sentences are used as training data of the text evaluation submodel, wherein the number of the positive example sentences and the number of the negative example sentences with the same word number are the same.
The data cleansing module 420 may be configured to perform a cleansing process on the training data.
Specifically, the data cleansing module 420 is specifically configured to:
filtering the training data to remove data in a non-preset format in the training data;
the filtered training data is subjected to data sorting, and the training data of each sub-model is sorted into a corresponding format required by each sub-model;
and dividing the training data of each sub-model into a training data set and a testing data set according to a preset proportion.
Further, the data cleansing module 420 is configured to:
and filtering the data in the non-preset format contained in the training data in a regular expression matching mode, and converting the font of the training data into a preset font.
And the data encoding module 430 may be configured to encode the cleaned training data to obtain a vocabulary, where the vocabulary includes words and symbols required by the data.
Specifically, the data encoding module 430 is configured to:
counting characters or symbols in the training data after cleaning;
and sequencing the words or symbols in the vocabulary table according to the word frequency of the counted words or symbols to obtain the vocabulary table.
The embodiment of the application also provides a readable storage medium, and the readable storage medium stores computer executable instructions which can execute the man-machine conversation control method in any method embodiment.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to corresponding processes in the method embodiments, and are not described in detail in this application. In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and there may be other divisions in actual implementation, and for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or modules through some communication interfaces, and may be in an electrical, mechanical or other form.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (26)

1. A man-machine conversation control method is applied to an interactive robot, and comprises the following steps:
when a target problem of a user is received, judging whether the received target problem is a cold talk problem or not;
when the target question is a cold-talk question, obtaining a first question reply corresponding to the target question from a knowledge base of the interactive robot according to a preset question-answer matching rule, and adopting the first question reply as a first probability of replying the target question;
when the target question is a cold-talk question, generating a second question reply corresponding to the target question according to a preset text generation rule, and calculating a second probability of adopting the second question reply as a reply of the target question according to an evaluation rule of a preset question reply;
and comparing the first probability with the second probability, and selecting the first question reply or the second question reply as a reply to the target question according to the comparison result.
2. The method of claim 1, wherein comparing the first probability and the second probability, and selecting either the first question reply or the second question reply as the reply to the target question based on the comparison comprises:
when the first probability is greater than a second probability, answering the first question as a reply to the target question;
when the first probability is less than a second probability, answering the second question as a reply to the target question;
optionally one of the first question reply and the second question reply as a reply to the target question when the first probability is equal to a second probability.
3. The method of claim 1, wherein before the interactive robot includes a human-computer conversation reply model to determine whether the received target problem is a small talk problem, the method further comprises:
training the human-computer conversation reply model, wherein the human-computer conversation reply model comprises a long-short term memory network (LSTM) structure, a small-talk problem judgment sub-model, a multi-classification sub-model, a text generation sub-model and a text evaluation sub-model;
the training of the human-computer dialogue reply model comprises:
and randomly inputting the training data of each sub-model into the LSTM structure for training, and inputting the training result after the LSTM structure training into each corresponding sub-model for training until the man-machine conversation reply model is converged.
4. The method of claim 3, wherein the step of training the human-machine dialog reply model further comprises:
calculating a loss function value of the man-machine conversation reply model after each training by adopting a cross entropy loss function;
comparing the loss function value with a preset threshold value;
if the loss function value is not smaller than the preset threshold value, judging that the human-computer conversation reply model is not converged;
and if the loss function value is larger than the preset threshold value, judging that the human-computer conversation reply model is converged.
5. The method of claim 3, wherein the step of training the human dialog reply model prior to randomly entering the training data for each sub-model into the LSTM structure for training further comprises:
and adjusting the data volume of training data for training the cold-talk problem judging submodel, the multi-classification submodel, the text generating submodel and the text evaluation submodel according to the data volume of the training data of the cold-talk problem judging submodel, the multi-classification submodel, the text generating submodel and the text evaluation submodel.
6. The method of claim 3, wherein the step of training the human-machine dialog reply model further comprises:
in each training process, optimizing the parameters of the sub-model corresponding to the training data randomly input into the man-machine conversation reply model and the parameters of the LSTM structure by adopting an optimizer, wherein the optimizer comprises an Adam optimizer.
7. The method of any one of claims 3-6, wherein: the interactive robot adopts a trained human-computer conversation reply model to carry out human-computer conversation control, wherein,
judging whether the received target problem is a cold talk problem or not by adopting the cold talk problem judging submodel;
when the target question is a cold-talk question, adopting the multi-classification submodel to obtain a first question reply corresponding to the target question and a first probability of the first question reply serving as a reply of the target question, wherein the multi-classification submodel is used for training a question-answer matching rule;
and when the target question is a cold-talk question, generating a second question reply corresponding to the target question by adopting the text generation submodel, and calculating a second probability of the second question reply serving as a reply of the target question by adopting the text evaluation submodel, wherein the text generation submodel is used for training a text generation rule, and the text evaluation submodel is used for training an evaluation rule of the question reply.
8. The method of any of claims 3-6, wherein prior to training the human-machine dialog reply model, the method further comprises the step of processing training data for the human-machine dialog reply model, the steps comprising:
acquiring training data of the man-machine conversation reply model;
cleaning the training data;
and coding the cleaned training data to obtain a vocabulary, wherein the vocabulary comprises words and symbols required by the data.
9. The method of claim 8, wherein the step of obtaining training data for the human-machine dialog reply model comprises:
acquiring marked cold talk problem, and using the acquired cold talk problem as training data of the multi-classification submodel, wherein each type of cold talk problem comprises a plurality of similar problems, and each problem comprises a corresponding category;
taking the training data of the multi-classification submodel as a positive case, taking a preset number of similar problems selected from business problems as a negative case, and composing the training data of the small-talk problem judgment submodel by the positive case and the negative case, wherein each positive case and negative case corresponds to a label identifying whether the small-talk problem is generated or not;
using the cold-data as training data of the text generation submodel, wherein the cold-data comprises question and answer pairs;
positive example sentences are randomly sampled from the cold-spoken data and the traffic data, sentences composed of randomly extracted words are used as negative example sentences, and the positive example sentences and the negative example sentences are used as training data of the text evaluation submodel, wherein the number of the positive example sentences and the negative example sentences with the same word number is the same.
10. The method of claim 9, wherein said step of subjecting said training data to a washing process comprises:
filtering the training data to remove data with a non-preset format in the training data;
the filtered training data is subjected to data sorting, and the training data of each sub-model is sorted into a corresponding format required by each sub-model;
and dividing the training data of each sub-model into a training data set and a testing data set according to a preset proportion.
11. The method of claim 10, wherein the step of filtering the training data to remove data in a non-predetermined format from the training data comprises:
and filtering data in a non-preset format contained in the training data in a regular expression matching mode, and converting the font of the training data into a preset font.
12. The method of claim 8, wherein the step of encoding the cleaned training data into a vocabulary comprises:
counting characters or symbols in the training data after cleaning;
and sequencing the words or symbols in the vocabulary table according to the word frequency of the counted words or symbols to obtain the vocabulary table.
13. A human-computer conversation control apparatus, applied to an interactive robot, the apparatus comprising:
the judging module is used for judging whether the received target problem is a small talk problem or not when the target problem of the user is received;
an obtaining module, configured to obtain a first question reply corresponding to the target question from a knowledge base of the interactive robot according to a preset question-answer matching rule when the target question is a cold-speech question, and use the first question reply as a first probability of replying to the target question;
a generating module, configured to generate a second question reply corresponding to the target question according to a preset text generation rule when the target question is a cold conversation question, and calculate a second probability of adopting the second question reply as a reply to the target question according to an evaluation rule of a preset question reply;
and the selection module is used for comparing the first probability with the second probability and selecting the first question reply or the second question reply as a reply to the target question according to a comparison result.
14. The apparatus of claim 13, wherein the selection module is specifically configured to:
when the first probability is greater than a second probability, answering the first question as a reply to the target question;
when the first probability is less than a second probability, answering the second question as a reply to the target question;
optionally one of the first question reply and the second question reply as a reply to the target question when the first probability is equal to a second probability.
15. The apparatus of claim 13, wherein the interactive robot includes a human-machine dialog reply model, the apparatus further comprising:
the training module is used for training the man-machine conversation reply model, wherein the man-machine conversation reply model comprises a long-short term memory network (LSTM) structure, a small talk problem judgment submodel, a multi-classification submodel, a text generation submodel and a text evaluation submodel;
the training module is specifically configured to:
and randomly inputting the training data of each sub-model into the LSTM structure for training, and inputting the training result after the LSTM structure training into each corresponding sub-model for training until the man-machine conversation reply model is converged.
16. The apparatus of claim 15, wherein the training module is further to:
calculating a loss function value of the man-machine conversation reply model after each training by adopting a cross entropy loss function;
comparing the loss function value with a preset threshold value;
if the loss function value is not smaller than the preset threshold value, judging that the human-computer conversation reply model is not converged;
and if the loss function value is larger than the preset threshold value, judging that the human-computer conversation reply model is converged.
17. The apparatus of claim 15, wherein the training module is further to:
and adjusting the data volume of training data for training the cold-talk problem judging submodel, the multi-classification submodel, the text generating submodel and the text evaluation submodel according to the data volume of the training data of the cold-talk problem judging submodel, the multi-classification submodel, the text generating submodel and the text evaluation submodel.
18. The apparatus of claim 15, wherein the training module is further to:
in each training process, optimizing the parameters of the sub-model corresponding to the training data randomly input into the man-machine conversation reply model and the parameters of the LSTM structure by adopting an optimizer, wherein the optimizer comprises an Adam optimizer.
19. The apparatus of any one of claims 15-18, wherein: the interactive robot adopts a trained human-computer conversation reply model to carry out human-computer conversation control, wherein,
the judging module is used for judging whether the received target problem is a small talk problem by adopting the small talk problem judging submodel;
the obtaining module is configured to obtain a first question reply corresponding to the target question by using the multi-classification submodel when the target question is a cold conversation question, and obtain a first probability that the first question reply is used as a reply of the target question, where the multi-classification submodel is used for training a question-answer matching rule;
and the generating module is used for generating a second question reply corresponding to the target question by adopting the text generating sub-model when the target question is a cold-scaled question and calculating a second probability of the second question reply serving as a reply of the target question by adopting the text evaluation sub-model, wherein the text generating sub-model is used for training a text generating rule, and the text evaluation sub-model is used for training an evaluation rule of the question reply.
20. The apparatus of any one of claims 15-18, further comprising:
the data acquisition module is used for acquiring training data of the man-machine conversation reply model;
the data cleaning module is used for cleaning the training data;
and the data coding module is used for coding the cleaned training data to obtain a vocabulary table, wherein the vocabulary table comprises words and symbols required by the data.
21. The apparatus of claim 20, wherein the data acquisition module is specifically configured to:
acquiring marked cold talk problem, and using the acquired cold talk problem as training data of the multi-classification submodel, wherein each type of cold talk problem comprises a plurality of similar problems, and each problem comprises a corresponding category;
taking the training data of the multi-classification submodel as a positive case, taking a preset number of similar problems selected from business problems as a negative case, and composing the training data of the small-talk problem judgment submodel by the positive case and the negative case, wherein each positive case and negative case corresponds to a label identifying whether the small-talk problem is generated or not;
using the cold-data as training data of the text generation submodel, wherein the cold-data comprises question and answer pairs;
positive example sentences are randomly sampled from the cold-spoken data and the traffic data, sentences composed of randomly extracted words are used as negative example sentences, and the positive example sentences and the negative example sentences are used as training data of the text evaluation submodel, wherein the number of the positive example sentences and the negative example sentences with the same word number is the same.
22. The apparatus of claim 21, wherein the data cleansing module is specifically configured to:
filtering the training data to remove data with a non-preset format in the training data;
the filtered training data is subjected to data sorting, and the training data of each sub-model is sorted into a corresponding format required by each sub-model;
and dividing the training data of each sub-model into a training data set and a testing data set according to a preset proportion.
23. The apparatus of claim 22, wherein the data cleansing module is further to:
and filtering data in a non-preset format contained in the training data in a regular expression matching mode, and converting the font of the training data into a preset font.
24. The apparatus of claim 20, wherein the data encoding module is specifically configured to:
counting characters or symbols in the training data after cleaning;
and sequencing the words or symbols in the vocabulary table according to the word frequency of the counted words or symbols to obtain the vocabulary table.
25. A server, comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating via the bus when the server is running, the processor executing the machine-readable instructions to perform the steps of the human-machine interaction control method according to any one of claims 1-12 when executed.
26. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the human-machine dialog control method as claimed in any one of the claims 1 to 12.
CN201910140016.5A 2019-02-26 2019-02-26 Man-machine conversation control method and device, server and readable storage medium Active CN111611354B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910140016.5A CN111611354B (en) 2019-02-26 2019-02-26 Man-machine conversation control method and device, server and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910140016.5A CN111611354B (en) 2019-02-26 2019-02-26 Man-machine conversation control method and device, server and readable storage medium

Publications (2)

Publication Number Publication Date
CN111611354A true CN111611354A (en) 2020-09-01
CN111611354B CN111611354B (en) 2023-09-29

Family

ID=72195613

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910140016.5A Active CN111611354B (en) 2019-02-26 2019-02-26 Man-machine conversation control method and device, server and readable storage medium

Country Status (1)

Country Link
CN (1) CN111611354B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160253596A1 (en) * 2015-02-26 2016-09-01 International Business Machines Corporation Geometry-directed active question selection for question answering systems
CN107423432A (en) * 2017-08-03 2017-12-01 当家移动绿色互联网技术集团有限公司 The method and system of professional problem and greeting problem are distinguished by robot
CN107844784A (en) * 2017-12-08 2018-03-27 广东美的智能机器人有限公司 Face identification method, device, computer equipment and readable storage medium storing program for executing
CN107908803A (en) * 2017-12-26 2018-04-13 上海智臻智能网络科技股份有限公司 The response method and device, storage medium, terminal of question and answer interaction
CN108334497A (en) * 2018-02-06 2018-07-27 北京航空航天大学 The method and apparatus for automatically generating text
CN108363690A (en) * 2018-02-08 2018-08-03 北京十三科技有限公司 Dialog semantics Intention Anticipation method based on neural network and learning training method
CN108491433A (en) * 2018-02-09 2018-09-04 平安科技(深圳)有限公司 Chat answer method, electronic device and storage medium
CN108734276A (en) * 2018-04-28 2018-11-02 同济大学 A kind of learning by imitation dialogue generation method generating network based on confrontation
CN108984679A (en) * 2018-06-29 2018-12-11 北京百度网讯科技有限公司 Dialogue generates the training method and device of model
US20190371299A1 (en) * 2017-02-28 2019-12-05 Huawei Technologies Co., Ltd. Question Answering Method and Apparatus

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160253596A1 (en) * 2015-02-26 2016-09-01 International Business Machines Corporation Geometry-directed active question selection for question answering systems
US20190371299A1 (en) * 2017-02-28 2019-12-05 Huawei Technologies Co., Ltd. Question Answering Method and Apparatus
CN107423432A (en) * 2017-08-03 2017-12-01 当家移动绿色互联网技术集团有限公司 The method and system of professional problem and greeting problem are distinguished by robot
CN107844784A (en) * 2017-12-08 2018-03-27 广东美的智能机器人有限公司 Face identification method, device, computer equipment and readable storage medium storing program for executing
CN107908803A (en) * 2017-12-26 2018-04-13 上海智臻智能网络科技股份有限公司 The response method and device, storage medium, terminal of question and answer interaction
CN108334497A (en) * 2018-02-06 2018-07-27 北京航空航天大学 The method and apparatus for automatically generating text
CN108363690A (en) * 2018-02-08 2018-08-03 北京十三科技有限公司 Dialog semantics Intention Anticipation method based on neural network and learning training method
CN108491433A (en) * 2018-02-09 2018-09-04 平安科技(深圳)有限公司 Chat answer method, electronic device and storage medium
CN108734276A (en) * 2018-04-28 2018-11-02 同济大学 A kind of learning by imitation dialogue generation method generating network based on confrontation
CN108984679A (en) * 2018-06-29 2018-12-11 北京百度网讯科技有限公司 Dialogue generates the training method and device of model

Also Published As

Publication number Publication date
CN111611354B (en) 2023-09-29

Similar Documents

Publication Publication Date Title
CN111179935B (en) Voice quality inspection method and device
CN107239450B (en) Method for processing natural language based on interactive context
CN111191450A (en) Corpus cleaning method, corpus entry device and computer-readable storage medium
CN106489159A (en) A kind of user's portrait based on deep neural network represents learning system and method
CN112037775B (en) Voice recognition method, device, equipment and storage medium
KR102521594B1 (en) A system that analyzes picture colors and analyzes users based on artificial intelligence
CN108628908B (en) Method, device and electronic equipment for classifying user question-answer boundaries
CN115309877A (en) Dialog generation method, dialog model training method and device
KR102117287B1 (en) Method and apparatus of dialog scenario database constructing for dialog system
CN115146124A (en) Question-answering system response method and device, equipment, medium and product thereof
CN111597821A (en) Method and device for determining response probability
CN114783421A (en) Intelligent recommendation method and device, equipment and medium
CN114970666B (en) Spoken language processing method and device, electronic equipment and storage medium
CN115953080A (en) Engineer service level determination method, apparatus and storage medium
CN111611354A (en) Man-machine conversation control method, device, server and readable storage medium
CN109919657A (en) Acquisition methods, device, storage medium and the speech ciphering equipment of user demand information
CN111401388A (en) Data mining method, device, server and readable storage medium
CN114490967A (en) Training method of dialogue model, dialogue method and device of dialogue robot and electronic equipment
CN114756655A (en) Data query method, device, equipment and storage medium
CN114202363A (en) Artificial intelligence based call method, device, computer equipment and medium
CN114464179A (en) Voice interaction method, system, device, equipment and storage medium
CN107066567B (en) Topic detection-based user portrait modeling method and system in text conversation
CN112328871A (en) Reply generation method, device, equipment and storage medium based on RPA module
CN111933133A (en) Intelligent customer service response method and device, electronic equipment and storage medium
CN113627399B (en) Topic processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant