CN109344242B - Dialogue question-answering method, device, equipment and storage medium - Google Patents

Dialogue question-answering method, device, equipment and storage medium Download PDF

Info

Publication number
CN109344242B
CN109344242B CN201811139032.4A CN201811139032A CN109344242B CN 109344242 B CN109344242 B CN 109344242B CN 201811139032 A CN201811139032 A CN 201811139032A CN 109344242 B CN109344242 B CN 109344242B
Authority
CN
China
Prior art keywords
target
historical
information
vector
target information
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
CN201811139032.4A
Other languages
Chinese (zh)
Other versions
CN109344242A (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.)
Guangdong University of Technology
Original Assignee
Guangdong University of Technology
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 Guangdong University of Technology filed Critical Guangdong University of Technology
Priority to CN201811139032.4A priority Critical patent/CN109344242B/en
Publication of CN109344242A publication Critical patent/CN109344242A/en
Application granted granted Critical
Publication of CN109344242B publication Critical patent/CN109344242B/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/044Recurrent networks, e.g. Hopfield networks
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • Artificial Intelligence (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)
  • Machine Translation (AREA)

Abstract

The invention discloses a dialogue question-answering method, which comprises the steps of firstly obtaining target information input by a user, then judging whether historical information matched with the target information exists in historical dialogue of a target database, and if so, determining the historical answer of the historical information matched with the target information as the target answer of the target information. Therefore, by adopting the scheme, the historical information of the dialogue history in the target database can be matched with the target information aiming at the target information input by the user, and when the target information is matched with the historical information in the target database, the historical answer of the historical information matched with the target database is used as the answer of the target voice, so that the consistency of the dialogue answers is ensured. In addition, the invention also discloses a device, equipment and a storage medium for dialogue question answering, which have the effects as above.

Description

Dialogue question-answering method, device, equipment and storage medium
Technical Field
The invention relates to the field of artificial intelligence, in particular to a dialogue question-answering method, a dialogue question-answering device, dialogue question-answering equipment and a dialogue storage medium.
Background
Natural language processing is an important direction in the field of artificial intelligence, and a question-answering system based on natural language processing is also developed greatly at present.
The general question-answering system is designed based on a preset template at present, the question-answering system is matched with the preset template according to text information input by a user, and if the matching similarity between voice information input by the user and the preset template meets a preset requirement, the question-answering system replies aiming at the input voice of the user. Although the question-answering system can realize the dialogue between a person and a machine, the answer generated by the existing question-answering system can only give the answer to the question based on the question proposed by the current user, and when the user inputs the same question as before, the existing question-answering system does not consider whether the current user inputs the same question before, so that the answer given by the question-answering system is inconsistent before and after the same question proposed by the user, the question-answering system has the question of inconsistent answer, and the experience of the user is reduced.
Therefore, when a user repeatedly proposes the same question, how to ensure that the question-answering system gives a consistent answer and improve the experience of the user is a problem to be solved by the technical personnel in the field.
Disclosure of Invention
The invention aims to provide a dialogue question-answering method, a dialogue question-answering device, a dialogue question-answering equipment and a dialogue question-answering storage medium.
In order to achieve the above purpose, the embodiment of the present invention provides the following technical solutions:
first, an embodiment of the present invention provides a method for dialogue question answering, including:
acquiring target information input by a user;
judging whether historical information matched with the target information exists in a historical dialogue of a target database;
and if the historical information matched with the target information exists, determining that the historical answer corresponding to the historical information matched with the target information is the target answer of the target information.
Preferably, if the target information is text information,
the determining whether there is history information matching the target information in the history dialogue of the target database includes:
encoding the target information by using Bi-LSTM to obtain a target encoding vector;
judging whether a historical coding vector matched with the target coding vector exists in the historical dialogue of the target database;
and if the matching degree of the target coding vector and the historical coding vector is greater than a threshold value, matching the target information with the historical information.
Preferably, if there is no history information matching with the target information in the target database, the method further includes:
judging whether the target database has associated history information associated with the target information;
if yes, searching an answer corresponding to the target information in the target database according to the target information and the associated historical information.
Preferably, if there is no history information matching with the target information in the target database, the method further includes:
and searching a target answer corresponding to the target information in the target database.
Preferably, the searching for the target answer corresponding to the target information in the target database includes:
encoding the target information by using Bi-LSTM to obtain a target encoding vector;
searching a key value pair corresponding to the target coding vector in a target database;
and if the key-value pair is matched with the target coding vector, taking target information corresponding to the key-value pair as the target answer.
Preferably, the searching for the key-value pair corresponding to the target encoding vector in the target database includes:
determining a key and a value in the target database;
assigning a correlation probability to the value based on the key and the target encoding vector;
carrying out weighted summation on the values by utilizing the correlation probability to obtain a weighted sum value;
and integrating the target coding vector and the weighted sum value to obtain an integrated vector, and taking the integrated vector as a key value pair corresponding to the target coding vector.
Second, an embodiment of the present invention provides a device for dialogue question answering, including:
the acquisition module is used for acquiring target information input by a user;
the judging module is used for judging whether historical information matched with the target information exists in the historical dialogue of the target database, and if so, entering the determining module;
the determining module is used for determining that the historical answer corresponding to the historical information matched with the target information is the target answer of the target information.
Preferably, the judging module includes:
the encoding unit is used for encoding the target information by using the Bi-LSTM to obtain a target encoding vector;
and the judging unit is used for judging whether a historical coding vector matched with the target coding vector exists in the historical dialogue of the target database, and if the matching degree of the target coding vector and the historical coding vector is greater than a threshold value, the target information is matched with the historical information.
Third, the embodiment of the present invention discloses a dialogue question-answering device, which includes:
a memory for storing a computer program;
a processor for executing a computer program stored in said memory to implement the steps of any of the above-mentioned dialog question-answering methods.
Finally, the embodiment of the present invention discloses a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the above-mentioned dialog question-answering methods.
Therefore, the dialogue question-answering method disclosed by the embodiment of the invention comprises the steps of firstly obtaining target information input by a user, then judging whether historical information matched with the target information exists in historical dialogue of a target database, and if so, determining that historical answers of the historical information matched with the target information are target answers of the target information. Therefore, by adopting the scheme, the historical information of the dialogue history in the target database can be matched with the target information aiming at the target information input by the user, and when the target information is matched with the historical information in the target database, the historical answer of the historical information matched with the target database is used as the answer of the target voice, so that the consistency of the dialogue answers is ensured. In addition, the embodiment of the invention also discloses a device, equipment and a storage medium for dialogue question answering, which have the effects as above.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a dialogue question-answering method disclosed in the embodiment of the invention;
fig. 2 is a schematic structural diagram of a dialogue question-answering device disclosed in the embodiment of the present invention;
fig. 3 is a schematic structural diagram of a dialogue question-answering device disclosed in the embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention discloses a dialogue question-answering method, a dialogue question-answering device, a dialogue question-answering equipment and a dialogue storage medium.
Referring to fig. 1, fig. 1 is a schematic flow chart of a method for question answering in a dialog, which is disclosed in an embodiment of the present invention, and the method includes:
s101, acquiring target information input by a user.
Specifically, in this embodiment, the target information refers to a question input by the user in a text form or a question input in a voice form, and after the user inputs the target information, the target information may be encoded, so that the encoded target information is identified. The purpose of encoding the target information is to convert machine-unrecognizable text into recognizable numbers and then compare the numbers against those in the target database. When the input form of the target information is a voice form, the following encoding process can be directly executed for converting the voice into the text, and when the input form of the target information is a text form, the following encoding process can be directly executed, specifically: firstly, segmenting target information input by a user (when the target information input by the user is a sentence, the sentence needs to be decomposed into a plurality of words), after segmenting the word, taking each word as a word vector, inputting each word vector into a Bi-LSTM long-short term memory network, and coding each word vector in the sentence according to a form of a triple by the long-short term memory network, wherein the coding mode is that the last hidden layer state in the long-short term memory network is combined (the word vectors in the target information input by the user are combined according to a (entity 1, relation, entity 2) relation, an 'entity 1' code is called as a first vector, a 'relation' is coded as a second vector, an 'entity 2' code is called as a third vector, the first vector corresponding to the 'entity 1' and the second vector corresponding to the 'relation' are combined (the state of the corresponding hidden layer) to obtain a 'key' in a key value pair), the third vector corresponding to "entity 2" is taken as the value in the key-value pair). Thus, the target information input by the user is encoded, and the encoded target information is obtained. Of course, in the embodiment of the present invention, after the user inputs the target information, the target information may be processed in other forms.
Further, the target information in the embodiment of the present invention may be a question input by the user in a text form, or may be a question input by the user in a voice form.
S102, judging whether historical information matched with the target information exists in the historical dialogue of the target database.
Specifically, in the present embodiment, since many user problems are included in the history dialog, when the user inputs the target information, it is necessary to search whether there is history information matching the target information provided by the user from the history dialog. The history dialogue input by the user comprises a question (history information) input by the user and a history answer corresponding to the question, and the history information and the history answer corresponding to the history information are mainly stored according to a key value pair mode: for historical dialogue (including historical information)Resting and historical answers) to convert the historical dialog into a three-dimensional vector, which may be represented by the following equation: DH ═ X, W, E, where X refers to all conversation histories, W refers to the serials of each conversation round in the conversation history, and the serials of each conversation round can be represented by the following formula: w ═ W1,...,wvAnd w refers to word segmentation in each round of conversation. Each pair of dialogs in the dialog history can be used as a set to form a vector matrix, and the vector matrix can be represented as: d ═ D1,...,DnFor each turn of dialog DiMay be represented by different participles, i.e. W ═ W as described above1,...,wvAnd coding each participle of each round of conversation according to the word vector to obtain a coding vector set E ═ E }1,...,evAnd (4) encoding the three-dimensional tensor DH by using the LSTM and the CNN for the three-dimensional tensor, and obtaining the encoding vector combination of each round of historical conversation in all historical conversations after the LSTM is used for encoding the three-dimensional tensor
Figure BDA0001815336990000061
After the CNN is used for coding the three-dimensional tensor, the coding vector combination of each round of historical conversation in all historical conversations is obtained
Figure BDA0001815336990000062
Wherein, each element in the M set represents the encoding vector of each dialog turn encoded by LSTM, and each element in the C combination represents the encoding vector of each dialog turn encoded by CNN.
Specifically, in this embodiment, since the history information is stored in the form of a structured encoding vector, and the target information is encoded and then matched with the encoded history information, the identification rate of the target information can be improved, based on the above embodiment, as a preferred embodiment, if the target information is character information, step S102 includes:
encoding the target information by using Bi-LSTM to obtain a target encoding vector;
judging whether a historical coding vector matched with the target coding vector exists in the historical dialogue of the target database;
and if the matching degree of the target coding vector and the historical coding vector is greater than a threshold value, matching the target information with the historical information.
Specifically, in this embodiment, the process of encoding the target information may refer to the description of the above embodiment, when the target information is text information, the text information is encoded to obtain an encoding vector, and then the encoding vector is matched with a historical encoding vector stored in a unified manner in the target database, or of course, the matching degree between the target information and the historical information may be determined directly through the coincidence degree between the text in the target information and the text in the historical information. The threshold may be set empirically, and the size of the threshold may be set according to different requirements of the matching accuracy, and as to how much the threshold is specifically set to be appropriate, the embodiment of the present invention is not limited herein.
On the other hand, after the target information is encoded, the related word information corresponding to the target information may be searched in the target database, and the specific steps may be to search a key-value pair corresponding to the target encoding vector in the target database, and after the key-value pair is found, output the target answer corresponding to the target information in combination with the history information in the history dialogue. Therefore, the real-time performance and the uniformity of target answers output aiming at the target information are improved. In addition, the key value pair can also be directly searched in the target database, and the information in the key value pair is used as the target answer of the target information. And if the key value pair is matched with the target coding vector, taking target information corresponding to the key value pair as the target answer.
And S103, determining the historical answer corresponding to the historical information matched with the target information as the target answer of the target information.
Specifically, in this embodiment, when the history information matches with the target information currently input by the user, it indicates that the current target information has been input by the user before, and therefore, the history answer corresponding to the history information is directly used as the target answer of the target information currently input by the user, so that a situation that the user outputs different answers after inputting the same question can be avoided, and the experience of the user is improved.
The invention discloses a dialogue question-answering method, which comprises the steps of firstly obtaining target information input by a user, then judging whether historical information matched with the target information exists in historical dialogue of a target database, and if so, determining the historical answer of the historical information matched with the target information as the target answer of the target information. Therefore, by adopting the scheme, the historical information of the dialogue history in the target database can be matched with the target information aiming at the target information input by the user, and when the target information is matched with the historical information in the target database, the historical answer of the historical information matched with the target database is used as the answer of the target voice, so that the consistency of the dialogue answers is ensured.
After the user inputs the target information, the user is likely to input a question associated with the target information before inputting the target information, for example, the target information is "what your profession is", the user inputs a question of "where you work" before, the question-answering system outputs an answer "i work in hospital" for the question "where you work", at this time, the question-answering system is likely to output an answer "i are lawyers" for "what your profession is", which may cause the question-answering system to give inconsistent answers to the two questions. In order to avoid such a situation, based on the above embodiment, as a preferred embodiment, when there is no history information matching the target information in the target database, the method further includes:
and judging whether the associated historical information associated with the target information exists in the target database.
If yes, searching an answer corresponding to the target information in a target database according to the target information and the associated historical information.
Specifically, in this embodiment, the associated history information refers to a history question having a corresponding relationship with the target information, and as in the example illustrated in the above embodiment, the "what your profession is" and the "where you work" are both associated, so when the target answer of the target information is searched in the target database, the history answer of the associated history information must be considered, so that it is ensured that the target answer corresponding to the target information is consistent with the history answer of the associated history information. For example, for the target information "what your profession is", the corresponding answers in the target database are "i am a teacher", "i am a lawyer" and "i am a doctor", and if the associated history information is not considered, any one of "i am a teacher", "i am a lawyer" and "i am a doctor" may be output from the history answers; if the associated historical information of 'where you work' (the corresponding historical answer is 'I work in hospital') is considered, the target answer of the output target information can only be 'I is a doctor', and the condition that the target information output by the question-answering system is inconsistent before and after is avoided.
In order to enable the question answering system to output timeliness of the answer of the target information when the history information matching the target information does not exist in the target database, as a preferred embodiment, the method further includes:
and searching a target answer corresponding to the target information in the target database.
Preferably, the searching for the target answer corresponding to the target information in the target database includes:
encoding the target information by using Bi-LSTM to obtain a target encoding vector;
searching a key value pair corresponding to the target coding vector in a target database;
and if the key-value pair is matched with the target coding vector, taking target information corresponding to the key-value pair as the target answer.
Based on the foregoing embodiment, as a preferred embodiment, the searching the key-value pair corresponding to the target encoding vector in the target database includes:
determining a key and a value in a target database;
the values are assigned correlation probabilities based on the key and the target encoding vector.
And carrying out weighted summation on the values by utilizing the correlation probability to obtain a weighted sum value.
And integrating the target coding vector and the weighted sum value to obtain an integrated vector, and taking the integrated vector as a key value pair corresponding to the target coding vector.
Specifically, in this embodiment, the keys and values in the target database refer to: and keys and values of the data stored in the target database, wherein the keys correspondingly store the entity 1 and relationship information of each character message, and the values correspondingly store the entity 2 information of the character messages. In the following, the related contents of probability assignment are explained in detail, where k is the key of the key value pair stored in the target database, v is the value of the key value pair stored in the target database, and the related probability p is assigned to the key k in the key value pairiThe following formula may be employed:
pi=Softmax(uj·ki)
wherein k isiRepresenting key values, u, of data stored in the target databasejIt is referred to as an integration vector,
with respect to Softmax (u)j·ki) Can be calculated using the following formula:
Figure BDA0001815336990000081
wherein z isi=uj*kiAbout ujThe calculation of (c) can be given by:
uj=q+Bjoj
where q refers to the target code vector, BjRefers to a trainable parameter matrix in a memory network, ojRefers to the output vector (corresponding to the integration vector in the embodiment of the present invention) in the memory network. Calculated ujNamely, the target coding vector and the weighted sum value are integrated to obtain an integrated vector in the embodiment of the invention.
With respect to the output vector ojThe following can be used for calculation:
Figure BDA0001815336990000091
wherein v isiRefers to the value of a key-value pair in the target database, where o is calculatedjThat is, the values are weighted and summed by using the correlation probability in this embodiment to obtain a weighted sum value.
Thus, iteration is performed in the above manner, the number of iterations may be determined according to the number of layers of the memory network, and assuming that the number of layers of the memory network has H layers, the finally output vector is used as the integration vector in the embodiment of the present invention, and the integration vector is used as the key-value pair in the embodiment of the present invention. And finally, the key value pair of the target coding vector is used as the target answer of the target information.
In addition, after the target answer of the target information is found in the target database, in order to further ensure that the target answer corresponding to the target information is consistent in the historical dialog or extract the associated information in the historical dialog, after the key value pair corresponding to the target information is obtained, the key value pair is decoded and output in combination with the historical dialog, which is specifically as follows: generating a target answer sequence of target information by using a recurrent neural network, and receiving a generated word y of a previous time step by using the recurrent neural network at a t time stept-1And hidden state h of previous time stept-1Generating as input a hidden state h of this time step ttAnd using the hidden state htAnd generating words y of coding key values in conversation history to cost time step ttThe initial amount of hidden states in the recurrent neural network is the integration vector (key value pair corresponding to the target coding vector) mentioned in this embodiment, and the initial amount h of hidden states0Can be represented by the following formula:
h0=oH
wherein o isHShown is an integration vector. Then, the hidden state quantity of the current time step t is calculated through the recurrent neural network, and the hidden state quantity can be represented by the following formula:
ht=RNN(yt-1,ht-1)
at the calculated hidden state quantity h of the current time steptThen, the encoded keys and values in the history dialog are taken asMemory cells of a memory network with a hidden state quantity htAs an input to the single-layer memory network, the correlation probability calculation of the history information in the dialogue history is performed as follows:
pi=Softmax(htmi)
wherein m isiAfter calculating the related probability of the history dialog, the encoding vector of each round of history dialog after LSTM encoding is used for calculating the pre-output word of the encoding vector of each round of history dialog after CNN encoding by using the following formula:
Figure BDA0001815336990000101
in obtaining atThen, the output word y of this time step is calculated by the following formulatThe specific calculation formula is as follows:
pvocab(wi)=Softmax(atY(wi))i=1,2,...,m
yt=argmaxi=1,2,...,mPvocab(wi)
specifically, in the present embodiment, wiRefers to predefined words in the target database, which has m words in total, A is a trainable parameter matrix in the recurrent neural network, phiYIs to wiGenerating a probability p in the target database at each time stepvocab(wi) The largest word is used as the generated word y of the time steptAfter iteration of a plurality of time steps, a target answer corresponding to the target information is obtained, namely a word sequence [ y ] is generated1,y2,...,yT]. Therefore, the final answer of the target information can be obtained by comprehensively considering the key value pair corresponding to the integration vector in the target database and the historical information in the conversation history.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a question-answering device disclosed in an embodiment of the present invention, where the question-answering device includes:
an obtaining module 201, configured to obtain target information input by a user;
a judging module 202, configured to judge whether history information matched with the target information exists in a history dialogue of a target database, and if yes, enter a determining module 203;
a determining module 203, configured to determine a historical answer corresponding to the historical information that matches the target information as a target answer of the target information.
The invention discloses a dialogue question-answering device, which firstly obtains target information input by a user, then judges whether historical information matched with the target information exists in historical dialogue of a target database, and if so, determines the historical answer of the historical information matched with the target information as the target answer of the target information. Therefore, by adopting the scheme, the historical information of the dialogue history in the target database can be matched with the target information aiming at the target information input by the user, and when the target information is matched with the historical information in the target database, the historical answer of the historical information matched with the target database is used as the answer of the target voice, so that the consistency of the dialogue answers is ensured.
Based on the above embodiment, as a preferred embodiment, the judging module 202 includes:
the encoding unit is used for encoding the target information by using the Bi-LSTM to obtain a target encoding vector;
and the judging unit is used for judging whether a historical coding vector matched with the target coding vector exists in the historical dialogue of the target database, and if the matching degree of the target coding vector and the historical coding vector is greater than a threshold value, the target information is matched with the historical information.
In addition, an embodiment of the present invention further discloses a question-answering device, please refer to fig. 3, where fig. 3 is a schematic structural diagram of a question-answering device according to an embodiment of the present invention, where the device includes:
a memory 301 for storing a computer program;
a processor 302 for executing the computer program stored in the memory to implement the steps of the dialogue question answering method mentioned in any one of the above embodiments.
In order to better understand the present solution, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the dialog question-answering method mentioned in any of the above embodiments.
Since the computer program stored in the computer-readable storage medium can be called by the processor to implement the steps of the question-answering method provided in any of the above embodiments, the computer-readable storage medium has the same practical effects as the above question-answering method.
The above provides a method, an apparatus, a device and a storage medium for dialogue question answering. The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.

Claims (8)

1. A method for dialogue question answering, comprising:
acquiring target information input by a user;
judging whether historical information matched with the target information exists in a historical dialogue of a target database;
if the historical information matched with the target information exists, determining that a historical answer corresponding to the historical information matched with the target information is a target answer of the target information;
if the target information is text information, the judging whether historical information matched with the target information exists in the historical dialogue of the target database comprises the following steps:
encoding the target information by using Bi-LSTM to obtain a target encoding vector;
judging whether a historical coding vector matched with the target coding vector exists in the historical dialogue of the target database;
if the matching degree of the target coding vector and the historical coding vector is larger than a threshold value, matching the target information with the historical information;
the judging whether the historical encoding vector matched with the target encoding vector exists in the historical dialogue of the target database comprises the following steps: when a user inputs target information, searching whether historical information matched with the target information provided by the user exists in a historical dialogue, wherein the historical dialogue input by the user comprises a question input by the user and a historical answer corresponding to the question, and the historical information and the historical answer corresponding to the historical information are stored in a key value pair mode: for a historical dialog, the historical dialog comprises: history information and history answers, history dialogues are firstly converted into a three-dimensional vector which can be represented by DH = (X, W, E), wherein X refers to all dialog histories, W refers to the series words of each dialog turn in the dialog histories, and the series words of each dialog turn can be represented by W ═ W = (W, E)1,...,wnExpressing, w refers to word segmentation in each round of conversation;
each pair of dialogs in the dialog history is used as a set to form a vector matrix, and the vector matrix is expressed as: d ═ D1,...,DNFor each turn of dialog DiAre all represented by different participles, i.e. W ═ W as described above1,...,wNAnd (4) coding each participle of each round of conversation according to the word vector to obtain a coding vectorSet E ═ { E ═ E1,...,evAnd (4) encoding the three-dimensional tensor DH by using the LSTM and the CNN for the three-dimensional tensor, and obtaining the encoding vector combination of each round of historical conversation in all historical conversations after the LSTM is used for encoding the three-dimensional tensor
Figure FDA0003202684450000021
After the CNN is used for coding the three-dimensional tensor, the coding vector combination of each round of historical conversation in all historical conversations is obtained
Figure FDA0003202684450000022
Wherein, each element in the M set represents the encoding vector of each dialog turn encoded by LSTM, and each element in the C combination represents the encoding vector of each dialog turn encoded by CNN.
2. The method according to claim 1, wherein if there is no history information matching the target information in the target database, further comprising:
judging whether the target database has associated history information associated with the target information;
if yes, searching an answer corresponding to the target information in the target database according to the target information and the associated historical information.
3. The method according to claim 1, wherein if there is no history information matching the target information in the target database, further comprising:
and searching a target answer corresponding to the target information in the target database.
4. The method according to claim 3, wherein the searching for the target answer corresponding to the target information in the target database comprises:
encoding the target information by using Bi-LSTM to obtain a target encoding vector;
searching a key value pair corresponding to the target coding vector in a target database;
and if the key-value pair is matched with the target coding vector, taking target information corresponding to the key-value pair as the target answer.
5. The method of claim 4, wherein the searching the target database for the key-value pair corresponding to the target encoding vector comprises:
determining a key and a value in the target database;
assigning a correlation probability to the value based on the key and the target encoding vector;
carrying out weighted summation on the values by utilizing the correlation probability to obtain a weighted sum value;
and integrating the target coding vector and the weighted sum value to obtain an integrated vector, and taking the integrated vector as a key value pair corresponding to the target coding vector.
6. A dialogue question-answering device, comprising:
the acquisition module is used for acquiring target information input by a user;
the judging module is used for judging whether historical information matched with the target information exists in the historical dialogue of the target database, and if so, entering the determining module;
the determining module is used for determining that the historical answer corresponding to the historical information matched with the target information is the target answer of the target information;
the judging module comprises:
the encoding unit is used for encoding the target information by using the Bi-LSTM to obtain a target encoding vector;
the judging unit is used for judging whether a historical coding vector matched with the target coding vector exists in a historical dialogue of the target database, and if the matching degree of the target coding vector and the historical coding vector is greater than a threshold value, the target information is matched with the historical information;
wherein the determining whether a historical encoding vector matching the target encoding vector exists in the historical dialogue of the target database comprises: when a user inputs target information, searching whether historical information matched with the target information provided by the user exists in a historical dialogue, wherein the historical dialogue input by the user comprises a question input by the user and a historical answer corresponding to the question, and the historical information and the historical answer corresponding to the historical information are stored in a key value pair mode: for a historical dialog, the historical dialog comprises: history information and history answers, history conversations are firstly converted into a three-dimensional vector which is expressed, wherein X refers to all conversation histories, W refers to a series word of each round of conversation in the conversation histories, and the series word of each round of conversation is expressed and refers to a participle in each round of conversation;
each pair of dialogs in the dialog history is used as a set to form a vector matrix, and the vector matrix is expressed as: each turn of conversation is represented by different participles, namely, as described above, each participle of each turn of conversation is encoded according to a word vector to obtain an encoding vector set, the three-dimensional tensor is encoded by using the LSTM and the CNN, the three-dimensional tensor is encoded by using the LSTM to obtain an encoding vector combination of each turn of historical conversation in all historical conversations, and the three-dimensional tensor is encoded by using the CNN to obtain an encoding vector combination of each turn of historical conversation in all historical conversations;
wherein, each element in the M set represents the encoding vector of each dialog turn encoded by LSTM, and each element in the C combination represents the encoding vector of each dialog turn encoded by CNN.
7. A dialogue question-answering apparatus, comprising:
a memory for storing a computer program;
a processor for executing a computer program stored in said memory to implement the steps of the dialogue quiz method according to any one of claims 1 to 5.
8. A computer-readable storage medium, on which a computer program is stored, which computer program is executable by a processor for implementing the steps of the dialog question-answering method according to any one of claims 1 to 5.
CN201811139032.4A 2018-09-28 2018-09-28 Dialogue question-answering method, device, equipment and storage medium Active CN109344242B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811139032.4A CN109344242B (en) 2018-09-28 2018-09-28 Dialogue question-answering method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811139032.4A CN109344242B (en) 2018-09-28 2018-09-28 Dialogue question-answering method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109344242A CN109344242A (en) 2019-02-15
CN109344242B true CN109344242B (en) 2021-10-01

Family

ID=65307143

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811139032.4A Active CN109344242B (en) 2018-09-28 2018-09-28 Dialogue question-answering method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109344242B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111680497B (en) * 2019-02-25 2023-12-08 北京嘀嘀无限科技发展有限公司 Session recognition model training method and device
CN110727775B (en) * 2019-10-11 2021-03-30 京东数字科技控股有限公司 Method and apparatus for processing information
CN110807093A (en) * 2019-10-30 2020-02-18 中国联合网络通信集团有限公司 Voice processing method and device and terminal equipment
CN110955769B (en) * 2019-12-17 2023-07-21 联想(北京)有限公司 Method for constructing processing stream and electronic equipment
CN111858854B (en) * 2020-07-20 2024-03-19 上海汽车集团股份有限公司 Question-answer matching method and relevant device based on historical dialogue information
CN112365892A (en) * 2020-11-10 2021-02-12 杭州大搜车汽车服务有限公司 Man-machine interaction method, device, electronic device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103455592A (en) * 2013-08-30 2013-12-18 广州网易计算机系统有限公司 Question answering method, device and system
CN106484801A (en) * 2016-09-23 2017-03-08 厦门快商通科技股份有限公司 A kind of dialogue method of intelligent customer service robot and its knowledge base management system
CN106776578A (en) * 2017-01-03 2017-05-31 竹间智能科技(上海)有限公司 Talk with the method and device of performance for lifting conversational system
CN107748757A (en) * 2017-09-21 2018-03-02 北京航空航天大学 A kind of answering method of knowledge based collection of illustrative plates
CN107918634A (en) * 2017-06-27 2018-04-17 上海壹账通金融科技有限公司 Intelligent answer method, apparatus and computer-readable recording medium
CN108491433A (en) * 2018-02-09 2018-09-04 平安科技(深圳)有限公司 Chat answer method, electronic device and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108304911B (en) * 2018-01-09 2020-03-13 中国科学院自动化研究所 Knowledge extraction method, system and equipment based on memory neural network
CN108416058B (en) * 2018-03-22 2020-10-09 北京理工大学 Bi-LSTM input information enhancement-based relation extraction method
CN108519890B (en) * 2018-04-08 2021-07-20 武汉大学 Robust code abstract generation method based on self-attention mechanism

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103455592A (en) * 2013-08-30 2013-12-18 广州网易计算机系统有限公司 Question answering method, device and system
CN106484801A (en) * 2016-09-23 2017-03-08 厦门快商通科技股份有限公司 A kind of dialogue method of intelligent customer service robot and its knowledge base management system
CN106776578A (en) * 2017-01-03 2017-05-31 竹间智能科技(上海)有限公司 Talk with the method and device of performance for lifting conversational system
CN107918634A (en) * 2017-06-27 2018-04-17 上海壹账通金融科技有限公司 Intelligent answer method, apparatus and computer-readable recording medium
CN107748757A (en) * 2017-09-21 2018-03-02 北京航空航天大学 A kind of answering method of knowledge based collection of illustrative plates
CN108491433A (en) * 2018-02-09 2018-09-04 平安科技(深圳)有限公司 Chat answer method, electronic device and storage medium

Also Published As

Publication number Publication date
CN109344242A (en) 2019-02-15

Similar Documents

Publication Publication Date Title
CN109344242B (en) Dialogue question-answering method, device, equipment and storage medium
CN110928997A (en) Intention recognition method and device, electronic equipment and readable storage medium
CN111061847A (en) Dialogue generation and corpus expansion method and device, computer equipment and storage medium
CN113268609B (en) Knowledge graph-based dialogue content recommendation method, device, equipment and medium
CN111930914B (en) Problem generation method and device, electronic equipment and computer readable storage medium
WO2022241950A1 (en) Text summarization generation method and apparatus, and device and storage medium
CN114245203B (en) Video editing method, device, equipment and medium based on script
CN112633003A (en) Address recognition method and device, computer equipment and storage medium
CN111223476B (en) Method and device for extracting voice feature vector, computer equipment and storage medium
CN112100354A (en) Man-machine conversation method, device, equipment and storage medium
CN112131888B (en) Method, device, equipment and storage medium for analyzing semantic emotion
CN112632252B (en) Dialogue response method, dialogue response device, computer equipment and storage medium
CN112417855A (en) Text intention recognition method and device and related equipment
CN117520523B (en) Data processing method, device, equipment and storage medium
CN111949762B (en) Method and system for context-based emotion dialogue and storage medium
CN110597968A (en) Reply selection method and device
CN113590078A (en) Virtual image synthesis method and device, computing equipment and storage medium
CN115497465A (en) Voice interaction method and device, electronic equipment and storage medium
CN114360502A (en) Processing method of voice recognition model, voice recognition method and device
CN112632248A (en) Question answering method, device, computer equipment and storage medium
CN112395887A (en) Dialogue response method, dialogue response device, computer equipment and storage medium
CN111400340A (en) Natural language processing method and device, computer equipment and storage medium
CN111241843B (en) Semantic relation inference system and method based on composite neural network
CN113343711A (en) Work order generation method, device, equipment and storage medium
CN115617972B (en) Robot dialogue method, device, electronic 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