CN108829896B - Reply information feedback method and device - Google Patents

Reply information feedback method and device Download PDF

Info

Publication number
CN108829896B
CN108829896B CN201810718062.4A CN201810718062A CN108829896B CN 108829896 B CN108829896 B CN 108829896B CN 201810718062 A CN201810718062 A CN 201810718062A CN 108829896 B CN108829896 B CN 108829896B
Authority
CN
China
Prior art keywords
correlation
reply
statement
information
generate
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.)
Active
Application number
CN201810718062.4A
Other languages
Chinese (zh)
Other versions
CN108829896A (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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201810718062.4A priority Critical patent/CN108829896B/en
Publication of CN108829896A publication Critical patent/CN108829896A/en
Application granted granted Critical
Publication of CN108829896B publication Critical patent/CN108829896B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a reply information feedback method and a reply information feedback device, wherein the method comprises the following steps: acquiring an input statement, and acquiring at least one candidate reply statement corresponding to the input statement according to a pre-trained context reply model; performing correlation calculation on each candidate reply statement and each input statement to generate a corresponding first correlation matrix containing diagonal correlation information; carrying out diagonal linear transformation on each first correlation matrix to obtain a corresponding second correlation matrix containing matrix correlation information; processing each second correlation matrix through a convolutional neural network to generate corresponding eigenvectors; and calculating each characteristic vector through a neural network to obtain the association degree between each candidate reply statement and each input statement, and feeding back information according to the association degree. Therefore, the convolution efficiency is improved by carrying out diagonal conversion on the matrix containing the diagonal related information and then processing the matrix through the convolution neural network, so that the accuracy of feedback of reply information is improved, and the user experience is improved.

Description

Reply information feedback method and device
Technical Field
The application relates to the technical field of artificial intelligence, in particular to a reply information feedback method and device.
Background
With the continuous development of artificial intelligence technology, the general dialog system is receiving more and more attention as an important scene of artificial intelligence, such as a chat robot, a mobile phone assistant, and the like. In a general dialog system, however, statements are generated that reply to the user, typically from a retrieval or generation model.
In the prior art, reply sentences from retrieval are not related to the currently spoken sentences of a user in a retrieval system; reply statements from generative models can have many unnatural and unrealistic replies, even safe replies. Therefore, in the prior art, the relevance of the reply statement is not high, that is, the accuracy of the reply statement is not high.
Disclosure of Invention
The present application is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, a first objective of the present application is to provide a reply information feedback method, so as to implement processing by a convolutional neural network after performing diagonal transformation on a matrix containing diagonal related information, improve convolution efficiency, and solve the technical problem in the prior art that a reply statement is not highly correlated, i.e., the accuracy of the reply statement is not high.
A second objective of the present application is to provide a reply information feedback device.
A third object of the present application is to propose a computer device.
A fourth object of the present application is to propose a non-transitory computer-readable storage medium.
A fifth object of the present application is to propose a computer program product.
To achieve the above object, an embodiment of a first aspect of the present application provides a reply information feedback method, including:
acquiring an input statement, and acquiring at least one candidate reply statement corresponding to the input statement according to a pre-trained context reply model;
performing correlation calculation on each candidate reply statement and the input statement to generate a corresponding first correlation matrix containing diagonal correlation information;
carrying out diagonal linear transformation on each first correlation matrix to obtain a corresponding second correlation matrix containing matrix correlation information;
processing each second correlation matrix through a convolutional neural network to generate corresponding eigenvectors;
and calculating each feature vector through a neural network, obtaining the association degree between each candidate reply statement and the input statement, and feeding back information according to the association degree.
According to the reply information feedback method, the input statement is obtained, at least one candidate reply statement corresponding to the input statement is obtained according to a pre-trained context reply model, then correlation calculation is carried out on each candidate reply statement and the input statement to generate a corresponding first correlation matrix containing diagonal correlation information, diagonal linear transformation is carried out on each first correlation matrix to obtain a corresponding second correlation matrix containing matrix correlation information, each second correlation matrix is processed through a convolutional neural network to generate a corresponding feature vector, finally, calculation is carried out on each feature vector through the neural network to obtain the correlation degree between each candidate reply statement and the input statement, and information feedback is carried out according to the correlation degree. Therefore, the convolution efficiency is improved by carrying out diagonal conversion on the matrix containing the diagonal related information and then processing the matrix through the convolution neural network, so that the accuracy of feedback of reply information is improved, and the user experience is improved.
To achieve the above object, a second aspect of the present application provides a reply information feedback apparatus, including:
the acquisition module is used for acquiring an input statement and acquiring at least one candidate reply statement corresponding to the input statement according to a pre-trained context reply model;
the generating module is used for performing correlation calculation on each candidate reply statement and the input statement to generate a corresponding first correlation matrix containing diagonal correlation information;
the transformation module is used for carrying out diagonal linear transformation on each first correlation matrix to obtain a corresponding second correlation matrix containing matrix correlation information;
the processing module is used for processing each second correlation matrix through a convolutional neural network to generate corresponding eigenvectors;
and the feedback module is used for calculating each feature vector through a neural network, acquiring the association degree between each candidate reply statement and the input statement, and feeding back information according to the association degree.
The reply information feedback device of the embodiment of the application acquires an input statement, acquires at least one candidate reply statement corresponding to the input statement according to a pre-trained context reply model, performs correlation calculation on each candidate reply statement and the input statement to generate a corresponding first correlation matrix containing diagonal correlation information, performs diagonal linear transformation on each first correlation matrix to acquire a corresponding second correlation matrix containing matrix correlation information, processes each second correlation matrix through a convolutional neural network to generate a corresponding eigenvector, calculates each eigenvector through a neural network to acquire the correlation degree between each candidate reply statement and the input statement, and performs information feedback according to the correlation degree. Therefore, the convolution efficiency is improved by carrying out diagonal conversion on the matrix containing the diagonal related information and then processing the matrix through the convolution neural network, so that the accuracy of feedback of reply information is improved, and the user experience is improved.
To achieve the above object, a third aspect of the present application provides a computer device, including: a processor; a memory for storing the processor-executable instructions; the processor reads the executable program code stored in the memory to run a program corresponding to the executable program code, so as to execute the reply information feedback method described in the embodiment of the first aspect.
In order to achieve the above object, a fourth aspect of the present application provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is configured to, when executed by a processor, implement a reply information feedback method according to an embodiment of the first aspect of the present application.
In order to achieve the above object, an embodiment of a fifth aspect of the present application provides a computer program product, where when executed by an instruction processor, the computer program product implements a reply information feedback method as described in the embodiment of the first aspect of the present application.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flowchart illustrating a reply information feedback method according to an embodiment of the present application;
FIG. 2 is an exemplary diagram of a correlation matrix provided by an embodiment of the present application;
fig. 3 is a schematic flowchart illustrating a reply information feedback method according to a second embodiment of the present application;
fig. 4 is a schematic structural diagram of a reply information feedback apparatus according to an embodiment of the present disclosure; and
FIG. 5 illustrates a block diagram of an exemplary computer device suitable for use in implementing embodiments of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
In an artificial intelligence general dialog system, sentences for replying to a user are usually generated and generally come from a retrieval or generation model, and reply sentences from retrieval are likely to be irrelevant aiming at the fact that the sentences currently spoken by the user are not in the retrieval system; reply statements from generative models can have many unnatural and unrealistic replies, even safe replies. In the prior art, the relevance of the reply statement is not high, that is, the accuracy of the reply statement is not high, so that the method is very necessary for improving the accuracy of the reply statement.
The method aims to solve the technical problem that the relevance of the reply sentences is not high, namely the accuracy of the reply sentences is not high in the prior art. In the embodiment of the application, the input statement is obtained, at least one candidate reply statement corresponding to the input statement is obtained according to a pre-trained context reply model, then, each candidate reply statement and the input statement are subjected to correlation calculation to generate a corresponding first correlation matrix containing diagonal correlation information, then, each first correlation matrix is subjected to diagonal linear transformation to obtain a corresponding second correlation matrix containing matrix correlation information, so that each second correlation matrix is processed through a convolutional neural network to generate a corresponding feature vector, finally, each feature vector is calculated through the neural network to obtain the correlation degree between each candidate reply statement and the input statement, and information feedback is performed according to the correlation degree.
The reply information feedback method and apparatus according to the embodiment of the present application are described below with reference to the drawings.
Fig. 1 is a flowchart illustrating a reply information feedback method according to an embodiment of the present disclosure.
As shown in fig. 1, the reply information feedback method includes the following steps:
step 101, obtaining an input statement, and obtaining at least one candidate reply statement corresponding to the input statement according to a pre-trained context reply model.
In practical applications, for example, when a chat robot, a mobile phone assistant and other human-computer interactions occur, a user can receive a corresponding reply sentence after inputting the sentence according to actual needs. It is understood that, for different scenarios, it may be that the user inputs the sentence in the form of voice or text, etc.
Therefore, the relevance between the reply sentence and the input sentence plays a critical role in the whole human-computer interaction, for example, the user input sentence "how good the air quality of beijing today" is, the received reply sentence is "good", or the reply sentence is "the air index is 30, excellent", that is, the relevance between the second reply information and the user input sentence is closer, and the user requirement can be better met. Therefore, the embodiment of the application mainly describes how to enable the reply information feedback to be more accurate, and the use experience of a user is improved.
Specifically, after the user input sentence is obtained, one or more candidate reply sentences can be obtained by processing the input sentence according to a pre-trained context reply model. For example, if the user input statement is "a", the "a" is input to the context reply model and processed to obtain the candidate reply statements "B, C and D", or the "a" is input to the context reply model and processed to obtain the candidate reply statement "E", and so on.
The context reply model is trained in advance, and the corresponding context reply model can be generated by extracting historical reply sentences output aiming at the same input sentence in different dialogue scenes and taking the extracted historical reply sentences as training samples for training.
That is, based on a normal dialog, the reply sentences with stronger relevance to the input sentences may be used as positive samples, the reply sentences with weaker or irrelevant relevance may be used as negative samples, and the training may be performed, and then the corresponding context reply model may be generated by processing through a correlation algorithm. The sample can be updated and adjusted according to the actual application requirement so as to improve the precision of the context reply model, so that the accuracy of the candidate reply statement is improved, and the final feedback reply statement is more accurate.
And 102, performing correlation calculation on each candidate reply statement and each input statement to generate a corresponding first correlation matrix containing diagonal correlation information.
It is understood that the candidate reply sentences may be one or more, and the relevance between the candidate reply sentences and the input sentences is different, so that the relevance between the candidate reply sentences and the input sentences can be calculated by a correlation calculation method, and a corresponding first correlation matrix containing diagonal correlation information is generated.
As a possible implementation manner, word segmentation is performed on the candidate reply sentences to generate a first word segmentation set, and word segmentation is performed on the input sentences to generate a second word segmentation set, wherein the number of the words in the first word segmentation set is the same as that in the second word segmentation set, and the words at the same position in the first word segmentation set and the second word segmentation set are respectively subjected to correlation calculation to generate a corresponding first correlation matrix containing diagonal correlation information.
The diagonal related information means that two participles with good relevance appear on the diagonal. That is, the diagonal relation information indicates that the word segmentation relevance at the same position is better.
And 103, carrying out diagonal linear transformation on each first correlation matrix to obtain a corresponding second correlation matrix containing matrix correlation information.
And 104, processing each second correlation matrix through the convolutional neural network to generate corresponding feature vectors.
Specifically, how many candidate reply sentences can generate how many corresponding first correlation matrices containing diagonal correlation information. Through analysis of the first correlation matrixes, it can be known that information with relatively good correlation appears on opposite angles, and therefore, diagonal linear transformation needs to be performed on each first correlation matrix to obtain corresponding second correlation matrixes containing matrix correlation information.
In order to make the above process more clear to those skilled in the art, the following description is made in detail with reference to fig. 2. As shown in fig. 2, the darker the color indicates that the correlation is stronger, and the lighter the color indicates that the correlation is weaker, it can be seen that the correlation marks of the first correlation matrix are all on the diagonal line, and the second correlation matrix in fig. 2 can be obtained by performing linear transformation on the correlation marks, so as to convert the correlation marks into rectangles.
Therefore, the correlation can be better amplified when the corresponding feature vectors are generated through subsequent convolutional neural network processing, as a possible implementation manner, a plurality of convolutional kernels with preset sizes are adopted to respectively carry out convolutional processing on a second correlation matrix containing matrix correlation information to generate a plurality of convolutional layers, the plurality of convolutional layers are respectively subjected to pooling processing to obtain a plurality of feature vectors, and the plurality of feature vectors are spliced to generate a fusion feature vector.
Specifically, continuing with fig. 2 as an example, taking convolution kernel 3 to directly convolve the first correlation matrix in fig. 2 can only process up to five small squares, and taking convolution kernel 3 to directly convolve the second correlation matrix in fig. 2 can process up to nine small squares. Therefore, the correlation is amplified through the conversion of the matrix, so that the subsequent association degree is more obviously acquired, and more accurate information feedback is obtained.
And 105, calculating each feature vector through a neural network, acquiring the association degree between each candidate reply statement and each input statement, and feeding back information according to the association degree.
Specifically, a method for feeding back information according to the relevance may be selected for the number of candidate reply sentences, which is described as follows:
in a first example, when a plurality of candidate reply sentences are provided, the association degrees between each candidate reply sentence and the input sentence are sorted, and the candidate reply sentence corresponding to the highest association degree is selected according to the sorting result for feedback.
In a second example, when there is one candidate reply statement, the association degree is compared with a preset threshold, the candidate reply statement is fed back when the association degree is greater than or equal to the preset threshold, and the information missing prompt message is fed back when the association degree is smaller than the preset threshold.
The preset threshold value can be selected and set according to the actual application requirement. That is to say, when there is only one candidate reply statement, it is directly determined whether the candidate reply statement can be output as a reply statement, so that the association between the candidate reply statement and the input statement is directly compared with a preset threshold, and if the association is better than or equal to the preset threshold, the candidate reply statement can be used as a reply statement, otherwise, no relevant reply statement exists, and the information missing prompt information is directly fed back (prompt can be performed in voice broadcast, vibration and other manners).
It should be noted that, in order to further improve the user experience, the prompting information content may be set, for example, to prompt the user to replace an input sentence with the same expression meaning.
According to the reply information feedback method, the input statement is obtained, at least one candidate reply statement corresponding to the input statement is obtained according to a pre-trained context reply model, then correlation calculation is carried out on each candidate reply statement and the input statement to generate a corresponding first correlation matrix containing diagonal correlation information, diagonal linear transformation is carried out on each first correlation matrix to obtain a corresponding second correlation matrix containing matrix correlation information, each second correlation matrix is processed through a convolutional neural network to generate a corresponding feature vector, finally, calculation is carried out on each feature vector through the neural network to obtain the correlation degree between each candidate reply statement and the input statement, and information feedback is carried out according to the correlation degree. Therefore, the convolution efficiency is improved by carrying out diagonal conversion on the matrix containing the diagonal related information and then processing the matrix through the convolution neural network, so that the accuracy of feedback of reply information is improved, and the user experience is improved.
For clarity of the above embodiment, the following description will be made in detail with reference to fig. 3 by taking the case where there are multiple candidate reply statements as an example. Fig. 3 is a schematic flowchart of a reply information feedback method according to a second embodiment of the present application.
As shown in fig. 3, the reply information feedback method may include the steps of:
step 201, obtaining an input statement, and obtaining at least one candidate reply statement corresponding to the input statement according to a pre-trained context reply model.
It should be noted that step 201 is the same as step 101, and the detailed description of step 201 may refer to step 101, and is not described in detail here.
Step 202, performing word segmentation on the candidate reply sentence to generate a first participle set, and performing word segmentation on the input sentence to generate a second participle set, wherein the number of the participles in the first participle set is the same as that in the second participle set.
Step 203, performing correlation calculation on the participles at the same position in the first participle set and the second participle set respectively to generate a corresponding first correlation matrix containing diagonal correlation information.
Specifically, word segmentation is performed on each candidate reply sentence through a relevant word segmentation processing algorithm or model, and a corresponding first word segmentation set is generated, compared with a reply sentence of "thunderstorm occurs in Beijing today", and the first word segmentation set generated after word segmentation processing is performed is "today", "Beijing", "thunderstorm occurs", and "thunderstorm".
Specifically, word segmentation processing is performed on the input sentence through a relevant word segmentation processing algorithm or model, and a corresponding second word segmentation set is generated, compared with a reply sentence of "how much is the weather of Beijing today", the second word segmentation set generated after word segmentation processing is performed is "today", "Beijing", "weather" and "how much".
It can be seen from the above example that the number of the participles in the first participle set is the same as that in the second participle set. It can be understood that the number of the two participles is inconsistent, and the participles can be supplemented or deleted according to actual needs to ensure the consistency of the number of the two participles.
Furthermore, the relevance between the participles at the same position in the first participle set and the participles at the same position in the second participle set are calculated respectively, and continuing to take the above example as an example, the relevance between the first participle set "today", "beijing", "occurrence of thunderstorm" and "thunderstorm" and the second participle set "today", "beijing", "weather" and "what kind" is calculated, so that the relevance can be seen, and a first relevance matrix of the similarity can be generated. By marking their correlation degrees, it can be determined that they all appear on the diagonal of the first correlation matrix, and the first correlation matrix thus generated contains diagonal correlation information.
And 204, performing diagonal linear transformation on each first correlation matrix to obtain a corresponding second correlation matrix containing matrix correlation information.
In step 205, a plurality of convolution kernels with preset sizes are used to perform convolution processing on the second correlation matrix containing the matrix correlation information, so as to generate a plurality of convolution layers.
And step 206, performing pooling processing on the plurality of convolutional layers respectively to obtain a plurality of feature vectors, and splicing the plurality of feature vectors to generate a fusion feature vector.
Specifically, through analysis of the first correlation matrices, it can be known that information with relatively good correlation appears on opposite angles, and therefore, diagonal linear transformation needs to be performed on each first correlation matrix to obtain a corresponding second correlation matrix containing matrix correlation information, so that correlation can be amplified better, and accuracy of a reply sentence is improved.
Therefore, in order to further amplify the correlation, a plurality of convolution kernels with different sizes may be preset to perform convolution processing on the second correlation matrix including the matrix correlation information respectively to generate a plurality of convolution layers, different convolution kernels may obtain different convolution layers, and the convolution layers are respectively subjected to pooling processing to obtain a plurality of feature vectors and are spliced to generate a fused feature vector as output data.
It should be noted that although the convolution kernel itself has convolutions in various directions, other useless convolutions too much disturb the information which is useful for itself. Therefore, in the embodiment, linear transformation is adopted to convert the first correlation matrix containing diagonal correlation information into the second correlation matrix containing matrix correlation information, so that useful information can be easily captured in the convolution process, and the feedback effect of replying information is obviously improved. The convolutional neural network can be a standard convolutional neural network, and can also be selectively set according to the actual application requirements.
And step 207, calculating each fusion feature vector through a neural network to obtain the association degree between each candidate reply statement and each input statement.
And 208, sequencing the association degrees between each candidate reply sentence and the input sentence, and selecting the candidate reply sentence corresponding to the highest association degree according to the sequencing result for feedback.
The neural network may be one or more of a recurrent neural network, a convolutional neural network, and the like.
Specifically, the association degree between each candidate reply statement and the input statement, such as the association degree of 0.5, 0.75, etc., can be obtained by calculating each fused feature vector through the neural network. That is, the degree of association is quantized and can be sorted and compared. Therefore, the candidate reply sentences corresponding to the highest association degree can be selected for feedback according to the sorting result, and the effect of the reply sentences is further improved.
The reply information feedback method of the embodiment of the application acquires an input sentence, acquires at least one candidate reply sentence corresponding to the input sentence according to a pre-trained context reply model, performs word segmentation processing on the candidate reply sentence to generate a first participle set, performs word segmentation processing on the input sentence to generate a second participle set, performs correlation calculation on participles at the same position in the first participle set and the second participle set respectively to generate a corresponding first correlation matrix containing diagonal correlation information, performs diagonal linear transformation on each first correlation matrix to acquire a corresponding second correlation matrix containing matrix correlation information, performs convolution processing on the second correlation matrix containing matrix correlation information respectively by adopting a plurality of convolution kernels with preset sizes to generate a plurality of convolution layers, performs pooling processing on the plurality of convolution layers respectively to acquire a plurality of characteristic vectors, and splicing the plurality of feature vectors to generate fusion feature vectors, calculating each fusion feature vector through a neural network to obtain the association degree between each candidate reply statement and each input statement, sequencing the association degrees between each candidate reply statement and each input statement, and selecting the candidate reply statement corresponding to the highest association degree according to the sequencing result for feedback. Therefore, the convolution efficiency is improved by carrying out diagonal conversion on the matrix containing the diagonal related information and then processing the matrix through the convolution neural network, so that the accuracy of feedback of reply information is improved, and the user experience is improved.
In order to implement the above embodiments, the present application further provides a reply information feedback device.
Fig. 4 is a schematic structural diagram of a reply information feedback device according to an embodiment of the present application.
As shown in fig. 4, the reply information feedback apparatus includes: an acquisition module 410, a generation module 420, a transformation module 430, a processing module 440, and a feedback module 450.
An obtaining module 410, configured to obtain an input sentence, and obtain at least one candidate reply sentence corresponding to the input sentence according to a pre-trained context reply model.
The generating module 420 is configured to perform correlation calculation on each candidate reply statement and the input statement, and generate a corresponding first correlation matrix including diagonal correlation information.
The transformation module 430 is configured to perform diagonal linear transformation on each first correlation matrix to obtain a corresponding second correlation matrix containing matrix correlation information.
And the processing module 440 is configured to process each second correlation matrix through a convolutional neural network to generate a corresponding feature vector.
The feedback module 450 is configured to calculate each feature vector through a neural network, obtain a degree of association between each candidate reply statement and each input statement, and perform information feedback according to the degree of association.
The generating module 420 is specifically configured to perform word segmentation on the candidate reply sentence to generate a first participle set, and perform word segmentation on the input sentence to generate a second participle set, where the number of participles in the first participle set is the same as that in the second participle set; and respectively carrying out correlation calculation on the participles at the same position in the first participle set and the second participle set to generate a corresponding first correlation matrix containing diagonal correlation information.
The processing module 440 is specifically configured to perform convolution processing on the second correlation matrix including the matrix correlation information by using a plurality of convolution kernels of preset sizes to generate a plurality of convolution layers, perform pooling processing on the plurality of convolution layers to obtain a plurality of eigenvectors, and perform splicing on the plurality of eigenvectors to generate a fusion eigenvector.
The feedback module 450 is specifically configured to rank the association degrees between each candidate reply statement and the input statement, and select the candidate reply statement corresponding to the highest association degree according to the ranking result for feedback.
The feedback module 450 is specifically configured to compare the association degree with a preset threshold, feed back the candidate reply sentence if the association degree is greater than or equal to the preset threshold, and feed back the missing-of-information prompt message if the association degree is smaller than the preset threshold.
The reply information feedback device of the embodiment of the application acquires an input statement, acquires at least one candidate reply statement corresponding to the input statement according to a pre-trained context reply model, performs correlation calculation on each candidate reply statement and the input statement to generate a corresponding first correlation matrix containing diagonal correlation information, performs diagonal linear transformation on each first correlation matrix to acquire a corresponding second correlation matrix containing matrix correlation information, processes each second correlation matrix through a convolutional neural network to generate a corresponding eigenvector, calculates each eigenvector through a neural network to acquire the correlation degree between each candidate reply statement and the input statement, and performs information feedback according to the correlation degree. Therefore, the convolution efficiency is improved by carrying out diagonal conversion on the matrix containing the diagonal related information and then processing the matrix through the convolution neural network, so that the accuracy of feedback of reply information is improved, and the user experience is improved.
It should be noted that the foregoing explanation of the embodiment of the reply information feedback method is also applicable to the reply information feedback apparatus of this embodiment, and is not repeated herein.
In order to implement the foregoing embodiments, the present application also provides a computer device, including: a processor, and a memory for storing processor-executable instructions.
The processor reads the executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the reply information feedback method as proposed in the foregoing embodiments of the present application.
In order to achieve the above embodiments, the present application also proposes a non-transitory computer-readable storage medium, wherein instructions of the storage medium, when executed by a processor, enable the processor to execute the reply information feedback method proposed by the foregoing embodiments of the present application.
In order to implement the foregoing embodiments, the present application further provides a computer program product, and when instructions in the computer program product are executed by a processor, the computer program product executes a reply information feedback method that implements the foregoing embodiments of the present application.
FIG. 5 illustrates a block diagram of an exemplary computer device suitable for use in implementing embodiments of the present application. The computer device 12 shown in fig. 5 is only an example and should not bring any limitation to the function and scope of use of the embodiments of the present application.
As shown in FIG. 5, computer device 12 is in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. These architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus, to name a few.
Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 28 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 30 and/or cache Memory 32. Computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, and commonly referred to as a "hard drive"). Although not shown in FIG. 5, a disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk Read Only Memory (CD-ROM), a Digital versatile disk Read Only Memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the application.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally perform the functions and/or methodologies of the embodiments described herein.
The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with the computer system/server 12, and/or with any devices (e.g., network card, modem, etc.) that enable the computer system/server 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Moreover, computer device 12 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public Network such as the Internet) via Network adapter 20. As shown, network adapter 20 communicates with the other modules of computer device 12 via bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, implementing the reply information feedback method mentioned in the foregoing embodiments.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

Claims (9)

1. A reply information feedback method is characterized by comprising the following steps:
acquiring an input statement, and acquiring at least one candidate reply statement corresponding to the input statement according to a pre-trained context reply model;
performing correlation calculation on each candidate reply statement and the input statement to generate a corresponding first correlation matrix containing diagonal correlation information, wherein the correlation information is on a diagonal of the first correlation matrix;
carrying out diagonal linear transformation on each first correlation matrix to obtain a corresponding second correlation matrix containing matrix correlation information;
processing each second correlation matrix through a convolutional neural network to generate corresponding eigenvectors;
and calculating each feature vector through a neural network, obtaining the association degree between each candidate reply statement and the input statement, and feeding back information according to the association degree.
2. The method of claim 1, wherein if there are a plurality of candidate reply sentences, the feeding back information according to the association degree comprises:
sorting the association degrees between the candidate reply sentences and the input sentences;
and selecting the candidate reply sentence corresponding to the highest association degree according to the sorting result for feedback.
3. The method of claim 1, wherein if there is one candidate reply statement, the feeding back information according to the association degree comprises:
comparing the correlation degree with a preset threshold value;
if the association degree is larger than or equal to a preset threshold value, feeding back the candidate reply statement;
and if the association degree is less than a preset threshold value, feeding back a prompt message of information missing.
4. The method of claim 1, wherein said correlating each of said candidate reply sentences with said input sentence to generate a corresponding first correlation matrix containing diagonal correlation information comprises:
performing word segmentation on the candidate reply sentence to generate a first word segmentation set, and performing word segmentation on the input sentence to generate a second word segmentation set, wherein the number of words in the first word segmentation set is the same as that of words in the second word segmentation set;
and respectively carrying out correlation calculation on the participles at the same position in the first participle set and the second participle set to generate a corresponding first correlation matrix containing diagonal correlation information.
5. The method of claim 1, wherein processing each of the second correlation matrices comprising matrix correlation information by a convolutional neural network to generate a corresponding eigenvector comprises:
performing convolution processing on the second correlation matrix containing the matrix correlation information by adopting a plurality of convolution kernels with preset sizes to generate a plurality of convolution layers;
performing pooling processing on the plurality of convolutional layers respectively to obtain a plurality of characteristic vectors;
and splicing the plurality of feature vectors to generate a fused feature vector.
6. An apparatus for feeding back reply information, the apparatus comprising:
the acquisition module is used for acquiring an input statement and acquiring at least one candidate reply statement corresponding to the input statement according to a pre-trained context reply model;
a generating module, configured to perform correlation calculation on each candidate reply statement and the input statement, and generate a corresponding first correlation matrix including diagonal correlation information, where the correlation information is on a diagonal of the first correlation matrix;
the transformation module is used for carrying out diagonal linear transformation on each first correlation matrix to obtain a corresponding second correlation matrix containing matrix correlation information;
the processing module is used for processing each second correlation matrix through a convolutional neural network to generate corresponding eigenvectors;
and the feedback module is used for calculating each feature vector through a neural network, acquiring the association degree between each candidate reply statement and the input statement, and feeding back information according to the association degree.
7. The apparatus of claim 6, wherein the generation module is specifically configured to:
performing word segmentation on the candidate reply sentence to generate a first word segmentation set, and performing word segmentation on the input sentence to generate a second word segmentation set, wherein the number of words in the first word segmentation set is the same as that of words in the second word segmentation set;
and respectively carrying out correlation calculation on the participles at the same position in the first participle set and the second participle set to generate a corresponding first correlation matrix containing diagonal correlation information.
8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the reply information feedback method according to any one of claims 1 to 5 when executing the program.
9. A non-transitory computer-readable storage medium having stored thereon a computer program, wherein the program, when executed by a processor, implements the reply information feedback method according to any one of claims 1 to 5.
CN201810718062.4A 2018-06-29 2018-06-29 Reply information feedback method and device Active CN108829896B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810718062.4A CN108829896B (en) 2018-06-29 2018-06-29 Reply information feedback method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810718062.4A CN108829896B (en) 2018-06-29 2018-06-29 Reply information feedback method and device

Publications (2)

Publication Number Publication Date
CN108829896A CN108829896A (en) 2018-11-16
CN108829896B true CN108829896B (en) 2022-03-25

Family

ID=64134827

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810718062.4A Active CN108829896B (en) 2018-06-29 2018-06-29 Reply information feedback method and device

Country Status (1)

Country Link
CN (1) CN108829896B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110321486B (en) * 2019-06-28 2021-08-03 北京科技大学 Recommendation method and device for network mall
CN110378704B (en) * 2019-07-23 2021-10-22 珠海格力电器股份有限公司 Opinion feedback method based on fuzzy recognition, storage medium and terminal equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140229158A1 (en) * 2013-02-10 2014-08-14 Microsoft Corporation Feature-Augmented Neural Networks and Applications of Same
CN104144392A (en) * 2013-05-08 2014-11-12 华为技术有限公司 Message processing method, device and system
CN107038221A (en) * 2017-03-22 2017-08-11 杭州电子科技大学 A kind of video content description method guided based on semantic information
CN107315772A (en) * 2017-05-24 2017-11-03 北京邮电大学 The problem of based on deep learning matching process and device
CN107562792A (en) * 2017-07-31 2018-01-09 同济大学 A kind of question and answer matching process based on deep learning
CN107818164A (en) * 2017-11-02 2018-03-20 东北师范大学 A kind of intelligent answer method and its system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140229158A1 (en) * 2013-02-10 2014-08-14 Microsoft Corporation Feature-Augmented Neural Networks and Applications of Same
CN104144392A (en) * 2013-05-08 2014-11-12 华为技术有限公司 Message processing method, device and system
CN107038221A (en) * 2017-03-22 2017-08-11 杭州电子科技大学 A kind of video content description method guided based on semantic information
CN107315772A (en) * 2017-05-24 2017-11-03 北京邮电大学 The problem of based on deep learning matching process and device
CN107562792A (en) * 2017-07-31 2018-01-09 同济大学 A kind of question and answer matching process based on deep learning
CN107818164A (en) * 2017-11-02 2018-03-20 东北师范大学 A kind of intelligent answer method and its system

Also Published As

Publication number Publication date
CN108829896A (en) 2018-11-16

Similar Documents

Publication Publication Date Title
US11080481B2 (en) Method and device for classifying questions based on artificial intelligence
CN110196894B (en) Language model training method and language model prediction method
CN107731228B (en) Text conversion method and device for English voice information
CN108984679B (en) Training method and device for dialogue generation model
CN110363810B (en) Method, apparatus, device and computer storage medium for establishing image detection model
CN110210021B (en) Reading understanding method and device
CN106557563B (en) Query statement recommendation method and device based on artificial intelligence
CN110188350B (en) Text consistency calculation method and device
JP2019528502A (en) Method and apparatus for optimizing a model applicable to pattern recognition and terminal device
CN110232340B (en) Method and device for establishing video classification model and video classification
CN113361578B (en) Training method and device for image processing model, electronic equipment and storage medium
CN112528637B (en) Text processing model training method, device, computer equipment and storage medium
CN110222330B (en) Semantic recognition method and device, storage medium and computer equipment
CN111401071A (en) Model training method and device, computer equipment and readable storage medium
CN108460098B (en) Information recommendation method and device and computer equipment
CN108090211B (en) Hot news pushing method and device
CN111667066A (en) Network model training and character recognition method and device and electronic equipment
CN107273883B (en) Decision tree model training method, and method and device for determining data attributes in OCR (optical character recognition) result
CN112633423B (en) Training method of text recognition model, text recognition method, device and equipment
CN113807074A (en) Similar statement generation method and device based on pre-training language model
CN112016271A (en) Language style conversion model training method, text processing method and device
CN114863429A (en) Text error correction method and training method based on RPA and AI and related equipment thereof
CN108829896B (en) Reply information feedback method and device
CN113449489A (en) Punctuation mark marking method, punctuation mark marking device, computer equipment and storage medium
CN109919214B (en) Training method and training device for neural network model

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