An Enhanced Question-Answer Matching Method for Large Language Model Question-Answer Processing
By optimizing training using a joint loss function of the sentence layer and character layer in the large language model, and combining BERT and GRU modules, the problems of high resource consumption and low efficiency in the question-answering matching process of the large language model are solved, and more efficient question-answering matching results are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NAVAL UNIV OF ENG PLA
- Filing Date
- 2026-03-31
- Publication Date
- 2026-07-03
Smart Images

Figure CN122334476A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of large language model optimization technology, and in particular relates to an enhanced question-answering matching method for question-answering processing of large language models. Background Technology
[0002] Large language models are an emerging technology derived from natural language processing and deep learning techniques. They can be used to understand and analyze contextual dialogue data, simulate human thought processes, and automate specific tasks. Understanding contextual semantic information to enhance the efficiency and accuracy of automated question-and-answer matching is fundamental to improving the performance of large language models. Current question-and-answer matching technologies mainly rely on pre-trained models for multi-round positive retrieval and matching analysis, improving accuracy through multiple training processes. However, this also increases the consumption of computational resources during the matching process, making it difficult to achieve a truly effective improvement in question-and-answer matching capabilities. Summary of the Invention
[0003] The purpose of this invention is to propose an enhanced question-answering matching method that, based on practical needs, considers contextual semantic information between different levels and uses a joint loss function to optimize the matching model, thereby enhancing the training efficiency of large language matching.
[0004] To achieve the above objectives, the present invention adopts the following technical solution.
[0005] An enhanced question-answering matching method for large language model question-answering processing includes the following steps:
[0006] Step A. Statement-level question-and-answer matching, specifically refers to:
[0007] Given a large language model question-answering dataset, construct the data in the question-answering context data and perform pre-training to obtain the hidden representation of the question-answering context data and the hidden representation of the answer data.
[0008] The sentence matching feature matrix between the sentence-level contextual question-and-answer data and the answer number hidden representation is calculated using the question-and-answer contextual data hidden representation and the answer number hidden representation.
[0009] After pre-training, a feature extraction unit consisting of a convolutional neural module and a pooling module is established to process the sentence matching feature matrix and convert the high-dimensional sentence matching feature matrix into a low-dimensional matching vector.
[0010] The matching vectors corresponding to the question-and-answer data are obtained by using the GRU gated recurrent module to obtain their corresponding hidden state quantities, and then the sentence matching index is calculated to obtain the loss function for sentence layer matching training.
[0011] Step B. Character-level question-and-answer matching, specifically refers to:
[0012] Given question-and-answer context data and answer data, construct a word input sequence for pre-training to obtain contextual hidden data representation and answer data hidden representation; project the hidden representations of context data and answer data into the same latent space to calculate context data relevance, and use activation functions to calculate attention coefficients; multiply each word vector representation in the context data with its corresponding attention coefficient to obtain the perceptual vectors of the context data and answer data.
[0013] The perceptual vector corresponding to the question-and-answer context data is obtained and processed by average pooling to obtain its perceptual representation; the perceptual representation of the question-and-answer dataset is used as input to the GRU gated recurrent module to obtain the final hidden state output; the character layer question-and-answer matching index represented by the final hidden state output is obtained by using relevance calculation, and the character layer question-and-answer matching training loss function is further obtained.
[0014] Step C: The loss function for the two-level matching training is obtained by combining the loss function of the sentence-level matching training and the loss function of the character-level question-answering matching training. Question-answering records are obtained from historical question-answering data to establish a question-answering database. Two independent pre-trained matching networks are used to extract hidden relationships and complete the calculation of matching information. The pre-trained matching network is optimized and trained based on the joint loss function to enhance the question-answering matching effect.
[0015] In a further improved or preferred embodiment of the aforementioned enhanced question-answering matching method for large language model question-answering processing, step A specifically includes:
[0016] A1 Defines a given large language model question-answering dataset. ,in This represents the question-and-answer data from the nth round. This refers to the contextual data of the question and answer process; It refers to and Corresponding answer data;
[0017] A2 Regarding the first in the question-and-answer context data Data Construct it as The data is fed into the BERT pre-trained model in the form of [data] to obtain the last layer of the sentence layer contextual hidden representation; the first [data] in the question-answering data is then [processed]. Data Construct it as The data is fed into the BERT pre-trained model in the form of a hidden representation of the last layer of the statement layer response data for pre-training.
[0018] The combined data yields the question-and-answer context data. Hidden Expressions ; Answer data Hidden Expressions ;
[0019] in, Indicates pre-trained encoding, This refers to the first question in the question-and-answer context data. The hidden expression corresponding to each word element ; This refers to the first question in the answer data. The hidden expression corresponding to each word element ;
[0020] A3 further hides the expression using question-and-answer context data. And the number of answers hides the expression Calculate the statement matching feature matrix between the statement-level contextual question-answer and answer data. ,in Represents a linear transformation matrix;
[0021] A4 After pre-training, a feature extraction unit consisting of convolutional neural modules and pooling modules is established to process the sentence matching feature matrix. The process involves converting the high-dimensional sentence matching feature matrix into a low-dimensional matching vector; specifically:
[0022] The sentence matching feature matrix is used as input and convolutional neural module is used for convolution processing. For the convolutional neural module, the first... Layer, using a window size of Two-dimensional convolution operations process the upper-layer input, and the feature output can be represented as: ;in It is the ReLU activation function. ,in and For the first Layer training parameters;
[0023] Convolution and Linear Transition Function Based on Max Pooling Obtaining the low-dimensional matching vector can be represented as The pooling operation outputs... , Indicates the first High-level reddening convolution Width;
[0024] A5 retrieves the matching vectors corresponding to n rounds of question-and-answer data. As such, the GRU gated loop module is used to obtain its corresponding hidden state. And further calculate the statement matching index. ;in , For learning parameters of the GRU gated recurrent network, It is the sigmoid function;
[0025] For question-and-answer data To obtain the optimal matching metrics, the loss function for sentence-level matching training is: ,in It refers to the first Data from one answer Is it context? The indicated quantity, .
[0026] Further improvements or preferred implementations of the aforementioned enhanced question-answering matching method for large language model question-answering processing, specifically step B includes:
[0027] B1 For a given question-and-answer context data and answer data Construct the word input sequence The character layer hidden representation is obtained by feeding it into the BERT pre-trained model for pre-training. Hides the expression from the character layer Extracting contextual hidden data representations from each and hidden expression in response data : , ;in This represents the hidden representation of the p-th word in the context data. This represents the hidden representation of the q-th word in the response data;
[0028] B2 Hidden Expressions of Contextual and Response Data and Projecting onto the same latent space to compute the relevance between the p-th term in the context data and the q-th term in the response data. The attention coefficient for each word vector in the response data is calculated using an activation function. Multiplying the vector representation of each word in the context data with its corresponding attention coefficient yields the perceptual vector of the context data and the response data. ;
[0029] B3 Obtain the perceptual vector corresponding to the question-answering context data. Its perceptual representation was obtained using average pooling. For a given large language model question-answering dataset This yields a perceptual representation containing all questions and answers from the question-answering dataset. ; Perceptual representation of question-answering datasets The final hidden state is obtained by inputting the GRU gated loop module. ;
[0030] B4 uses relevance calculation to obtain the character-level question-answering matching metric represented by the final hidden state output. ;
[0031] Further, the character-level question-answering matching training loss function is obtained. .
[0032] A further improved or preferred implementation of the aforementioned enhanced question-answering matching method for large language model question-answering processing also includes step D: question-answering matching enhancement processing based on domain knowledge relevance;
[0033] Specifically, this involves: preprocessing the newly added knowledge question-and-answer data, segmenting it into words, constructing word sequences, using a BERT pre-trained model to obtain the hidden representation of the word sequences, using a bidirectional long short-term memory network to extract contextual features, and calculating the joint probability that each word x belongs to the classification label y; obtaining the text entity extraction and classification results from the newly added question-and-answer data based on the magnitude of the joint probability, and using a BERT pre-trained language model to obtain the hidden state representation of the input sequence; extracting the contextual relationships of two text entities from the entity hidden representations through activation functions and fully connected networks; connecting [CLS] with any two text entities and using fully connected networks and activation functions to determine the text entity relationship classification probability, establishing triples based on the extracted entity relationship type probabilities, and obtaining the entity relationship graph of the newly added question-and-answer data after joint processing; defining key-value pair modules based on triples to obtain the embedding scores of key-value pairs; and obtaining the loss function for triples in the entity relationship graph of the newly added question-and-answer data added during the training process of the dialogue question-and-answer model, based on the positive examples composed of correct responses.
[0034] In a further improved or preferred embodiment of the aforementioned enhanced question-answering matching method for large language model question-answering processing, step D specifically includes:
[0035] D1 performs necessary preprocessing on the newly added knowledge question-and-answer data, then segments it into words to construct a word sequence. Using BERT pre-trained models to obtain hidden representations of word sequences A bidirectional long short-term memory network is used to extract contextual features, and the joint probability that each word x belongs to the classification label y is calculated. ;
[0036] This refers to normalization processing. This refers to the number of transformation feature functions of the current node. The number of feature functions of the current node state;
[0037] D. Based on the magnitude of the joint probability, obtain the text entity extraction and classification results from the newly added question-and-answer data. To further determine the relationships between entities, analyze the text sequences... Constructed based on the text boundaries of the entities The input sequence, where [1] and [2] refer to custom, non-text entity start and end markers; It refers to the character sequence corresponding to a text entity;
[0038] Using a BERT pre-trained language model to obtain the hidden state representation of the input sequence ,in It refers to the first The hidden representations for each character, specifically, i=0 corresponds to the hidden representation of [CLS];
[0039] D3 Obtain any two text entities from step b. and Corresponding hidden expression and , ;
[0040] The entity hiding representation is obtained by extracting context relations between two text entities through activation functions and fully connected networks. and ,in: ; ; and These are the training parameters for a fully connected network;
[0041] D4 connects [CLS] and any two text entities. and Context hiding representation as input Using fully connected networks and activation functions to perform text entity relationship classification probabilities Based on the probability of the extracted entity relationship types, triples are established to determine the relationships between entities. After combining, an entity relationship graph of the newly added question and answer data is obtained;
[0042] D5. Based on the triples in the entity relationship graph of the newly added question-and-answer data. Define key-value pair module , where the key vector Indicates the subject entity and relationships Average word embedding, value vector For object entity Word embeddings; obtain embedding scores for key-value pairs. ,
[0043] For the triples in the entity relation graph of the newly added question-answering data during the training process of the dialogue question-answering model, the loss function is obtained on the positive examples consisting of correct responses. ; This refers to the number of triples formed by correct question-and-answer responses.
[0044] The main beneficial effects of this application are:
[0045] This invention relates to an enhanced question-and-answer matching method for large language model question-and-answer processing. It helps to solve the problem of difficulty in improving the matching efficiency of question-and-answer data during the training of large language models, and the problem of high resource consumption and limited efficiency in the matching process when facing complex question-and-answer data. It achieves matching analysis at multiple levels of words, sentences and characters through multi-level hidden element matching analysis, obtains more comprehensive hidden relationships in question-and-answer data, and enhances the question-and-answer dialogue matching effect. Attached Figure Description
[0046] Figure 1 This is a flowchart illustrating an enhanced question-answering matching method used for question-answering processing in large language models. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0048] This invention mainly relates to an enhanced question-answer matching method for large language model question-answering processing, which solves the problem that the current large language model question-answering data matching task is inefficient and it is difficult to efficiently integrate new question-answering knowledge data.
[0049] like Figure 1 As shown, this invention provides a scheme for optimizing the question-and-answer data matching training process by establishing a joint loss function based on multi-level hidden semantic information matching at the statement and character levels. This scheme aims to further enhance the expressive power of multi-dimensional intrinsic semantic information and improve the quality of question-and-answer data matching. Specifically, it includes steps A to D.
[0050] Step A. Statement-level question-and-answer matching
[0051] This step involves pre-training encoding and simplifying vector representations based on the relationship between the sentence-level context and the hidden representation of the question-answering data. This rapidly constructs an analysis and judgment of the sentence-level matching quality, improving the efficiency of sentence-level question-answering data matching. Specifically, it can be divided into the following steps:
[0052] A1 Defines a given large language model question-answering dataset. ,in This represents the question-and-answer data from the nth round. This refers to the contextual data of the question and answer process; It refers to and Corresponding answer data;
[0053] A2 Regarding the first in the question-and-answer context data Data Construct it as The data is fed into the BERT pre-trained model in the form of [data] to obtain the last layer of the sentence layer contextual hidden representation; the first [data] in the question-answering data is then [processed]. Data Construct it as The data is fed into the BERT pre-trained model in the form of a hidden representation of the last layer of the statement layer response data for pre-training.
[0054] The combined data yields the question-and-answer context data. Hidden Expressions ; Answer data Hidden Expressions ;
[0055] in, Indicates pre-trained encoding, This refers to the first question in the question-and-answer context data. The hidden expression corresponding to each word element ; This refers to the first question in the answer data. The hidden expression corresponding to each word element ;
[0056] A3 further hides the expression using question-and-answer context data. And the number of answers hides the expression Calculate the statement matching feature matrix between the statement-level contextual question-answer and answer data. ,in Represents a linear transformation matrix;
[0057] A4 After pre-training, a feature extraction unit consisting of convolutional neural modules and pooling modules is established to process the sentence matching feature matrix. The process involves converting the high-dimensional sentence matching feature matrix into a low-dimensional matching vector; specifically:
[0058] The sentence matching feature matrix is used as input and convolutional neural module is used for convolution processing. For the convolutional neural module, the first... Layer, using a window size of Two-dimensional convolution operations process the upper-layer input, and the feature output can be represented as: ;in It is the ReLU activation function. ,in and For the first Layer training parameters;
[0059] Convolution and Linear Transition Function Based on Max Pooling Obtaining the low-dimensional matching vector can be represented as The pooling operation outputs... , Indicates the first High-level reddening convolution Width;
[0060] A5 retrieves the matching vectors corresponding to n rounds of question-and-answer data. As such, the GRU gated loop module is used to obtain its corresponding hidden state. And further calculate the statement matching index.
[0061] ;in , For learning parameters of the GRU gated recurrent network, It is the sigmoid function;
[0062] For question-and-answer data To obtain the optimal matching metrics, the loss function for sentence-level matching training is: ,in It refers to the first Data from one answer Is it context? The indicated quantity, .
[0063] Step B. Character-level question-and-answer matching
[0064] This step primarily involves analyzing and matching the local importance information between contextual question-and-answer data. The context and question-and-answer data are then pre-trained and matched as a whole. The model's attention module is used to enhance the hidden representation between the context and the answer data, thereby improving the expression and analysis of character matching relationships. Specifically, it includes the following steps:
[0065] B1 For a given question-and-answer context data and answer data Construct the word input sequence The character layer hidden representation is obtained by feeding it into the BERT pre-trained model for pre-training. Hides the expression from the character layer Extracting contextual hidden data representations from each and hidden expression in response data : , ;in This represents the hidden representation of the p-th word in the context data. This represents the hidden representation of the q-th word in the response data;
[0066] B2 Hidden Expressions of Contextual and Response Data and Projecting onto the same latent space to compute the relevance between the p-th term in the context data and the q-th term in the response data. The attention coefficient for each word vector in the response data is calculated using an activation function. Multiplying the vector representation of each word in the context data with its corresponding attention coefficient yields the perceptual vector of the context data and the response data. ;
[0067] B3 Obtain the perceptual vector corresponding to the question-answering context data. Its perceptual representation was obtained using average pooling. For a given large language model question-answering dataset This yields a perceptual representation containing all questions and answers from the question-answering dataset. ; Perceptual representation of question-answering datasets The final hidden state is obtained by inputting the GRU gated loop module. ;
[0068] B4 uses relevance calculation to obtain the character-level question-answering matching metric represented by the final hidden state output. ;
[0069] Further, the character-level question-answering matching training loss function is obtained. ;
[0070] C. Enhanced Question-Answer Matching in Question-Answer Processing
[0071] Based on the above, to fully consider the effects of sentence-level matching training and character-level question-answering matching training, the two loss functions are combined to obtain the joint loss function for the aforementioned two-level matching training. A question-and-answer database is established by acquiring question-and-answer records from historical question-and-answer data. Two independent pre-trained matching networks are used to extract hidden relationships and complete the calculation of matching information. The pre-trained matching network is optimized and trained based on the joint loss function to enhance the question-and-answer matching effect.
[0072] Furthermore, during the question-and-answer data matching training process, as the question-and-answer content and knowledge data are updated, new domain knowledge will be continuously formed over time. This domain knowledge needs to be collected, summarized, and preprocessed before being further integrated into the subsequent question-and-answer matching process. In this process, newly reported question-and-answer data needs to be processed to improve the relevant operations.
[0073] D. Question-answering matching enhancement processing based on domain knowledge relevance
[0074] To improve the understanding and compatibility of newly added question-and-answer knowledge data during the training and matching process, a knowledge graph-based method is used to identify entity and relation attributes in the question-and-answer knowledge data and build an entity-relationship graph of the newly added question-and-answer data. This graph, which extracts entity relations from the existing data, hides unclear relationships.
[0075] Specifically:
[0076] D1 performs necessary preprocessing on the newly added knowledge question-and-answer data, then segments it into words to construct a word sequence. Using BERT pre-trained models to obtain hidden representations of word sequences A bidirectional long short-term memory network is used to extract contextual features, and the joint probability that each word x belongs to the classification label y is calculated. ;
[0077] This refers to normalization processing. This refers to the number of transformation feature functions of the current node. The number of feature functions of the current node state;
[0078] D2 obtains the text entity extraction and classification results from the newly added question-and-answer data based on the magnitude of the joint probability. To further determine the relationships between entities, the text sequences are... Constructed based on the text boundaries of the entities The input sequence, where [1] and [2] refer to custom, non-text entity start and end markers; It refers to the character sequence corresponding to a text entity;
[0079] Using a BERT pre-trained language model to obtain the hidden state representation of the input sequence ,in It refers to the first The hidden representations for each character, specifically, i=0 corresponds to the hidden representation of [CLS];
[0080] D3 Obtain any two text entities from step b. and Corresponding hidden expression and , ;
[0081] The entity hiding representation is obtained by extracting context relations between two text entities through activation functions and fully connected networks. and ,in: ; ; and These are the training parameters for a fully connected network;
[0082] D4 connects [CLS] and any two text entities. and Context hiding representation as input Using fully connected networks and activation functions to perform text entity relationship classification probabilities Based on the probability of the extracted entity relationship types, triples are established to determine the relationships between entities. After combining, an entity relationship graph of the newly added question and answer data is obtained;
[0083] D5. Based on the triples in the entity relationship graph of the newly added question-and-answer data. Define key-value pair module , where the key vector Indicates the subject entity and relationships Average word embedding, value vector For object entity Word embeddings; obtain embedding scores for key-value pairs. ,
[0084] For the triples in the entity relation graph of the newly added question-answering data during the training process of the dialogue question-answering model, the loss function is obtained on the positive examples consisting of correct responses. ; This refers to the number of triples formed by correct question-and-answer responses.
[0085] Based on the above basic steps and methods, the question-answering data enhancement matching in this application further enhances the intrinsic relationship between contextual data, establishes an enhanced dialogue matching processing scheme for large language model question-answering processing based on the inherent hidden relationship of multi-level contextual data, and adds a new question-answering data fusion processing scheme.
[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit the scope of protection of the present invention. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the essence and scope of the technical solutions of the present invention.
Claims
1. An enhanced question-answer matching method for large language model question answering processing, characterized in that, Includes the following steps: Step A. Statement-level question-and-answer matching, specifically refers to: Given a large language model question-answering dataset, construct the data in the question-answering context data and perform pre-training to obtain the hidden representation of the question-answering context data and the hidden representation of the answer data. The sentence matching feature matrix between the sentence-level contextual question-and-answer data and the answer number hidden representation is calculated using the question-and-answer contextual data hidden representation and the answer number hidden representation. After pre-training, a feature extraction unit consisting of a convolutional neural module and a pooling module is established to process the sentence matching feature matrix and convert the high-dimensional sentence matching feature matrix into a low-dimensional matching vector. The matching vectors corresponding to the question-and-answer data are obtained by using the GRU gated recurrent module to obtain their corresponding hidden state quantities, and then the sentence matching index is calculated to obtain the loss function for sentence layer matching training. Step B. Character-level question-and-answer matching, specifically refers to: Given question-and-answer context data and answer data, construct a word input sequence for pre-training to obtain contextual hidden data representation and answer data hidden representation; project the hidden representations of contextual data and answer data into the same latent space to calculate contextual data relevance, and use activation functions to calculate attention coefficients; The perceptual vector of the context data and the response data is obtained by multiplying the vector representation of each word in the context data with its corresponding attention coefficient. The perceptual vector corresponding to the question-and-answer context data is obtained and processed by average pooling to obtain its perceptual representation; the perceptual representation of the question-and-answer dataset is used as input to the GRU gated recurrent module to obtain the final hidden state output; the character layer question-and-answer matching index represented by the final hidden state output is obtained by using relevance calculation, and the character layer question-and-answer matching training loss function is further obtained. Step C: The loss function for the two-level matching training is obtained by combining the loss function of the sentence-level matching training and the loss function of the character-level question-answering matching training. Question-answering records are obtained from historical question-answering data to establish a question-answering database. Two independent pre-trained matching networks are used to extract hidden relationships and complete the calculation of matching information. The pre-trained matching network is optimized and trained based on the joint loss function to enhance the question-answering matching effect.
2. The enhanced question-answering matching method for large language model question-answering processing according to claim 1, characterized in that, Step A specifically includes: A1 Defines a given large language model question-answering dataset. ,in This represents the question-and-answer data from the nth round. This refers to the contextual data of the question and answer process; It refers to and Corresponding answer data; A2 Regarding the first in the question-and-answer context data Data Construct it as The data is fed into the BERT pre-trained model in the form of [data] to obtain the last layer of the sentence layer contextual hidden representation; the first [data] in the question-answering data is then [processed]. Data Construct it as The data is fed into the BERT pre-trained model in the form of a hidden representation of the last layer of the statement layer response data for pre-training. The combined data yields the question-and-answer context data. Hidden Expressions ; Answer data Hidden Expressions ; in, Indicates pre-trained encoding, This refers to the first question in the question-and-answer context data. The hidden expression corresponding to each word element ; This refers to the first question in the answer data. The hidden expression corresponding to each word element ; A3 further hides the expression using question-and-answer context data. And the number of answers hides the expression Calculate the statement matching feature matrix between the statement-level contextual question-answer and answer data. ,in Represents a linear transformation matrix; A4 After pre-training, a feature extraction unit consisting of convolutional neural modules and pooling modules is established to process the sentence matching feature matrix. The process involves converting the high-dimensional sentence matching feature matrix into a low-dimensional matching vector; specifically: The sentence matching feature matrix is used as input and convolutional neural module is used for convolution processing. For the convolutional neural module, the first... Layer, using a window size of Two-dimensional convolution operations process the upper-layer input, and the feature output can be represented as: ;in It is the ReLU activation function. ,in and For the first Layer training parameters; Convolution and Linear Transition Function Based on Max Pooling Obtaining the low-dimensional matching vector can be represented as The pooling operation outputs... , Indicates the first High-level reddening convolution Width; A5 retrieves the matching vectors corresponding to n rounds of question-and-answer data. As such, the GRU gated loop module is used to obtain its corresponding hidden state. And further calculate the statement matching index. ;in , For learning parameters of the GRU gated recurrent network, It is the sigmoid function; For question-and-answer data To obtain the optimal matching metrics, the loss function for sentence-level matching training is: ,in It refers to the first Data from one answer Is it context? The indicated quantity, .
3. The enhanced question-answering matching method for large language model question-answering processing according to claim 1, characterized in that, Step B specifically includes: B1 For a given question-and-answer context data and answer data Construct the word input sequence The character layer hidden representation is obtained by feeding it into the BERT pre-trained model for pre-training. Hides the expression from the character layer Extracting contextual hidden data representations from each and hidden expression in response data : , ;in This represents the hidden representation of the p-th word in the context data. This represents the hidden representation of the q-th word in the response data; B2 Hidden Expressions of Contextual and Response Data and Projecting onto the same latent space to compute the relevance between the p-th term in the context data and the q-th term in the response data. The attention coefficient for each word vector in the response data is calculated using an activation function. Multiplying the vector representation of each word in the context data with its corresponding attention coefficient yields the perceptual vector of the context data and the response data. ; B3 Obtain the perceptual vector corresponding to the question-answering context data. Its perceptual representation was obtained using average pooling. For a given large language model question-answering dataset This yields a perceptual representation containing all questions and answers from the question-answering dataset. ; Perceptual representation of question-answering datasets The final hidden state is obtained by inputting the GRU gated loop module. ; B4 uses relevance calculation to obtain the character-level question-answering matching metric represented by the final hidden state output. ; Further, the character-level question-answering matching training loss function is obtained. .
4. The enhanced question-answering matching method for large language model question-answering processing according to claim 1, characterized in that, It also includes step D. Question-answering matching enhancement processing based on domain knowledge relevance; Specifically, this involves: preprocessing the newly added knowledge question-and-answer data, segmenting it into words, constructing word sequences, using a BERT pre-trained model to obtain the hidden representation of the word sequences, using a bidirectional long short-term memory network to extract contextual features, and calculating the joint probability that each word x belongs to the classification label y; obtaining the text entity extraction and classification results from the newly added question-and-answer data based on the magnitude of the joint probability, and using a BERT pre-trained language model to obtain the hidden state representation of the input sequence; extracting the contextual relationships of two text entities from the entity hidden representations through activation functions and fully connected networks; connecting [CLS] with any two text entities and using fully connected networks and activation functions to determine the text entity relationship classification probability, establishing triples based on the extracted entity relationship type probabilities, and obtaining the entity relationship graph of the newly added question-and-answer data after joint processing; defining key-value pair modules based on triples to obtain the embedding scores of key-value pairs; and obtaining the loss function for triples in the entity relationship graph of the newly added question-and-answer data added during the training process of the dialogue question-and-answer model, based on the positive examples composed of correct responses.
5. The enhanced question-answering matching method for large language model question-answering processing according to claim 4, characterized in that, Step D specifically includes: D1 performs necessary preprocessing on the newly added knowledge question-and-answer data, then segments it into words to construct a word sequence. Using BERT pre-trained models to obtain hidden representations of word sequences A bidirectional long short-term memory network is used to extract contextual features, and the joint probability that each word x belongs to the classification label y is calculated. ; This refers to normalization processing. This refers to the number of transition feature functions of the current node. The number of feature functions of the current node state; D. Based on the magnitude of the joint probability, obtain the text entity extraction and classification results from the newly added question-and-answer data. To further determine the relationships between entities, analyze the text sequences... Constructed based on the text boundaries of the entities The input sequence, where [1] and [2] refer to custom, non-text entity start and end markers; It refers to the character sequence corresponding to a text entity; Using a BERT pre-trained language model to obtain the hidden state representation of the input sequence ,in It refers to the first The hidden representations for each character, specifically, i=0 corresponds to the hidden representation of [CLS]; D3 Obtain any two text entities from step b. and Corresponding hidden expression and , ; The entity hiding representation is obtained by extracting context relations between two text entities through activation functions and fully connected networks. and ,in: ; ; and These are the training parameters for a fully connected network; D4 connects [CLS] and any two text entities. and Context hiding representation as input Using fully connected networks and activation functions to classify text entity relationships probabilities Based on the probability of the extracted entity relationship types, triples are established to determine the relationships between entities. After combining, an entity relationship graph of the newly added question and answer data is obtained; D5. Based on the triples in the entity relationship graph of the newly added question-and-answer data. Define key-value pair module , where the key vector Indicates the subject entity and relationships Average word embedding, value vector For object entities Word embeddings; obtain embedding scores for key-value pairs. , For the triples in the entity relation graph of the newly added question-answering data during the training process of the dialogue question-answering model, the loss function is obtained on the positive examples consisting of correct responses. ; This refers to the number of triples formed by correct question-and-answer responses.