Knowledge question-answering device and method based on multi-agent technology
Through the knowledge question and answer device based on multi-agent technology, using natural language processing and analysis technology to semantically encode and disassemble the question description, the problem of insufficient accuracy and contextual understanding of traditional knowledge question and answer device when dealing with complex problems is solved, and the problem of insufficient accuracy and contextual understanding of traditional knowledge question and answer device is realized. More efficient and intelligent knowledge Q&A.
Patent Information
- Application Number
- CN202411327348.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-12-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional knowledge question-and-answer devices have difficulty providing precise answers when dealing with complex questions, and have limitations in natural language understanding and context perception, which cannot effectively deal with the complexity and diversity of professional field knowledge and are difficult to provide personalized and targeted answers.
Using a knowledge question-and-answer device based on multi-agent technology, semantic coding and disassembly of the user's input question description, natural language processing and analysis technology generate answer text, and query matching representation of semantic features and sub-question answer semantic features To generate answers automatically.
It improves the accuracy and efficiency of the Q&A device when dealing with complex questions, enhances the intelligence level of knowledge Q&A, can more accurately understand the user's question intention and context, and provides answers that are more in line with user needs.
Smart Images

Figure CN119166784A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent data analysis, and more specifically, to a knowledge question-answering device and method based on multi-agent technology. Background Art
[0002] With the explosive growth of Internet information, users have an increasing demand for fast and accurate access to the information they need. Modern users are no longer satisfied with just a large number of search results, but expect to directly obtain accurate and useful information. This change in demand reflects people's higher requirements for information acquisition efficiency. In daily life, whether it is students looking for learning materials, professionals seeking industry information, or ordinary consumers looking for product reviews, they all hope to find reliable answers in the shortest possible time.
[0003] However, although traditional knowledge question-and-answer devices can provide a large number of search results, they often have difficulty in giving clear answers directly when faced with complex questions. Specifically, when the questions raised by users are more complex, involving deep information integration, multi-step reasoning, or requiring domain expertise, traditional knowledge question-and-answer devices often cannot directly provide accurate answers. They tend to return a series of potentially relevant web pages rather than exact information that has been sorted and analyzed. For example, if a user asks "How can I use a home solar power generation system to reduce home energy consumption?" The knowledge question-and-answer device may list many articles about solar power generation systems, home energy consumption management, and energy conservation and emission reduction, but users need to browse these articles themselves, extract relevant information from them, and integrate them to get the answer to the question. In addition, traditional knowledge question-and-answer devices also have limitations in processing natural language understanding and context perception. That is, it is difficult for traditional knowledge question-and-answer devices to understand the implicit contextual dependencies and contextual relationships, and therefore it is difficult to provide personalized and targeted answers.
[0004] Therefore, an optimized knowledge question answering device is desired. Summary of the invention
[0005] In order to solve the above technical problems, the present application is proposed. The embodiment of the present application provides a knowledge question-answering device and method based on multi-agent technology, which uses text processing and analysis technology based on multi-agent and natural language to semantically encode the question description input by the user, and performs agent-based answer generation and semantic understanding on each question sub-question obtained by decomposing the question description, so as to automatically generate the answer text according to the query matching representation between the semantic features of the question description and the semantic features of the answers to each sub-question. In this way, it can effectively cope with the complexity and diversity of professional field knowledge, and at the same time can more accurately understand the user's question intention and context, and provide answers that better meet the user's needs, thereby improving the accuracy and efficiency of the question-answering device when dealing with complex problems and enhancing the intelligence level of knowledge question-answering.
[0006] According to one aspect of the present application, a knowledge question answering device based on multi-agent technology is provided, which includes:
[0007] A question description data collection module is used to obtain the question description input by the user;
[0008] A question description decomposition answer generation module is used to decompose the question description and input the decomposition into the answer generator to obtain a set of sub-question answers;
[0009] A sub-question answer semantic encoding module, used for semantically encoding each sub-question answer in the set of sub-question answers to obtain a set of sub-question answer semantic encoding feature vectors;
[0010] A question description semantic encoding module, used for semantically encoding the question description to obtain a question description semantic encoding feature vector;
[0011] A question global-answer global query matching module, used to use the question description semantic encoding feature vector as a query feature vector and a feature matrix composed of a set of sub-question answer semantic encoding feature vectors as an initial key matrix, and input the query feature vector and the initial key matrix into a cross-domain feature gated query system driven by key matrix local association to obtain a question global-answer global query matching semantic representation vector;
[0012] The answer text generation module is used to obtain the answer text based on the question global-answer global query matching semantic representation vector.
[0013] In the above-mentioned knowledge question and answer device based on multi-agent technology, the question description decomposition and answer generation module includes: a question description problem decomposition unit, which is used to decompose the question description to obtain a set of question sub-questions; a sub-question answer generation unit, which is used to input each question sub-question in the set of question sub-questions into the agent-based answer generator to obtain the set of sub-question answers.
[0014] In the above-mentioned knowledge question and answer device based on multi-agent technology, the question global-answer global query matching module includes: a question description-sub-question answer semantic feature distribution difference energy coefficient calculation unit, which is used to calculate the feature distribution difference energy coefficient between the question description semantic encoding feature vector and each initial sub-question answer semantic row vector in the initial key matrix to obtain a set of question description-sub-question answer semantic feature distribution difference energy coefficients; a sub-question answer semantic row vector updating unit, which is used to compare each question description-sub-question answer semantic feature distribution difference energy coefficient in the set of question description-sub-question answer semantic feature distribution difference energy coefficients with a predetermined threshold, and in response to the question description-sub-question answer semantic feature distribution difference energy coefficient being less than the predetermined threshold, compare the initial sub-question answer semantic row vector corresponding to the question description-sub-question answer semantic feature distribution difference energy coefficient with the question description semantic encoding feature vector. The mean vector between the vectors is used as the updated sub-question answer semantic row vector to obtain the updated sub-question answer semantic key matrix; a question description semantic feature embedding unit is used to process the question description semantic encoding feature vector using the value embedding matrix to obtain the question description semantic value vector; a question description-sub-question answer semantic cross-domain query unit is used to input the question description semantic encoding feature vector as the query vector, each updated sub-question answer semantic row vector in the updated sub-question answer semantic key matrix as the key vector and the question description semantic value vector into a cross-domain attention gate query module based on the Transformer structure to obtain a set of question description-sub-question answer semantic cross-domain query attention vectors; a question global-answer global query matching semantic representation generation unit is used to calculate the positional mean vector of the set of question description-sub-question answer semantic cross-domain query attention vectors to obtain the question global-answer global query matching semantic representation vector.
[0015] In the above-mentioned knowledge question and answer device based on multi-agent technology, the question description-sub-question answer semantic feature distribution difference energy coefficient calculation unit includes: a question description-sub-question answer semantic association interaction sub-unit, which is used to calculate the semantic association interaction vector between the question description semantic encoding feature vector and each initial sub-question answer semantic row vector in the initial key matrix to obtain a set of question description-sub-question answer semantic association interaction vectors; a question description-sub-question answer interaction feature energy coefficient calculation sub-unit, which is used to calculate the feature distribution difference energy coefficient of each question description-sub-question answer semantic association interaction vector in the set of question description-sub-question answer semantic association interaction vectors to obtain a set of question description-sub-question answer semantic feature distribution difference energy coefficients, wherein the feature distribution difference energy coefficients of each question description-sub-question answer semantic association interaction vector are related to the maximum value, mean and variance of each question description-sub-question answer semantic association interaction vector.
[0016] In the above-mentioned knowledge question and answer device based on multi-agent technology, the question description-sub-question answer semantic association interaction sub-unit is used to: respectively calculate the positional difference, positional dot product and positional addition between the question description semantic encoding feature vector and the initial sub-question answer semantic row vector to obtain the question description-sub-question answer semantic differential vector, the question description-sub-question answer semantic dot product vector and the question description-sub-question answer semantic sum vector; cascade the question description-sub-question answer semantic differential vector, the question description-sub-question answer semantic dot product vector and the question description-sub-question answer semantic sum vector and perform one-dimensional convolution encoding to obtain the question description-sub-question answer semantic multi-dimensional fusion vector; perform local window-based maximum pooling processing on the question description-sub-question answer semantic multi-dimensional fusion vector to obtain the question description-sub-question answer semantic association interaction vector.
[0017] In the above-mentioned knowledge question-answering device based on multi-agent technology, the question description-sub-question answer interaction feature energy coefficient calculation subunit is used to: respectively extract the maximum value of the question description-sub-question answer semantic association interaction vector to obtain the question description-sub-question answer semantic association interaction maximum value; respectively calculate the mean and variance of the question description-sub-question answer semantic association interaction vector to obtain the question description-sub-question answer semantic association interaction mean and the question description-sub-question answer semantic association interaction variance; add the question description-sub-question answer semantic association interaction variance and the hyperparameter to obtain the question description-sub-question answer semantic association interaction first difference energy coefficient; calculate the question description-sub-question answer semantic association interaction maximum value and the question description The square of the difference between the mean of the question description-sub-question answer semantic association interaction is obtained to obtain the question description-sub-question answer semantic difference value; the question description-sub-question answer semantic association interaction variance is multiplied by a constant of two to obtain a modulated question description-sub-question answer semantic association interaction variance; the question description-sub-question answer semantic difference value and the modulated question description-sub-question answer semantic association interaction variance are added to the hyperparameter to obtain the question description-sub-question answer semantic association interaction second difference energy coefficient; the question description-sub-question answer semantic association interaction first difference energy coefficient is divided by the question description-sub-question answer semantic association interaction second difference energy coefficient to obtain the question description-sub-question answer semantic feature distribution difference energy coefficient.
[0018] In the above-mentioned knowledge question and answer device based on multi-agent technology, the question description semantic feature embedding unit is used to: after matrix multiplication of the question description semantic encoding feature vector and the value embedding matrix, add the obtained question description semantic embedding vector and the value bias vector by position to obtain the question description semantic value vector.
[0019] In the above-mentioned knowledge question and answer device based on multi-agent technology, the question description-sub-question answer semantic cross-domain query unit is used to: calculate the product between the question description semantic encoding feature vector and the transposed vector of the updated sub-question answer semantic row vector to obtain the question description-updated sub-question answer semantic association matrix, and then divide the question description-updated sub-question answer semantic association matrix by the square root of the length of the updated sub-question answer semantic row vector by position to obtain the question description-updated sub-question answer semantic modulation matrix; input the question description-updated sub-question answer semantic modulation matrix into the softmax function to obtain the question description-updated sub-question answer semantic activation matrix; multiply the question description-updated sub-question answer semantic activation matrix by the question description semantic value vector to obtain the question description-sub-question answer semantic cross-domain query attention vector.
[0020] In the above-mentioned knowledge question-answering device based on multi-agent technology, the answer text generation module is used to: input the question global-answer global query matching semantic representation vector into the decoder-based answer generator to obtain the answer text.
[0021] According to another aspect of the present application, a knowledge question answering method based on multi-agent technology is provided, which includes:
[0022] Get the question description entered by the user;
[0023] Decomposing the question description into sub-questions and inputting them into the answer generator respectively to obtain a set of sub-question answers;
[0024] Performing semantic coding on each sub-question answer in the set of sub-question answers to obtain a set of semantic coding feature vectors of the sub-question answers;
[0025] Performing semantic encoding on the question description to obtain a semantic encoding feature vector of the question description;
[0026] Using the question description semantic encoding feature vector as the query feature vector and the feature matrix composed of the set of sub-question answer semantic encoding feature vectors as the initial key matrix, the query feature vector and the initial key matrix are input into a cross-domain feature gated query system driven by key matrix local association to obtain a question global-answer global query matching semantic representation vector;
[0027] Based on the question global-answer global query matching semantic representation vector, the answer text is obtained.
[0028] Compared with the prior art, the knowledge question-answering device and method based on multi-agent technology provided by the present application uses text processing and analysis technology based on multi-agent and natural language to semantically encode the question description input by the user, and performs agent-based answer generation and semantic understanding on each question sub-question obtained by decomposing the question description, thereby automatically generating the answer text according to the query matching representation between the semantic features of the question description and the semantic features of the answers to each sub-question. In this way, the complexity and diversity of professional field knowledge can be effectively dealt with, and at the same time, the user's question intention and context can be understood more accurately, and answers that better meet the user's needs can be provided, thereby improving the accuracy and efficiency of the question-answering device in handling complex questions and enhancing the intelligent level of knowledge question-answering. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0030] Figure 1 It is a block diagram of a knowledge question and answer device based on multi-agent technology according to an embodiment of the present application.
[0031] Figure 2 Schematic diagram of data flow of a knowledge question and answer device based on multi-agent technology according to an embodiment of the present application.
[0032] Figure 3 A block diagram of a question description disassembly answer generation module in a knowledge question answering device based on multi-agent technology according to an embodiment of the present application.
[0033] Figure 4 It is a block diagram of a question global-answer global query matching module in a knowledge question-answering device based on multi-agent technology according to an embodiment of the present application.
[0034] Figure 5 It is a block diagram of a question description-sub-question answer semantic feature distribution difference energy coefficient calculation unit in a knowledge question and answer device based on multi-agent technology according to an embodiment of the present application.
[0035] Figure 6 It is a flowchart of a knowledge question answering method based on multi-agent technology according to an embodiment of the present application. DETAILED DESCRIPTION
[0036] Below, the exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application, and it should be understood that the present application is not limited to the exemplary embodiments described here.
[0037] As mentioned in the above background technology, with the surge in the amount of information on the Internet, users have put forward higher requirements for the efficiency and accuracy of information retrieval. They no longer just need a large number of search results, but are more pursuing the ability to quickly obtain accurate and practical information. In various life scenarios, whether students, professionals or consumers, they all expect to find reliable answers in a short time. However, when dealing with complex problems, traditional knowledge question-and-answer devices often cannot directly provide clear answers, but return a series of possibly related web pages, requiring users to filter and integrate information by themselves. In addition, traditional knowledge question-and-answer devices also have deficiencies in natural language understanding and context perception, making it difficult to provide personalized and targeted answers.
[0038] It should be understood that multi-agent technology is an important branch of distributed artificial intelligence. Specifically, multi-agent technology divides the system into multiple independent agents, each of which communicates and adapts itself through natural language processing to work together to complete complex business scenario requirements. In the field of knowledge question and answer, the agent can collect the necessary unique information for professional question and answer from users through an active questioning mechanism, which can enhance the user's interactive experience in knowledge question and answer. At the same time, the agent can also automatically manage topics in the conversation, track the progress of topics, and effectively conduct discussions centered on the current topic, thereby ensuring the coherence and depth of the question and answer process.
[0039] Based on this, the present application proposes a knowledge question-answering device based on multi-agent technology, which obtains a question description input by a user, decomposes the question description to obtain a set of question sub-questions, and uses text processing and analysis technology based on multi-agents and natural languages to semantically encode the question description, and performs agent-based answer generation and semantic understanding on each question sub-question, thereby automatically generating an answer text based on the query matching representation between the semantic features of the question description and the semantic features of the answers to each sub-question. In this way, the complexity and diversity of professional field knowledge can be effectively dealt with, and at the same time, the user's question intention and context can be understood more accurately, and answers that better meet user needs can be provided, thereby improving the accuracy and efficiency of the question-answering device in handling complex problems and enhancing the intelligence level of knowledge question-answering.
[0040] Figure 1 It is a block diagram of a knowledge question and answer device based on multi-agent technology according to an embodiment of the present application. Figure 2 Schematic diagram of data flow of the knowledge question answering device based on multi-agent technology according to an embodiment of the present application. Figure 1 and Figure 2As shown, in the knowledge question-answering device 100 based on multi-agent technology, it includes: a question description data acquisition module 110, which is used to obtain the question description input by the user; a question description decomposition answer generation module 120, which is used to decompose the question description and input the decomposition into the answer generator to obtain a set of sub-question answers; a sub-question answer semantic encoding module 130, which is used to semantically encode each sub-question answer in the set of sub-question answers to obtain a set of sub-question answer semantic encoding feature vectors; a question description semantic encoding module 140, which is used to semantically encode the question description to obtain a question description semantic encoding feature vector; a question global-answer global query matching module 150, which is used to use the question description semantic encoding feature vector as the query feature vector and the feature matrix composed of the set of sub-question answer semantic encoding feature vectors as the initial key matrix, and input the query feature vector and the initial key matrix into the cross-domain feature gating query system driven by the local association of the key matrix to obtain the question global-answer global query matching semantic representation vector; an answer text generation module 160, which is used to obtain the answer text based on the question global-answer global query matching semantic representation vector.
[0041] In the embodiment of the present application, the question description data acquisition module 110 is used to obtain the question description input by the user. It should be understood that the question description input by the user contains the information that the user wants to obtain by asking the question, that is, the user's clear query intention. By analyzing the user's query intention, it is possible to better understand the user's needs and provide accurate and relevant answers, thereby enhancing the user's knowledge question and answer experience. In particular, in a specific implementation method of the embodiment of the present application, the user's question description data can be obtained through the database at the back end of the knowledge question and answer device.
[0042] In the embodiment of the present application, the question description decomposition answer generation module 120 is used to decompose the question description and input the decomposition into the answer generator to obtain a set of sub-question answers. Specifically, Figure 3 FIG. 1 is a block diagram of a question description disassembly answer generation module in a knowledge question answering device based on multi-agent technology according to an embodiment of the present application. Figure 3As shown, the question description decomposition answer generation module 120 includes: a question description decomposition unit 121, which is used to decompose the question description to obtain a set of question sub-questions; a sub-question answer generation unit 122, which is used to input each question sub-question in the set of question sub-questions into the agent-based answer generator to obtain a set of sub-question answers. It should be understood that the question raised by the user may contain multiple intentions or inquire about multiple matters, and each intention and matter contains different aspects of information. Therefore, in order to clarify the exact intention of each sub-question in the user's question description, so as to more accurately process and answer, in the technical solution of the present application, the question description is decomposed to obtain a set of question sub-questions. Furthermore, in order to provide a reasonable answer to each question sub-question in the set of question sub-questions in a more targeted and concentrated manner, in the technical solution of the present application, each question sub-question in the set of question sub-questions is input into the agent-based answer generator to obtain a set of sub-question answers. It should be understood that an agent is an entity that can independently perform tasks, make decisions and respond to its environment. That is, each agent can be designed to specialize in problems of a specific type or field, and each sub-question is input into the agent-based answer generator. The agent can choose the most appropriate method to generate answers based on its own expertise and resource consumption. At the same time, each agent can communicate, communicate and collaborate through natural language processing to jointly solve complex problems, thereby optimizing the use of system resources and improving the quality and relevance of the answers.
[0043] In an embodiment of the present application, the sub-question answer semantic encoding module 130 is used to semantically encode each sub-question answer in the set of sub-question answers to obtain a set of sub-question answer semantic encoding feature vectors. Accordingly, considering that each sub-question answer in the set of sub-question answers contains core semantic information of various aspects, and there is a semantic association dependency between each sub-question answer, based on this, in the technical solution of the present application, each sub-question answer in the set of sub-question answers is semantically encoded to capture and extract key semantic information, and obtain a set of sub-question answer semantic encoding feature vectors.
[0044] In an embodiment of the present application, the question description semantic encoding module 140 is used to semantically encode the question description to obtain a question description semantic encoding feature vector. It should be understood that the question description also contains rich contextual information and the key intent of the question. Based on this, in order to more accurately understand and analyze the user's questions and inquiry information, in the technical solution of the present application, the question description is semantically encoded to obtain a question description semantic encoding feature vector. In particular, in a specific implementation method of the embodiment of the present application, the question description can be semantically encoded by a converter-based semantic encoder including an embedding layer, thereby obtaining a question description semantic encoding feature vector containing the user's query intent semantics.
[0045] In an embodiment of the present application, the question global-answer global query matching module 150 is used to use the question description semantic encoding feature vector as the query feature vector and the feature matrix composed of the set of sub-question answer semantic encoding feature vectors as the initial key matrix, and input the query feature vector and the initial key matrix into a cross-domain feature gated query system driven by local association of the key matrix to obtain a question global-answer global query matching semantic representation vector. Accordingly, considering that the question description semantic encoding feature vector captures the semantic information of the core intention and focus of the user's question, the set of sub-question answer semantic encoding feature vectors expresses the specific information of the corresponding sub-questions and the context of the key points of the answer. Therefore, in order to perform local and fine-grained matching of the question description semantic encoding feature vector and the semantic encoding feature vectors of each sub-question answer to find the best answer match and generate a comprehensive answer, in the technical solution of the present application, the question description semantic encoding feature vector is used as the query feature vector and the feature matrix composed of the set of sub-question answer semantic encoding feature vectors is used as the initial key matrix, and the query feature vector and the initial key matrix are input into a cross-domain feature gated query system driven by local association of the key matrix to obtain a question global-answer global query matching semantic representation vector.
[0046] In detail, the semantic association interaction vector between the question description semantic encoding feature vector and each initial sub-question answer semantic row vector in the initial key matrix is first calculated to obtain a set of question description-sub-question answer semantic association interaction vectors, which can enrich the semantic association and potential dependency between the question description and the sub-question answer. Then, based on the maximum value, mean and variance of each question description-sub-question answer semantic association interaction vector, the feature distribution difference coefficient between the question description semantic encoding feature vector and each initial sub-question answer semantic row vector is calculated to obtain a set of question description-sub-question answer semantic feature distribution difference energy coefficients. In particular, the query feature vector (question description semantic encoding feature vector) is used as the center point of comparison, and the feature distribution energy difference coefficient is used to measure its semantic difference with each initial sub-question answer semantic row vector. Specifically, since the query vector is used as a common reference, these feature distribution energy difference coefficients not only reveal the semantic association between different sub-question answer semantic row vectors and the query vector, but also implicitly express the local mutual relationship and internal connection between these row vectors. Subsequently, each feature distribution difference energy coefficient is evaluated. If its value is lower than the preset threshold, the vector obtained by calculating the average value of the query vector and the corresponding semantic row vectors of the answers to different sub-questions is used to update the corresponding row vector in the semantic key matrix of the answer to the sub-question. Next, the question description semantic encoding feature vector is linearly transformed to generate a value vector, and the row vectors of the updated sub-question answer semantic key matrix are used as key vectors. The query vector, value vector and key vector are input into the cross-domain attention query module based on the Transformer architecture to achieve local cross-domain semantic query matching and semantic association encoding, and obtain a set of question description-sub-question answer semantic cross-domain query attention vectors. Finally, the query attention vector is a set of cascade processing to obtain the final question global-answer global query matching semantic representation vector containing local query matching information in different knowledge fields.
[0047] Specifically, Figure 4 FIG. 1 is a block diagram of a global question-answer global query matching module in a knowledge question-answering device based on multi-agent technology according to an embodiment of the present application. Figure 4As shown, the question global-answer global query matching module 150 includes: a question description-sub-question answer semantic feature distribution difference energy coefficient calculation unit 151, which is used to calculate the feature distribution difference energy coefficient between the question description semantic encoding feature vector and each initial sub-question answer semantic row vector in the initial key matrix to obtain a set of question description-sub-question answer semantic feature distribution difference energy coefficients; a sub-question answer semantic row vector updating unit 152, which is used to compare each question description-sub-question answer semantic feature distribution difference energy coefficient in the set of question description-sub-question answer semantic feature distribution difference energy coefficients with a predetermined threshold, and in response to the question description-sub-question answer semantic feature distribution difference energy coefficient being less than the predetermined threshold, update the question description-sub-question answer semantic feature distribution difference energy coefficient with the mean value between the initial sub-question answer semantic row vector corresponding to the question description-sub-question answer semantic feature distribution difference energy coefficient and the question description semantic encoding feature vector. The value is used as the updated sub-question answer semantic row vector to obtain the updated sub-question answer semantic key matrix; the question description semantic feature embedding unit 153 is used to use the value embedding matrix to process the question description semantic encoding feature vector to obtain the question description semantic value vector; the question description-sub-question answer semantic cross-domain query unit 154 is used to input the question description semantic encoding feature vector as the query vector, each updated sub-question answer semantic row vector in the updated sub-question answer semantic key matrix as the key vector and the question description semantic value vector into a cross-domain attention gate query module based on the Transformer structure to obtain a set of question description-sub-question answer semantic cross-domain query attention vectors; the question global-answer global query matching semantic representation generation unit 155 is used to calculate the positional mean vector of the set of question description-sub-question answer semantic cross-domain query attention vectors to obtain the question global-answer global query matching semantic representation vector.
[0048] More specifically, Figure 5 FIG. 1 is a block diagram of a question description-sub-question answer semantic feature distribution difference energy coefficient calculation unit in a knowledge question answering device based on multi-agent technology according to an embodiment of the present application. Figure 5As shown, the question description-sub-question answer semantic feature distribution difference energy coefficient calculation unit 151 includes: a question description-sub-question answer semantic association interaction sub-unit 1511, which is used to calculate the semantic association interaction vector between the question description semantic encoding feature vector and each initial sub-question answer semantic row vector in the initial key matrix to obtain a set of question description-sub-question answer semantic association interaction vectors; a question description-sub-question answer interaction feature energy coefficient calculation sub-unit 1512, which is used to calculate the feature distribution difference energy coefficient of each question description-sub-question answer semantic association interaction vector in the set of question description-sub-question answer semantic association interaction vectors to obtain a set of question description-sub-question answer semantic feature distribution difference energy coefficients, wherein the feature distribution difference energy coefficients of each question description-sub-question answer semantic association interaction vector are related to the maximum value, mean and variance of each question description-sub-question answer semantic association interaction vector.
[0049] More specifically, in an embodiment of the present application, the question description-sub-question answer semantic association interaction sub-unit is used to: respectively calculate the positional difference, positional dot product and positional addition between the question description semantic encoding feature vector and the initial sub-question answer semantic row vector to obtain a question description-sub-question answer semantic differential vector, a question description-sub-question answer semantic dot product vector and a question description-sub-question answer semantic sum vector; cascade the question description-sub-question answer semantic differential vector, the question description-sub-question answer semantic dot product vector and the question description-sub-question answer semantic sum vector, and then perform one-dimensional convolution encoding to obtain a question description-sub-question answer semantic multi-dimensional fusion vector; perform local window-based maximum pooling processing on the question description-sub-question answer semantic multi-dimensional fusion vector to obtain the question description-sub-question answer semantic association interaction vector.
[0050] More specifically, in an embodiment of the present application, the question description-sub-question answer interaction feature energy coefficient calculation subunit is used to: respectively extract the maximum value of the question description-sub-question answer semantic association interaction vector to obtain the question description-sub-question answer semantic association interaction maximum value; respectively calculate the mean and variance of the question description-sub-question answer semantic association interaction vector to obtain the question description-sub-question answer semantic association interaction mean and the question description-sub-question answer semantic association interaction variance; add the question description-sub-question answer semantic association interaction variance and a hyperparameter to obtain the question description-sub-question answer semantic association interaction first difference energy coefficient; calculate the question description-sub-question answer semantic association interaction maximum value and the question description-sub-question answer semantic association interaction variance; The square of the difference between the mean values of the question-answer semantic association interaction is used to obtain the question description-sub-question answer semantic difference value; the question description-sub-question answer semantic association interaction variance is multiplied by a constant of two to obtain a modulated question description-sub-question answer semantic association interaction variance; the question description-sub-question answer semantic difference value and the modulated question description-sub-question answer semantic association interaction variance are added to the hyperparameter to obtain the question description-sub-question answer semantic association interaction second difference energy coefficient; the question description-sub-question answer semantic association interaction first difference energy coefficient is divided by the question description-sub-question answer semantic association interaction second difference energy coefficient to obtain the question description-sub-question answer semantic feature distribution difference energy coefficient.
[0051] More specifically, in an embodiment of the present application, the question description semantic feature embedding unit is used to: after matrix multiplication of the question description semantic encoding feature vector and the value embedding matrix, add the obtained question description semantic embedding vector and the value bias vector by position to obtain the question description semantic value vector.
[0052] More specifically, in an embodiment of the present application, the question description-sub-question answer semantic cross-domain query unit is used to: calculate the product between the question description semantic encoding feature vector and the transposed vector of the updated sub-question answer semantic row vector to obtain a question description-updated sub-question answer semantic association matrix, and then divide the question description-updated sub-question answer semantic association matrix by the square root of the length of the updated sub-question answer semantic row vector by position to obtain a question description-updated sub-question answer semantic modulation matrix; input the question description-updated sub-question answer semantic modulation matrix into a softmax function to obtain a question description-updated sub-question answer semantic activation matrix; multiply the question description-updated sub-question answer semantic activation matrix by the question description semantic value vector to obtain the question description-sub-question answer semantic cross-domain query attention vector.
[0053] In the embodiment of the present application, specifically, the question global-answer global query matching module is used to: use the question description semantic encoding feature vector as the query feature vector and the feature matrix composed of the set of sub-question answer semantic encoding feature vectors as the initial key matrix, input the query feature vector and the initial key matrix into the cross-domain feature gated query system driven by the local association of the key matrix, and process it with the following cross-domain gated query to obtain the question global-answer global query matching semantic representation vector; wherein, the cross-domain gated query formula is:
[0054]
[0055] v v =v q W q +b q
[0056]
[0057] Among them, k i is the semantic row vector of the answer to the ith initial sub-question in the initial key matrix, v q is the semantic encoding feature vector describing the question, ⊙ and are position difference, position point multiplication and position addition respectively, [·,·,·] is cascade processing, conv1D(·) is a one-dimensional convolutional encoding operation, MaxPool(·) is a maximum pooling operation, R i is the i-th question description-sub-question answer semantic association interaction vector in the set of question description-sub-question answer semantic association interaction vectors, max(·) is the maximum value of the extracted vector, μ i and σ i 2 R i The mean and variance of , α is a hyperparameter, e(R i ) is the i-th question description-sub-question answer semantic feature distribution difference energy coefficient in the set of question description-sub-question answer semantic feature distribution difference energy coefficients, ε is a predetermined threshold, M i The updated sub-question answer semantic key matrix, k i ' is the i-th updated sub-question answer semantic row vector in the updated sub-question answer semantic key matrix, W q and b q are the value embedding matrix and value bias vector, respectively, v v is the semantic value vector describing the question, k i ' T k i', d is the length of the semantic row vector of each updated sub-question answer, softmax(·) is the softmax function, v pi is the i-th question description-sub-question answer semantic cross-domain query attention vector in the set of question description-sub-question answer semantic cross-domain query attention vectors, n is the number of vectors in the set of question description-sub-question answer semantic cross-domain query attention vectors, v p is the question global-answer global query matching semantic representation vector.
[0058] In an embodiment of the present application, the answer text generation module 160 is used to obtain the answer text based on the question global-answer global query matching semantic representation vector. Specifically, in an embodiment of the present application, the answer text generation module is used to: input the question global-answer global query matching semantic representation vector into a decoder-based answer generator to obtain the answer text. That is, the question global-answer global query matching semantic representation vector obtained by performing local cross-domain query matching using the set of the question description semantic encoding feature vector and the sub-question answer semantic encoding feature vector is processed to automatically generate the answer text. In this way, the complexity and diversity of professional field knowledge can be effectively dealt with, and at the same time, the user's question intention and context can be understood more accurately, and answers that better meet user needs can be provided, thereby improving the accuracy and efficiency of the question-answering device in handling complex questions and realizing the intelligence of knowledge question-answering.
[0059] In particular, since the set of the question description semantic encoding feature vector and the set of sub-question answer semantic encoding feature vectors respectively represent the encoded semantic features of the question description and the set of sub-question answers, when they are input into the cross-domain feature gated query system driven by the local association of the key matrix, the local association differences of the key matrix attributed to the differences in the distribution of the encoded semantic features will also cause differences in driven queries across the text semantic space, so that the question global-answer global query matching semantic representation vector will also have a diversified set expression distribution of cross-domain query aggregation features. Therefore, it is expected to improve the balance between the accuracy and completeness of the regression mapping when the question global-answer global query matching semantic representation vector is input into the decoder-based answer generator for decoding regression, thereby improving the semantic accuracy of the obtained answer text.
[0060] In a preferred example, inputting the question global-answer global query matching semantic representation vector into the decoder-based answer generator to obtain the answer text includes: determining the question global-answer global query matching semantic maximum eigenvalue and the question global-answer global query matching semantic minimum eigenvalue of the question global-answer global query matching semantic representation vector; calculating the question global-answer global query matching semantic mean and the question global-answer global query matching semantic standard deviation of the feature set of the question global-answer global query matching semantic representation vector, and calculating the quotient of the question global-answer global query matching semantic mean and the question global-answer global query matching semantic standard deviation to obtain the question global-answer global query matching semantic statistical normalization value; calculating the inverse of each eigenvalue of the question global-answer global query matching semantic representation vector, and quotient it with the question global-answer global query matching semantic maximum eigenvalue. After multiplying the value by the difference between the minimum eigenvalue of the question global-answer global query matching semantics, the value is subtracted from the statistical normalized value of the question global-answer global query matching semantics to obtain the question global-answer global query matching semantics distribution approximation vector; an exponential function with the natural constant e as the base and each eigenvalue of the question global-answer global query matching semantics distribution approximation vector as the exponent is calculated to obtain the question global-answer global query matching semantics distribution class approximation vector; the question global-answer global query matching semantics distribution class approximation vector is dot-added with the question global-answer global query matching semantics statistical normalized value, and the base-two logarithm of the absolute value of each eigenvalue of the dot-added vector is calculated to obtain the optimized question global-answer global query matching semantics representation vector; the optimized question global-answer global query matching semantics representation vector is input into a decoder-based temperature compensation adaptive controller to obtain a control instruction.
[0061] The optimized representation of the question global-answer global query matching semantic representation vector is:
[0062] V'=log|η⊕V e |
[0063]
[0064] δ=v max -v min
[0065] Where V is the semantic representation vector of the question global-answer global query matching, μ and σ are the semantic mean of the question global-answer global query matching and the semantic standard deviation of the question global-answer global query matching, respectively, v max and v minare the maximum semantic feature value of the question global-answer global query matching and the minimum semantic feature value of the question global-answer global query matching, η is the statistical normalization value of the question global-answer global query matching semantics, and δ is the difference between the maximum semantic feature value of the question global-answer global query matching and the minimum semantic feature value of the question global-answer global query matching, log is the logarithm with base 2, exp represents the natural exponential function, ⊙ represents the point multiplication by position, Indicates point-by-point subtraction, V e Represents the global question-answer global query matching semantic distribution class approximation vector, V ⊙-1 To calculate the inverse of each eigenvalue of the question global-answer global query matching semantic representation vector, ⊕ represents point-by-point addition, and V' represents the optimized question global-answer global query matching semantic representation vector.
[0066] Here, by performing random statistical normalization on the diversified feature set of the question global-answer global query matching semantic representation vector, the confidence space constructed based on the overall feature value of the question global-answer global query matching semantic representation vector is approximated by the standardized continuous probability density distribution relative to the response hypothesis test of each feature value of the question global-answer global query matching semantic representation vector, thereby establishing the target reachability of the diversified feature distribution of the question global-answer global query matching semantic representation vector to the unified regression target, so as to achieve the balanced executableness between mapping accuracy and mapping completeness in the decoding regression process based on the diversified feature distribution of the question global-answer global query matching semantic representation vector, and improve the semantic accuracy of the answer text obtained by the question global-answer global query matching semantic feature input to the decoder-based answer generator. In this way, the complexity and diversity of professional field knowledge can be effectively dealt with, and the user's question intention and context can be understood more accurately, and answers that better meet user needs can be provided, thereby improving the accuracy and efficiency of the question-answering device in processing complex questions and realizing the intelligence of knowledge question-answering.
[0067] In summary, the knowledge question-answering device 100 based on multi-agent technology according to the embodiment of the present application is explained, which uses text processing and analysis technology based on multi-agent and natural language to semantically encode the question description input by the user, and performs agent-based answer generation and semantic understanding on each question sub-question obtained by decomposing the question description, so as to automatically generate the answer text according to the query matching representation between the semantic features of the question description and the semantic features of the answers to each sub-question. In this way, the complexity and diversity of professional field knowledge can be effectively dealt with, and at the same time, the user's question intention and context can be understood more accurately, and answers that better meet the user's needs can be provided, thereby improving the accuracy and efficiency of the question-answering device in handling complex questions and enhancing the intelligence level of knowledge question-answering.
[0068] As described above, the knowledge question and answer device 100 based on multi-agent technology according to the embodiment of the present application can be implemented in various terminal devices, such as a server for knowledge question and answer based on multi-agent technology. In one example, the knowledge question and answer device 100 based on multi-agent technology according to the embodiment of the present application can be integrated into the terminal device as a software module and / or a hardware module. For example, the knowledge question and answer device 100 based on multi-agent technology can be a software module in the operating system of the terminal device, or can be an application developed for the terminal device; of course, the knowledge question and answer device 100 based on multi-agent technology can also be one of the many hardware modules of the terminal device.
[0069] Alternatively, in another example, the knowledge question and answer apparatus 100 based on multi-agent technology and the terminal device may also be separate devices, and the knowledge question and answer apparatus 100 based on multi-agent technology may be connected to the terminal device via a wired and / or wireless network and transmit interactive information in accordance with an agreed data format.
[0070] Figure 6 FIG. 1 is a flow chart of a knowledge question answering method based on multi-agent technology according to an embodiment of the present application. Figure 6As shown, in the knowledge question answering method based on multi-agent technology, it includes: S110, obtaining a question description input by a user; S120, decomposing the question description into questions and inputting them into the answer generator respectively to obtain a set of sub-question answers; S130, semantically encoding each sub-question answer in the set of sub-question answers to obtain a set of sub-question answer semantic encoding feature vectors; S140, semantically encoding the question description to obtain a question description semantic encoding feature vector; S150, using the question description semantic encoding feature vector as a query feature vector and a feature matrix composed of a set of sub-question answer semantic encoding feature vectors as an initial key matrix, inputting the query feature vector and the initial key matrix into a cross-domain feature gated query system driven by local association of key matrices to obtain a question global-answer global query matching semantic representation vector; S160, obtaining an answer text based on the question global-answer global query matching semantic representation vector.
[0071] Here, those skilled in the art can understand that the specific operations of each step in the above-mentioned knowledge question answering method based on multi-agent technology have been referred to above. Figures 1 to 5 The invention has been introduced in detail in the description of the knowledge question answering device based on multi-agent technology, and therefore, its repeated description will be omitted.
[0072] In summary, the knowledge question-answering method based on multi-agent technology based on the embodiment of the present application is explained, which uses text processing and analysis technology based on multi-agent and natural language to semantically encode the question description input by the user, and performs agent-based answer generation and semantic understanding on each question sub-question obtained by decomposing the question description, so as to automatically generate the answer text according to the query matching representation between the semantic features of the question description and the semantic features of the answers to each sub-question. In this way, it can effectively cope with the complexity and diversity of professional field knowledge, and at the same time, it can more accurately understand the user's question intention and context, and provide answers that better meet the user's needs, thereby improving the accuracy and efficiency of the question-answering device in handling complex problems and enhancing the intelligence level of knowledge question-answering.
[0073] In the several embodiments provided in this application, it should be understood that the disclosed device or method can be implemented in other ways. For example, the system embodiment described above is only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0074] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0075] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0076] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the spirit or essential features of the present application.
Claims
1. A knowledge question-answering device based on multi-agent technology, characterized in that: include: A question description data collection module is used to obtain the question description input by the user; A question description decomposition answer generation module is used to decompose the question description and input the decomposition into the answer generator to obtain a set of sub-question answers; A sub-question answer semantic encoding module, used for semantically encoding each sub-question answer in the set of sub-question answers to obtain a set of sub-question answer semantic encoding feature vectors; A question description semantic encoding module, used for semantically encoding the question description to obtain a question description semantic encoding feature vector; A question global-answer global query matching module, used to use the question description semantic encoding feature vector as a query feature vector and a feature matrix composed of a set of sub-question answer semantic encoding feature vectors as an initial key matrix, and input the query feature vector and the initial key matrix into a cross-domain feature gated query system driven by key matrix local association to obtain a question global-answer global query matching semantic representation vector; The answer text generation module is used to obtain the answer text based on the question global-answer global query matching semantic representation vector.
2. The knowledge question-answering device based on multi-agent technology according to claim 1 is characterized in that: The question description disassembly answer generation module includes: A question description problem decomposition unit, used to decompose the question description to obtain a set of question sub-questions; The sub-question answer generating unit is used to input each question sub-question in the set of question sub-questions into the agent-based answer generator to obtain the set of sub-question answers.
3. The knowledge question-answering device based on multi-agent technology according to claim 2 is characterized in that: The question global-answer global query matching module includes: A question description-sub-question answer semantic feature distribution difference energy coefficient calculation unit, used to calculate the feature distribution difference energy coefficient between the question description semantic encoding feature vector and each initial sub-question answer semantic row vector in the initial key matrix to obtain a set of question description-sub-question answer semantic feature distribution difference energy coefficients; a sub-question answer semantic row vector updating unit, configured to compare each question description-sub-question answer semantic feature distribution difference energy coefficient in the set of question description-sub-question answer semantic feature distribution difference energy coefficients with a predetermined threshold, and in response to the question description-sub-question answer semantic feature distribution difference energy coefficient being less than the predetermined threshold, using a mean vector between an initial sub-question answer semantic row vector corresponding to the question description-sub-question answer semantic feature distribution difference energy coefficient and the question description semantic encoding feature vector as an updated sub-question answer semantic row vector to obtain an updated sub-question answer semantic key matrix; A question description semantic feature embedding unit, used for processing the question description semantic encoding feature vector using a value embedding matrix to obtain a question description semantic value vector; A question description-sub-question answer semantic cross-domain query unit, used to input the question description semantic encoding feature vector as a query vector, each updated sub-question answer semantic row vector in the updated sub-question answer semantic key matrix as a key vector, and the question description semantic value vector into a cross-domain attention gate query module based on a Transformer structure to obtain a set of question description-sub-question answer semantic cross-domain query attention vectors; The question global-answer global query matching semantic representation generation unit is used to calculate the positional mean vector of the set of question description-sub-question answer semantic cross-domain query attention vectors to obtain the question global-answer global query matching semantic representation vector.
4. The knowledge question-answering device based on multi-agent technology according to claim 3 is characterized in that: The question description-sub-question answer semantic feature distribution difference energy coefficient calculation unit includes: A question description-sub-question answer semantic association interaction subunit, used to calculate the semantic association interaction vector between the question description semantic encoding feature vector and each initial sub-question answer semantic row vector in the initial key matrix to obtain a set of question description-sub-question answer semantic association interaction vectors; The question description-sub-question answer interaction feature energy coefficient calculation subunit is used to calculate the feature distribution difference energy coefficient of each question description-sub-question answer semantic association interaction vector in the set of question description-sub-question answer semantic association interaction vectors to obtain the set of question description-sub-question answer semantic feature distribution difference energy coefficients, wherein the feature distribution difference energy coefficient of each question description-sub-question answer semantic association interaction vector is related to the maximum value, mean and variance of each question description-sub-question answer semantic association interaction vector.
5. The knowledge question-answering device based on multi-agent technology according to claim 4 is characterized in that: The question description-sub-question answer semantic association interaction sub-unit is used to: Respectively calculating the positional difference, positional dot product and positional addition between the question description semantic encoding feature vector and the initial sub-question answer semantic row vector to obtain a question description-sub-question answer semantic difference vector, a question description-sub-question answer semantic dot product vector and a question description-sub-question answer semantic sum vector; The question description-sub-question answer semantic difference vector, the question description-sub-question answer semantic dot product vector and the question description-sub-question answer semantic sum vector are cascaded and then one-dimensional convolutional coding is performed to obtain a question description-sub-question answer semantic multi-dimensional fusion vector; The question description-sub-question answer semantic multi-dimensional fusion vector is subjected to a local window-based maximum pooling process to obtain the question description-sub-question answer semantic association interaction vector.
6. The knowledge question-answering device based on multi-agent technology according to claim 5 is characterized in that: The question description-sub-question answer interactive characteristic energy coefficient calculation subunit is used to: Extracting the maximum values of the question description-sub-question answer semantic association interaction vectors respectively to obtain the question description-sub-question answer semantic association interaction maximum value; Calculating the mean and variance of the question description-sub-question answer semantic association interaction vector respectively to obtain the question description-sub-question answer semantic association interaction mean and the question description-sub-question answer semantic association interaction variance; Adding the question description-sub-question answer semantic association interaction variance and the hyperparameter to obtain the question description-sub-question answer semantic association interaction first difference energy coefficient; Calculate the square of the difference between the maximum value of the question description-sub-question answer semantic association interaction and the mean value of the question description-sub-question answer semantic association interaction to obtain a question description-sub-question answer semantic difference value; Multiplying the question description-sub-question answer semantic association interaction variance by a constant of two to obtain a modulated question description-sub-question answer semantic association interaction variance; Adding the question description-sub-question answer semantic difference value and the modulated question description-sub-question answer semantic association interaction variance to the hyperparameter to obtain the question description-sub-question answer semantic association interaction second difference energy coefficient; The first difference energy coefficient of the question description-sub-question answer semantic association interaction is divided by the second difference energy coefficient of the question description-sub-question answer semantic association interaction to obtain the question description-sub-question answer semantic feature distribution difference energy coefficient.
7. The knowledge question-answering device based on multi-agent technology according to claim 6 is characterized in that: The question description semantic feature embedding unit is used to: after matrix multiplication of the question description semantic encoding feature vector and the value embedding matrix, add the obtained question description semantic embedding vector and the value bias vector by position to obtain the question description semantic value vector.
8. The knowledge question-answering device based on multi-agent technology according to claim 7 is characterized in that: The question description-sub-question answer semantic cross-domain query unit is used to: After calculating the product between the question description semantic encoding feature vector and the transposed vector of the updated sub-question answer semantic row vector to obtain a question description-updated sub-question answer semantic association matrix, the question description-updated sub-question answer semantic association matrix and the square root of the length of the updated sub-question answer semantic row vector are divided by position to obtain a question description-updated sub-question answer semantic modulation matrix; Input the question description-updated sub-question answer semantic modulation matrix into a softmax function to obtain a question description-updated sub-question answer semantic activation matrix; The question description-updated sub-question answer semantic activation matrix is multiplied by the question description semantic value vector to obtain the question description-sub-question answer semantic cross-domain query attention vector.
9. The knowledge question-answering device based on multi-agent technology according to claim 8, characterized in that: The answer text generation module is used to: input the question global-answer global query matching semantic representation vector into the decoder-based answer generator to obtain the answer text.
10. A knowledge question answering method based on multi-agent technology, characterized in that: include: Get the question description entered by the user; Decomposing the question description into sub-questions and inputting them into the answer generator respectively to obtain a set of sub-question answers; Performing semantic coding on each sub-question answer in the set of sub-question answers to obtain a set of semantic coding feature vectors of the sub-question answers; Performing semantic encoding on the question description to obtain a semantic encoding feature vector of the question description; Using the question description semantic encoding feature vector as the query feature vector and the feature matrix composed of the set of sub-question answer semantic encoding feature vectors as the initial key matrix, the query feature vector and the initial key matrix are input into a cross-domain feature gated query system driven by key matrix local association to obtain a question global-answer global query matching semantic representation vector; Based on the question global-answer global query matching semantic representation vector, the answer text is obtained.
Citation Information
Cited By
Multi-dimensional power failure accurate studying and judging method
CN119226978A
Children psychological counseling auxiliary system and method based on large language model
CN119418870A
Power grid optimization scheduling method and system based on intelligent optimization algorithm
CN119476649A
Platform management method, terminal and storage medium
CN119987923A
