Answer generation method and device, equipment and storage medium

By rewriting the original questions of users and recalling background knowledge, the problem of low stability in answer generation of existing enterprise knowledge Q&A systems is solved, achieving more accurate and effective answer generation results.

CN119691103APending Publication Date: 2025-03-25CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411584870.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The existing enterprise knowledge question and answer system has low effect stability when generating answers, and highly relies on the accuracy of user's question content and question templates, making it difficult to accurately and effectively generate the answers corresponding to users' original questions.

Method used

By rewriting the original user's original problem, determine the multiple sub-questions after the rewritten; then determine the problem search terms corresponding to each sub-question, and determine the background knowledge list based on these words; then determine the target background knowledge corresponding to each sub-question based on the background knowledge list, and finally determine the answers corresponding to the user's original problem based on the target background knowledge.

Benefits of technology

Accurate rewriting of user's original questions and effective recall of background knowledge are achieved, and the stability and accuracy of answer generation are improved. Compared with the prior art, answers corresponding to user's original questions can be generated more accurately and effectively.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691103A_ABST
    Figure CN119691103A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of data processing, and discloses an answer generation method and device, equipment and a storage medium. The method comprises the following steps: rewriting an original question of a user, determining a plurality of rewritten sub-questions, determining a question search word corresponding to each sub-question, determining a background knowledge list according to the question search words, and determining target background knowledge corresponding to each sub-question according to the background knowledge list. And determining a final answer corresponding to the original question of the user according to the target background knowledge. According to the method and the device, the original question of the user can be effectively rewritten to obtain a plurality of rewritten sub-questions, then the background knowledge list is determined according to the question search word corresponding to each sub-question, the background knowledge list related to each sub-question can be obtained, the target background knowledge corresponding to each sub-question is further determined, and the user experience is improved. And the final answer corresponding to the original question of the user is determined according to the target background knowledge, so that the answer corresponding to the original question of the user can be accurately and effectively generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to an answer generation method, device, equipment and storage medium. Background Art

[0002] The enterprise knowledge question-and-answer system mainly provides answers to information related to a certain range of enterprises, including but not limited to basic information of the enterprise, business scope, shareholder information, financial statements, public events and other information, aiming to provide users with a function to ask questions and obtain corresponding answers. At present, the main means of obtaining answers is to construct a question template based on the user's question and use keyword matching to recall the answer. The effect of the question-and-answer system is highly dependent on the content of the user's question and whether the constructed question template is accurate, and the stability of the answer effect is relatively low. Therefore, how to accurately and effectively generate answers corresponding to the user's original question has become a problem that needs to be solved urgently. Summary of the invention

[0003] The main purpose of this application is to provide an answer generation method, device, equipment and storage medium, aiming to solve the technical problem of how to accurately and effectively generate answers corresponding to the user's original questions.

[0004] To achieve the above purpose, the present application provides an answer generation method, which comprises the following steps:

[0005] Rewrite the user's original question and determine multiple sub-questions after the rewrite;

[0006] Determine the question search terms corresponding to each sub-question, and determine the background knowledge list according to the question search terms;

[0007] The target background knowledge corresponding to each sub-question is determined according to the background knowledge list, and the final answer corresponding to the original question of the user is determined according to the target background knowledge.

[0008] Optionally, the step of rewriting the original question of the user and determining a plurality of rewritten sub-questions specifically includes:

[0009] When the user's intention is a single question, the user's original question is rewritten into similar sentences to determine multiple sub-questions after the rewriting;

[0010] When the user intention is multiple intentions, rewrite the original question of the user by segmenting it by punctuation marks, and determine multiple rewritten sub-questions;

[0011] When the user intention is multiple intentions, the user's original question is split and rewritten by connecting words to determine multiple sub-questions after the rewriting.

[0012] Optionally, the step of determining the question search terms corresponding to each sub-question and determining the background knowledge list according to the question search terms specifically includes:

[0013] Determine the question search terms corresponding to each sub-question, and calculate the vector similarity between the question search terms and the user's original question;

[0014] When the vector similarity is greater than a preset threshold, determining the background knowledge corresponding to the question search term;

[0015] Performing vectorization processing and word segmentation processing on the background knowledge respectively to obtain vectors and keywords;

[0016] The vector and the keyword are matched with a preset knowledge base to obtain a background knowledge list.

[0017] Optionally, before the step of matching the vector and the keyword with a preset knowledge base to obtain a background knowledge list, the step further includes:

[0018] Divide the original enterprise data to obtain structured data and paragraph text;

[0019] The structured data and the paragraph text are processed respectively to obtain a preset knowledge base.

[0020] Optionally, the step of performing data processing on the structured data and the paragraph text respectively to obtain a preset knowledge base specifically includes:

[0021] Extracting fields from the structured data to obtain field names;

[0022] Performing multi-semantic word segmentation processing on the field name to obtain a first keyword after the word segmentation, and performing vectorization processing on the first keyword to obtain a first vector;

[0023] Building a preset knowledge base according to the first vector and the first keyword;

[0024] Extracting keywords from the paragraph text to obtain a second keyword;

[0025] Segmenting the paragraph text into long and short paragraphs to obtain segmented paragraphs, and performing vectorization processing on the segmented paragraphs to obtain a second vector;

[0026] A preset knowledge base is constructed according to the second vector and the second keyword.

[0027] Optionally, the step of determining target background knowledge corresponding to each sub-question according to the background knowledge list, and determining a final answer corresponding to the user's original question according to the target background knowledge specifically includes:

[0028] Determine the target background knowledge corresponding to each sub-question according to the background knowledge list;

[0029] When the target background knowledge is related to the original question of the user, determining the sub-answers corresponding to the sub-questions according to the target background knowledge;

[0030] A final answer corresponding to the user's original question is determined according to the sub-answers.

[0031] Optionally, the step of determining the target background knowledge corresponding to each sub-question according to the background knowledge list specifically includes:

[0032] Determine the background knowledge search term corresponding to the background knowledge list;

[0033] Calculating the similarity between the background knowledge search term and the question search term, and determining a score based on the similarity;

[0034] The target background knowledge corresponding to each sub-question is selected from the background knowledge list according to the score.

[0035] In addition, to achieve the above-mentioned purpose, the present application also provides an answer generation device, the answer generation device comprising:

[0036] A question rewriting module is used to rewrite the user's original question and determine multiple sub-questions after the rewriting;

[0037] A knowledge list determination module is used to determine the question search terms corresponding to each sub-question, and determine the background knowledge list according to the question search terms;

[0038] The answer generation module is used to determine the target background knowledge corresponding to each sub-question according to the background knowledge list, and determine the final answer corresponding to the user's original question according to the target background knowledge.

[0039] In addition, to achieve the above-mentioned purpose, the present application also proposes an answer generation device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the answer generation method described above.

[0040] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the answer generation method described above are implemented.

[0041] The present application rewrites the user's original question to determine multiple rewritten sub-questions, then determines the question search terms corresponding to each sub-question, and determines a background knowledge list based on the question search terms, and then determines the target background knowledge corresponding to each sub-question based on the background knowledge list, and determines the final answer corresponding to the user's original question based on the target background knowledge. The present application can effectively rewrite the user's original question to obtain multiple rewritten sub-questions, and then determine a background knowledge list based on the question search terms corresponding to each sub-question, and can obtain a background knowledge list related to each sub-question, further determine the target background knowledge corresponding to each sub-question, and determine the final answer corresponding to the user's original question based on the target background knowledge. Compared with the existing method of obtaining answers by constructing question templates based on user question content, the above method of the present application can accurately and effectively generate answers corresponding to the user's original question. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0043] In order to more clearly illustrate the embodiments of the present application 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0044] Figure 1 This is a flow chart of the first embodiment of the answer generation method of this application;

[0045] Figure 2 This is a flow chart of the second embodiment of the answer generation method of this application;

[0046] Figure 3 A schematic diagram of the process of constructing a preset knowledge base in an embodiment of the answer generation method of this application;

[0047] Figure 4 This is a flowchart of the third embodiment of the answer generation method of this application;

[0048] Figure 5 This is a structural block diagram of the first embodiment of the answer generation device of this application;

[0049] Figure 6 It is a structural diagram of an answer generation device in a hardware operating environment involved in an embodiment of the present application.

[0050] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0051] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0052] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0053] The main solution of the embodiment of the present application is: rewrite the user's original question to determine multiple sub-questions after the rewrite; determine the question search terms corresponding to each sub-question, and determine the background knowledge list based on the question search terms; determine the target background knowledge corresponding to each sub-question based on the background knowledge list, and determine the final answer corresponding to the user's original question based on the target background knowledge.

[0054] The enterprise knowledge question-and-answer system mainly provides answers to information related to a specific range of enterprises, including but not limited to basic information of the enterprise, business scope, shareholder information, financial statements, public events, etc., aiming to provide users with a function to ask questions independently and obtain corresponding answers. At present, the main means of obtaining answers is to construct a question template based on the user's question and use keyword matching to recall the answer. The question-and-answer effect is highly dependent on the content of the user's question and whether the constructed question template is accurate, and the stability of the answer effect is relatively low.

[0055] The present application rewrites the user's original question to determine multiple rewritten sub-questions, then determines the question search terms corresponding to each sub-question, and determines a background knowledge list based on the question search terms, and then determines the target background knowledge corresponding to each sub-question based on the background knowledge list, and determines the final answer corresponding to the user's original question based on the target background knowledge. The present application can effectively rewrite the user's original question to obtain multiple rewritten sub-questions, and then determine a background knowledge list based on the question search terms corresponding to each sub-question, and can obtain a background knowledge list related to each sub-question, further determine the target background knowledge corresponding to each sub-question, and determine the final answer corresponding to the user's original question based on the target background knowledge. Compared with the existing method of obtaining answers by constructing question templates based on user question content, the above method of the present application can accurately and effectively generate answers corresponding to the user's original question.

[0056] It should be noted that the execution subject of the present application may be a computing service device with data processing, network communication and program running functions, such as a computer, or an electronic device capable of implementing the above functions, an answer generation device, etc. The following takes the answer generation device as an example to illustrate this embodiment and the following embodiments.

[0057] Based on this, the embodiment of the present application provides a method for generating an answer, referring to Figure 1 , Figure 1This is a flowchart of the first embodiment of the answer generation method of this application.

[0058] In this embodiment, the answer generation method includes the following steps:

[0059] Step S10: rewrite the original question of the user and determine a plurality of rewritten sub-questions.

[0060] It is understandable that the original question of the user may be the user's initial question related to the enterprise, such as the basic information, business scope, shareholder information, financial statements, public events, etc. of the enterprise. The original question of the user is rewritten, and specifically the original question of the user may be segmented to obtain multiple rewritten sub-questions.

[0061] Furthermore, in order to effectively rewrite the user's original question, in this embodiment, the step S10 includes: when the user's intention is a single question intention, rewriting the user's original question into similar sentences, and determining multiple sub-questions after the rewriting; when the user's intention is multiple intentions, rewriting the user's original question by splitting the punctuation marks, and determining multiple sub-questions after the rewriting; when the user's intention is multiple intentions, rewriting the user's original question by splitting the conjunctions, and determining multiple sub-questions after the rewriting.

[0062] It should be understood that reference Figure 2 , Figure 2 This is a flow chart of rewriting the questions in the first embodiment of the answer generation method of this application. Figure 2 As shown, when the user's intention is a single question intention, that is, the user's original questions are all questions of the same type, the user's original questions can be rewritten into similar sentences. For example, the user's original question is what is China's GDP, and the rewritten sub-questions are 1. What is China's gross national product; 2. What is China's GDP.

[0063] In the specific implementation, when the user intent is multi-intent, that is, the user's original question includes multiple types of questions, the user's original question can be rewritten by punctuation segmentation. For example, the user's original question is "Please help me give the operating income, net profit, profit margin and other data of XXX enterprise in 2024", and the rewritten sub-questions are 1. The operating income of XXX enterprise in 2024; 2. The net profit of XXX enterprise in 2024; 3. The profit margin of XXX enterprise in 2024. When the user intent is multi-intent, the user's original question can also be rewritten by conjunction segmentation. For example, the user's original question is "What is the operating income and operating profit of XXX enterprise in 2024?", and the rewritten sub-questions are 1. The operating income of XXX enterprise in 2024; 2. The operating profit of XXX enterprise in 2024.

[0064] Step S20: determining the question search terms corresponding to each sub-question, and determining a background knowledge list according to the question search terms.

[0065] It is understandable that after obtaining multiple sub-questions, the question search terms corresponding to each sub-question can be determined. The question search terms are the words in the sub-questions. The question search terms corresponding to each sub-question can be obtained through a large model, and a background knowledge list can be determined based on the question search terms. The background knowledge list may include some background knowledge.

[0066] Step S30: determining the target background knowledge corresponding to each sub-question according to the background knowledge list, and determining the final answer corresponding to the original question of the user according to the target background knowledge.

[0067] It should be understood that the target background knowledge corresponding to each sub-question can be determined based on the background knowledge list. The target background knowledge can be selected from the background knowledge list, and the final answer corresponding to the user's original question can be determined based on the target background knowledge. Specifically, the answer corresponding to each sub-question can be obtained first, and then the answers can be merged to obtain the final answer corresponding to the user's original question.

[0068] This embodiment rewrites the user's original question to determine multiple rewritten sub-questions, then determines the question search terms corresponding to each sub-question, and determines a background knowledge list based on the question search terms, and then determines the target background knowledge corresponding to each sub-question based on the background knowledge list, and determines the final answer corresponding to the user's original question based on the target background knowledge. This embodiment can effectively rewrite the user's original question to obtain multiple rewritten sub-questions, and then determine a background knowledge list based on the question search terms corresponding to each sub-question, and can obtain a background knowledge list related to each sub-question, further determine the target background knowledge corresponding to each sub-question, and determine the final answer corresponding to the user's original question based on the target background knowledge. Compared with the existing method of obtaining answers by constructing question templates based on user question content, the above method of this embodiment can accurately and effectively generate answers corresponding to the user's original question.

[0069] refer to Figure 2 , Figure 2 This is a flow chart of the second embodiment of the answer generation method of this application.

[0070] Based on the above first embodiment, in this embodiment, step S20 includes:

[0071] Step S201: determine the question search terms corresponding to each sub-question, and calculate the vector similarity between the question search terms and the user's original question.

[0072] It is understandable that the question search terms corresponding to each sub-question can be determined first, and the vector similarity between the question search terms and the user's original question can be calculated. Specifically, the question search terms and the user's original question can be vectorized first to obtain the corresponding vectors, and then the vector similarity between the two vectors can be calculated.

[0073] Step S202: when the vector similarity is greater than a preset threshold, determining the background knowledge corresponding to the question search term.

[0074] It should be understood that when the vector similarity is greater than a preset threshold, the background knowledge corresponding to the question search term can be determined by the knowledge recaller, and when the vector similarity is less than or equal to the preset threshold, each sub-question is still used for recall.

[0075] Step S203: performing vectorization processing and word segmentation processing on the background knowledge to obtain vectors and keywords.

[0076] It is understandable that the recall input can be vectorized and segmented. When background knowledge is recalled, the background knowledge can be vectorized and segmented to obtain vectors and keywords.

[0077] Step S204: Match the vector and the keyword with a preset knowledge base to obtain a background knowledge list.

[0078] It should be understood that the preset knowledge base refers to a pre-set knowledge base consisting of vectors and keywords. The obtained vectors and keywords can be matched with the preset knowledge base to obtain a background knowledge list, which can contain multiple vectors and multiple keywords.

[0079] Furthermore, in order to effectively construct a preset knowledge base, in this embodiment, before step S204, it also includes: dividing the original enterprise data to obtain structured data and paragraph text; and performing data processing on the structured data and the paragraph text respectively to obtain a preset knowledge base.

[0080] It is understandable that the original enterprise data may include underlying enterprise-related background knowledge data, and the original data may be divided to obtain structured JSON data and paragraph text, and then the structured data and paragraph text may be processed separately to obtain a preset knowledge base.

[0081] Furthermore, in order to accurately construct a knowledge base, in this embodiment, the steps of performing data processing on the structured data and the paragraph text respectively to obtain a preset knowledge base specifically include: performing field extraction on the structured data to obtain field names; performing multi-semantic word segmentation on the field names to obtain the first keyword after word segmentation, and vectorizing the first keyword to obtain a first vector; constructing a preset knowledge base based on the first vector and the first keyword; performing keyword extraction on the paragraph text to obtain a second keyword; performing long and short paragraph segmentation on the paragraph text to obtain segmented paragraphs, and vectorizing the segmented paragraphs to obtain a second vector; and constructing a preset knowledge base based on the second vector and the second keyword.

[0082] It should be understood that reference Figure 3 , Figure 3 This is a flow chart of building a preset knowledge base in accordance with an embodiment of the answer generation method of this application. Figure 3 As shown, field extraction can be performed on structured data to obtain field names, and then multi-semantic word segmentation can be performed on the field names to obtain the first keyword after word segmentation, and the first keyword can be vectorized to obtain the first vector. A preset knowledge base can be constructed based on the first vector and the first keyword.

[0083] In the specific implementation, keywords can be extracted from the paragraph text to obtain the second keyword, and the paragraph text can be segmented into long and short paragraphs to obtain segmented paragraphs, and the segmented paragraphs can be vectorized to obtain the second vector, and then a preset knowledge base can be constructed based on the second vector and the second keyword. Finally, a preset knowledge base composed of multiple vectors and associated words can be constructed, and joint matching is supported, which effectively improves the recall rate of background knowledge.

[0084] This embodiment determines the question search terms corresponding to each sub-question, and calculates the vector similarity between the question search terms and the user's original question. When the vector similarity is greater than a preset threshold, the background knowledge corresponding to the question search terms is determined, and then the background knowledge is vectorized and segmented to obtain vectors and keywords, and then the vectors and keywords are matched with a preset knowledge base to obtain a background knowledge list. This embodiment performs vectorization and segmentation on the background knowledge corresponding to the question search terms when the vector similarity between the question search terms and the user's original question is greater than a preset threshold, and then the vectors and keywords are matched with a preset knowledge base to obtain a background knowledge list, which can improve the recall rate of the background knowledge.

[0085] refer to Figure 4 , Figure 4 This is a flowchart of the third embodiment of the answer generation method of this application.

[0086] Based on the above embodiments, in this embodiment, step S30 includes:

[0087] Step S301: determining the target background knowledge corresponding to each sub-question according to the background knowledge list.

[0088] Furthermore, in order to effectively determine the target background knowledge corresponding to each sub-question, in this embodiment, step S301 includes: determining the background knowledge search terms corresponding to the background knowledge list; calculating the similarity between the background knowledge search terms and the question search terms, and determining a score based on the similarity; and selecting the target background knowledge corresponding to each sub-question from the background knowledge list based on the score.

[0089] It is understandable that the background knowledge search terms corresponding to the background knowledge list can be determined, the background knowledge search terms can be in the background knowledge list, and the similarity between the background knowledge search terms and the question search terms can be calculated, and then the score is determined based on the similarity. Specifically, the higher the similarity, the higher the score.

[0090] It should be understood that the target background knowledge corresponding to each sub-question can be selected from the background knowledge list according to the score. Specifically, the background knowledge with the highest score can be selected from the background knowledge list as the target background knowledge, and there is no specific limit on the number of selections.

[0091] Step S302: when the target background knowledge is related to the original question of the user, determine the sub-answers corresponding to the sub-questions according to the target background knowledge.

[0092] It is understandable that the background knowledge evaluator can be used to determine whether the target background knowledge is relevant to the user's original question. If so, the target background knowledge and the corresponding sub-questions are sent to the answer generator to obtain the sub-answers corresponding to each sub-question; if not, the current user's original question is rewritten to try matching again.

[0093] Step S303: Determine the final answer corresponding to the user's original question based on the sub-answers.

[0094] It should be understood that after obtaining the sub-answers corresponding to each sub-question, each sub-answer and the user's original question can be sent to the final answer summarizer, at which time the large model will summarize the final answer based on the corresponding information.

[0095] It is understandable that after obtaining the final answer, the answer verification process will be entered. Specifically, the prompt content can be adjusted to allow the large model to judge the similarity between the user's original question and the final answer. When the similarity is greater than the threshold, the final answer is output, otherwise the entire question-and-answer process will be repeated.

[0096] This embodiment makes the user's question intention clearer by rewriting the original question into multiple sub-questions, which is convenient for model understanding and background information recall; then, multiple rounds of adaptive recall evaluation are used to ensure the high quality of the recalled background information and generated answers; the large model is then used to make a final summary output based on the answers to the sub-questions and the original question, ensuring the completeness of the answer; finally, the answer is verified to ensure the reliability of the final answer, thereby improving the overall question-answering experience.

[0097] This embodiment determines the target background knowledge corresponding to each sub-question based on the background knowledge list. When the target background knowledge is related to the user's original question, the sub-answer corresponding to each sub-question is determined based on the target background knowledge, and then the final answer corresponding to the user's original question is determined based on the sub-answer. This embodiment can screen the background knowledge list to obtain the target background knowledge corresponding to each sub-question. When the target background knowledge is related to the user's original question, the sub-answer corresponding to each sub-question is determined based on the target background knowledge, and then the final answer corresponding to the user's original question is determined based on the sub-answer, so that the final answer corresponding to the user's original question can be accurately and effectively generated.

[0098] Reference Figure 5 , Figure 5 This is a structural block diagram of the first embodiment of the answer generation device of this application.

[0099] like Figure 5 As shown, the answer generation device proposed in the embodiment of the present application includes:

[0100] The question rewriting module 10 is used to rewrite the original question of the user and determine a plurality of sub-questions after the rewriting;

[0101] A knowledge list determination module 20 is used to determine the question search terms corresponding to each sub-question, and determine the background knowledge list according to the question search terms;

[0102] The answer generation module 30 is used to determine the target background knowledge corresponding to each sub-question according to the background knowledge list, and determine the final answer corresponding to the user's original question according to the target background knowledge.

[0103] This embodiment rewrites the user's original question to determine multiple rewritten sub-questions, then determines the question search terms corresponding to each sub-question, and determines a background knowledge list based on the question search terms, and then determines the target background knowledge corresponding to each sub-question based on the background knowledge list, and determines the final answer corresponding to the user's original question based on the target background knowledge. This embodiment can effectively rewrite the user's original question to obtain multiple rewritten sub-questions, and then determine a background knowledge list based on the question search terms corresponding to each sub-question, and can obtain a background knowledge list related to each sub-question, further determine the target background knowledge corresponding to each sub-question, and determine the final answer corresponding to the user's original question based on the target background knowledge. Compared with the existing method of obtaining answers by constructing question templates based on user question content, the above method of this embodiment can accurately and effectively generate answers corresponding to the user's original question.

[0104] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present application. In practical applications, technicians in this field can select part or all of it according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.

[0105] In addition, for technical details that are not described in detail in this embodiment, please refer to the answer generation method provided in any embodiment of the present application, and will not be repeated here.

[0106] Based on the above-mentioned first embodiment of the answer generation device of the present application, a second embodiment of the answer generation device of the present application is proposed.

[0107] In this embodiment, the question rewriting module 10 is also used to rewrite the user's original question by similar sentences when the user's intention is a single question intention, and determine multiple sub-questions after the rewriting; when the user's intention is multiple intentions, rewrite the user's original question by punctuation segmentation, and determine multiple sub-questions after the rewriting; when the user's intention is multiple intentions, rewrite the user's original question by conjunction segmentation, and determine multiple sub-questions after the rewriting.

[0108] Furthermore, the knowledge list determination module 20 is also used to determine the question search terms corresponding to each sub-question, and calculate the vector similarity between the question search terms and the user's original question; when the vector similarity is greater than a preset threshold, determine the background knowledge corresponding to the question search terms; perform vectorization and word segmentation processing on the background knowledge respectively to obtain vectors and keywords; match the vectors and the keywords with a preset knowledge base to obtain a background knowledge list.

[0109] Furthermore, the knowledge list determination module 20 is also used to divide the original enterprise data to obtain structured data and paragraph texts; and perform data processing on the structured data and the paragraph texts respectively to obtain a preset knowledge base.

[0110] Furthermore, the knowledge list determination module 20 is also used to extract fields from the structured data to obtain field names; perform multi-semantic word segmentation on the field names to obtain the first keyword after word segmentation, and vectorize the first keyword to obtain a first vector; construct a preset knowledge base based on the first vector and the first keyword; perform keyword extraction on the paragraph text to obtain a second keyword; perform long and short paragraph segmentation on the paragraph text to obtain segmented paragraphs, and vectorize the segmented paragraphs to obtain a second vector; and construct a preset knowledge base based on the second vector and the second keyword.

[0111] Furthermore, the answer generation module 30 is also used to determine the target background knowledge corresponding to each sub-question based on the background knowledge list; when the target background knowledge is related to the user's original question, determine the sub-answers corresponding to each sub-question based on the target background knowledge; and determine the final answer corresponding to the user's original question based on the sub-answers.

[0112] Furthermore, the answer generation module 30 is also used to determine the background knowledge search terms corresponding to the background knowledge list; calculate the similarity between the background knowledge search terms and the question search terms, and determine the score based on the similarity; and select the target background knowledge corresponding to each sub-question from the background knowledge list based on the score.

[0113] Other embodiments or specific implementation methods of the answer generation device of the present application can refer to the above-mentioned method embodiments and will not be repeated here.

[0114] The present application provides an answer generating device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the answer generating method in the above-mentioned embodiment one.

[0115] Reference below Figure 6, which shows a schematic diagram of the structure of an answer generation device suitable for implementing the embodiment of the present application. The answer generation device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The answer generation device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0116] like Figure 6 As shown, the answer generation device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the answer generation device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the answer generation device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an answer generation device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0117] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0118] The answer generation device provided by the present application adopts the answer generation method in the above embodiment, which can solve the technical problem of how to accurately and effectively generate the answer corresponding to the user's original question. Compared with the prior art, the beneficial effects of the answer generation device provided by the present application are the same as the beneficial effects of the answer generation method provided by the above embodiment, and the other technical features in the answer generation device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0119] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0120] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0121] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the answer generation method in the above-mentioned embodiment.

[0122] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: 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 embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0123] The computer-readable storage medium may be included in the answer generation device; or may exist independently without being assembled into the answer generation device.

[0124] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the answer generating device, the answer generating device: rewrites the user's original question and determines multiple sub-questions after the rewriting; determines the question search terms corresponding to each sub-question, and determines a background knowledge list based on the question search terms; determines the target background knowledge corresponding to each sub-question based on the background knowledge list, and determines the final answer corresponding to the user's original question based on the target background knowledge.

[0125] Computer program code for performing the operations of the present application 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).

[0126] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0127] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0128] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned answer generation method, and can solve the technical problem of how to accurately and effectively generate answers corresponding to the user's original questions. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the answer generation method provided by the above-mentioned embodiment, and will not be repeated here.

[0129] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for generating an answer, characterized in that: The answer generation method comprises the following steps: Rewrite the user's original question and determine multiple sub-questions after the rewrite; Determine the question search terms corresponding to each sub-question, and determine the background knowledge list according to the question search terms; The target background knowledge corresponding to each sub-question is determined according to the background knowledge list, and the final answer corresponding to the original question of the user is determined according to the target background knowledge.

2. The answer generation method according to claim 1, characterized in that: The step of rewriting the original question of the user and determining the rewritten multiple sub-questions specifically includes: When the user's intention is a single question, the user's original question is rewritten into similar sentences to determine multiple sub-questions after the rewriting; When the user intention is multiple intentions, rewrite the original question of the user by segmenting it by punctuation marks, and determine multiple rewritten sub-questions; When the user intention is multiple intentions, the user's original question is split and rewritten by connecting words to determine multiple sub-questions after the rewriting.

3. The answer generation method according to claim 1, characterized in that: The step of determining the question search terms corresponding to each sub-question and determining the background knowledge list according to the question search terms specifically includes: Determine the question search terms corresponding to each sub-question, and calculate the vector similarity between the question search terms and the user's original question; When the vector similarity is greater than a preset threshold, determining the background knowledge corresponding to the question search term; Performing vectorization processing and word segmentation processing on the background knowledge respectively to obtain vectors and keywords; The vector and the keyword are matched with a preset knowledge base to obtain a background knowledge list.

4. The answer generation method according to claim 3, characterized in that: Before the step of matching the vector and the keyword with a preset knowledge base to obtain a background knowledge list, the method further includes: Divide the original enterprise data to obtain structured data and paragraph text; The structured data and the paragraph text are processed respectively to obtain a preset knowledge base.

5. The answer generation method according to claim 4, characterized in that: The step of performing data processing on the structured data and the paragraph text respectively to obtain a preset knowledge base specifically includes: Extracting fields from the structured data to obtain field names; Performing multi-semantic word segmentation processing on the field name to obtain a first keyword after the word segmentation, and performing vectorization processing on the first keyword to obtain a first vector; Building a preset knowledge base according to the first vector and the first keyword; Extracting keywords from the paragraph text to obtain a second keyword; Segmenting the paragraph text into long and short paragraphs to obtain segmented paragraphs, and performing vectorization processing on the segmented paragraphs to obtain a second vector; A preset knowledge base is constructed according to the second vector and the second keyword.

6. The answer generation method according to claim 1, characterized in that: The step of determining the target background knowledge corresponding to each sub-question according to the background knowledge list, and determining the final answer corresponding to the user's original question according to the target background knowledge, specifically includes: Determine the target background knowledge corresponding to each sub-question according to the background knowledge list; When the target background knowledge is related to the original question of the user, determining the sub-answers corresponding to the sub-questions according to the target background knowledge; A final answer corresponding to the user's original question is determined according to the sub-answers.

7. The answer generation method according to claim 1, characterized in that: The step of determining the target background knowledge corresponding to each sub-question according to the background knowledge list specifically includes: Determine the background knowledge search term corresponding to the background knowledge list; Calculating the similarity between the background knowledge search term and the question search term, and determining a score based on the similarity; The target background knowledge corresponding to each sub-question is selected from the background knowledge list according to the score.

8. An answer generation device, characterized in that: The answer generating device comprises: A question rewriting module is used to rewrite the user's original question and determine multiple sub-questions after the rewriting; A knowledge list determination module is used to determine the question search terms corresponding to each sub-question, and determine the background knowledge list according to the question search terms; The answer generation module is used to determine the target background knowledge corresponding to each sub-question according to the background knowledge list, and determine the final answer corresponding to the user's original question according to the target background knowledge.

9. An answer generating device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the answer generation method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the answer generation method according to any one of claims 1 to 7 are implemented.