Answer generation system based on confidence verification

By introducing confidence checksum graph structure construction technology into the answer generation system, the problems of inaccurate answers and insufficient credibility in traditional systems are solved, and more accurate, reliable and multi-dimensional answer generation is achieved.

CN120106218APending Publication Date: 2025-06-06SHANGHAI XINBOTE INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510171891.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-17
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

The traditional answer generation system lacks deep understanding of the questions and semantic multi-angle capture, which leads to inaccurate answers that may be answered inaccurately, and often lacks an effective verification mechanism, resulting in insufficient accuracy and credibility of the answers.

Method used

A response generation system based on confidence verification is adopted to construct a question-enlarged graph structure through a graph structure construction unit, generate multiple question prompt texts, and use the confidence verification unit to classify and calculate the text of multiple answer texts to filter out the main answer text that best meets the intent of the question, and optimize it through clause classification and merging units.

Benefits of technology

It significantly improves the accuracy and reliability of the answers, ensures the completeness and accuracy of the answers, reduces the generation of error messages, improves the credibility of the answers, and enhances the depth of the question understanding and the diversity of the answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120106218A_ABST
    Figure CN120106218A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of large language generation, in particular to an answer generation system based on confidence verification, which comprises a graph structure construction unit, a question generation unit, an answer generation unit, a confidence verification unit, a clause classification unit and a clause merging unit, and is characterized in that the graph structure construction unit is used for obtaining a question text of a target user; performing word segmentation on the question text to obtain a question word sequence corresponding to the question text, and constructing a question expansion graph structure based on the question word sequence and a preset question knowledge base. According to the method, the multiple answer texts are classified through the confidence verification unit, the similarity between the answer texts and the question texts is calculated, the main answer text most conforming to the question intention is screened out, the mechanism effectively avoids common questions which cannot be answered in a traditional answer generation system, and the answer accuracy and reliability are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of large language generation, and in particular to an answer generation system based on confidence verification. Background Art

[0002] Confidence verification refers to the process of evaluating and verifying the credibility of the results through some mechanism after the system generates or infers the results. The purpose of this process is to ensure that the generated answers or inferences meet a preset standard in terms of accuracy and reliability.

[0003] Traditional systems often generate answers based only on question text, lacking in-depth understanding of the questions and multi-angle capture of semantics. Therefore, the generated answers may not accurately solve the user's actual problems and often give irrelevant answers. Traditional systems are usually based on a single text generation model, and the output answers are often simple and single, lacking multi-angle explanations and rich information. Since they fail to effectively utilize multi-dimensional information and multiple question prompts, the answers are prone to being one-sided or incomplete. In addition, since traditional systems do not have an effective verification mechanism in the answer generation process, they are often unable to filter out the most relevant content from multiple generated answers, resulting in insufficient accuracy and credibility of the final answer. Traditional systems are prone to generating erroneous information and lack effective screening and optimization methods. Traditional systems often simply generate answers based on keywords and surface semantics and are unable to deeply understand and process the multi-dimensional information of the question, which makes traditional systems less effective in dealing with complex problems and prone to missing certain important aspects of the problem. Summary of the invention

[0004] The technical problem to be solved by the present invention is to overcome the shortcomings of the above-mentioned prior art and provide an answer generation system based on confidence verification.

[0005] The technical solution adopted to solve the above technical problems is: an answer generation system based on confidence verification, including a graph structure construction unit, a question generation unit, an answer generation unit, a confidence verification unit, a clause classification unit and a clause merging unit, specifically:

[0006] The graph structure construction unit is used to obtain a question text of a target user, perform word segmentation on the question text to obtain a question word sequence corresponding to the question text, and construct a question expansion graph structure based on the question word sequence and a preset question knowledge base;

[0007] The question generation unit is used to generate questions for the question expansion graph structure based on a pre-trained question generation model at a preset time interval to obtain a plurality of question prompt texts corresponding to the question text;

[0008] The answer generation unit is used to input the multiple question prompt texts into a pre-trained large language model, and output multiple answer texts corresponding to the multiple question prompt texts based on the large language model;

[0009] The confidence verification unit is used to perform text classification on the multiple answer texts to obtain text type labels of the multiple answer texts, calculate the first similarity between the text type labels of the multiple answer texts and the question text, and perform confidence verification on the multiple answer texts based on the first similarity to obtain the main answer text.

[0010] Preferably, the clause classification unit is used to perform sentence segmentation on the answer texts whose first similarity is higher than a preset first similarity threshold to obtain a clause sequence corresponding to the remaining answer texts, perform clause classification on the clause sequence to obtain a clause type label sequence corresponding to the clause sequence, and calculate a second similarity between the clause type label sequence and the question text;

[0011] The clause merging unit is used to add the clauses corresponding to the second similarities higher than the preset second similarity threshold to the corresponding positions in the main answer text to obtain the final answer text.

[0012] Preferably, the question expansion graph structure includes a node set and a relationship edge set, wherein the node set includes question words, question knowledge base table names and question knowledge base column names, and the relationship edge set includes the relationship between the question words and the question knowledge base table names, the relationship between the question words and the question knowledge base column names, and the relationship between the question knowledge base table names and the question knowledge base column names, wherein the relationship between the question words and the question knowledge base table names includes whether the question words match the question knowledge base table names, the relationship between the question words and the question knowledge base column names includes whether the question words match the question knowledge base column names, and the relationship between the question knowledge base table names and the question knowledge base column names is a database relationship.

[0013] Preferably, the question generation is performed on the question expansion graph structure based on a pre-trained question generation model to obtain a question prompt text corresponding to the question text, including:

[0014] Calculate the path length from each node to other nodes in the problem expansion graph structure based on a breadth-first search algorithm;

[0015] The nodes whose path length is 1 are retained, the nodes whose path length is not 1 are deleted, the relationship edge types between the nodes whose path length is 1 are deleted, and the link relationship between the nodes whose path length is 1 is retained, so as to obtain a node subgraph corresponding to the problem expansion graph structure;

[0016] Deleting the node types of the nodes in the problem expansion graph structure to obtain a relationship edge subgraph corresponding to the problem expansion graph structure;

[0017] Question generation is performed on the node subgraph and the relationship edge subgraph corresponding to the question expansion graph structure based on a pre-trained question generation model to obtain a question prompt text corresponding to the question text.

[0018] Preferably, the question generation model includes an encoder and a decoder, wherein the encoder extracts the first node features of the nodes in the node subgraph through a first graph neural network, extracts the second node features of the nodes in the relationship edge subgraph through a second graph neural network, and aggregates the first node features and the second node features through a third graph neural network to obtain the aggregate features of the nodes in the question expansion graph structure, and the decoder uses a Transformer to pass the aggregate features of the nodes to each layer of the Transformer after position encoding, and each layer of the Transformer uses a multi-head self-attention mechanism to process the current input and adjust the attention distribution according to the output of the encoder.

[0019] Preferably, the calculation formula of the first node feature is as follows:

[0020]

[0021] in, represents the first node feature after the information of the lth layer of nodes in the first graph neural network is aggregated, σ represents a nonlinear function, N i Represents node v i The neighborhood set, W o and W k represents the learnable weight matrix;

[0022] The calculation formula of the second node feature is as follows:

[0023] ;

[0025] in, Represents the second node feature after the l-th layer node information aggregation in the second graph neural network, Represents node v i The neighbor relationship edge of Represents the relationship edge r j Neighborhood nodes, W q and W k represents the learnable weight matrix, |N(r j )| represents node v i The number of nodes connected by the neighbor relationship edge.

[0026] Preferably, the calculation formula of the aggregation feature is as follows:

[0027]

[0028] in, represents the aggregated features after the information of the l+1th layer nodes in the third graph neural network is aggregated, W v represents the learnable weight matrix, d z represents the dimension of aggregated features, H represents the number of attention heads, Represents the l-1th layer node v in the three-graph neural network i and node v j The relationship edge features.

[0029] Preferably, performing text classification on the plurality of answer texts to obtain text type labels of the plurality of answer texts includes:

[0030] Performing a word segmentation operation on the answer text to obtain a set of answer word segments corresponding to the answer text;

[0031] The answer word segmentation in the answer word segmentation set is vector-encoded to obtain a word segmentation vector, and the word segmentation vector is input into the BERT pre-training model to obtain the output vector of each layer of the BERT pre-training model, and the CLS vector is taken from the output vector. The output vector expression is as follows:

[0032]

[0033] Among them, l i represents the output vector of each layer of the BERT pre-trained model, I(x) represents the vector encoding of the answer word in the answer word set, represents the word segmentation vector, f bert represents the BERT pre-trained model, i represents the number of layers in the BERT pre-trained model;

[0034] The CLS vector of the first layer in the BERT pre-trained model is deleted, and the CLS vectors of the remaining layers in the BERT pre-trained model are concatenated to obtain a coding vector, and the coding vector expression is as follows:

[0035]

[0036] Where L represents the encoding vector, Represents the CLS vectors of the remaining layers in the BERT pre-trained model;

[0037] The encoded vector is input into the Bi-LSTM model to obtain feature information, and the feature information is fused with the output vector of the BERT pre-trained model, and a vector representation is obtained through a fully connected layer network, and the vector representation is input into the Softmax classifier to obtain a predicted label distribution;

[0038] A text type label of the answer text is obtained based on the predicted label distribution.

[0039] Preferably, calculating the first similarity between the text type labels of the plurality of answer texts and the question text comprises:

[0040] Performing a word segmentation operation on the text type label and the question text to obtain a label word segmentation sequence corresponding to the text type label and a question word segmentation sequence corresponding to the question text;

[0041] Sequencing the label word segmentation sequence and the question word segmentation sequence based on the Word2vec model to obtain a first word vector matrix of the label word segmentation sequence and a second word vector matrix of the question word segmentation sequence;

[0042] Interacting the first word vector matrix with the second word vector matrix to obtain a first interactive attention matrix corresponding to the first word vector matrix and a second interactive attention matrix corresponding to the second word vector matrix;

[0043] The first word vector matrix and the first interaction attention matrix are matrix-concatenated to obtain a first concatenated matrix, and the second word vector matrix and the second interaction attention matrix are matrix-concatenated to obtain a second concatenated matrix.

[0044] Preferably, calculating the first similarity between the text type labels of the plurality of answer texts and the question text further includes:

[0045] Inputting the first splicing matrix and the second splicing matrix into a Transformer model respectively, and outputting a first text feature of the first splicing matrix and a second text feature of the second splicing matrix based on the Transformer model;

[0046] One-dimensionalizing the first text feature and the second text feature based on a fully connected layer to obtain a first semantic feature and a second semantic feature;

[0047] Calculating a difference and a product of the first semantic feature and the second semantic feature, and concatenating the difference and the product to obtain a fusion feature;

[0048] The fused features are processed based on a two-layer fully connected network to obtain a first similarity between the text type label and the question text, wherein the first layer of the fully connected network adopts a ReLU activation function and the second layer of the fully connected network adopts a Softmax normalization function.

[0049] The beneficial effects of the present invention are as follows: (1) The present invention classifies multiple answer texts through a confidence verification unit, calculates their similarity with the question text, and selects the main answer text that best meets the question intent. This mechanism effectively avoids the common problem of irrelevant answers in traditional answer generation systems, and significantly improves the accuracy and reliability of the answers. Moreover, through the clause classification and clause merging units, the system further optimizes the main answer text and adds highly similar clauses to the main answer to ensure the integrity and accuracy of the answer content. This multi-round verification mechanism can effectively reduce the generation of erroneous information and improve the credibility of the answers. (2) The present invention constructs a question expansion graph structure through a graph structure construction unit by combining the question word sequence with the question knowledge base, which can capture the multi-dimensional information of the question. This structure not only It enhances the depth of question understanding and provides richer contextual information for subsequent question generation and answer generation. The question generation unit generates multiple question prompt texts based on the question expansion graph structure, ensuring that the answer generation unit can understand the question from different angles and generate diverse answers. This multi-angle generation mechanism significantly improves the completeness and richness of the answer. (3) The present invention further enriches the answer content by adding highly similar clauses to the main answer text through the clause merging unit, avoiding the limitations of a single answer and ensuring that users can obtain comprehensive and detailed answers. Through the question expansion graph structure and the multi-question prompt generation mechanism, the system can capture the user's personalized needs and generate answer content that meets the user's preferences. This personalized service can further improve user satisfaction and loyalty. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 A schematic diagram of the system architecture of an overall system in an embodiment of the present invention.

[0051] Figure numerals: 1. graph structure construction unit; 2. question generation unit; 3. answer generation unit; 4. confidence verification unit; 5. clause classification unit; 6. clause merging unit. DETAILED DESCRIPTION

[0052] Embodiment 1, as Figure 1 As shown, the answer generation system based on confidence verification proposed in the present invention includes a graph structure construction unit 1, a question generation unit 2, an answer generation unit 3, a confidence verification unit 4, a clause classification unit 5 and a clause merging unit 6. Specifically:

[0053] The graph structure construction unit 1 is used to obtain the question text of the target user, perform word segmentation on the question text to obtain the question word sequence corresponding to the question text, and construct the question expansion graph structure based on the question word sequence and the preset question knowledge base;

[0054] The question generation unit 2 is used to generate questions for the question expansion graph structure based on the pre-trained question generation model at a preset time interval to obtain multiple question prompt texts corresponding to the question text;

[0055] The answer generation unit 3 is used to input multiple question prompt texts into a pre-trained large language model, and output multiple answer texts corresponding to the multiple question prompt texts based on the large language model;

[0056] The confidence verification unit 4 is used to perform text classification on multiple answer texts to obtain text type labels of multiple answer texts, calculate the first similarity between the text type labels of multiple answer texts and the question text, and perform confidence verification on the multiple answer texts based on the first similarity to obtain the main answer text.

[0057] In the present invention, question text refers to the natural language question raised by the user. It is the original question form input by the system and is used for subsequent processing; word segmentation refers to the process of dividing the question text into several words. Natural language text is usually a continuous string. The purpose of word segmentation is to identify the individual words in it. This process is particularly important in Chinese, because Chinese has no obvious spaces between words. Word segmentation needs to rely on dictionaries or models to identify different words; question word sequence refers to a sequence of words obtained by word segmentation, that is, the order of each word or phrase obtained in the question text after word segmentation; the question expansion graph structure is a graph data structure used to represent various information related to the question; the question generation model is a pre-processed The trained model is used to generate questions based on the input information. These questions can be extended questions or variant questions related to the original questions, and are designed to improve the quality or coverage of answers by asking questions from multiple angles. A large language model refers to a large-scale pre-trained model such as GPT (Generative Pre-trained Transformer), which learns language rules and contextual relationships by training on large-scale text datasets. When multiple question prompt texts are input, the large language model can generate natural language answers based on its learned knowledge. Confidence verification is the process of evaluating the credibility of multiple candidate answers. It determines which answer texts are more likely to be correct based on the quality and relevance of the answers by calculating similarity and other methods, and selects the best answer text as the "main answer text."

[0058] In an optional embodiment, the clause classification unit 5 is used to perform sentence segmentation on the answer texts whose first similarity is higher than a preset first similarity threshold to obtain a clause sequence corresponding to the remaining answer texts, perform clause classification on the clause sequence to obtain a clause type label sequence corresponding to the clause sequence, and calculate a second similarity between the clause type label sequence and the question text;

[0059] The clause merging unit 6 is used to add the clauses corresponding to the second similarities higher than the preset second similarity threshold to the corresponding positions in the main answer text to obtain the final answer text.

[0060] It should be noted that a clause sequence refers to a sequence obtained by dividing an answer text into clauses. A clause is a relatively independent unit in grammatical structure, usually containing a subject and a predicate. For example, in the sentence "He likes football because he thinks football is interesting", "he likes football" and "because he thinks football is interesting" are two clauses. A clause sequence is to divide the answer text into several such clauses.

[0061] Embodiment 2: An answer generation system based on confidence verification proposed in the present invention, compared with embodiment 1, this embodiment also includes: a question expansion graph structure includes a node set and a relationship edge set, wherein the node set includes question words, question knowledge base table names and question knowledge base column names, and the relationship edge set includes the relationship between question words and question knowledge base table names, the relationship between question words and question knowledge base column names, and the relationship between question knowledge base table names and question knowledge base column names, wherein the relationship between question words and question knowledge base table names includes whether the question words match the question knowledge base table names, the relationship between question words and question knowledge base column names includes whether the question words match the question knowledge base column names, and the relationship between question knowledge base table names and question knowledge base column names is a database relationship.

[0062] In this embodiment, the question expansion graph structure is a way to model the question, knowledge base information and the relationship between them as a graph structure. This graph structure is used to represent the relationship between the question and the knowledge base, helping the system to better understand the question and provide accurate answers based on the knowledge in the database. Each element of the graph structure can be a node (such as question term, table name, column name), and the relationship edge between them (such as matching relationship, database relationship, etc.); database relationship refers to the structural relationship between different tables in the database, which describes how one table is associated with another table through columns. For example, the "user table" and the "order table" may be associated through the "user ID", which is a typical database relationship. The relationship between the question knowledge base table name and the question knowledge base column name may be the organizational structure of the table and column or the intrinsic connection in the data model.

[0063] In an optional embodiment, question generation is performed on the question expansion graph structure based on a pre-trained question generation model to obtain a question prompt text corresponding to the question text, including:

[0064] Calculate the path length from each node to other nodes in the problem expansion graph structure based on the breadth-first search algorithm;

[0065] The nodes with path length of 1 are retained, the nodes with path length not of 1 are deleted, the relationship edge types between the nodes with path length of 1 are deleted, and the link relationship between the nodes with path length of 1 is retained to obtain the node subgraph corresponding to the problem expansion graph structure;

[0066] Deleting the node type of the node in the problem expansion graph structure to obtain the relationship edge subgraph corresponding to the problem expansion graph structure;

[0067] Based on the pre-trained question generation model, question generation is performed on the node subgraph and relationship edge subgraph corresponding to the question expansion graph structure to obtain the question prompt text corresponding to the question text.

[0068] It should be noted that breadth-first search (BFS) is a graph traversal algorithm that first visits the root node in the graph and then expands outward layer by layer, visiting the nodes adjacent to the current node in turn until all nodes have been visited; the problem expansion graph is a graph structure constructed to represent various relationships between problems. Its nodes represent different elements of the problem, and the edges represent the relationships or dependencies between them. In this graph structure, each node may have different types and edges have different types (such as pointing relationships, dependency relationships, etc.).

[0069] In an optional embodiment, the question generation model includes an encoder and a decoder, wherein the encoder extracts the first node features of the nodes in the node subgraph through a first graph neural network, extracts the second node features of the nodes in the relationship edge subgraph through a second graph neural network, and aggregates the first node features and the second node features through a third graph neural network to obtain the aggregated features of the nodes in the question expansion graph structure. The decoder uses a Transformer to pass the aggregated features of the nodes to each layer of the Transformer after position encoding. Each layer of the Transformer uses a multi-head self-attention mechanism to process the current input and adjust the attention distribution according to the output of the encoder.

[0070] It should be noted that graph neural networks are a type of neural network that specializes in processing graph-structured data. Unlike traditional neural networks, graph neural networks can update the representation of nodes through the relationships between nodes. Transformer is a deep learning model based on the self-attention mechanism, which is widely used in natural language processing tasks, especially machine translation, text generation, etc. It improves the ability to model long-distance dependencies through parallel computing.

[0071] In an optional embodiment, the calculation formula of the first node feature is as follows:

[0072]

[0073] in, represents the first node feature after the information of the lth layer of nodes in the first graph neural network is aggregated, σ represents a nonlinear function, N i Represents node v i The neighborhood set, W o and W k represents the learnable weight matrix;

[0074] The calculation formula of the second node feature is as follows:

[0075]

[0076] in, Represents the second node feature after the l-th layer node information aggregation in the second graph neural network, Represents node v i The neighbor relationship edge of Represents the relationship edge r j Neighborhood nodes, W q and W k represents the learnable weight matrix, |N(r j )| represents node v i The number of nodes connected by the neighbor relationship edge.

[0077] In an optional embodiment, the calculation formula of the aggregate feature is as follows:

[0078]

[0079] in, represents the aggregated features after the information of the l+1th layer nodes in the third graph neural network is aggregated, W v represents the learnable weight matrix, d z represents the dimension of aggregated features, H represents the number of attention heads, Represents the l-1th layer node v in the three-graph neural network i and node v j The relationship edge features.

[0080] In an optional embodiment, text classification is performed on multiple answer texts to obtain text type labels of the multiple answer texts, including:

[0081] Perform word segmentation operation on the answer text to obtain a set of answer word segments corresponding to the answer text;

[0082] The answer word in the answer word set is vector-encoded to obtain the word vector, and the word vector is input into the BERT pre-trained model to obtain the output vector of each layer of the BERT pre-trained model, and the CLS vector is taken from the output vector. The output vector expression is as follows:

[0083]

[0084] Among them, l i represents the output vector of each layer of the BERT pre-trained model, I(x) represents the vector encoding of the answer word in the answer word set, represents the word segmentation vector, f bert represents the BERT pre-trained model, i represents the number of layers in the BERT pre-trained model;

[0085] The CLS vector of the first layer in the BERT pre-trained model is deleted, and the CLS vectors of the remaining layers in the BERT pre-trained model are concatenated to obtain the encoding vector. The encoding vector expression is as follows:

[0086]

[0087] Where L represents the encoding vector, Represents the CLS vectors of the remaining layers in the BERT pre-trained model;

[0088] The encoded vector is input into the Bi-LSTM model to obtain feature information, and the feature information is fused with the output vector of the BERT pre-trained model, and the vector representation is obtained through the fully connected layer network. The vector representation is input into the Softmax classifier to obtain the predicted label distribution;

[0089] The text type label of the answer text is obtained based on the predicted label distribution.

[0090] It should be noted that vector encoding is the process of converting discrete text data (such as words or characters) into digital vectors. Each word segment will be mapped to a vector in a vector space so that the model can process the text information. Common vector encoding methods include Word2Vec, GloVe, etc.; BERT is a language model based on the Transformer architecture. It uses a bidirectional self-attention mechanism to pre-train deep context representations. BERT is pre-trained with large-scale text data, and then can be fine-tuned to adapt to specific tasks such as text classification, question answering, etc.; Bi-LSTM (bidirectional long short-term memory network) is a variant of a recurrent neural network (RNN) that can simultaneously transmit and memorize information from the left and right sides of the text, thereby obtaining bidirectional contextual information; Softmax is an activation function commonly used in multi-category classification tasks, which converts the output of the model into a probability distribution.

[0091] In an optional embodiment, calculating the first similarity between the text type labels of the plurality of answer texts and the question text includes:

[0092] Perform word segmentation operations on the text type label and the question text to obtain a label word segmentation sequence corresponding to the text type label and a question word segmentation sequence corresponding to the question text;

[0093] Based on the Word2vec model, the label word segmentation sequence and the question word segmentation sequence are sequenced to obtain the first word vector matrix of the label word segmentation sequence and the second word vector matrix of the question word segmentation sequence;

[0094] Interact the first word vector matrix with the second word vector matrix to obtain a first interactive attention matrix corresponding to the first word vector matrix and a second interactive attention matrix corresponding to the second word vector matrix;

[0095] The first word vector matrix and the first interaction attention matrix are concatenated to obtain a first concatenated matrix, and the second word vector matrix and the second interaction attention matrix are concatenated to obtain a second concatenated matrix.

[0096] It should be noted that the interactive attention mechanism is a way to weight two sequences by calculating the similarity or correlation between the two sequences. In this step, the purpose is to calculate the interactive relationship between the label segmentation sequence and the question segmentation sequence. Through interactive attention, the model can find the correlation between each word in the label and question text.

[0097] In an optional embodiment, calculating the first similarity between the text type labels of the plurality of answer texts and the question text further includes:

[0098] Inputting the first concatenation matrix and the second concatenation matrix into the Transformer model respectively, and outputting the first text feature of the first concatenation matrix and the second text feature of the second concatenation matrix based on the Transformer model;

[0099] One-dimensionalizing the first text feature and the second text feature based on a fully connected layer to obtain a first semantic feature and a second semantic feature;

[0100] Calculating the difference and product of the first semantic feature and the second semantic feature, and concatenating the difference and the product to obtain a fusion feature;

[0101] The fused features are processed based on a two-layer fully connected network to obtain the first similarity between the text type label and the question text, where the first layer of the fully connected network adopts the ReLU activation function and the second layer of the fully connected network adopts the Softmax normalization function.

[0102] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited thereto, and various changes can be made within the knowledge scope of technicians in the relevant technical field without departing from the purpose of the present invention.

Claims

1. A confidence-checking-based answer generation system, characterized in that: It includes a graph structure construction unit (1), a question generation unit (2), an answer generation unit (3), a confidence verification unit (4), a clause classification unit (5) and a clause merging unit (6), specifically: The graph structure construction unit (1) is used to obtain a question text of a target user, perform word segmentation on the question text to obtain a question word sequence corresponding to the question text, and construct a question expansion graph structure based on the question word sequence and a preset question knowledge base; The question generation unit (2) is used to generate questions for the question expansion graph structure based on a pre-trained question generation model at a preset time interval, so as to obtain a plurality of question prompt texts corresponding to the question text; The answer generation unit (3) is used to input the multiple question prompt texts into a pre-trained large language model, and output multiple answer texts corresponding to the multiple question prompt texts based on the large language model; The confidence verification unit (4) is used to perform text classification on the multiple answer texts to obtain text type labels of the multiple answer texts, calculate the first similarity between the text type labels of the multiple answer texts and the question text, and perform confidence verification on the multiple answer texts based on the first similarity to obtain a main answer text.

2. The answer generation system based on confidence verification according to claim 1, characterized in that: The clause classification unit (5) is used to perform sentence segmentation on the answer texts whose first similarity is higher than a preset first similarity threshold value to obtain a clause sequence corresponding to the remaining answer texts, perform clause classification on the clause sequence to obtain a clause type label sequence corresponding to the clause sequence, and calculate a second similarity between the clause type label sequence and the question text; The clause merging unit (6) is used to add the clause corresponding to the second similarity higher than a preset second similarity threshold to the corresponding position in the main answer text to obtain a final answer text.

3. The answer generation system based on confidence verification according to claim 1, characterized in that: The problem expansion graph structure includes a node set and a relationship edge set, wherein the node set includes problem words, problem knowledge base table names and problem knowledge base column names, and the relationship edge set includes the relationship between the problem words and the problem knowledge base table names, the relationship between the problem words and the problem knowledge base column names, and the relationship between the problem knowledge base table names and the problem knowledge base column names, wherein the relationship between the problem words and the problem knowledge base table names includes whether the problem words match the problem knowledge base table names, the relationship between the problem words and the problem knowledge base column names includes whether the problem words match the problem knowledge base column names, and the relationship between the problem knowledge base table names and the problem knowledge base column names is a database relationship.

4. The answer generation system based on confidence verification according to claim 1, characterized in that: Generating questions for the question expansion graph structure based on a pre-trained question generation model to obtain question prompt text corresponding to the question text includes: Calculate the path length from each node to other nodes in the problem expansion graph structure based on a breadth-first search algorithm; The nodes whose path length is 1 are retained, the nodes whose path length is not 1 are deleted, the relationship edge types between the nodes whose path length is 1 are deleted, and the link relationship between the nodes whose path length is 1 is retained, so as to obtain a node subgraph corresponding to the problem expansion graph structure; Deleting the node types of the nodes in the problem expansion graph structure to obtain a relationship edge subgraph corresponding to the problem expansion graph structure; Question generation is performed on the node subgraph and the relationship edge subgraph corresponding to the question expansion graph structure based on a pre-trained question generation model to obtain a question prompt text corresponding to the question text.

5. The answer generation system based on confidence verification according to claim 4, characterized in that: The question generation model includes an encoder and a decoder, wherein the encoder extracts the first node features of the nodes in the node subgraph through a first graph neural network, extracts the second node features of the nodes in the relationship edge subgraph through a second graph neural network, and aggregates the first node features and the second node features through a third graph neural network to obtain the aggregated features of the nodes in the question expansion graph structure. The decoder uses a Transformer to pass the aggregated features of the nodes to each layer of the Transformer after position encoding. Each layer of the Transformer uses a multi-head self-attention mechanism to process the current input and adjusts the attention distribution according to the output of the encoder.

6. The answer generation system based on confidence verification according to claim 5, characterized in that: The calculation formula of the first node feature is as follows: in, represents the first node feature after the information of the lth layer of nodes in the first graph neural network is aggregated, σ represents a nonlinear function, N i Represents node v i The neighborhood set, W o and W k represents the learnable weight matrix; The calculation formula of the second node feature is as follows: in, Represents the second node feature after the l-th layer node information aggregation in the second graph neural network, Represents node v i The neighbor relationship edge of Represents the relationship edge r j Neighborhood nodes, W q and W k represents the learnable weight matrix, |N(r j )| represents node v i The number of nodes connected by the neighbor relationship edge.

7. The answer generation system based on confidence verification according to claim 6, characterized in that: The calculation formula of the aggregation feature is as follows: in, represents the aggregated features after the information of the l+1th layer nodes in the third graph neural network is aggregated, W v represents the learnable weight matrix, d z represents the dimension of aggregated features, H represents the number of attention heads, Represents the l-1th layer node v in the three-graph neural network i and node v j The relationship edge features.

8. The confidence-checking-based answer generation system according to claim 1, characterized in that: Performing text classification on the plurality of answer texts to obtain text type labels of the plurality of answer texts includes: Performing a word segmentation operation on the answer text to obtain a set of answer word segments corresponding to the answer text; The answer word segmentation in the answer word segmentation set is vector-encoded to obtain a word segmentation vector, and the word segmentation vector is input into the BERT pre-training model to obtain the output vector of each layer of the BERT pre-training model, and the CLS vector is taken from the output vector. The output vector expression is as follows: Among them, l i represents the output vector of each layer of the BERT pre-trained model, I(x) represents the vector encoding of the answer word in the answer word set, represents the word segmentation vector, f bert represents the BERT pre-trained model, i represents the number of layers in the BERT pre-trained model; The CLS vector of the first layer in the BERT pre-trained model is deleted, and the CLS vectors of the remaining layers in the BERT pre-trained model are concatenated to obtain a coding vector, and the coding vector expression is as follows: Where L represents the encoding vector, Represents the CLS vectors of the remaining layers in the BERT pre-trained model; The encoded vector is input into the Bi-LSTM model to obtain feature information, and the feature information is fused with the output vector of the BERT pre-trained model, and a vector representation is obtained through a fully connected layer network, and the vector representation is input into the Softmax classifier to obtain a predicted label distribution; A text type label of the answer text is obtained based on the predicted label distribution.

9. The answer generation system based on confidence verification according to claim 1, characterized in that: Calculating a first similarity between the text type labels of the plurality of answer texts and the question text comprises: Performing a word segmentation operation on the text type label and the question text to obtain a label word segmentation sequence corresponding to the text type label and a question word segmentation sequence corresponding to the question text; Sequencing the label word segmentation sequence and the question word segmentation sequence based on the Word2vec model to obtain a first word vector matrix of the label word segmentation sequence and a second word vector matrix of the question word segmentation sequence; Interacting the first word vector matrix with the second word vector matrix to obtain a first interactive attention matrix corresponding to the first word vector matrix and a second interactive attention matrix corresponding to the second word vector matrix; The first word vector matrix and the first interaction attention matrix are matrix-concatenated to obtain a first concatenated matrix, and the second word vector matrix and the second interaction attention matrix are matrix-concatenated to obtain a second concatenated matrix.

10. The answer generation system based on confidence verification according to claim 8, characterized in that: Calculating a first similarity between the text type labels of the plurality of answer texts and the question text also includes: Inputting the first splicing matrix and the second splicing matrix into a Transformer model respectively, and outputting a first text feature of the first splicing matrix and a second text feature of the second splicing matrix based on the Transformer model; One-dimensionalizing the first text feature and the second text feature based on a fully connected layer to obtain a first semantic feature and a second semantic feature; Calculating a difference and a product of the first semantic feature and the second semantic feature, and concatenating the difference and the product to obtain a fusion feature; The fused features are processed based on a two-layer fully connected network to obtain a first similarity between the text type label and the question text, wherein the first layer of the fully connected network adopts a ReLU activation function and the second layer of the fully connected network adopts a Softmax normalization function.