A method, device, equipment and storage medium for extracting question-answer pairs

By using the correlation and similarity calculations between candidate answers and questions to be selected in the question-and-answer pair extraction, combined with the preset matching network model, the problem of low accuracy of extraction question-and-answer pairs in the prior art is solved, and high-quality question-and-answer pairs are achieved Extraction and removal of noise data.

CN111737543BActive Publication Date: 2025-01-17BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201910447437.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-05-27
Publication Date
2025-01-17
Estimated Expiration
2039-05-27

AI Technical Summary

Technical Problem

When extracting question-and-answer pairs, the prior art cannot effectively extract high-quality question-and-answer pairs, and it is easy to mix high-frequency noise data, resulting in low extraction accuracy.

Method used

By determining the candidate answers and questions to be selected based on the frequency of answers in the historical dialogue log, the correlation and similarity of candidate question-and-answer pairs are calculated, and deep semantic matching is used to filter out high-quality question-and-answer pairs.

Benefits of technology

It improves the accuracy of question and answer pair extraction, can effectively extract more high-quality question and answer pairs, and reduces the impact of noise data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111737543B_ABST
    Figure CN111737543B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a method, device, equipment and storage medium for extracting question-answer pairs, the method comprising: determining multiple candidate answers and multiple questions to be selected corresponding to each candidate answer according to the first occurrence frequency corresponding to each historical answer in the historical conversation log; determining the correlation between each question to be selected and the corresponding candidate answer, and determining the candidate question corresponding to each candidate answer based on the correlation, to obtain each candidate question-answer pair; determining the candidate similarity between each answer keyword and each question keyword in the candidate question-answer pair; using each candidate similarity as the input of a preset matching network model, determining the matching result corresponding to the candidate question-answer pair according to the output of the preset matching network model, and determining the candidate question-answer pair with a successful matching result as the target question-answer pair. Through the technical solution of the embodiment of the present invention, more high-quality question-answer pairs can be extracted, and the accuracy of extraction can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to computer technology, and in particular to a method, apparatus, device and storage medium for extracting question and answer pairs. Background Art

[0002] In service industries such as e-commerce, customer service needs to answer business knowledge questions frequently raised by users. To this end, a question-and-answer database can usually be built to automatically answer questions based on the database, thereby reducing the number and cost of manual customer service.

[0003] When building a question-and-answer database, operations personnel can summarize high-quality question-and-answer pairs based on questions asked by online users; or they can automatically extract some high-frequency question-and-answer pairs from historical conversation data to improve extraction efficiency.

[0004] In the prior art, the process of extracting question-answer pairs is: extracting relatively high-frequency and closely-appearing question-answer pairs from historical conversation data, and determining whether the question-answer pairs are matched by detecting whether the extracted question-answer pairs contain the same keywords, thereby adding the matched question-answer pairs to the question-answer database, for example: Question Q: "Is this free to install?", Answer A: "Hello, the first installation is free of labor costs." It can be seen that the question and the answer both contain the keywords "install," "install," "free," and "fee." At this time, it can be determined that the question-answer pairs match, and thus the question-answer pairs can be added to the question-answer database.

[0005] However, in the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0006] Since the user's questions and the corresponding answers are often not adjacent, the existing extraction methods cannot extract many effective question-answer pairs, and are prone to mixing in high-frequency noise data, such as welcome messages. Moreover, in real conversation scenarios, questions and answers with the same semantics and matching do not always have the same keywords. For example, question Q: "Will it arrive tomorrow?", answer A: "The delivery time will be displayed when you place an order." It can be seen that the existing question-answer pair matching methods cannot effectively and reasonably extract high-quality question-answer pairs, reducing the extraction accuracy. Summary of the invention

[0007] The embodiments of the present invention provide a method, apparatus, device and storage medium for extracting question-answer pairs, so as to extract more high-quality question-answer pairs and improve the accuracy of extraction.

[0008] In a first aspect, an embodiment of the present invention provides a method for extracting question-answer pairs, comprising:

[0009] Determine, according to the first occurrence frequency corresponding to each historical answer in the historical conversation log, a plurality of candidate answers and a plurality of questions to be selected corresponding to each candidate answer;

[0010] Determine the correlation between each of the to-be-selected questions and the corresponding candidate answers, and determine the candidate questions corresponding to each of the candidate answers based on the correlation to obtain each candidate question-answer pair;

[0011] Determining a candidate similarity between each answer keyword and each question keyword in the candidate question-answer pair;

[0012] Each of the candidate similarities is used as an input of a preset matching network model, a matching result corresponding to the candidate question-answer pair is determined according to an output of the preset matching network model, and the candidate question-answer pair whose matching result is a successful match is determined as a target question-answer pair.

[0013] In a second aspect, an embodiment of the present invention further provides a device for extracting question-answer pairs, including:

[0014] A candidate answer determination module, used to determine a plurality of candidate answers and a plurality of questions to be selected corresponding to each of the candidate answers according to the first occurrence frequency corresponding to each historical answer in the historical conversation log;

[0015] A candidate question-answer pair obtaining module, used to determine the correlation between each of the to-be-selected questions and the corresponding candidate answers, and determine the candidate questions corresponding to each of the candidate answers based on the correlation, to obtain each candidate question-answer pair;

[0016] A candidate similarity determination module, used to determine the candidate similarity between each answer keyword and each question keyword in the candidate question-answer pair;

[0017] The target question and answer pair determination module is used to use each of the candidate similarities as the input of a preset matching network model, determine the matching result corresponding to the candidate question and answer pair according to the output of the preset matching network model, and determine the candidate question and answer pair with a successful matching result as the target question and answer pair.

[0018] In a third aspect, an embodiment of the present invention further provides a device, the device comprising:

[0019] one or more processors;

[0020] A memory for storing one or more programs;

[0021] When the one or more programs are executed by the one or more processors, the one or more processors implement the steps of the question-answer pair extraction method provided in any embodiment of the present invention.

[0022] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the method for extracting question and answer pairs provided in any embodiment of the present invention are implemented.

[0023] The embodiments of the above invention have the following advantages or beneficial effects:

[0024] By first extracting multiple candidate answers from the historical conversation log according to the first occurrence frequency corresponding to each historical answer in the historical conversation log, and then extracting multiple candidate questions corresponding to each candidate answer, the extracted candidate questions can be questions adjacent to the candidate answers or non-adjacent questions. By screening the candidate questions corresponding to each candidate answer from multiple candidate questions according to the correlation between each candidate question and the corresponding candidate answer, more and effective candidate question-answer pairs can be obtained. By presetting the matching network model, deep semantic matching is performed on each candidate question-answer pair, so that more high-quality question-answer pairs can be extracted, improving the accuracy of extraction. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 is a flow chart of a method for extracting question-answer pairs provided in Embodiment 1 of the present invention;

[0026] Figure 2 is an example of a candidate similarity matrix involved in the first embodiment of the present invention;

[0027] Figure 3 This is an example of a MatchPyramid model involved in Embodiment 1 of the present invention;

[0028] Figure 4 is a flow chart of a method for extracting question-answer pairs provided in Embodiment 2 of the present invention;

[0029] Figure 5 is a schematic diagram of the structure of a question-answer pair extraction device provided in Embodiment 3 of the present invention;

[0030] Figure 6 It is a structural diagram of a device involved in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0031] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0032] Embodiment 1

[0033] Figure 1This is a flowchart of a method for extracting question-answer pairs provided in Embodiment 1 of the present invention. This embodiment is applicable to the case of extracting high-quality question-answer pairs. The method can be performed by a device for extracting question-answer pairs, which can be implemented by software and / or hardware and integrated in a terminal with data processing functions. The method specifically includes the following steps:

[0034] S110: Determine a plurality of candidate answers and a plurality of to-be-selected questions corresponding to each candidate answer according to the first occurrence frequency corresponding to each historical answer in the historical conversation log.

[0035] The historical conversation log may refer to each conversation record generated between the user and the customer service in a preset historical time period. The historical answer may refer to the answer replied by the customer service in the historical conversation log. The selected question may refer to the question asked by the user in the historical conversation log. The first occurrence frequency may refer to the number of times the historical answer appears in the historical conversation log.

[0036] Specifically, by counting the first occurrence frequency of each historical answer in the historical conversation log, the historical answers whose first occurrence frequency is greater than or equal to the preset frequency can be determined as candidate answers, or the first occurrence frequencies can be arranged in descending order, and the historical answers corresponding to the first occurrence frequencies of the first preset number after arrangement can be determined as candidate answers, so that multiple candidate answers with high frequency replies can be determined. Since the candidate answers appear frequently and the questions asked by users are ever-changing, the candidate answers can correspond to multiple different questions to be selected, so that the corresponding multiple questions to be selected can be reversely searched in the historical conversation log according to each candidate answer. The candidate answers and the questions to be selected in this embodiment are not extracted together, so that the extracted candidate answers and the questions to be selected are not necessarily closely adjacent, which is conducive to extracting more valid question and answer pairs.

[0037] S120: Determine the correlation between each candidate question and the corresponding candidate answer, and determine the candidate question corresponding to each candidate answer based on the correlation to obtain each candidate question-answer pair.

[0038] The relevance may refer to the matching degree between the candidate answer and the question to be selected, that is, the higher the matching degree, the higher the relevance. A candidate question-answer pair may refer to a question-answer pair consisting of a candidate answer and a corresponding candidate question.

[0039] Specifically, this embodiment can determine the correlation between each candidate question and the corresponding candidate answer based on the matching degree between the keywords in each candidate question and the keywords in the corresponding candidate answer. Based on the correlation between the candidate answer and each candidate question, the candidate question with the highest correlation can be determined as the candidate question corresponding to the candidate answer, and a candidate question-answer pair is generated, thereby obtaining multiple valid candidate question-answer pairs.

[0040] S130: Determine the candidate similarity between each answer keyword and each question keyword in the candidate question-answer pair.

[0041] The answer keyword may refer to a valid word or phrase in the candidate answer. The question keyword may refer to a valid word or phrase in the candidate question. The candidate similarity may refer to the similarity between each answer keyword and each question keyword in a candidate question-answer pair.

[0042] Exemplarily, S130 may include: determining the answer word vector corresponding to each answer keyword in the candidate question-answer pair and the question word vector corresponding to each question keyword; based on the cosine distance formula, determining the candidate similarity between each answer keyword and each question keyword according to each answer word vector and each question word vector.

[0043] Among them, the word vector can be determined based on a preset word library. The dimension of the elements in the word vector is the same as the number of words in the preset word library, and each element in the word vector can correspond to each word in the preset word library in a predetermined order. The element value corresponding to each element in the answer word vector can be used to characterize the probability that the word in the preset word library corresponding to the element is used as the context word of the answer keyword, so that the answer word vector corresponding to the answer keyword can be represented according to the probability that each word in the preset word library is used as the context word of the answer keyword. Similarly, the element value corresponding to each element in the question word vector can be used to characterize the probability that the word in the preset word library corresponding to the element is used as the context word of the question keyword, so that the question word vector corresponding to the question keyword can be represented according to the probability that each word in the preset word library is used as the context word of the question keyword.

[0044] Specifically, the present embodiment can perform word segmentation processing on the candidate questions and candidate answers in the candidate question-answer pairs, respectively, to determine each question keyword and each answer keyword. The word segmentation processing may include, but is not limited to, Chinese word segmentation, identification of proper nouns, and removal of stop words. By performing word segmentation processing on the candidate questions and candidate answers, and eliminating stop words that have no semantics, such as "ah", "bar", etc., it is possible to quickly obtain each question word vector and each answer word vector, thereby improving the efficiency of word vector generation. Exemplarily, the present embodiment can determine the candidate similarity between each answer keyword and each question keyword based on the following cosine distance formula:

[0045]

[0046] Among them, M ij It refers to the candidate similarity between the i-th answer keyword and the j-th question keyword; A irefers to the answer word vector corresponding to the i-th answer keyword; Q j is the question word vector corresponding to the jth question keyword. By using the answer word vector and the question word vector to determine the candidate similarity between the answer keyword and the question keyword, the contextual importance of the word can be measured to avoid semantic drift, so as to improve the accuracy of semantic matching.

[0047] S140. Use each candidate similarity as the input of a preset matching network model, determine the matching result corresponding to the candidate question and answer pair according to the output of the preset matching network model, and determine the candidate question and answer pair with a successful matching result as the target question and answer pair.

[0048] The preset matching network model may refer to a neural network model used to determine whether a candidate question-answer pair matches. The preset matching network model may be, but is not limited to, a text matching MatchPyramid model. The matching results may include two types, namely, a successful match and a failed match.

[0049] Specifically, before using the preset matching network model, this embodiment also includes a training process for the preset matching network model. The candidate similarities corresponding to multiple matching question-answer pair samples and the candidate similarities corresponding to multiple unmatched question-answer pair samples (which may refer to randomly generated question-answer pairs) are used as training samples to train the preset matching network model. Based on the loss function, the training error corresponding to each question-answer pair sample is calculated according to the training matching result of the preset matching network model and the standard matching result. When the training error is greater than or equal to the preset error, the network parameters of the preset matching network model are adjusted; when the training error is less than the preset error, or the number of iterations is equal to the preset number, it can be determined that the training of the preset matching network model is completed. In this embodiment, each candidate similarity corresponding to each candidate question-answer pair can be input into the preset regression network model after the training is completed, and the matching result corresponding to each candidate question-answer pair can be determined according to the output of the preset regression network model, so that the automatic judgment of whether the candidate question-answer pair is matched can be realized based on the preset regression network model, thereby improving the matching efficiency. By determining the candidate question-answer pair with a successful matching result as the target question-answer pair, a high-quality target question-answer pair can be added to the question-answer database.

[0050] The technical solution of this embodiment first extracts multiple candidate answers from the historical conversation log according to the first frequency of occurrence corresponding to each historical answer in the historical conversation log, and then extracts multiple questions to be selected corresponding to each candidate answer. At this time, the extracted questions to be selected can be questions adjacent to the candidate answers or non-adjacent questions. By screening the candidate questions corresponding to each candidate answer from the multiple questions to be selected based on the correlation between each question to be selected and the corresponding candidate answer, more and effective candidate question-answer pairs can be obtained. By presetting the matching network model, deep semantic matching is performed on each candidate question-answer pair, so that more high-quality question-answer pairs can be extracted, improving the accuracy of extraction.

[0051] On the basis of the above technical scheme, S110 may include: filtering each historical answer in the historical conversation log based on preset filtering rules; counting the first occurrence frequency corresponding to the filtered historical answers, and taking the historical answers whose first occurrence frequency is greater than or equal to the preset frequency as candidate answers, and the historical answers whose first occurrence frequency is less than the preset frequency as first answers; determining the answer similarity between each first answer and each candidate answer, and taking the first answer whose answer similarity is greater than or equal to the preset similarity as a candidate answer; according to each conversation record in the historical conversation log, extracting the user questions that are located before the candidate answers in each conversation record, and determining multiple candidate questions corresponding to the candidate answers according to the user questions extracted from each conversation record.

[0052] The preset filtering rule may be a rule for filtering meaningless answers in historical answers. Meaningless answers may refer to, but are not limited to, welcome words, polite words, and activity slogans. The candidate answers in this embodiment are high-frequency answers, so that the conversation records where the candidate answers are located may be one or more.

[0053] Specifically, by filtering the meaningless historical answers in the historical dialogue log based on the preset filtering rules, the historical answers obtained after filtering are all answers to the user's questions, so as to avoid mixing with high-frequency noise. By directly taking the historical answer with the first appearance frequency greater than or equal to the preset frequency among all the historical answers obtained after filtering as the candidate answer, so as to obtain the historical answer with high frequency reply. At the same time, the historical answer with the first appearance frequency less than the preset frequency is taken as the first answer, and the answer similarity between each first answer and each candidate answer can be determined based on the edit distance or the proportion of the longest common string. By taking the first answer with the answer similarity greater than or equal to the preset similarity as the candidate answer, the first answer with a low appearance frequency but similar to the high-frequency answer can also be taken as the candidate answer, so as to avoid the omission of the long-tail question and answer pair, and also meet the diversity needs of customer service, such as a high-frequency candidate answer is: "package installation"; a low-frequency first answer similar to the candidate answer is: "Dear, package installation", by taking the first answer as the candidate answer, the customer service can choose the answer they like to reply to the user. After each candidate answer is determined, the conversation record containing each candidate answer can be extracted from the various conversation records in the historical conversation log, and multiple candidate questions corresponding to each candidate answer can be determined based on the user questions that precede the candidate answers in the conversation records. For example, all user questions that precede the candidate answers in the conversation records can be used as candidate questions corresponding to the candidate answers.

[0054] Exemplarily, determining multiple candidate questions corresponding to candidate answers based on user questions extracted from each conversation record may include: if multiple user questions are extracted from the conversation record, obtaining a first user question that is closest to the candidate answer; detecting whether there is a second user question that is asked consecutively to the first user question; if so, using both the first user question and the second user question as candidate questions corresponding to the candidate answers; if not, using the first user question as the candidate question corresponding to the candidate answer.

[0055] Specifically, for each conversation record where each candidate answer is located, if there is only one user question before the candidate answer in the conversation record, then the user question can be directly determined as the candidate question corresponding to the candidate answer. If there are multiple user questions before the candidate answer in the conversation record, the user question before the candidate answer and closest to the candidate answer is taken as the first user question, and by detecting whether there is a second user question asked consecutively with the first user question in the conversation record, if so, both the first user question and the second user question can be taken as the candidate questions corresponding to the candidate answer, where the second user question can be one or more; if not, the first user question can be taken as the candidate question corresponding to the candidate answer.

[0056] For example, a conversation record is as follows:

[0057] Question 1 :Hello

[0058] Answer A 1 :Yes

[0059] Question 2 :How long is the warranty?

[0060] Question 3 : There are problems after using it for a while, who can I ask to solve it?

[0061] Answer A 4 : Dear

[0062] Answer A 5 :This product is under nationwide warranty and enjoys three-guarantee service. The warranty period is: one-year warranty for the whole machine and three-year warranty for major components

[0063] In the above conversation record, if the answer is A 5 is a candidate answer, then the distance from candidate answer A 5 The most recent first user question is question Q 3 , and there exists a problem with Q 3 The second user question Q asked consecutively 2 , so that the problem Q 2 and question Q 3 All are candidate answers A 5 The question to be answered.

[0064] On the basis of the above technical solution, when the preset matching network model is a text matching MatchPyramid model, "taking each candidate similarity as the input of the preset matching network model, and determining the matching result corresponding to the candidate question and answer pair according to the output of the preset matching network model" in S140 may include: taking each candidate similarity to form a candidate similarity matrix corresponding to the candidate question and answer pair; taking the candidate similarity matrix as the input of the MatchPyramid model, and determining the matching result corresponding to the candidate question and answer pair according to the output of the MatchPyramid model.

[0065] The candidate similarity matrix can be a matrix composed of the candidate similarities between each answer keyword and each question keyword in the candidate question-answer pair. For example, when the candidate question in the candidate question-answer pair is: "Is there any installation charge?" and the candidate answer is: "No labor charge for the first installation." Figure 2 An example of a candidate similarity matrix is ​​given, such as Figure 2As shown, each row vector in the candidate similarity matrix represents the candidate similarity between a question keyword and each answer keyword; each column vector identifies the candidate similarity between an answer keyword and each question keyword.

[0066] Specifically, after forming a candidate similarity matrix from the candidate similarity matrices in the candidate question-answer pairs, the candidate similarity matrix can be used as a two-dimensional grayscale image and input into the MatchPyramid model, so that the question-answer pair matching problem can be converted into an image classification problem, and the matching result corresponding to the candidate question-answer pair can be determined based on the output of the MatchPyramid model. Figure 3 An example of a MatchPyramid model is given. Figure 3 As shown in the figure, the MatchPyramid model can include a CNN (Convolutional Neural Network) layer, a fully connected layer, and an output layer, where the CNN network includes a convolutional layer and a pooling layer; the fully connected layer is used to perform nonlinear transformation on the low-dimensional vector x output by the CNN layer, and obtain the matching degree of the candidate question-answer pair through the softmax normalized exponential function. 0 and S 1 It can represent positive and negative scores respectively, where the positive class indicates that the candidate question-answer pair matches; the negative class indicates that the candidate question-answer pair does not match. By inputting the candidate similarity matrix into the MatchPyramid model, the matching result corresponding to the candidate question-answer pair can be determined according to the positive class score output by the MatchPyramid model. For example, when the positive class score is greater than 0.5, the matching result corresponding to the candidate question-answer pair is determined to be a successful match, otherwise the matching result is determined to be a failed match, so that the candidate question-answer pair can be automatically judged whether it matches, which greatly improves the judgment efficiency.

[0067] Embodiment 2

[0068] Figure 4 This is a flow chart of a method for extracting question-answer pairs provided in Embodiment 2 of the present invention. Based on the above embodiments, this embodiment optimizes "determining the correlation between each question to be selected and the corresponding candidate answer, and determining the candidate question corresponding to each candidate answer based on the correlation, to obtain each candidate question-answer pair". The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.

[0069] See also Figure 4 The method for extracting question-answer pairs provided in this embodiment includes the following steps:

[0070] S210: Determine a plurality of candidate answers and a plurality of to-be-selected questions corresponding to each candidate answer according to the first occurrence frequency corresponding to each historical answer in the historical conversation log.

[0071] S220: Cluster the candidate answers to determine each candidate answer set, and determine the set of questions to be selected corresponding to each candidate answer set based on the correspondence between the candidate answers and the questions to be selected.

[0072] The candidate answer set may be composed of two or more candidate answers whose similarity is greater than a preset similarity threshold. The set of questions to be selected may be composed of multiple questions to be selected corresponding to each candidate answer in the candidate answer set.

[0073] Specifically, this embodiment can cluster the candidate answers based on the existing clustering method to cluster similar candidate answers together to obtain multiple candidate answer sets, so that more question keywords can be obtained later to improve the accuracy of correlation determination. For each candidate answer set, multiple candidate questions corresponding to each candidate answer in the candidate answer set are obtained, and the obtained candidate questions are combined to determine the candidate question set corresponding to the candidate answer set.

[0074] S230 , extracting question keywords from each of the questions to be selected in the set of questions to be selected, and determining a set of question keywords corresponding to each of the set of questions to be selected.

[0075] The question keyword may be a character or a word in the question to be selected.

[0076] Specifically, for each set of questions to be selected, all the questions in the set can be segmented to obtain each question keyword in each question to be selected, and then all the question keywords are combined to determine the question keyword set corresponding to the set of questions to be selected.

[0077] S240: Determine the keyword importance corresponding to each question keyword in the question keyword set according to each question keyword set, and determine the correlation between each to-be-selected question and the corresponding candidate answer based on the importance of each keyword.

[0078] The keyword importance corresponding to the question keyword may refer to the importance of the question keyword in the question keyword set, which may reflect the importance of the question keyword to the candidate answer. The higher the question keyword importance, the higher the possibility that the question keyword is a keyword in the standard question of the candidate answer.

[0079] Specifically, this embodiment can be based on the TF-IDF (Term Frequency-Inverse Document Frequency) method, and according to each question keyword in each question keyword set, the keyword importance corresponding to each question keyword can be determined. According to the keyword importance corresponding to each question keyword in each question to be selected, the question importance corresponding to the question to be selected can be calculated, and the question importance can be used as the correlation between the question to be selected and the corresponding candidate answer. Similarly, the correlation between each question to be selected and the corresponding candidate answer can be determined.

[0080] Exemplarily, "determining the keyword importance corresponding to each question keyword in the question keyword set according to each question keyword set" in S240 may include: determining the keyword importance corresponding to each question keyword in the question keyword set according to the second occurrence frequency corresponding to each question keyword, the number of question keyword sets containing the same question keyword, and the total number of question keyword sets.

[0081] The second occurrence frequency may refer to the occurrence frequency in the same question keyword set. In this embodiment, the occurrence frequency of each question keyword in the same question keyword set may be counted as the second occurrence frequency. Exemplarily, the keyword importance corresponding to each question keyword in the question keyword set may be determined according to the following formula:

[0082]

[0083] Among them, S iw is the i-th question keyword set D i The importance of the keyword w in the question; F iw The question keyword w appears in the question keyword set D i The second frequency of occurrence; N is the total number of question keyword sets; n w is the number of problem keyword sets containing the problem keyword w; m is the problem keyword set D i Any question keyword in F im The question keyword m appears in the question keyword set D i The second frequency of occurrence; n m is the number of problem keyword sets containing the problem keyword m. Specifically, this embodiment can perform normalization processing on the keyword importance corresponding to each problem keyword based on the above formula, so as to accurately reflect the keyword importance corresponding to each problem keyword.

[0084] Exemplarily, "determining the correlation between each question to be selected and the corresponding candidate answer based on the importance of each keyword" in S240 may include: adding the importance of keywords corresponding to each question keyword in the question to be selected, and determining the addition result as the correlation between the question to be selected and the corresponding candidate answer.

[0085] Specifically, for each candidate question, the keyword importances corresponding to the various question keywords in the candidate question may be added together, and the obtained addition result may be used as the correlation between the candidate question and the corresponding candidate answer.

[0086] S250: Determine the candidate question with the highest correlation as the candidate question corresponding to the corresponding candidate answer, and obtain a candidate question-answer pair.

[0087] Specifically, for each candidate answer corresponding to multiple candidate questions, based on the correlation corresponding to each candidate question, the candidate question with the highest correlation can be used as the candidate question corresponding to the candidate answer, thereby obtaining multiple valid candidate question-answer pairs.

[0088] S260: Determine the candidate similarity between each answer keyword and each question keyword in the candidate question-answer pair.

[0089] S270. Use each candidate similarity as the input of a preset matching network model, determine the matching result corresponding to the candidate question and answer pair according to the output of the preset matching network model, and determine the candidate question and answer pair with a successful matching result as the target question and answer pair.

[0090] The technical solution of this embodiment determines each candidate answer set and a set of candidate questions corresponding to each candidate answer set by clustering the candidate answers, and extracts question keywords for each candidate question in the set of candidate questions to determine the keyword importance corresponding to each question keyword; determines the correlation between each candidate question and the corresponding candidate answer based on the importance of each keyword, and determines the candidate question with the highest correlation as the candidate question corresponding to the corresponding candidate answer, thereby obtaining more effective and accurate candidate question-answer pairs, and further improving the accuracy of question-answer pair extraction.

[0091] On the basis of the above technical solution, after S270, it also includes: obtaining the current conversation log generated by the current time period corresponding to the historical time period; determining multiple current candidate answers and multiple current questions to be selected corresponding to each current candidate answer according to the third occurrence frequency corresponding to each current answer in the current conversation log; determining the current candidate question corresponding to the current candidate answer from each current question to be selected according to each current candidate answer, each current question to be selected, and the historical candidate answers and historical questions to be selected corresponding to the historical time period, and obtaining each current candidate question and answer pair; determining the matching result corresponding to each current candidate question and answer pair according to a preset matching network model, and determining the current candidate question and answer pair whose matching result is a successful match as the target question and answer pair.

[0092] The current dialogue log may refer to each dialogue record generated in the current time period, such as the current dialogue log generated in the current time period. The third occurrence frequency may refer to the number of times each current answer in the current dialogue log appears in the current dialogue log.

[0093] Specifically, this embodiment can filter out meaningless current answers in the current dialogue log, such as welcome words, polite replies, etc., based on preset filtering rules. According to the third occurrence frequency corresponding to each current answer obtained after filtering, the current answer with a third occurrence frequency higher than the preset frequency can be used as the current candidate answer. And multiple current questions to be selected corresponding to each current candidate answer can be extracted from the current dialogue log in a similar manner to extracting historical questions to be selected. This embodiment can cluster the current candidate answers and historical candidate answers to determine each first candidate answer set, and determine the first question set to be selected corresponding to each first candidate answer set based on the corresponding relationship between the historical candidate answers and the historical questions to be selected and the corresponding relationship between the current candidate answers and the current questions to be selected; extract the question keywords of each first question to be selected in the first question set to determine the first question keyword set corresponding to each first question set, wherein the first question to be selected can be a historical question to be selected or a current question to be selected. Based on the implementation method of the above step S240, the keyword importance corresponding to each question keyword in the first question keyword set can be determined according to each first question keyword set, and the keyword importance corresponding to each current question keyword in the first candidate question can be added, and the obtained addition result is used as the correlation between the current candidate question and the corresponding current candidate answer, and the current candidate question with the highest correlation is used as the current candidate question corresponding to the corresponding current candidate answer, so that multiple current candidate question and answer pairs can be determined. By taking the candidate similarity between each current answer keyword and each current question keyword in each current candidate question and answer pair as the input of the preset matching network model, the matching result corresponding to each current candidate question and answer pair can be determined according to the output of the preset matching network model, and the current candidate question and answer pair with a matching result of a successful match can be determined as the target question and answer pair, so that the high-quality current candidate question and answer pairs that are successfully matched can be added to the question and answer database in real time, realizing the mining of question and answer pairs for conversation logs in a short period of time, so as to update the question and answer database in real time and ensure the timeliness of the question and answer pairs.

[0094] The following is an embodiment of a device for extracting question and answer pairs provided in an embodiment of the present invention. The device and the method for extracting question and answer pairs in the above-mentioned embodiments belong to the same inventive concept. For details not fully described in the embodiment of the device for extracting question and answer pairs, please refer to the embodiment of the method for extracting question and answer pairs mentioned above.

[0095] Embodiment 3

[0096] Figure 5This is a structural diagram of a question-answer pair extraction device provided in Example 3 of the present invention. This embodiment is applicable to the case of extracting high-quality question-answer pairs. The device specifically includes: a candidate answer determination module 310, a candidate question-answer pair acquisition module 320, a candidate similarity determination module 330 and a target question-answer pair determination module 340.

[0097] Among them, the candidate answer determination module 310 is used to determine multiple candidate answers and multiple questions to be selected corresponding to each candidate answer according to the first occurrence frequency corresponding to each historical answer in the historical conversation log; the candidate question and answer pair acquisition module 320 is used to determine the correlation between each question to be selected and the corresponding candidate answer, and determine the candidate question corresponding to each candidate answer based on the correlation to obtain each candidate question and answer pair; the candidate similarity determination module 330 is used to determine the candidate similarity between each answer keyword and each question keyword in the candidate question and answer pair; the target question and answer pair determination module 340 is used to use each candidate similarity as the input of the preset matching network model, determine the matching result corresponding to the candidate question and answer pair according to the output of the preset matching network model, and determine the candidate question and answer pair with a successful matching result as the target question and answer pair.

[0098] Optionally, the candidate answer determination module 310 includes:

[0099] A historical answer filtering unit, used to filter each historical answer in the historical conversation log based on a preset filtering rule;

[0100] A first candidate answer determination unit, used to count the first occurrence frequencies corresponding to the filtered historical answers, and to take the historical answers whose first occurrence frequencies are greater than or equal to a preset frequency as candidate answers, and the historical answers whose first occurrence frequencies are less than the preset frequency as first answers;

[0101] A second candidate answer determination unit is used to determine the answer similarity between each first answer and each candidate answer, and to take the first answer whose answer similarity is greater than or equal to a preset similarity as a candidate answer;

[0102] The candidate question determination unit is used to extract the user questions that precede the candidate answers in each dialogue record according to each dialogue record in the historical dialogue log, and determine multiple candidate questions corresponding to the candidate answers according to the user questions extracted from each dialogue record.

[0103] Optionally, the unit for determining the question to be selected is specifically used to: if multiple user questions are extracted from the conversation record, obtain a first user question that is closest to the candidate answer; detect whether there is a second user question that is asked continuously with the first user question; if so, use both the first user question and the second user question as the question to be selected corresponding to the candidate answer; if not, use the first user question as the question to be selected corresponding to the candidate answer.

[0104] Optionally, the candidate question-answer pair obtaining module 320 includes:

[0105] A unit for determining a set of questions to be selected, used to cluster the candidate answers, determine the sets of candidate answers, and determine the set of questions to be selected corresponding to each candidate answer set according to the corresponding relationship between the candidate answers and the questions to be selected;

[0106] A question keyword set determination unit is used to extract question keywords from each of the questions to be selected in the question set, and determine a question keyword set corresponding to each of the questions to be selected;

[0107] A relevance determination unit, for determining the importance of each keyword in the question keyword set according to each question keyword set, and determining the relevance between each question to be selected and the corresponding candidate answer based on the importance of each keyword;

[0108] The candidate question-answer pair determination unit is used to determine the candidate question with the highest correlation as the candidate question corresponding to the corresponding candidate answer to obtain a candidate question-answer pair.

[0109] Optionally, the relevance determination unit includes: a keyword importance determination subunit, used to determine the keyword importance corresponding to each question keyword in the question keyword set based on the second occurrence frequency corresponding to each question keyword, the number of question keyword sets containing the same question keyword, and the total number of question keyword sets, wherein the second occurrence frequency refers to the frequency of occurrence in the same question keyword set.

[0110] Optionally, the keyword importance corresponding to each question keyword in the question keyword set is determined according to the following formula:

[0111]

[0112] Among them, S iw is the i-th question keyword set D i The importance of the keyword w in the question; F iw The question keyword w appears in the question keyword set D i The second frequency of occurrence; N is the total number of question keyword sets; n w is the number of problem keyword sets containing the problem keyword w; m is the problem keyword set D i Any question keyword in F im The question keyword m appears in the question keyword set D i The second frequency of occurrence; n m is the number of problem keyword sets containing the problem keyword m.

[0113] Optionally, the relevance determination unit further includes: a relevance determination subunit, which is used to add the keyword importances corresponding to each question keyword in the question to be selected, and determine the addition result as the relevance between the question to be selected and the corresponding candidate answer.

[0114] Optionally, the candidate similarity determination module 330 is specifically used to: determine the answer word vector corresponding to each answer keyword in the candidate question and answer pair and the question word vector corresponding to each question keyword; based on the cosine distance formula, determine the candidate similarity between each answer keyword and each question keyword according to each answer word vector and each question word vector.

[0115] Optionally, the preset matching network model is a text matching MatchPyramid model; accordingly, the target question and answer pair determination module 340 also includes: a matching result determination unit, which is used to organize each candidate similarity into a candidate similarity matrix corresponding to the candidate question and answer pair; using the candidate similarity matrix as the input of the MatchPyramid model, and determining the matching result corresponding to the candidate question and answer pair according to the output of the MatchPyramid model.

[0116] Optionally, the device further comprises:

[0117] A current conversation log acquisition module is used to acquire the current conversation log generated in the current time period corresponding to the historical time period after determining the candidate question-answer pair with a successful match result as the target question-answer pair;

[0118] A current candidate answer determination module, used to determine a plurality of current candidate answers and a plurality of current questions to be selected corresponding to each current candidate answer according to the third occurrence frequency corresponding to each current answer in the current dialogue log;

[0119] A current candidate question-answer pair determination module is used to determine the current candidate question corresponding to the current candidate answer from each current candidate question, based on each current candidate answer, each current candidate question, and the historical candidate answers and historical candidate questions corresponding to the historical time period, to obtain each current candidate question-answer pair;

[0120] The target question and answer pair determination module 340 is also used to determine the matching result corresponding to each current candidate question and answer pair according to a preset matching network model, and determine the current candidate question and answer pair with a successful matching result as the target question and answer pair.

[0121] The question-answer pair extraction device provided in the embodiment of the present invention can execute the question-answer pair extraction method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the question-answer pair extraction method.

[0122] Embodiment 4

[0123] Figure 6 A schematic diagram of the structure of a device provided in Embodiment 4 of the present invention. Figure 6 A block diagram of an exemplary device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 6 The device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0124] like Figure 6 As shown, device 12 is in the form of a general purpose computing device. Components of device 12 may include, but are not limited to, one or more processors or processing units 16, system memory 28, and bus 18 that connects various system components (including system memory 28 and processing unit 16).

[0125] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0126] Device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by device 12, including volatile and non-volatile media, removable and non-removable media.

[0127] System 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. Device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 not shown, usually called a "hard drive"). Although Figure 6 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0128] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system 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 or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0129] The device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the device 12, and / or may communicate with any device that enables the device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the 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.

[0130] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing a question-answer pair extraction method provided in the embodiment of the present invention, the method comprising:

[0131] Determine multiple candidate answers and multiple questions to be selected corresponding to each candidate answer according to the first occurrence frequency corresponding to each historical answer in the historical conversation log;

[0132] Determine the correlation between each candidate question and the corresponding candidate answer, and determine the candidate question corresponding to each candidate answer based on the correlation, to obtain each candidate question-answer pair;

[0133] Determining a candidate similarity between each answer keyword and each question keyword in a candidate question-answer pair;

[0134] Each candidate similarity is used as the input of the preset matching network model, the matching result corresponding to the candidate question and answer pair is determined according to the output of the preset matching network model, and the candidate question and answer pair with a successful matching result is determined as the target question and answer pair.

[0135] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the question-answer pair extraction method provided in any embodiment of the present invention.

[0136] Embodiment 5

[0137] This fifth embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the method for extracting question-answer pairs provided in any embodiment of the present invention are implemented. The method includes:

[0138] Determine multiple candidate answers and multiple questions to be selected corresponding to each candidate answer according to the first occurrence frequency corresponding to each historical answer in the historical conversation log;

[0139] Determine the correlation between each candidate question and the corresponding candidate answer, and determine the candidate question corresponding to each candidate answer based on the correlation, to obtain each candidate question-answer pair;

[0140] Determining a candidate similarity between each answer keyword and each question keyword in a candidate question-answer pair;

[0141] Each candidate similarity is used as the input of the preset matching network model, the matching result corresponding to the candidate question and answer pair is determined according to the output of the preset matching network model, and the candidate question and answer pair with a successful matching result is determined as the target question and answer pair.

[0142] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0143] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0144] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0145] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0146] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0147] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for extracting question-answer pairs, characterized in that: include: Determine, according to the first occurrence frequency corresponding to each historical answer in the historical conversation log, a plurality of candidate answers and a plurality of questions to be selected corresponding to each candidate answer; Clustering the candidate answers to determine each candidate answer set, and determining a set of questions to be selected corresponding to each candidate answer set based on the correspondence between the candidate answers and the questions to be selected; Extracting question keywords from each of the questions to be selected in the set of questions to be selected, and determining a question keyword set corresponding to each of the questions to be selected; Determine the keyword importance corresponding to each of the question keywords in the question keyword set according to each of the question keyword sets, and determine the association between each to-be-selected question and the corresponding candidate answer based on each of the keyword importances, wherein the keyword importance is used to characterize the possibility that the question keyword is a keyword in the standard question of the candidate answer; Determine the candidate question with the highest correlation as the candidate question corresponding to the corresponding candidate answer, and obtain a candidate question-answer pair; Determine a candidate similarity between each answer keyword and each question keyword in the candidate question-answer pair, wherein the answer keyword refers to a valid word or phrase in the candidate answer, and the question keyword refers to a valid word or phrase in the candidate question; Each of the candidate similarities is used as an input of a preset matching network model, a matching result corresponding to the candidate question-answer pair is determined according to an output of the preset matching network model, and the candidate question-answer pair whose matching result is a successful match is determined as a target question-answer pair.

2. The method according to claim 1, characterized in that: Determining a plurality of candidate answers and a plurality of questions to be selected corresponding to each candidate answer according to the first occurrence frequency corresponding to each historical answer in the historical conversation log includes: Filter each historical answer in the historical conversation log based on the preset filtering rules; Counting the first occurrence frequencies corresponding to the filtered historical answers, taking the historical answers whose first occurrence frequencies are greater than or equal to the preset frequency as candidate answers, and taking the historical answers whose first occurrence frequencies are less than the preset frequency as first answers; Determine the answer similarity between each of the first answers and each of the candidate answers, and take the first answers whose answer similarity is greater than or equal to a preset similarity as candidate answers; According to each conversation record in the historical conversation log, the user question located before the candidate answer in each conversation record is extracted, and a plurality of candidate questions corresponding to the candidate answer are determined according to the user questions extracted from each conversation record.

3. The method according to claim 2, characterized in that Determining a plurality of questions to be selected corresponding to the candidate answers according to the user questions extracted from each of the conversation records includes: If there are multiple user questions extracted from the conversation record, obtaining the first user question closest to the candidate answer; Detecting whether there is a second user question asked consecutively to the first user question; If yes, both the first user question and the second user question are used as the candidate questions corresponding to the candidate answers; If not, the first user question is used as the candidate question corresponding to the candidate answer.

4. The method according to claim 1, characterized in that Determining the keyword importance corresponding to each of the question keywords in the question keyword set according to each of the question keyword sets includes: The keyword importance corresponding to each of the question keywords in the question keyword set is determined based on the second occurrence frequency corresponding to each of the question keywords, the number of question keyword sets containing the same question keyword, and the total number of question keyword sets, wherein the second occurrence frequency refers to the frequency of occurrence in the same question keyword set.

5. The method according to claim 4, characterized in that The keyword importance corresponding to each of the question keywords in the question keyword set is determined according to the following formula: Among them, S iw is the i-th question keyword set D i The importance of the keyword w in the question; F iw The question keyword w appears in the question keyword set D i The second frequency of occurrence; N is the total number of question keyword sets; n w is the number of problem keyword sets containing the problem keyword w; m is the problem keyword set D i Any question keyword in F im The question keyword m appears in the question keyword set D i The second frequency of occurrence; n m is the number of problem keyword sets containing the problem keyword m.

6. The method according to claim 1, characterized in that Determining the relevance between each candidate question and the corresponding candidate answer based on the importance of each keyword includes: The importance of the keywords corresponding to the keywords in the question to be selected are added, and the result of the addition is determined as the correlation between the question to be selected and the corresponding candidate answer.

7. The method according to claim 1, characterized in that Determining a candidate similarity between each answer keyword and each question keyword in the candidate question-answer pair includes: Determine an answer word vector corresponding to each answer keyword and a question word vector corresponding to each question keyword in the candidate question-answer pair; Based on the cosine distance formula, the candidate similarity between each answer keyword and each question keyword is determined according to each answer word vector and each question word vector.

8. The method according to claim 1, characterized in that The preset matching network model is a text matching MatchPyramid model; Accordingly, each candidate similarity is used as an input of a preset matching network model, and a matching result corresponding to the candidate question-answer pair is determined according to an output of the preset matching network model, including: Combining the candidate similarities into a candidate similarity matrix corresponding to the candidate question-answer pair; The candidate similarity matrix is ​​used as the input of the MatchPyramid model, and the matching result corresponding to the candidate question-answer pair is determined according to the output of the MatchPyramid model.

9. The method according to any one of claims 1 to 8, characterized in that: After determining the candidate question-answer pair with a successful match as a target question-answer pair, the method further includes: Get the current conversation log generated in the current time period corresponding to the historical time period; Determine, according to the third occurrence frequency corresponding to each current answer in the current conversation log, a plurality of current candidate answers and a plurality of current questions to be selected corresponding to each current candidate answer; According to each of the current candidate answers, each of the current questions to be selected, and the historical candidate answers and historical questions to be selected corresponding to the historical time period, a current candidate question corresponding to the current candidate answer is determined from each of the current questions to be selected, and each current candidate question-answer pair is obtained; According to the preset matching network model, the matching result corresponding to each of the current candidate question-answer pairs is determined, and the current candidate question-answer pair for which the matching result is a successful match is determined as the target question-answer pair.

10. A device for extracting question-answer pairs, characterized in that: include: A candidate answer determination module, used to determine a plurality of candidate answers and a plurality of questions to be selected corresponding to each of the candidate answers according to the first occurrence frequency corresponding to each historical answer in the historical conversation log; The candidate question-answer pair acquisition module includes: A unit for determining a set of questions to be selected, configured to cluster the candidate answers to determine each set of candidate answers, and determine a set of questions to be selected corresponding to each set of candidate answers based on the correspondence between the candidate answers and the questions to be selected; A question keyword set determination unit, configured to extract question keywords from each of the questions to be selected in the question set, and determine a question keyword set corresponding to each of the questions to be selected; a relevance determination unit, configured to determine, based on each of the question keyword sets, a keyword importance corresponding to each of the question keywords in the question keyword set, and determine a relevance between each to-be-selected question and a corresponding candidate answer based on each of the keyword importances, wherein the keyword importance is used to characterize the possibility that the question keyword is a keyword in the standard question of the candidate answer; A candidate question-answer pair determination unit is used to determine the candidate question with the highest correlation as the candidate question corresponding to the corresponding candidate answer, so as to obtain a candidate question-answer pair; A candidate similarity determination module, used to determine the candidate similarity between each answer keyword and each question keyword in the candidate question-answer pair; A target question-answer pair determination module is used to use each of the candidate similarities as an input of a preset matching network model, determine the matching result corresponding to the candidate question-answer pair according to the output of the preset matching network model, and determine the candidate question-answer pair whose matching result is a successful match as the target question-answer pair; The answer keywords refer to valid characters or words in the candidate answers, and the question keywords refer to valid characters or words in the candidate questions.

11. An electronic device, characterized in that: The device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the steps of the question-answer pair extraction method as described in any one of claims 1-9.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method for extracting question-answer pairs as described in any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Method for establishing knowledge base based on historical consultation data

    CN103455535A