A knowledge question and answer method, device and electronic equipment

CN123012116APending Publication Date: 2026-10-30BEIJING JINGWEI HIRAIN TECH CO INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611264374.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-19
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

然而,上述实现方式的准确率较低,难以为用户问题生成高准确率的答案

Benefits of technology

[0045]根据以上方案可知,本申请提供的知识问答方法、装置和电子设备,通过构建第一知识库的全局知识摘要,并以全局知识摘要为依据,确定第一知识库中与待解答的第一问题相关的目标知识,进而基于目标知识对第一问题进行改写,实现了基于第一知识库的整体全局知识摘要对用户问题进行意图识别,相应可实现从整个第一知识库的全局视野上更清晰、准确地理解用户问题(第一问题),便于大模型基于第一知识库的全局内容对用户问题进行高效、准确的思考,从而本申请可提升对用户问题的回答准确性,能够使大模型进行高准确率的问题回答。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123012116A_ABST
    Figure CN123012116A_ABST
Patent Text Reader

Abstract

The application discloses a knowledge question answering method and device and electronic equipment, and relates to the technical field of artificial intelligence. The disclosed method comprises the following steps: acquiring a first question to be answered and a global knowledge summary of a first knowledge base, wherein the global knowledge summary comprises knowledge summaries of knowledge provided by respective knowledge documents included in the first knowledge base; determining target knowledge related to the first question in the first knowledge base based on the global knowledge summary; in response to the determination of the target knowledge, rewriting the first question based on the target knowledge to obtain a second question; and generating a first answer corresponding to the first question by a large model based on the target knowledge and the second question. The application can more clearly and accurately understand the user question from the global perspective of the entire first knowledge base, can enable the large model to efficiently and accurately think about the user question based on the global content of the first knowledge base, and is convenient for the large model to answer the question with high accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a knowledge question answering method, apparatus and electronic device. Background Technology

[0002] With the development of self-developed industrial software, software usability is receiving increasing attention. The continuous iteration and advancement of AI (Artificial Intelligence) technology has led to the emergence of various intelligent question-and-answer assistants, such as software question-and-answer assistants. A good software question-and-answer assistant can help users quickly and accurately solve software-related problems, thereby significantly improving software usability.

[0003] In known technologies, intelligent question-answering assistants typically provide a RAG (Retrieval-Augmented Generation)-based intelligent question-answering solution. This solution queries a database based on vector similarity and recalls data blocks that are highly similar to the user's question. A large model then answers the question based on the recalled data blocks and the user's question. However, the accuracy of this implementation is relatively low, making it difficult to generate highly accurate answers to user questions. Summary of the Invention

[0004] In view of this, this application provides a knowledge question answering method, apparatus, and electronic device for identifying the intent of user questions by performing global knowledge summaries based on a knowledge base, thereby gaining a clearer and more accurate understanding of user questions from a global perspective of the knowledge base, and thus improving the accuracy of answering user questions.

[0005] The specific technical solution is as follows:

[0006] A knowledge-based question-and-answer method, comprising:

[0007] Obtain the first question to be answered and the global knowledge summary of the first knowledge base, wherein the global knowledge summary includes the knowledge summary provided by each knowledge document contained in the first knowledge base;

[0008] Based on the global knowledge summary, target knowledge related to the first problem in the first knowledge base is determined;

[0009] In response to determining the target knowledge, the first problem is rewritten based on the target knowledge to obtain the second problem;

[0010] Using a large model, based on the target knowledge, the first question, and the second question, a first answer corresponding to the first question is generated.

[0011] Optionally, the global knowledge summary further includes: location information corresponding to the knowledge provided by each knowledge document in the first knowledge base;

[0012] Based on the global knowledge summary, target knowledge related to the first problem in the first knowledge base is determined, including:

[0013] The global knowledge summary, the first question, and the first prompt word information are input into the large model to obtain the target location information output by the large model.

[0014] Wherein, the target location information indicates the location of the target knowledge related to the first question in the first knowledge base, and the first prompt word information is used to instruct the large model to determine the target knowledge related to the first question in the first knowledge base represented by the global knowledge summary.

[0015] Optionally, the first problem can be rewritten based on the target knowledge to obtain a second problem, including:

[0016] Generate individual target sub-problems corresponding to each piece of target knowledge;

[0017] The target sub-problem corresponding to each piece of target knowledge includes at least one of the questions related to the target knowledge in the first question and the target location information corresponding to the target knowledge; the second question includes each of the target sub-problems.

[0018] Optionally, using a large model, based on the target knowledge, the first question, and the second question, a first answer corresponding to the first question is generated, including:

[0019] Using a large model, based on the target knowledge and the second question, a second answer corresponding to the second question is generated;

[0020] Using a large model, based on the first question, the second question, and the second answer, the first answer corresponding to the first question is generated.

[0021] Optionally, based on the target knowledge and the second question, a second answer corresponding to the second question is generated using a large model, including:

[0022] Based on the target location information in each target sub-problem, the target knowledge corresponding to each target sub-problem is obtained from the first knowledge base;

[0023] The large model generates sub-answers for each target sub-problem based on each target sub-problem and the target knowledge corresponding to each target sub-problem; the second answer includes the sub-answers corresponding to each target sub-problem respectively.

[0024] Using a large model, based on the first question, the second question, and the second answer, a first answer corresponding to the first question is generated, including:

[0025] Input the first question, each target sub-question, the sub-answers and second prompt words corresponding to each target sub-question into the large model to obtain the first answer output by the large model;

[0026] The second prompt word information is used to instruct the large model to generate the corresponding first answer for the first input question based on the various input information.

[0027] Optionally, before determining the target knowledge related to the first problem in the first knowledge base based on the global knowledge summary, the above method further includes:

[0028] Obtain target historical dialogue data from a second knowledge base, which includes historical dialogue data with the user;

[0029] The first question is rewritten based on the target historical dialogue data to obtain the third question. Then, given the target knowledge, the third question is rewritten based on the target knowledge to obtain the second question.

[0030] Optionally, before obtaining the first question to be answered and the global knowledge summary of the first knowledge base, the above method further includes:

[0031] Knowledge is extracted from each knowledge document in the first knowledge base according to a predetermined hierarchical structure.

[0032] The extracted knowledge is used to generate knowledge summaries for each knowledge item, thereby obtaining the global knowledge summary.

[0033] Optionally, the above methods also include:

[0034] Obtain the target answer that satisfies the target conditions from the output of the large model, and the target question corresponding to the target answer;

[0035] The target question and the target answer are added to the first knowledge base so that, if the question to be answered and the target question meet the similarity condition, the large model generates the answer corresponding to the question to be answered based on the target answer.

[0036] A knowledge-based question-and-answer device, comprising:

[0037] The acquisition module is used to acquire the first question to be answered and the global knowledge summary of the first knowledge base. The global knowledge summary includes the knowledge summary of each knowledge document contained in the first knowledge base.

[0038] The determination module is used to determine the target knowledge related to the first problem in the first knowledge base based on the global knowledge summary;

[0039] The rewriting module is used to rewrite the first problem based on the target knowledge in response to determining the target knowledge, so as to obtain the second problem;

[0040] The generation module is used to generate a first answer to the first question based on the target knowledge, the first question, and the second question, using a large model.

[0041] An electronic device, comprising:

[0042] Memory, used to store computer programs;

[0043] A processor is configured to implement any of the knowledge-based question-and-answer methods provided above by calling and executing computer programs in the memory.

[0044] A computer-readable medium having a computer program stored thereon, the computer program comprising program code for performing any of the knowledge question-answering methods provided above.

[0045] As can be seen from the above scheme, the knowledge question answering method, device, and electronic device provided in this application construct a global knowledge summary of a first knowledge base, and determine the target knowledge related to the first question to be answered in the first knowledge base based on the global knowledge summary of the first knowledge base. Then, the first question is rewritten based on the target knowledge, realizing the intent recognition of the user question based on the overall global knowledge summary of the first knowledge base. Accordingly, it can achieve a clearer and more accurate understanding of the user question (the first question) from the global perspective of the entire first knowledge base, which facilitates the large model to think about the user question efficiently and accurately based on the global content of the first knowledge base. Thus, this application can improve the accuracy of answering user questions and enable the large model to answer questions with high accuracy. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0047] Figure 1 This is a flowchart illustrating the knowledge-based question-and-answer method provided in this application;

[0048] Figure 2 This is an exemplary system architecture of the software question-and-answer assistant provided in this application;

[0049] Figure 3 This is a structural diagram of the knowledge question-answering device provided in this application;

[0050] Figure 4 This is a structural diagram of the electronic device provided in this application. Detailed Implementation

[0051] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0052] This application provides a knowledge-based question-answering method, apparatus, and electronic device, applicable to, but not limited to, knowledge-based question-answering scenarios for software products such as industrial software. It aims to improve the usability of such software products by assisting users in quickly and accurately resolving problems. The method provided in this application can be implemented, but is not limited to, as an intelligent question-answering assistant; for example, it can be implemented as a software question-answering assistant for corresponding industrial software.

[0053] See Figure 1 The flowchart shown illustrates the knowledge question-and-answer method provided in this application embodiment, which may include the following steps 101 to 104, which are described in detail below.

[0054] Step 101: Obtain the first question to be answered and the global knowledge summary of the first knowledge base. The global knowledge summary includes the knowledge summaries provided by each knowledge document contained in the first knowledge base.

[0055] The first question can be an unanswered question raised by the user. Taking the implementation of the method in this application as a software Q&A assistant for industrial software as an example, the first question can be various questions raised by the user regarding industrial software.

[0056] The first knowledge base is used to store knowledge documents, and may be, but is not limited to, a help document knowledge base for storing help documents. Taking the implementation of the method of this application as a software question-and-answer assistant for industrial software as an example, the first knowledge base can store a series of software help documents. These software help documents may include, but are not limited to, quick manuals and detailed design documents for the software. The help documents may contain detailed introductions to the software and some common questions. The knowledge points in the help documents need to cover as comprehensively as possible the relevant user questions of the applicable industrial software.

[0057] In implementation, a primary knowledge base, such as a help document knowledge base, can be prepared in advance. Based on the content of the knowledge documents stored in the primary knowledge base, a global knowledge summary of the primary knowledge base can be constructed. The global knowledge summary, also known as a global knowledge overview, is essentially a refinement and summary of the content of the knowledge documents in the primary knowledge base.

[0058] Optionally, the process of constructing a global knowledge summary of the first knowledge base can be implemented as follows: steps “1-1”-“1-3”.

[0059] 1-1: Obtain the first knowledge base.

[0060] For example, accessing a pre-prepared knowledge base of help documentation for industrial software.

[0061] 1-2: Extract knowledge from each knowledge document in the first knowledge base according to the predetermined hierarchical structure.

[0062] The predetermined hierarchical structure can include, but is not limited to, a hierarchical knowledge structure such as a table of contents or chapters of a knowledge document. This step can accordingly extract knowledge from each knowledge document in the first knowledge base according to the hierarchical knowledge structure such as a table of contents or chapters; for example, extracting the content of each chapter from a software help document.

[0063] Optionally, programmatic methods can be used to extract content from various chapters from knowledge documents such as help documentation.

[0064] 1-3: Generate knowledge summaries corresponding to each extracted knowledge item through a large model to obtain the global knowledge summary.

[0065] After obtaining the content of each chapter of the knowledge document, the extracted chapter content can be input into the large model. The large model can then be used to further extract the core or key points of each chapter content and / or summarize the knowledge, thereby obtaining the knowledge summary (knowledge introduction) corresponding to each knowledge.

[0066] Based on this, by summarizing and integrating the knowledge summaries of each knowledge document in the first knowledge base, the overall hierarchical knowledge summary of the first knowledge base can be obtained. In this embodiment of the application, this overall hierarchical knowledge summary is referred to as the global knowledge summary of the first knowledge base.

[0067] The global knowledge summary includes not only the knowledge summaries provided by each knowledge document in the first knowledge base, but also the location information corresponding to the knowledge provided by each knowledge document in the first knowledge base. The location information corresponding to the knowledge provided by the knowledge document may include, but is not limited to, the table of contents location, chapter number, and chapter name corresponding to the knowledge provided by the knowledge document.

[0068] See Table 1 for an example of a global knowledge summary / global knowledge overview built for a software help documentation knowledge base.

[0069] Table 1

[0070]

[0071] The purpose of extracting the global knowledge summary in this application is to reduce the tokens (lexical units) of knowledge documents, such as help documents, to a certain extent so that the global knowledge summary can be directly input into the large model. This allows the large model to think globally based on the first knowledge base when performing intent recognition (using the global knowledge summary to represent the first knowledge base), thereby ensuring accurate intent recognition.

[0072] The accuracy of the global knowledge summary is very important. In practical applications, manual review and modification can be added on the basis of extracting the knowledge summaries of each document from the large model to ensure that a high-accuracy global knowledge summary is generated for the first knowledge base.

[0073] The large model involved in this application may be, but is not limited to, an LLM (Large Language Model), such as deepseek, qwen, etc.

[0074] Step 102: Based on the global knowledge summary, determine the target knowledge in the first knowledge base that is related to the first problem.

[0075] This step can be based on a large model to determine the target knowledge in the first knowledge base that is relevant to the first question.

[0076] Optionally, the global knowledge summary, the first question, and the first prompt word information of the first knowledge base can be input into the large model. The large model then determines whether the user's question, i.e., the first question, is related to the content of the knowledge documents in the first knowledge base (using the global knowledge summary to represent the first knowledge base) based on the input information. For example, it can determine whether the input user question is related to the content of the help documents in the help document knowledge base, and obtain the output result of the large model.

[0077] If the large model determines that the content of the first question and the knowledge document in the first knowledge base are related, the output of the large model can include target location information, so as to use the target location information to represent or characterize the target knowledge in the first knowledge base that is related to the first question.

[0078] The target location information is used to indicate the location of the target knowledge related to the first question in the first knowledge base, such as the directory location and chapter number of the target knowledge related to the first question.

[0079] The first prompt word information may include pre-set system prompt words, which are used to instruct the large model to determine the target knowledge related to the first problem in the first knowledge base of the global knowledge summary representation.

[0080] In practical applications, the first question and the global knowledge summary of the first knowledge base can be input into the large model in text form. The large model can also determine whether the input first question is related to the global knowledge summary (indicating its relevance to the first knowledge base) by setting system prompts. For example, the system prompt can be set to "Please determine whether the user's question can be answered based on one or more chapters of the knowledge summary". Based on the input information, the large model will analyze the semantic and logical relationship between the first question and the global knowledge summary and output the results. This avoids the process of directly using the user's question to find relevant statements in the help document based on vector similarity.

[0081] Step 103: In response to determining the target knowledge, rewrite the first problem based on the target knowledge to obtain the second problem.

[0082] The target knowledge can be the entire knowledge document in the first knowledge base or a part of the knowledge document (such as a section of the help document), depending on the actual application.

[0083] Given that the target knowledge is determined, that is, when the output of the large model contains the target location information, the embodiments of this application continue to rewrite the first problem based on the target knowledge.

[0084] Optionally, the process of rewriting the first problem based on the target knowledge can be further implemented as: generating each target sub-problem corresponding to each piece of target knowledge.

[0085] Each target knowledge item corresponds to a target sub-problem, including at least one of the questions related to the target knowledge in the first question and the target location information corresponding to the target knowledge.

[0086] The questions related to the target knowledge in the first question can be either explicit questions or implicit potential questions related to the target knowledge in the first question. There are no restrictions on this, and it can be determined according to the actual application.

[0087] The second problem includes the various objective sub-problems obtained after rewriting.

[0088] The number of target sub-problems can be one or more, consistent with the number of target knowledge items, and can be determined based on the number of target knowledge items.

[0089] It is easy to understand that if no target knowledge related to the first question is identified from the first knowledge base, that is, if the first question is not related to the knowledge in the first knowledge base, then there is no need to rewrite the user's first question based on this step.

[0090] The following example illustrates this. Suppose the first question, or the original user question, is "How do I enable both function A and function B of software X simultaneously?". LLM can first determine if the help documentation knowledge base contains descriptions of both function A and function B. If not, the answer is "No relevant content in the knowledge base." If it does, the question is rewritten. The first sub-question after rewriting is "How do I enable function A? In which chapter is the relevant content (the target knowledge corresponding to 'How do I enable function A') located?". The second sub-question is "How do I enable function B? In which chapter is the relevant content (the target knowledge corresponding to 'How do I enable function B') located?". The third sub-question is "Do function A and function B share any common conditions for activation?". LLM breaks down the user question into three sub-questions, and these sub-questions collectively form the second question corresponding to the rewritten first question.

[0091] It's worth noting that in known techniques, directly searching for data blocks from a knowledge base using vector similarity only provides the large model with partial information about the knowledge base for understanding the user's intent. Furthermore, there's a high probability that the target data blocks won't be accurately retrieved, thus affecting the accuracy of the user's question answers. This is because vector similarity is essentially the semantic similarity of text, and it doesn't strictly represent the logic inherent in the text itself. Some text descriptions have high semantic similarity, but may represent drastically different meanings in different contexts. For example, the text description "apple" might represent a fruit in one context and an electronics brand in another, but the vector representation remains the same. In the example above, if a general RAG technique is used to retrieve the original user question directly, the retrieved data blocks might only contain function A, function B, or other data blocks. This prevents the large model from accurately understanding the user's intent and answering the question from a global knowledge base perspective. This is especially true when the retrieved data blocks don't match the actual context of the user question (e.g., the description of "apple"), further increasing the impact on the accuracy of the user's question answers.

[0092] This application, through steps 102-103, avoids the process of directly searching for relevant statements in the help document based on vector similarity using user questions. Instead of inputting the data blocks obtained from vector similarity search into the large model for answering, it replaces the large model's approach with thinking based on the global knowledge summary of the first knowledge base (such as analyzing the semantic and logical connections between the first question and the global knowledge summary). This not only enables intent analysis of user questions based on the overall / global content of the first knowledge base, allowing for a clearer and more accurate understanding of user questions from a global perspective of the entire knowledge base, but also avoids the drawbacks of vector similarity search at the textual logic understanding level (such as the explanation of "apple" above), thereby improving the accuracy of answering user questions.

[0093] Step 104: Using a large model, based on the target knowledge, the first question, and the second question, generate the first answer corresponding to the first question.

[0094] In this step, the process of generating the first answer to the first question based on the target knowledge, the first question, and the second question through the large model can be further implemented as the following steps "2-1"-"2-2".

[0095] 2-1: Using a large model, based on the target knowledge and the second question, generate the second answer corresponding to the second question.

[0096] Optionally, based on the target location information in each target sub-problem, the target knowledge corresponding to each target sub-problem can be obtained from the first knowledge base. On this basis, each target sub-problem and the target knowledge corresponding to each target sub-problem can be input into the large model, so that the large model can generate the sub-answer corresponding to each target sub-problem based on each target sub-problem and the target knowledge corresponding to each target sub-problem.

[0097] Continuing from the example above, the large model can provide answers to each target sub-question by combining knowledge documents. Specifically, it can first identify the relevant chapters for each target sub-question, extract the corresponding chapter content from the relevant help documents in the help document knowledge base based on the chapter number, and then the large model further answers the target sub-questions based on each target sub-question and its corresponding chapter content, providing sub-answers for each target sub-question.

[0098] The second answer to the second question includes the sub-answers corresponding to each target sub-question.

[0099] 2-2: Using a large model, based on the first question, the second question, and the second answer, generate the first answer corresponding to the first question.

[0100] Based on step 2-1, this step can further input the first question, each target sub-question, the sub-answers corresponding to each target sub-question, and the second prompt word information into the large model, so that the large model can answer the first question based on the input information, and finally obtain the first answer of the first question output by the large model.

[0101] The second prompt word information is used to instruct the large model to generate the corresponding first answer for the first input question based on the various input information.

[0102] In practical applications, the number of target sub-problems may be 0, 1, or more. If there are multiple target sub-problems, the large model needs to summarize the multiple sub-answers corresponding to the multiple target sub-problems and give a final answer, which is the first answer corresponding to the first question. If there is only one target sub-problem, the sub-answer of that target sub-problem can be used as a reference, and the large model's own capabilities can be combined to generate the corresponding first answer for the first question. If there are 0 target sub-problems, the large model's own capabilities and understanding of the first question can be used to directly give the corresponding first answer (in this case, the first answer may be empty or invalid).

[0103] In summary, the knowledge-based question-answering method provided in this application constructs a global knowledge summary of a first knowledge base and, based on this global knowledge summary, determines the target knowledge in the first knowledge base related to the first question to be answered. Then, it rewrites the first question based on the target knowledge, achieving intent recognition of the user's question based on the overall global knowledge summary of the first knowledge base. Consequently, it enables a clearer and more accurate understanding of the user's question (the first question) from the global perspective of the entire first knowledge base. This facilitates efficient and accurate thinking by the large model based on the global content of the first knowledge base, thereby improving the accuracy of the user's question answers and enabling the large model to provide highly accurate question answers.

[0104] In an optional embodiment, the knowledge question answering method provided in this application may further include the following processing steps "3-1"-"3-2" before step 102.

[0105] 3-1: Obtain target historical dialogue data from the second knowledge base.

[0106] The second knowledge base can be a historical dialogue knowledge base, including historical dialogue data between the user and the software. For example, it could include all historical dialogues between the software's question-and-answer assistant and the user.

[0107] The target historical dialogue data may include, but is not limited to, the historical dialogue content with the user's most recent bookings in the second knowledge base.

[0108] This embodiment filters and discards historical dialogues between the user and the second knowledge base, only acquiring target historical dialogue data, such as extracting only the most recent dialogue content. This avoids the problem of the large model exceeding its input limit due to the upper limit of the text content that can be input at one time.

[0109] 3-2: Based on the target historical dialogue data, the first question is rewritten to obtain the third question, so that, given the target knowledge, the third question is rewritten based on the target knowledge to obtain the second question.

[0110] After obtaining the target historical dialogue data, this embodiment uses the target historical dialogue data as context information to rewrite the first question. This can be achieved, but is not limited to, using a large model to rewrite the first question based on the target historical dialogue data.

[0111] For example, suppose a user's first question (target historical dialogue data) is "How do I activate feature A?", and after the software's question-and-answer assistant answers the user, the user's second question (equivalent to the first question in this application) is "What about feature B?". Based on the aforementioned historical dialogue data, the large model rewrites the user's second question as "How do I activate feature B?".

[0112] Subsequently, once the target knowledge is determined, the third question can be rewritten based on the target knowledge to obtain the second question.

[0113] This embodiment rewrites the first question based on historical dialogue data with the user, making the expression of the first question more standardized, comprehensive and accurate. This facilitates the large model's understanding of the user's question in conjunction with historical context, thereby further improving the accuracy of the answer to the user's question (the first question).

[0114] In an optional embodiment, the knowledge question-answering method provided in this application may further include the following processing steps "4-1"-"4-2".

[0115] 4-1: Obtain the target answer that satisfies the target conditions from the output of the large model, and the target question corresponding to the target answer.

[0116] The target conditions can be set as follows, but are not limited to: the confidence level of the answer output by the large model reaches the confidence level threshold, and / or the collected user feedback information represents the user's recognition / satisfaction with the answer output by the large model reaches the requirement (e.g., the user's rating of a certain answer or the rating of each answer involved in a certain interaction reaches the rating threshold, or the sentiment represented by the evaluation text is positive, etc.).

[0117] 4-1: Add the target question and the target answer to the first knowledge base so that, if the question to be answered and the target question meet the similarity condition, the large model generates the answer corresponding to the question to be answered based on the target answer.

[0118] Similarity conditions can be set to, but are not limited to, the semantic similarity between different questions reaching a similarity threshold.

[0119] In this embodiment, the target answer that meets the target conditions and its corresponding target question are added to the first knowledge base. When encountering similar questions, the large model can directly answer based on the target answers of similar questions stored in the first knowledge base, or it can use the target answers of similar questions as a reference to help the large model quickly generate answers for user questions, thereby further improving the speed and accuracy of answering user questions.

[0120] The following is an application example of the method of this application.

[0121] This application example, based on the method of this application, implements a software question-answering assistant based on a large model.

[0122] See Figure 2 The system architecture of the software question-and-answer assistant is shown, which includes a historical dialogue knowledge base, a help document knowledge base, an intent recognition module, and a question-and-answer retrieval module.

[0123] The system comprises two knowledge bases: a historical dialogue knowledge base for storing the software's question-and-answer assistant's historical dialogues with users, and a help document knowledge base for storing software help documents, such as quick start guides and detailed design documents. The intent recognition module can rewrite user questions based on the global knowledge summaries of the historical dialogue and help document knowledge bases. For example, the main model can rewrite user questions based on recent dialogues, and the system can perform intent recognition based on the global knowledge summaries of the help document knowledge base, further breaking down user questions into multiple sub-questions. The retrieval and answering module can answer multiple sub-questions based on the help document knowledge base and aggregate them to generate the final answer. For example, the main model can retrieve each sub-question using the method described in this application (extracting target knowledge from the knowledge base based on the target location information of the target knowledge) and answer it. Based on this, the main model combines the original question, sub-questions, and sub-question answers to provide the final answer.

[0124] This example allows large models to identify and respond to user questions based on the overall content of the help document, resulting in higher accuracy.

[0125] In practical applications, a data loop can also be introduced, storing user-approved or confidence-threshold answers and their corresponding questions in the help document knowledge base. When similar questions are encountered later, the large model can directly answer or quickly generate answers, thereby improving the speed and accuracy of responses.

[0126] In addition, the proposed solution does not require vector similarity retrieval, so it does not require embedding a large model in a knowledge base system or deploying it on a server. It can be packaged and released together with the software, thereby increasing ease of use.

[0127] Corresponding to the above method, this application also provides a knowledge question-answering device, see [link to relevant documentation]. Figure 3 A schematic diagram of the structural composition of the device, which includes:

[0128] The acquisition module 301 is used to acquire the first question to be answered and the global knowledge summary of the first knowledge base, wherein the global knowledge summary includes the knowledge summary provided by each knowledge document contained in the first knowledge base;

[0129] The determining module 302 is used to determine the target knowledge related to the first problem in the first knowledge base based on the global knowledge summary;

[0130] The rewriting module 303 is used to rewrite the first problem based on the target knowledge in response to determining the target knowledge, so as to obtain the second problem;

[0131] The generation module 304 is used to generate a first answer corresponding to the first question based on the target knowledge, the first question, and the second question using a large model.

[0132] In an optional implementation, the global knowledge summary further includes: location information corresponding to the knowledge provided by each knowledge document in the first knowledge base.

[0133] Module 302 is specifically used for:

[0134] The global knowledge summary, the first question, and the first prompt word information are input into the large model to obtain the target location information output by the large model.

[0135] Wherein, the target location information indicates the location of the target knowledge related to the first question in the first knowledge base, and the first prompt word information is used to instruct the large model to determine the target knowledge related to the first question in the first knowledge base represented by the global knowledge summary.

[0136] In an optional implementation, the rewriting module 303, when rewriting the first problem based on the target knowledge to obtain the second problem, is specifically used for:

[0137] Generate individual target sub-problems corresponding to each piece of target knowledge;

[0138] The target sub-problem corresponding to each piece of target knowledge includes at least one of the questions related to the target knowledge in the first question and the target location information corresponding to the target knowledge; the second question includes each of the target sub-problems.

[0139] In an optional implementation, the generation module 304 is specifically used for:

[0140] Using a large model, based on the target knowledge and the second question, a second answer corresponding to the second question is generated;

[0141] Using a large model, based on the first question, the second question, and the second answer, the first answer corresponding to the first question is generated.

[0142] In an optional implementation, the generation module 304, when generating the second answer corresponding to the second question based on the target knowledge and the second question using a large model, is specifically used for:

[0143] Based on the target location information in each target sub-problem, the target knowledge corresponding to each target sub-problem is obtained from the first knowledge base;

[0144] The large model generates sub-answers for each target sub-problem based on each target sub-problem and the target knowledge corresponding to each target sub-problem; the second answer includes the sub-answers corresponding to each target sub-problem respectively.

[0145] The generation module 304, when generating the first answer corresponding to the first question based on the first question, the second question, and the second answer using the large model, is specifically used for:

[0146] Input the first question, each target sub-question, the sub-answers and second prompt words corresponding to each target sub-question into the large model to obtain the first answer output by the large model;

[0147] The second prompt word information is used to instruct the large model to generate the corresponding first answer for the first input question based on the various input information.

[0148] In an alternative implementation, the rewrite module 303 is further configured to:

[0149] Before determining the target knowledge related to the first question in the first knowledge base based on the global knowledge summary, target historical dialogue data is obtained from the second knowledge base, which includes historical dialogue data between users.

[0150] The first question is rewritten based on the target historical dialogue data to obtain the third question. Then, given the target knowledge, the third question is rewritten based on the target knowledge to obtain the second question.

[0151] In an optional embodiment, the above apparatus further includes a preprocessing module for:

[0152] Before obtaining the first question to be answered and the global knowledge summary of the first knowledge base, knowledge is extracted from each knowledge document in the first knowledge base according to a predetermined hierarchical structure.

[0153] The extracted knowledge is used to generate knowledge summaries for each knowledge item, thereby obtaining the global knowledge summary.

[0154] In an optional embodiment, the above apparatus further includes a post-processing module for:

[0155] Obtain the target answer that satisfies the target conditions from the output of the large model, and the target question corresponding to the target answer;

[0156] The target question and the target answer are added to the first knowledge base so that, if the question to be answered and the target question meet the similarity condition, the large model generates the answer corresponding to the question to be answered based on the target answer.

[0157] The knowledge question answering device disclosed in this application is relatively simple to describe because it corresponds to the knowledge question answering methods disclosed in the above method embodiments. For related similarities, please refer to the descriptions of the above method embodiments, which will not be detailed here.

[0158] This application also discloses an electronic device, the composition and structure of which are as follows: Figure 4 As shown, it includes at least:

[0159] Memory 10 is used to store computer programs.

[0160] The processor 20 is configured to implement the knowledge question-answering method provided in any of the above method embodiments by calling and executing a computer program in the memory.

[0161] The processor 20 can be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a neural network processor (NPU), a deep learning processor (DPU), or other programmable logic devices.

[0162] In addition to these components, electronic devices may also include communication interfaces, communication buses, and other parts. Memory, processor, and communication interface communicate with each other through the communication bus.

[0163] Communication interfaces are used for communication between electronic devices and other devices. Communication buses can be Peripheral Component Interconnect (PCI) buses or Extended Industry Standard Architecture (EISA) buses, and can be categorized into address buses, data buses, control buses, etc.

[0164] In addition, this application also provides a computer-readable medium having a computer program stored thereon, the computer program including program code for performing the knowledge question-answering method disclosed in any of the above method embodiments.

[0165] In the context of this application, a computer-readable medium (machine-readable medium) can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0166] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0167] For ease of description, the above systems or devices are described separately as various modules or units based on their functions. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware components.

[0168] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0169] Finally, it should be noted that in this document, relational terms such as first, second, third, and target are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0170] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A knowledge-based question-and-answer method, characterized in that, include: Obtain the first question to be answered and the global knowledge summary of the first knowledge base, wherein the global knowledge summary includes the knowledge summary provided by each knowledge document contained in the first knowledge base; Based on the global knowledge summary, target knowledge related to the first problem in the first knowledge base is determined; In response to determining the target knowledge, the first problem is rewritten based on the target knowledge to obtain the second problem; Using a large model, based on the target knowledge, the first question, and the second question, a first answer corresponding to the first question is generated.

2. The knowledge question-answering method according to claim 1, characterized in that, The global knowledge summary also includes: the location information corresponding to the knowledge provided by each knowledge document in the first knowledge base; Based on the global knowledge summary, target knowledge related to the first problem in the first knowledge base is determined, including: The global knowledge summary, the first question, and the first prompt word information are input into the large model to obtain the target location information output by the large model. Wherein, the target location information indicates the location of the target knowledge related to the first question in the first knowledge base, and the first prompt word information is used to instruct the large model to determine the target knowledge related to the first question in the first knowledge base represented by the global knowledge summary.

3. The knowledge question-answering method according to claim 2, characterized in that, Based on the target knowledge, the first problem is rewritten to obtain the second problem, including: Generate individual target sub-problems corresponding to each piece of target knowledge; The target sub-problem corresponding to each piece of target knowledge includes at least one of the questions related to the target knowledge in the first question and the target location information corresponding to the target knowledge; the second question includes each of the target sub-problems.

4. The knowledge question-answering method according to claim 3, characterized in that, Using a large model, based on the target knowledge, the first question, and the second question, a first answer corresponding to the first question is generated, including: Using a large model, based on the target knowledge and the second question, a second answer corresponding to the second question is generated; Using a large model, based on the first question, the second question, and the second answer, the first answer corresponding to the first question is generated.

5. The knowledge question-answering method according to claim 4, characterized in that, Using a large model, based on the target knowledge and the second question, a second answer to the second question is generated, including: Based on the target location information in each target sub-problem, the target knowledge corresponding to each target sub-problem is obtained from the first knowledge base; The large model generates sub-answers for each target sub-problem based on each target sub-problem and the target knowledge corresponding to each target sub-problem; the second answer includes the sub-answers corresponding to each target sub-problem respectively. Using a large model, based on the first question, the second question, and the second answer, a first answer corresponding to the first question is generated, including: Input the first question, each target sub-question, the sub-answers and second prompt words corresponding to each target sub-question into the large model to obtain the first answer output by the large model; The second prompt word information is used to instruct the large model to generate the corresponding first answer for the first input question based on the various input information.

6. The knowledge question-answering method according to claim 1, characterized in that, Before determining the target knowledge related to the first problem in the first knowledge base based on the global knowledge summary, the method further includes: Obtain target historical dialogue data from a second knowledge base, which includes historical dialogue data with the user; The first question is rewritten based on the target historical dialogue data to obtain the third question. Then, given the target knowledge, the third question is rewritten based on the target knowledge to obtain the second question.

7. The knowledge question-answering method according to claim 1, characterized in that, Before obtaining the first question to be answered and the global knowledge summary of the first knowledge base, the following is also included: Knowledge is extracted from each knowledge document in the first knowledge base according to a predetermined hierarchical structure. The extracted knowledge is used to generate knowledge summaries for each knowledge item, thereby obtaining the global knowledge summary.

8. The knowledge question-answering method according to claim 1, characterized in that, Also includes: Obtain the target answer that satisfies the target conditions from the output of the large model, and the target question corresponding to the target answer; The target question and the target answer are added to the first knowledge base so that, if the question to be answered and the target question meet the similarity condition, the large model generates the answer corresponding to the question to be answered based on the target answer.

9. A knowledge-based question-and-answer device, characterized in that, include: The acquisition module is used to acquire the first question to be answered and the global knowledge summary of the first knowledge base. The global knowledge summary includes the knowledge summary of each knowledge document contained in the first knowledge base. The determination module is used to determine the target knowledge related to the first problem in the first knowledge base based on the global knowledge summary; The rewriting module is used to rewrite the first problem based on the target knowledge in response to determining the target knowledge, so as to obtain the second problem; The generation module is used to generate a first answer to the first question based on the target knowledge, the first question, and the second question, using a large model.

10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor is configured to implement the knowledge question-answering method as described in any one of claims 1-8 by calling and executing a computer program in the memory.