Question and answer method and system, computer equipment and storage medium

By rewriting knowledge of user questions and searching similar question databases, generating and matching problem vectors, the problems of unclear reference and inefficiency in the FAQ question-and-answer system are solved, and the accuracy and efficiency of answers are improved.

CN119128099APending Publication Date: 2024-12-13CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411250606.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The existing FAQ Q&A system has problems of unclear reference and inefficiency when processing user input questions, resulting in incorrect answers and difficulty in matching.

Method used

By receiving user question text, knowledge rewrite generate target entities and target questions, use preset similar question database to search candidate questions, and encode and match target questions and candidate questions to generate similar questions to improve answer accuracy and efficiency.

Benefits of technology

It improves the accuracy and efficiency of the answers of the FAQ Q&A system, solves the problem of unclear reference, and reduces the difficulty of selecting the correct answer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128099A_ABST
    Figure CN119128099A_ABST
Patent Text Reader

Abstract

The invention discloses a question and answer method and system, computer equipment and a storage medium, and relates to the technical field of artificial intelligence, and the method comprises the steps: receiving a user question text input by a target user, carrying out the knowledge rewriting of the user question text, and generating a target entity and a target question related to the user question text; based on a preset similar question library, retrieving a question set related to the target entity, and generating candidate questions corresponding to the target entity; respectively encoding the target problem and the candidate problem to generate a corresponding target problem vector and a corresponding candidate problem vector; performing question matching based on the target question vector and the candidate question vectors, and generating similar questions corresponding to the target question in the candidate questions; and based on the similar questions, taking corresponding answers as outputs and returning the answers to the target user. By means of the method, the question answering efficiency and accuracy of an existing FAQ system can be improved, and the query experience of a user is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a question-answering method, system, computer device, and non-volatile computer-readable storage medium. Background Art

[0002] At present, FAQ (Frequently Asked Questions) question-answering system is a typical application of artificial intelligence scenarios, and is also widely used in the insurance industry. The system indexes the high-frequency question-answer pairs that users often ask, and when new user questions are hit, they can be quickly answered. The existing FAQ question-answering system first accepts questions raised by users, then searches and establishes a candidate answer set from a similar question library based on the questions raised by users, and finally calculates the text similarity between user questions and candidate answers, and outputs the final answer.

[0003] At present, through the investigation of the existing FAQ question-answering system based on insurance products, it is found that the FAQ question-answering system in the insurance product field has the following problems:

[0004] 1. There are a lot of references in the text of the user input question, but the existing FAQ question-answering system cannot recognize it, resulting in wrong answers. For example, "I want to ask about Ping An Million Property Insurance, I don't want to know about employer liability insurance, what liabilities can this product cover?" The user actually wants to ask "What liabilities can Ping An Million Property Insurance cover?" However, since there are multiple insurance product entities in the text, the reference is unclear. The existing FAQ question-answering system makes a matching error, such as "What liabilities can employer liability insurance cover?", which causes the question-answering system to answer the question incorrectly;

[0005] 2. When searching for candidate question texts of user questions in a similar question database, the existing FAQ question-answering system focuses on the method of directly searching in the question database. However, since the similar question database contains a large amount of question text, directly matching the user questions in the question database will reduce the system's operating efficiency and increase the difficulty of selecting the correct answer to the question.

[0006] Based on this, how to provide a question-and-answer method, system, computer device and non-volatile computer-readable storage medium that can improve the efficiency and accuracy of answering questions in the existing FAQ question-and-answer system and optimize the user's query experience is a problem that urgently needs to be solved by technical personnel in this field. Summary of the invention

[0007] In view of the above-mentioned shortcomings of the prior art, the purpose of the present invention is to provide a question-and-answer method, system, computer device and non-volatile computer-readable storage medium that can be used in financial technology or other related fields, which can improve the efficiency and accuracy of answering questions in the existing FAQ question-and-answer system and optimize the user's query experience.

[0008] In order to achieve the above object, the present invention adopts the following technical solutions:

[0009] A question-answering method, comprising:

[0010] Receive a user question text input by a target user, perform knowledge rewriting on the user question text, and generate a target entity and a target question related to the user question text;

[0011] Based on a preset similar question library, a question set related to the target entity is retrieved to generate candidate questions corresponding to the target entity;

[0012] Encode the target question and the candidate question respectively to generate a corresponding target question vector and a candidate question vector;

[0013] Performing question matching based on the target question vector and the candidate question vector, generating similar questions corresponding to the target question among the candidate questions;

[0014] Based on the similar questions, the corresponding answers are returned to the target user as output.

[0015] In a further technical solution, the question-answering method, wherein the step of receiving a user question text input by a target user, performing knowledge rewriting on the user question text, and generating a target entity and a target question related to the user question text, comprises:

[0016] Receive the user question text input by the target user, use the user question text as the input of the BERT model, output the representation vector of each word, and aggregate the word representation vectors in each span into an aggregate vector;

[0017] Pre-train a mention detector, take the aggregate vector of each span as input, detect whether each aggregate vector is a mention entity, and output the corresponding first likelihood score;

[0018] Pre-train a classification model, take the aggregate vector of two spans as input, calculate whether the two aggregate vectors point to the same entity, and output the corresponding second likelihood score;

[0019] Add the first possibility score and the second possibility score of the two spans. When the total score exceeds a preset threshold, it is determined that the two spans have a reference relationship.

[0020] Based on the judgment results, the target entities and target questions related to the user's question text are generated.

[0021] In a further technical solution, the question-answering method, wherein the step of retrieving a set of questions related to the target entity based on a preset similar question library and generating candidate questions corresponding to the target entity, comprises:

[0022] Pre-set similar question bank;

[0023] Based on the similar question database, a set of questions related to the target entity is retrieved;

[0024] Based on the retrieval results, candidate questions corresponding to the target entity are generated.

[0025] In a further technical solution, the question-answering method, wherein the encoding of the target question and the candidate question respectively to generate the corresponding target question vector and candidate question vector comprises:

[0026] Use the Sentence-BERT model to encode the target question and candidate questions respectively, and generate the corresponding target question vector and candidate question vector.

[0027] In a further technical solution, the question-answering method, wherein the step of performing question matching based on the target question vector and the candidate question vector to generate similar questions corresponding to the target question in the candidate questions includes:

[0028] The similarity f between the target question and the candidate question is calculated in two parts: vector similarity and string similarity. The calculation formula is as follows:

[0029]

[0030] Among them, w1 and w2 are hyperparameters, e q1 With e q2 are the target question vector and the candidate question vector, s1 and s2 are the target question string length and the candidate question string length, m is the number of matching characters between s1 and s2, and t is the number of transpositions;

[0031] Set a similarity threshold to filter out similar questions that meet the criteria.

[0032] In a further technical solution, the question-answering method, wherein the setting of a similarity threshold to screen out similar questions that meet the conditions, includes:

[0033] Set a similarity threshold and select the candidate questions that meet the threshold conditions and have the highest similarity as similar questions.

[0034] In a further technical solution, the question-answering method, wherein the step of returning the corresponding answer to the target user as output based on the similar question, comprises:

[0035] Based on the similar questions obtained by screening, the answers corresponding to the similar questions are sorted out and returned to the target user as output.

[0036] A question-answering system, comprising:

[0037] A knowledge rewriting module is used to receive a user question text input by a target user, perform knowledge rewriting on the user question text, and generate a target entity and a target question related to the user question text;

[0038] A question retrieval module is used to retrieve a set of questions related to the target entity based on a preset similar question library, and generate candidate questions corresponding to the target entity;

[0039] A question encoding module, used to encode the target question and the candidate question respectively, and generate a corresponding target question vector and candidate question vector;

[0040] A question matching module, configured to perform question matching based on the target question vector and the candidate question vector, and generate similar questions corresponding to the target question among the candidate questions;

[0041] The answer returning module is used to return the corresponding answers to the similar questions as output to the target user.

[0042] A computer device, wherein the computer device comprises at least one processor; and

[0043] a memory communicatively connected to the at least one processor; wherein,

[0044] The memory stores a computer program that can be executed by the at least one processor. When the computer program is executed by the at least one processor, the question-and-answer method as described in any one of the above items can be implemented.

[0045] A non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, it can implement any of the question-and-answer methods described above.

[0046] Compared with the prior art, the present invention provides a question-answering method, system, computer device and non-volatile computer-readable storage medium, wherein the method includes: receiving a user question text input by a target user, rewriting the user question text with knowledge, and generating a target entity and a target question related to the user question text; based on a preset similar question library, retrieving a set of questions related to the target entity, and generating candidate questions corresponding to the target entity; encoding the target question and the candidate question respectively, and generating corresponding target question vectors and candidate question vectors; matching questions based on the target question vector and the candidate question vector, and generating similar questions corresponding to the target question in the candidate questions; based on the similar questions, returning the corresponding answers as output to the target user. In this way, the method of the present invention can improve the efficiency and accuracy of answering questions in the existing FAQ question-answering system, and optimize the user's query experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0048] Figure 1 A flowchart of a question-and-answer method provided in an embodiment of the present invention.

[0049] Figure 2 A schematic diagram of functional modules of a question-answering system provided in an embodiment of the present invention.

[0050] Figure 3 A schematic diagram of the hardware structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0052] In the description of the present invention, the terms "include", "including", "have", "contain", etc. are all open terms, which mean including but not limited to. The descriptions with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", etc. mean that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. The order of steps involved in each embodiment is used to schematically illustrate the implementation of the present application, and the order of steps therein is not limited and can be appropriately adjusted as needed.

[0053] Various non-limiting embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.

[0054] At present, FAQ (Frequently Asked Questions) question-answering system is a typical application of artificial intelligence scenarios, and is also widely used in the insurance industry. The system indexes the high-frequency question-answer pairs that users often ask, and when new user questions are hit, they can be quickly answered. The existing FAQ question-answering system first accepts questions raised by users, then searches and establishes a candidate answer set from a similar question library based on the questions raised by users, and finally calculates the text similarity between user questions and candidate answers, and outputs the final answer.

[0055] At present, through the investigation of the existing FAQ question-answering system based on insurance products, it is found that the FAQ question-answering system in the insurance product field has the following problems:

[0056] 1. There are a lot of references in the text of the user input question, but the existing FAQ question-answering system cannot recognize it, resulting in wrong answers. For example, "I want to ask about Ping An Million Property Insurance, I don't want to know about employer liability insurance, what liabilities can this product cover?" The user actually wants to ask "What liabilities can Ping An Million Property Insurance cover?" However, since there are multiple insurance product entities in the text, the reference is unclear. The existing FAQ question-answering system makes a matching error, such as "What liabilities can employer liability insurance cover?", which causes the question-answering system to answer the question incorrectly;

[0057] 2. When searching for candidate question texts of user questions in a similar question database, the existing FAQ question-answering system focuses on the method of directly searching in the question database. However, since the similar question database contains a large amount of question text, directly matching the user questions in the question database will reduce the system's operating efficiency and increase the difficulty of selecting the correct answer to the question.

[0058] Based on this, how to provide a question-and-answer method, system, computer device and non-volatile computer-readable storage medium that can improve the efficiency and accuracy of answering questions in the existing FAQ question-and-answer system and optimize the user's query experience is a problem that urgently needs to be solved by technical personnel in this field.

[0059] Therefore, to solve the above problem, please refer to Figure 1 The embodiment of the present invention provides a question-answering method, wherein the method comprises the steps of:

[0060] S100, receiving a user question text input by a target user, performing knowledge rewriting on the user question text, and generating a target entity and a target question related to the user question text;

[0061] S200, based on a preset similar question library, searching for a question set related to the target entity, and generating candidate questions corresponding to the target entity;

[0062] S300, encoding the target question and the candidate question respectively to generate a corresponding target question vector and candidate question vector;

[0063] S400, performing question matching based on the target question vector and the candidate question vector, generating similar questions corresponding to the target question among the candidate questions;

[0064] S500: Based on the similar questions, the corresponding answers are returned to the target user as output.

[0065] Furthermore, the question-answering method, wherein the step S100, receiving a user question text input by a target user, performing knowledge rewriting on the user question text, and generating a target entity and a target question related to the user question text, specifically includes:

[0066] Receive the user question text input by the target user, use the user question text as the input of the BERT model, output the representation vector of each word, and aggregate the word representation vectors in each span into an aggregate vector;

[0067] Pre-train a mention detector, take the aggregate vector of each span as input, detect whether each aggregate vector is a mention entity, and output the corresponding first likelihood score;

[0068] Pre-train a classification model, take the aggregate vector of two spans as input, calculate whether the two aggregate vectors point to the same entity, and output the corresponding second likelihood score;

[0069] Add the first possibility score and the second possibility score of these two spans. When the total score of the two exceeds a preset threshold, it is determined that these two spans have a referential relationship;

[0070] Based on the determination result, generate the target entity and the target question related to the user question text.

[0071] In specific implementation, in this embodiment, when receiving the user question text input by the target user, first, use this user question text as the input of the BERT model, output the representation vectors of each word in the user question text, and aggregate the word representation vectors in each span in the user question text into an aggregated vector; then, pre-train a mention detector, and use the aggregated vectors of each span as the input to detect whether each aggregated vector is a mention entity and output the corresponding first possibility score; then, pre-train a classification model, use the aggregated vectors of two spans as the input to calculate whether the two aggregated vectors point to the same entity and output the corresponding second possibility score; then, add the first possibility score and the second possibility score of these two spans. When the total score of the two exceeds a preset threshold, it is determined that these two spans have a referential relationship; finally, based on the determination result, generate the target entity and the target question related to the user question text.

[0072] Among them, the above BERT model is a pre-trained deep learning model for natural language processing tasks. It learns the structure and semantic information of language through pre-training on a large amount of text data; the BERT model can be used for a variety of NLP tasks, such as text classification, named entity recognition, sentiment analysis, etc. Its unique bidirectional training strategy enables it to better understand context information, thereby improving the performance of the model;

[0073] The above span is a text segment in the user question text; for example, in the question sentence: "I want to ask about Ping An's Million Home Property Insurance. I don't want to know about Employer Liability Insurance anymore. What responsibilities can this product cover?" Here, it can be considered that "Ping An's Million Home Property Insurance" is an entity, and the span corresponding to this entity is the text segment from "平" to "险";

[0074] The above Mention detector refers to a tool that can identify and detect specific entities or objects mentioned in the text. These entities can be names of people, places, organizations, or any other noun phrases that can be specifically marked. In natural language processing (NLP), such tools are helpful for tasks such as information extraction, text analysis, and knowledge graph construction.

[0075] Furthermore, the question-answering method, wherein the step S200, based on a preset similar question library, retrieves a set of questions related to the target entity and generates candidate questions corresponding to the target entity, specifically includes:

[0076] Pre-set similar question bank;

[0077] Based on the similar question database, a set of questions related to the target entity is retrieved;

[0078] Based on the retrieval results, candidate questions corresponding to the target entity are generated.

[0079] During specific implementation, in this embodiment, a similar question library is pre-set; since the similar question library contains a large number of question texts, if the user questions are directly matched in the question library, the efficiency of question matching will be reduced and the difficulty of selecting the correct answer to the question will be increased; therefore, in order to overcome this defect, this embodiment will retrieve the question text containing the target entity (name) in the similar question library as a candidate question (set); that is, after pre-setting the similar question library, this embodiment will retrieve the question set related to the target entity based on the similar question library, and then, based on the retrieval results, generate the candidate question corresponding to the target entity.

[0080] Furthermore, in the question-answering method, the step S300 of encoding the target question and the candidate question respectively to generate a corresponding target question vector and candidate question vector specifically includes:

[0081] Use the Sentence-BERT model to encode the target question and candidate questions respectively, and generate the corresponding target question vector and candidate question vector.

[0082] In the specific implementation, in this embodiment, the Sentence-BERT model is used to encode the target question and the candidate question respectively to generate the corresponding target question vector and the candidate question vector; wherein, the Sentence-BERT model is a pre-trained language representation model based on the BERT model, which is specifically used to generate sentence-level embedding vectors, which can capture the semantic information of the sentence and be used for various sentence-level natural language processing tasks, such as sentence similarity calculation, clustering, information retrieval, etc.

[0083] Further, the question-answering method, wherein the step S400, performing question matching based on the target question vector and the candidate question vector to generate similar questions corresponding to the target question in the candidate questions, specifically includes:

[0084] The similarity f between the target question and the candidate question is calculated in two parts: vector similarity and string similarity. The calculation formula is as follows:

[0085]

[0086] Among them, w1 and w2 are hyperparameters, e q1 With e q2 are the target question vector and the candidate question vector, s1 and s2 are the target question string length and the candidate question string length, m is the number of matching characters between s1 and s2, and t is the number of transpositions;

[0087] Set a similarity threshold to filter out similar questions that meet the criteria.

[0088] Furthermore, in the question-answering method, the setting of a similarity threshold to screen out similar questions that meet the conditions includes:

[0089] Set a similarity threshold and select the candidate questions that meet the threshold conditions and have the highest similarity as similar questions.

[0090] In the specific implementation, in this embodiment, the similarity f between the target question and the candidate question is calculated by two parts: vector similarity and string similarity. The calculation formula is as follows:

[0091]

[0092] Among them, w1 and w2 are hyperparameters, e q1 With e q2 are the target question vector and the candidate question vector, s1 and s2 are the target question string length and the candidate question string length, m is the number of matching characters between s1 and s2, and t is the number of transpositions;

[0093] Then, a similarity threshold is set to filter out the candidate questions that meet the threshold condition and have the highest similarity (top 1) as similar questions.

[0094] Furthermore, the question-answering method, wherein the step S500, based on the similar questions, returns the corresponding answers to the target user as output, specifically includes:

[0095] Based on the similar questions obtained by screening, the answers corresponding to the similar questions are sorted out and returned to the target user as output.

[0096] In specific implementation, in this embodiment, based on the similar questions obtained by screening, the answers corresponding to the similar questions are finally sorted out and output as answers to the user's question text, and returned to the target user.

[0097] It can be seen from the above method embodiments that the question-answering method provided by the present invention at least includes: receiving a user question text input by a target user, rewriting the user question text with knowledge, and generating a target entity and a target question related to the user question text; based on a preset similar question library, retrieving a question set related to the target entity, and generating a candidate question corresponding to the target entity; encoding the target question and the candidate question respectively, and generating a corresponding target question vector and a candidate question vector; matching questions based on the target question vector and the candidate question vector, and generating similar questions corresponding to the target question in the candidate questions; based on the similar questions, returning the corresponding answers as output to the target user; and so on. In this way, the method of the present invention can improve the efficiency and accuracy of answering questions in the existing FAQ question-answering system, and optimize the user's query experience.

[0098] That is, in the question-answering method provided by the present invention, by rewriting the user's question text with knowledge and by using the relevant target entity as the subject vocabulary to search in the similar question library to obtain the corresponding candidate question, the performance and efficiency of the existing FAQ question-answering system are optimized, and the accuracy of answering questions is improved, as follows:

[0099] 1. Solved the problem that the existing FAQ question-answering system cannot correctly answer the unclear question, and improved the accuracy of answering questions;

[0100] 2. Improved the operating efficiency of the existing FAQ question-and-answer system and reduced the difficulty of selecting the correct answer to a question.

[0101] It should be understood that, although the present application provides method operation steps as described in the embodiments or flowcharts, more or less operation steps may be included based on conventional or non-creative labor, and these operation steps are not necessarily performed in sequence according to the embodiment or flowchart. The order of steps listed in the embodiment or flowchart is only one way of executing the order of many steps, and does not represent the only execution order. It should be noted that there is not necessarily a certain order between the above steps. A person of ordinary skill in the art can understand from the description of the embodiment of the present invention that in different embodiments, the above steps may have different execution orders, that is, they may be executed in parallel, or they may be executed in exchange, etc. Moreover, at least a part of the steps in the embodiment or flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but may be executed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but may be executed in turn, alternately or synchronously with other steps or at least a part of the sub-steps or stages of other steps.

[0102] Based on the above method embodiment, please refer to Figure 2Another embodiment of the present invention further provides a question-answering system, wherein the system comprises:

[0103] The knowledge rewriting module 11 is used to receive a user question text input by a target user, perform knowledge rewriting on the user question text, and generate a target entity and a target question related to the user question text;

[0104] A question retrieval module 12 is used to retrieve a set of questions related to the target entity based on a preset similar question library, and generate candidate questions corresponding to the target entity;

[0105] A question encoding module 13, used to encode the target question and the candidate question respectively, and generate a corresponding target question vector and candidate question vector;

[0106] A question matching module 14 is used to perform question matching based on the target question vector and the candidate question vector, and generate similar questions corresponding to the target question among the candidate questions;

[0107] The answer returning module 15 is used to return the corresponding answers to the similar questions as output to the target user.

[0108] Furthermore, the question-answering system, wherein the step of receiving the user question text input by the target user, performing knowledge rewriting on the user question text, and generating a target entity and a target question related to the user question text, specifically includes:

[0109] Receive the user question text input by the target user, use the user question text as the input of the BERT model, output the representation vector of each word, and aggregate the word representation vectors in each span into an aggregate vector;

[0110] Pre-train a mention detector, take the aggregate vector of each span as input, detect whether each aggregate vector is a mention entity, and output the corresponding first likelihood score;

[0111] Pre-train a classification model, take the aggregate vector of two spans as input, calculate whether the two aggregate vectors point to the same entity, and output the corresponding second likelihood score;

[0112] Add the first possibility score and the second possibility score of the two spans. When the total score exceeds a preset threshold, it is determined that the two spans have a reference relationship.

[0113] Based on the judgment results, the target entities and target questions related to the user's question text are generated.

[0114] In specific implementation, in this embodiment, when receiving the user question text input by the target user, first, use the user question text as the input of the BERT model, output the representation vectors of each word in the user question text, and aggregate the word representation vectors in each span of the user question text into an aggregated vector; then, pre-train a mention detector, use the aggregated vectors of each span as the input, detect whether each aggregated vector is a mention entity, and output the corresponding first possibility score; then, pre-train a classification model, use the aggregated vectors of two spans as the input, calculate whether the two aggregated vectors point to the same entity, and output the corresponding second possibility score; then, add the first possibility score and the second possibility score of these two spans. When the total score of the two exceeds the preset threshold, it is determined that these two spans have a referential relationship; finally, based on the determination result, generate the target entity and the target question related to the user question text.

[0115] Among them, the above BERT model is a pre-trained deep learning model for natural language processing tasks. It pre-trains on a large amount of text data to learn the structure and semantic information of the language; the BERT model can be used for various NLP tasks, such as text classification, named entity recognition, sentiment analysis, etc. Its unique bidirectional training strategy enables it to better understand context information, thereby improving the performance of the model.

[0116] The above span is a text segment in the user question text; for example, in the question sentence: "I want to ask about Ping An's Million Home Property Insurance. I don't want to know about Employer Liability Insurance anymore. What responsibilities can this product cover?" Here, it can be considered that "Ping An's Million Home Property Insurance" is an entity, and the span corresponding to this entity is the text segment from "平" to "险".

[0117] The above Mention detector refers to a tool that can identify and detect specific entities or objects mentioned in the text. These entities can be names of people, places, organizations, or any other noun phrases that can be specifically marked. In natural language processing (NLP), such tools are helpful for tasks such as information extraction, text analysis, and knowledge graph construction.

[0118] Furthermore, for the described question-and-answer system, where retrieving a set of questions related to the target entity based on a preset similar question library and generating candidate questions corresponding to the target entity specifically includes:

[0119] Pre-set a similar question library;

[0120] Based on this similar question library, retrieve a set of questions related to the target entity;

[0121] Based on the retrieval result, generate candidate questions corresponding to the target entity.

[0122] During specific implementation, in this embodiment, a similar question library is pre-set; since the similar question library contains a large number of question texts, if the user questions are directly matched in the question library, the efficiency of question matching will be reduced and the difficulty of selecting the correct answer to the question will be increased; therefore, in order to overcome this defect, this embodiment will retrieve the question text containing the target entity (name) in the similar question library as a candidate question (set); that is, after pre-setting the similar question library, this embodiment will retrieve the question set related to the target entity based on the similar question library, and then, based on the retrieval results, generate the candidate question corresponding to the target entity.

[0123] Furthermore, in the question-answering system, the step of encoding the target question and the candidate question respectively to generate a corresponding target question vector and a candidate question vector specifically includes:

[0124] Use the Sentence-BERT model to encode the target question and candidate questions respectively, and generate the corresponding target question vector and candidate question vector.

[0125] In the specific implementation, in this embodiment, the Sentence-BERT model is used to encode the target question and the candidate question respectively to generate the corresponding target question vector and the candidate question vector; wherein, the Sentence-BERT model is a pre-trained language representation model based on the BERT model, which is specifically used to generate sentence-level embedding vectors, which can capture the semantic information of the sentence and be used for various sentence-level natural language processing tasks, such as sentence similarity calculation, clustering, information retrieval, etc.

[0126] Furthermore, the question-answering system, wherein the step of performing question matching based on the target question vector and the candidate question vector to generate similar questions corresponding to the target question in the candidate questions, specifically includes:

[0127] The similarity f between the target question and the candidate question is calculated in two parts: vector similarity and string similarity. The calculation formula is as follows:

[0128]

[0129] Among them, w1 and w2 are hyperparameters, e q1 With e q2 are the target question vector and the candidate question vector, s1 and s2 are the target question string length and the candidate question string length, m is the number of matching characters between s1 and s2, and t is the number of transpositions;

[0130] Set a similarity threshold to filter out similar questions that meet the criteria.

[0131] Furthermore, in the question-answering system, the setting of a similarity threshold to screen out similar questions that meet the conditions includes:

[0132] Set a similarity threshold and select the candidate questions that meet the threshold conditions and have the highest similarity as similar questions.

[0133] In the specific implementation, in this embodiment, the similarity f between the target question and the candidate question is calculated by two parts: vector similarity and string similarity. The calculation formula is as follows:

[0134]

[0135] Among them, w1 and w2 are hyperparameters, e q1 With e q2 are the target question vector and the candidate question vector, s1 and s2 are the target question string length and the candidate question string length, m is the number of matching characters between s1 and s2, and t is the number of transpositions;

[0136] Then, a similarity threshold is set to filter out the candidate questions that meet the threshold condition and have the highest similarity (top 1) as similar questions.

[0137] Furthermore, the question-answering system, wherein the step of returning the corresponding answer to the target user as output based on the similar question, specifically includes:

[0138] Based on the similar questions obtained by screening, the answers corresponding to the similar questions are sorted out and returned to the target user as output.

[0139] In specific implementation, in this embodiment, based on the similar questions obtained by screening, the answers corresponding to the similar questions are finally sorted out and output as answers to the user's question text, and returned to the target user.

[0140] It can be seen from the above system embodiments that the question-answering system provided by the present invention at least includes: receiving the user question text input by the target user, rewriting the user question text with knowledge, and generating the target entity and target question related to the user question text; based on the preset similar question library, retrieving the question set related to the target entity, and generating the candidate question corresponding to the target entity; encoding the target question and the candidate question respectively, and generating the corresponding target question vector and candidate question vector; matching the question based on the target question vector and the candidate question vector, and generating the similar question corresponding to the target question in the candidate question; based on the similar question, returning the corresponding answer as output to the target user; and so on. In this way, the system of the present invention can improve the efficiency and accuracy of answering questions in the existing FAQ question-answering system, and optimize the user's query experience.

[0141] That is, in the question-answering system provided by the present invention, by rewriting the user's question text with knowledge and by using the relevant target entity as the subject vocabulary to search in the similar question library to obtain the corresponding candidate question, the performance and efficiency of the existing FAQ question-answering system are optimized, and the accuracy of answering questions is improved, as follows:

[0142] 1. Solved the problem that the existing FAQ question-answering system cannot correctly answer the unclear question, and improved the accuracy of answering questions;

[0143] 2. Improved the operating efficiency of the existing FAQ question-and-answer system and reduced the difficulty of selecting the correct answer to a question.

[0144] Based on the above method embodiment, please refer to Figure 3 Another embodiment of the present invention further provides a computer device, wherein the computer device 10 includes:

[0145] memory 120 and one or more processors 110, Figure 3 A processor 110 is used as an example for description. The processor 110 and the memory 120 may be connected via a communication bus or other means. Figure 3 The example of connecting via a communication bus is taken as an example.

[0146] The processor 110 is used to complete various control logics of the computer device 10. It can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of these components. In addition, the processor 110 can also be any traditional processor, microprocessor or state machine. The processor 110 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP, or any other such configuration.

[0147] The memory 120 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the computer program corresponding to the question-answering method in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the computer device 10 by running the non-volatile software programs, instructions and units stored in the memory 120, that is, implements the question-answering method in the above method embodiment.

[0148] The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store an application required for operating the device or at least one function; the data storage area may store data created according to the use of the computer device 10, etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 120 may optionally include a memory remotely arranged relative to the processor 110, and these remote memories may be connected to the computer device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0149] One or more units are stored in the memory 120, and when executed by one or more processors 110, the question-answering method in any of the above method embodiments can be implemented, for example, the question-answering method described above can be implemented. Figure 1 The method comprises steps S100 to S500.

[0150] The specific implementation method is shown in the above method embodiment, which will not be described again here.

[0151] It can be seen from the above computer device embodiments that the question-answering computer device provided by the present invention can at least achieve: receiving the user question text input by the target user, rewriting the user question text with knowledge, and generating the target entity and target question related to the user question text; retrieving the question set related to the target entity based on the preset similar question library, and generating the candidate question corresponding to the target entity; encoding the target question and the candidate question respectively, and generating the corresponding target question vector and candidate question vector; matching the question based on the target question vector and the candidate question vector, and generating the similar question corresponding to the target question in the candidate question; based on the similar question, returning the corresponding answer as output to the target user; etc. In this way, the computer device of the present invention can improve the efficiency and accuracy of answering questions in the existing FAQ question-answering system, and optimize the user's query experience.

[0152] That is, in the question-answering computer device provided by the present invention, by rewriting the user's question text with knowledge and by retrieving the relevant target entity as the subject vocabulary in the similar question library to obtain the corresponding candidate question, the performance and efficiency of the existing FAQ question-answering system are optimized, and the accuracy of answering questions is improved, as follows:

[0153] 1. Solved the problem that the existing FAQ question-answering system cannot correctly answer the unclear question, and improved the accuracy of answering questions;

[0154] 2. Improved the operating efficiency of the existing FAQ question-and-answer system and reduced the difficulty of selecting the correct answer to a question.

[0155] Those skilled in the art will understand that Figure 3 The hardware structure diagram shown in the figure is only a schematic diagram of a partial structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0156] Based on the above method embodiments, another embodiment of the present invention further provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, the question-answering method in any of the above method embodiments can be implemented, for example, the question-answering method described above can be implemented. Figure 1 The method comprises steps S100 to S500.

[0157] As an example, the non-volatile storage medium can include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable ROM (EEPROM), or a flash memory. Volatile memory can include a random access memory (RAM) as an external cache memory. By way of illustration and not limitation, RAM can be obtained in many forms such as synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synch link DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.

[0158] Based on the above method embodiments, another embodiment of the present invention further provides a computer program product, the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by a processor, the question-answering method in any of the above method embodiments can be implemented, for example, the above described Figure 1 The method comprises steps S100 to S500.

[0159] The embodiments described above are merely illustrative, in which the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0160] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can exist in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0161] Conditional language such as "can," "can," "might," or "may," unless specifically stated otherwise or otherwise understood within the context as used, is generally intended to convey, among other things, that a particular embodiment can include (while other embodiments do not) a particular feature, element, and / or operation. Thus, such conditional language is also generally intended to imply that a feature, element, and / or operation is required for one or more embodiments anyway or that one or more embodiments must include logic for determining, with or without input or prompting, whether such features, elements, and / or operations are included or will be performed in any particular embodiment.

[0162] What has been described herein, in this specification and in the accompanying drawings includes examples that can provide a question-and-answer method, system, computer device, and non-volatile computer-readable storage medium. Of course, it is not possible to describe every conceivable combination of elements and / or methods for the purpose of describing the various features of the present disclosure, but it can be recognized that many other combinations and permutations of the disclosed features are possible. Therefore, it is obvious that various modifications can be made to the present disclosure without departing from the scope or spirit of the present disclosure, but all these various modifications should belong to the scope of protection of the claims attached to the present invention. In addition, or in an alternative, other embodiments of the present disclosure may be obvious from consideration of the present specification and the accompanying drawings and from the practice of the present disclosure as presented herein. It is intended that the examples proposed in the present specification and the accompanying drawings are considered to be illustrative and not restrictive in all respects. Although specific terms are used herein, they are used in a general and descriptive sense and are not used for limiting purposes.

Claims

1. A question-answering method, It is characterized in that include: Receive a user question text input by a target user, perform knowledge rewriting on the user question text, and generate a target entity and a target question related to the user question text; Based on a preset similar question library, a question set related to the target entity is retrieved to generate candidate questions corresponding to the target entity; Encode the target question and the candidate question respectively to generate a corresponding target question vector and a candidate question vector; Performing question matching based on the target question vector and the candidate question vector, generating similar questions corresponding to the target question among the candidate questions; Based on the similar questions, the corresponding answers are returned to the target user as output.

2. The question-answering method according to claim 1, It is characterized in that The receiving of a user question text input by a target user, performing knowledge rewriting on the user question text, and generating a target entity and a target question related to the user question text includes: Receive the user question text input by the target user, use the user question text as the input of the BERT model, output the representation vector of each word, and aggregate the word representation vectors in each span into an aggregate vector; Pre-train a mention detector, take the aggregate vector of each span as input, detect whether each aggregate vector is a mention entity, and output the corresponding first likelihood score; Pre-train a classification model, take the aggregate vector of two spans as input, calculate whether the two aggregate vectors point to the same entity, and output the corresponding second likelihood score; Add the first possibility score and the second possibility score of the two spans. When the total score exceeds a preset threshold, it is determined that the two spans have a reference relationship. Based on the judgment results, the target entities and target questions related to the user's question text are generated.

3. The question-answering method according to claim 2, It is characterized in that The retrieving a set of questions related to the target entity based on a preset similar question library and generating candidate questions corresponding to the target entity includes: Pre-set similar question bank; Based on the similar question database, a set of questions related to the target entity is retrieved; Based on the retrieval results, candidate questions corresponding to the target entity are generated.

4. The question-answering method according to claim 3, It is characterized in that The encoding of the target question and the candidate question respectively to generate a corresponding target question vector and a candidate question vector includes: Use the Sentence-BERT model to encode the target question and candidate questions respectively, and generate the corresponding target question vector and candidate question vector.

5. The question-answering method according to claim 4, It is characterized in that The problem matching based on the target problem vector and the candidate problem vector to generate similar problems corresponding to the target problem in the candidate problems includes: The similarity f between the target question and the candidate question is calculated in two parts: vector similarity and string similarity. The calculation formula is as follows: Among them, w1 and w2 are hyperparameters, e q1 With e q2 are the target question vector and the candidate question vector, s1 and s2 are the target question string length and the candidate question string length, m is the number of matching characters between s1 and s2, and t is the number of transpositions; Set a similarity threshold to filter out similar questions that meet the criteria.

6. The question-answering method according to claim 5, It is characterized in that The similarity threshold is set to filter out similar questions that meet the conditions, including: Set a similarity threshold and select the candidate questions that meet the threshold conditions and have the highest similarity as similar questions.

7. The question-answering method according to claim 6, It is characterized in that The step of returning the corresponding answers to the target user as output based on the similar questions includes: Based on the similar questions obtained by screening, the answers corresponding to the similar questions are sorted out and returned to the target user as output.

8. A question-answering system, It is characterized in that include: A knowledge rewriting module is used to receive a user question text input by a target user, perform knowledge rewriting on the user question text, and generate a target entity and a target question related to the user question text; A question retrieval module is used to retrieve a set of questions related to the target entity based on a preset similar question library, and generate candidate questions corresponding to the target entity; A question encoding module, used to encode the target question and the candidate question respectively, and generate a corresponding target question vector and candidate question vector; A question matching module, configured to perform question matching based on the target question vector and the candidate question vector, and generate similar questions corresponding to the target question among the candidate questions; The answer returning module is used to return the corresponding answers to the similar questions as output to the target user.

9. A computer device, It is characterized in that The computer device comprises at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor. When the computer program is executed by the at least one processor, the question-and-answer method according to any one of claims 1 to 7 can be implemented.

10. A non-volatile computer-readable storage medium, It is characterized in that The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, the question-answering method according to any one of claims 1 to 7 can be implemented.

Citation Information

Patent Citations

  • Question and answer system construction method based on named entity recognition

    CN113901824A

  • Information search method and device, terminal equipment and computer readable storage medium

    CN114416944A