A Matching Method and System for Semantic Understanding and Question Answering
Through deep learning models, semantic features are extracted and answers are generated in combination with language big models, the efficiency and accuracy of natural language processing technology in context information correlation analysis and answer matching generation is solved, and high-quality semantic analysis and answer generation are achieved.
Patent Information
- Application Number
- CN202411139695.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2044-08-20
AI Technical Summary
Existing natural language processing techniques have flaws in understanding long text, complex contexts and semantic logical reasoning, especially in contextual information correlation analysis and answer matching generation, with average efficiency and accuracy.
The deep learning model is used to extract the semantic features of the query and document, capture context information and long-distance dependencies, weight assignment through mapping relationships, select core field information, and generate optimized answers based on the language model.
It improves the accuracy and efficiency of semantic analysis, improves the answer matching generation mechanism, realizes multi-dimensional evaluation and matching of answer information, and generates high-quality answer information.
Smart Images

Figure CN119128077B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and particularly to a semantic understanding and question-answering matching method and system thereof. Background Art
[0002] Currently, the current text processing function still has defects in understanding long texts, complex contexts, and semantic logical reasoning. On the one hand, the correlation analysis of context information still needs to be enhanced. Especially for some words in core fields, it still stays in the process of using key identification to judge conventional data, and its efficiency and accuracy are average. On the other hand, in the generation and matching of answers, for the generation and quality control of answers, the mapping relationship still needs to be improved. In terms of fluency control and fact consistency, its effect is average. Therefore, we propose a semantic understanding and question-answering matching method and system for optimizing the context correlation analysis of core fields and the matching generation of answers. Summary of the Invention
[0003] In view of the above problems existing in the current natural language processing data processing, the present invention is proposed.
[0004] Therefore, one of the purposes of the present invention is to provide a semantic understanding and question-answering matching method and system thereof, which uses a deep learning model to extract semantic features of queries and documents, capture context information and long-distance dependencies, and then realize the context correlation analysis of core fields, and improve the answer matching generation mechanism, and improve the accuracy and efficiency of semantic analysis.
[0005] To solve the above technical problems, the present invention provides the following technical solutions:
[0006] On the one hand, the present invention provides a semantic understanding and question-answering matching method, including:
[0007] Semantic question-answering information collection, sorting the collected semantic question-answering data through part-of-speech analysis to obtain semantic question-answering information in a unified format, and inputting the semantic question-answering information in the unified format into a database;
[0008] Database data processing, dividing the fields of the semantic question-answering information in the unified format and dividing out data sets, and performing preprocessing and determination of the data sets;
[0009] Semantic understanding optimization processing, using the data sets after preprocessing by natural language processing, and based on a deep learning model to extract semantic features of queries and documents, capture context information and long-distance dependencies, and determine the mapping relationship between the context information and long-distance dependencies, assign weights according to the mapping relationship between the context information and long-distance dependencies, select the core field information in the context information, and generate a set of core fields;
[0010] Retrieval-enhanced generation, based on retrieving associated relevant information from a database, combines the retrieved associated relevant information with a language large model, and then generates corresponding response information according to similarity analysis;
[0011] Answer generation and quality control, in response to the response information, and based on the information retrieved by the language large model, determines and optimizes the semantic fields according to the organizational structure features, fluency features, and factual consistency features in the response information, and then generates and outputs the optimized answer information.
[0012] As a preferred solution of the present invention, wherein: the semantic features of the query and the document are extracted based on a deep learning model. Specifically, a clustering algorithm is used to cluster the data set. The complete data set is divided into several categories according to the extracted query and document data, and the core points of each category are determined by the K-value clustering algorithm. The core points are used as the optimized clustering centers of the categories, and the Euclidean distance value between the core points and the optimized clustering centers is calculated. The Euclidean distance value is determined as the distance metric between the clustering samples and the training samples, and the distance metric between the clustering samples and the training samples is used as the numerical output of the semantic feature samples to be predicted for the query and the document to be extracted; the calculation of the distance metric between the clustering samples and the training samples is as follows:
[0013]
[0014] wherein, Dist(x i ,y j ) is the distance metric value between the clustering sample x i and the training sample, x ik is the k-th clustering sample x i , y jk is the k-th training sample y j .
[0015] As a preferred solution of the present invention, wherein: weight assignment is performed according to the mapping relationship between the context information and the long-distance dependence relationship, the core field information in the context information is selected, and a set of core fields is generated. Specifically, the weight assignment of the mapping relationship is determined by analyzing the discrimination of the core field information, as follows:
[0016]
[0017] wherein, n represents the number of items of the i-th clustering sample x i , f i represents the frequency of occurrence of the data clustering sample x i , represents the logarithmic value of the clustering sample x i as a distinction, and m represents the clustering sample xi The number of core fields recorded, H i Denote the i-th clustering sample x i The discrimination value of; M represents the total number of core fields in the clustering sample x i Among them, Q i Denote the i-th clustering sample x i The discrimination degree, that is, the weight assignment of the core field information determined in the context information.
[0018] As a preferred solution of the present invention, wherein: by obtaining the weight assignment of the core field information in the context information, constructing a core field optimization vector model, specifically using the BERT-Base-Chinese model as the basic model, using the cosine distance as the loss function, based on the dataset after extracting the query and the document, training to obtain the vector representation model parameters based on Sentence-BERT for calculation to generate the optimized core field information, and synchronously generating a set of optimized core fields for subsequent retrieval enhancement generation.
[0019] As a preferred solution of the present invention, wherein: in the semantic understanding optimization process, selecting the core field information in the context information further includes evaluating the sorting result of the matching of the core field information. Specifically, the mean value of precision, recall rate and F1 value is used as the evaluation index, as follows:
[0020]
[0021] Among them, TP is the number of samples where the core field information is predicted as a positive example and the label is a positive example, FP is the number of samples where the core field information is predicted as a positive example but the label is a negative example, and FN is the number of samples where the core field information is predicted as a negative example but the label is a positive example.
[0022] As a preferred solution of the present invention, wherein: after combining the retrieved relevant information with the language large model, a virtual expert group for generating matching answers is constructed through the language large model. After the virtual expert group determines the relevant information, the relevant information is fused and selected according to the classical covariance intersection fusion algorithm to determine the information retrieved by the language large model as the answer information of the language large model.
[0023] As a preferred solution of the present invention, wherein: in answer generation and quality control, semantic fields are optimized by determining and according to the organizational structure characteristics, fluency characteristics, and factual consistency characteristics in the answer information, specifically as follows:
[0024]
[0025] Among them, G iis the evaluation value of the i-th answer information; wp represents the weight coefficient of the answer information in the information retrieved by the language large model, that is, the similarity of the information retrieved by the language large model to the answer information; respectively represent the weight coefficients of the α, β, and χ indexes corresponding to the three features of the organizational structure feature, fluency feature, and factual consistency feature; U(xi) represents the accuracy parameter of the answer information, and U represents the set of accuracy parameters of the answer information.
[0026] As a preferred solution of the present invention, wherein: for the generation of the accuracy parameter of the answer information, a deep learning neural network model for judging accuracy is used as the deep learning neural network model, and the answer information is specifically analyzed and obtained through the following formula, as follows:
[0027]
[0028] wherein, U(xi) e k+1 represents the output of the accuracy parameter of the answer information of the e-th neuron in the k + 1 layer, D represents the number of items of the d-th neuron, represents the connection weight value between the neuron d in the k layer and the neuron e in the k + 1 layer, represents the bias term of the e-th neuron in the k + 1 layer, and sig[*] represents the activation function.
[0029] As a preferred solution of the present invention, wherein: when optimizing the semantic field according to the organizational structure feature, fluency feature, and factual consistency feature in the answer information, it further includes performing attention-based knowledge distillation on the generated optimized answer information and generating high-quality answer information. The loss function of the knowledge distillation is specifically as follows:
[0030]
[0031] wherein, KL and H respectively represent the divergence and cross-entropy of the loss function of the knowledge distillation, G i is the model parameter, a is the hyperparameter, and controls the ratio of the true label cross-entropy to the KL divergence of the model distribution and the language large model output distribution. P S is the parameter of the answer information generated by the semantic understanding optimization module, is the smoothing value of the language large model, is the smoothing value of the parameter of the answer information generated by the semantic understanding optimization module.
[0032] On the one hand, the present invention provides a system for a semantic understanding and question-answering matching method, including:
[0033] An acquisition module, configured to organize the collected semantic Q&A data through part-of-speech analysis, obtain semantic Q&A information in a unified format, and input the semantic Q&A information in the unified format into a database;
[0034] A database processing module, configured to divide fields of the semantic Q&A information in the unified format and divide a data set, and perform preprocessing on the data set and determine;
[0035] A semantic understanding and optimization module, configured to use natural language processing on the data set after data preprocessing, and based on a deep learning model, extract semantic features of queries and documents, capture context information and long-distance dependencies, and determine a mapping relationship between the context information and the long-distance dependencies, perform weight assignment according to the mapping relationship between the context information and the long-distance dependencies, select core field information in the context information, and generate a set of core fields;
[0036] A retrieval enhancement and generation module, configured to generate corresponding answer information according to similarity analysis after combining the retrieved related information associated from the database with a large language model;
[0037] An answer generation and quality control module, configured to respond to the answer information, and based on the information retrieved by the large language model, determine and optimize semantic fields according to the organizational structure features, fluency features, and factual consistency features in the answer information, and then generate and output optimized answer information.
[0038] Advantages of the present invention: The present invention uses a deep learning model to extract semantic features of queries and documents, capture context information and long-distance dependencies, thereby realizing context correlation analysis of core fields, improving the answer matching generation mechanism, introducing multi-dimensional evaluation and matching of answer information, being more concise, logically reasonable and accurate, and generating high-quality answer information through attention-based knowledge distillation, further improving the accuracy and efficiency of semantic analysis answer result generation. Description of the Drawings
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts. Among them:
[0040] Figure 1 It is a flowchart of a semantic understanding and Q&A matching method according to Embodiment 1 of the present invention;
[0041] Figure 2Flow chart of the semantic understanding optimization process in Embodiment 1 of the present invention;
[0042] Figure 3 Flow chart of the retrieval augmented generation and answer generation in Embodiment 2 of the present invention;
[0043] Figure 4 Flow chart of the method for generating high-quality answers based on attention-based knowledge distillation in Embodiment 3 of the present invention;
[0044] Figure 5 Organizational structure diagram of the system for the semantic understanding and question-answering matching method in Embodiment 4 of the present invention. Detailed implementation manners
[0045] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the described embodiments of the present invention fall within the scope of protection of the present invention.
[0046] Refer to Figures 1-4 , which is an embodiment of the present invention. This embodiment provides a semantic understanding and question-answering matching method, including:
[0047] Semantic question-and-answer information collection: The collected semantic question-and-answer data is sorted through part-of-speech analysis to obtain semantic question-and-answer information in a unified format, and the semantic question-and-answer information in the unified format is entered into the database;
[0048] Database data processing: The unified format semantic question-and-answer information is divided into fields to divide the data set, and the data set is preprocessed and determined;
[0049] Semantic understanding optimization process: As Figure 2 shown, in this embodiment, the data set after preprocessing using natural language processing is used, and based on a deep learning model, the semantic features of the query and the document are extracted, the context information and long-distance dependencies are captured, and the mapping relationship between the context information and the long-distance dependencies is determined. Weight assignment is performed according to the mapping relationship between the context information and the long-distance dependencies, the core field information in the context information is selected, and a set of core fields is generated;
[0050] Retrieval augmented generation: Based on the relevant information retrieved from the database, after combining the retrieved relevant information with a large language model, corresponding answer information is generated according to similarity analysis;
[0051] Answer generation and quality control, in response to the answer information, and based on the information retrieved by the language large model, after determining and optimizing the semantic fields according to the organizational structure features, fluency features, and factual consistency features in the answer information, generate and output the optimized answer information.
[0052] Specifically in this embodiment, deep learning models are used to extract the semantic features of queries and documents. Specifically, a clustering algorithm is used to cluster the data set. The complete data set is divided into several categories according to the extracted query and document data, and the kernel points of each category are determined through the K - value clustering algorithm. The kernel points are used as the optimized clustering centers of the categories, and the Euclidean distance value between the kernel points and the optimized clustering centers is calculated. The Euclidean distance value is determined as the distance metric between the clustering samples and the training samples, and the distance metric between the clustering samples and the training samples is used as the numerical output for predicting the semantic feature samples of the queries and documents to be extracted. The calculation of the distance metric between the clustering samples and the training samples is as follows:
[0053]
[0054] Where, Dist(x i ,y j ) is the distance metric value between the clustering sample x i and the training sample, x ik is the k - th clustering sample x i , y jk is the k - th training sample y j .
[0055] Specifically in this embodiment, weight assignment is performed according to the mapping relationship between the context information and the long - distance dependence relationship. The core field information in the context information is selected, and a set of core fields is generated. Specifically, the weight assignment of the mapping relationship is determined by analyzing the discrimination of the core field information, as follows:
[0056]
[0057] Where, n represents the number of terms of the i - th clustering sample x i , f i represents the frequency of occurrence of the data set clustering sample x i , represents the logarithmic value of the clustering sample x i as a discriminant, m represents the number of core fields recorded for the clustering sample x i , H i represents the discrimination value of the i - th clustering sample x i ; M represents the total number of core fields in the clustering sample x i , Q i represents the i - th clustering sample x iThe discrimination degree, that is, determining the weight assignment of the core field information in the context information.
[0058] Specifically in this embodiment, by obtaining the weight assignment of the core field information in the context information, a core field optimization vector model is constructed. Specifically, the BERT-Base-Chinese model is used as the basic model, and the cosine distance is used as the loss function. Based on the dataset after extracting the query and the document, the vector representation model parameters based on Sentence-BERT are trained to calculate and generate the optimized core field information, and the set of optimized core fields is generated synchronously for subsequent retrieval enhancement generation. In addition, specifically in this embodiment, in the semantic understanding optimization process, selecting the core field information in the context information also includes evaluating the sorting result of the matching of the core field information. Specifically, the mean value of precision, recall, and F1 value is used as the evaluation index, as follows:
[0059]
[0060] Among them, TP is the number of samples where the core field information is predicted as a positive example and the label is a positive example, FP is the number of samples where the core field information is predicted as a positive example but the label is a negative example, and FN is the number of samples where the core field information is predicted as a negative example but the label is a positive example.
[0061] Based on the above, this embodiment uses a deep learning model to extract the semantic features of the query and the document, capture the context information and long-distance dependence relationship, and then realize the context correlation analysis of the core field, so that the semantic understanding of this embodiment can more accurately understand the semantic meaning of the question-and-answer data, which is beneficial to the subsequent generation and association of the answer data, and improves the accuracy and efficiency of the overall semantic processing.
[0062] Embodiment 2
[0063] As Figure 3 shown, on the basis of Embodiment 1, in this embodiment, after combining the retrieved relevant information with the language large model, a virtual expert group for generating answers is constructed through the language large model. After the virtual expert group determines the relevant information, the relevant information is fused and selected according to the classical covariance intersection fusion algorithm to determine the information retrieved by the language large model as the answer information of the language large model.
[0064] It should be emphasized in this embodiment that in answer generation and quality control, the semantic fields are optimized according to the organizational structure characteristics, fluency characteristics, and factual consistency characteristics in the answer information, specifically as follows:
[0065]
[0066] Among them, Gi is the evaluation value of the i-th answer information; wp represents the weight coefficient of the answer information in the information retrieved by the language large model, that is, the similarity of the information retrieved by the language large model to the answer information; respectively represent the weight coefficients of the α, β, and χ indicators corresponding to the three features of the organizational structure feature, fluency feature, and factual consistency feature; U(xi) represents the accuracy parameter of the answer information, and U represents the set of accuracy parameters of the answer information.
[0067] Furthermore, it can be seen that this embodiment introduces multi-dimensional evaluation and matching of answer information, and can specifically evaluate the answer information from three dimensions: organizational structure feature, fluency feature, and factual consistency, and obtain the evaluation value.
[0068] Specifically in the above-mentioned Embodiment 2, for the generation of the accuracy parameter of the answer information, the deep learning neural network model for judging accuracy is used as the deep learning neural network model, and the answer information is analyzed specifically through the following formula, as follows:
[0069]
[0070] where, U(xi) e k+1 represents the output of the accuracy parameter of the answer information of the e-th neuron in the k + 1-th layer, D represents the number of items of the d-th neuron, represents the connection weight value between the d-th neuron in the k-th layer and the e-th neuron in the k + 1-th layer, represents the bias term of the e-th neuron in the k + 1-th layer, and sig[*] represents the activation function.
[0071] Based on the above, this embodiment introduces multi-dimensional evaluation and matching of answer information, and can specifically evaluate the answer information from three dimensions: organizational structure feature, fluency feature, and factual consistency, and obtain the evaluation value, and selectively perform matching output according to the judgment of the evaluation value. In this way, not only does the answer information synthesize the characteristics of the three dimensions in terms of organizational structure feature, fluency, and factual consistency, but also the process is more concise, logically reasonable, and accurate compared to directly outputting the answer information.
[0072] Embodiment 3
[0073] As Figure 4 shown, based on the above Embodiments 1 and 2, when optimizing the semantic fields according to the organizational structure feature, fluency feature, and factual consistency feature in the answer information, it further includes performing attention-based knowledge distillation on the generated optimized answer information and generating high-quality answer information. The loss function of the knowledge distillation is specifically as follows:
[0074]
[0075] Among them, KL and H respectively represent the divergence and cross-entropy of the loss function of knowledge distillation, and G i is the model parameter, a is the hyperparameter, and it controls the ratio of the cross-entropy of the true label to the KL divergence between the model distribution and the output distribution of the language model. P S is the parameter of the answer information generated by the semantic understanding optimization module. is the smoothing value of the language model. is the smoothing value of the parameter of the answer information generated by the semantic understanding optimization module.
[0076] Example 4
[0077] As Figure 5 shown, this example provides a system for a semantic understanding and question-answering matching method, including:
[0078] An acquisition module, used to organize the collected semantic question-answering data through part-of-speech analysis, obtain semantic question-answering information in a unified format, and enter the semantic question-answering information in a unified format into the database;
[0079] A database processing module, used to divide the fields of the semantic question-answering information in a unified format and divide the data set, and perform data preprocessing on the data set and determine;
[0080] A semantic understanding optimization module, used to use natural language processing on the data set after data preprocessing, and based on a deep learning model, extract the semantic features of the query and the document, capture context information and long-distance dependencies, and determine the mapping relationship between the context information and the long-distance dependencies, assign weights according to the mapping relationship between the context information and the long-distance dependencies, select the core field information in the context information, and generate a set of core fields;
[0081] A retrieval enhanced generation module, used to combine the retrieved relevant information retrieved from the database with the language model, and generate corresponding answer information according to similarity analysis;
[0082] An answer generation and quality control module, used to respond to the answer information, and based on the information retrieved by the language model, determine and optimize the semantic fields according to the organizational structure characteristics, fluency characteristics, and fact consistency characteristics in the answer information, and generate and output the optimized answer information.
[0083] In summary, the beneficial effects of the present invention are as follows: The semantic understanding of the present invention uses advanced natural language processing techniques to extract semantic features of queries and documents through a deep learning model, capture the mapping relationship between the determined context information and long-distance dependencies, and select the core field information in the context information. Retrieval-Augmented Generation (RAG): Based on retrieving relevant information from a knowledge base, after combining the retrieved relevant information with a large language model, accurate, relevant, and rich answer information is generated. Answer generation and quality control: Based on the information retrieved by the large language model, after determining and optimizing semantic fields according to the organizational structure features, fluency features, and factual consistency features in the answer information, the optimized answer information is generated and output. Controlled from aspects such as the organizational structure of the answer, fluency control, and factual consistency, the answer information combines the characteristics of three dimensions in terms of organizational structure features, fluency, and factual consistency, and is more concise, logically reasonable, and accurate than the process of directly outputting answer information.
[0084] In summary, the present invention uses a deep learning model to extract semantic features of queries and documents, capture context information and long-distance dependencies, thereby realizing the context correlation analysis of core fields, improving the matching generation mechanism of answers to generate high-quality answer information, and improving the accuracy and efficiency of semantic analysis.
[0085] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.
[0086] In the description of this specification, the descriptions referring to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0087] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "a plurality of" means two or more, unless otherwise specifically defined.
[0088] Any process or method description represented in a flowchart or described otherwise herein can be understood to represent a module, segment, or portion of code including one or more executable instructions for implementing a specific logical function or process. And the scope of the preferred embodiments of the present application includes additional implementations, where functions can be executed in a substantially simultaneous manner or in a reverse order according to the involved functions, rather than in the order shown or discussed.
[0089] The logic and / or steps represented in a flowchart or described otherwise herein, for example, can be considered as an ordered list of executable instructions for implementing a logical function, and can be specifically implemented in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device.
[0090] It should be understood that each part of the present application can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the method in the above embodiments can be completed by a program instructing relevant hardware, and this program can be stored in a computer-readable storage medium. When this program is executed, it includes one or a combination of the steps of the method embodiments.
[0091] In addition, each functional unit in various embodiments of the present application can be integrated into one processing module, or each unit can exist physically alone, or two or more units can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. When the above integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. This storage medium can be a read-only memory, a magnetic disk, an optical disk, etc.
[0092] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of various changes or substitutions thereof, and these should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A method for matching semantic understanding with question answering, characterized in that: include: Semantic question and answer information collection: sorting the collected semantic question and answer data through part-of-speech analysis, obtaining semantic question and answer information in a unified format, and entering the semantic question and answer information in a unified format into a database; Database data processing: divide the fields of the unified format semantic question and answer information into data sets, pre-process and confirm the data sets; Semantic understanding optimization processing, using the data set after data preprocessing by natural language processing, and extracting the semantic features of queries and documents based on a deep learning model, capturing context information and long-distance dependencies, and determining the mapping relationship between the context information and the long-distance dependencies, assigning weights according to the mapping relationship between the context information and the long-distance dependencies, selecting the core field information in the context information, and generating a set of core fields; extracting the semantic features of queries and documents based on the deep learning model, specifically using a clustering algorithm to cluster the data set, dividing the complete data set into several categories according to the extracted query and document data, and determining the core point of each category through a K-value clustering algorithm, using the core point as the optimized clustering center of the category, and calculating the Euclidean distance value between the core point and the optimized clustering center, determining the Euclidean distance value as the distance metric between the cluster sample and the training sample, and using the distance metric between the cluster sample and the training sample as the numerical output of the semantic feature sample for predicting the query and document to be extracted; the distance metric between the cluster sample and the training sample is calculated as follows: Among them, Dist(x i ,y j ) is the cluster sample x i The distance measure between the training samples, x ik is the kth cluster sample x i ,y jk is the kth training sample y j ; According to the mapping relationship between context information and long-distance dependencies, weights are assigned, core field information in the context information is selected, and a set of core fields is generated. Specifically, the weight assignment of the mapping relationship is determined by analyzing the discrimination of the core field information, as follows: Where n represents the i-th cluster sample x i The number of terms, f i Represented as a data set cluster sample x i The frequency of occurrence, Represents cluster sample x i As the logarithm of the discrimination, m is represented by the cluster sample x i The number of core fields recorded, H i Represents the i-th cluster sample x i The distinguishing value of M is the clustering sample x i The total number of core fields in Q i Represents the i-th cluster sample x i The discrimination degree is determined as the weight assignment of the core field information in the context information; Retrieval enhancement generation, based on retrieving the associated relevant information from the database, combining the retrieved associated relevant information with the language model, and generating corresponding answer information based on similarity analysis; Answer generation and quality control responds to the answer information and, based on the information retrieved by the language macromodel, determines and optimizes the semantic fields according to the organizational structure features, fluency features, and factual consistency features in the answer information, generates optimized answer information and outputs it.
2. A method for matching semantic understanding with question and answer as claimed in claim 1, characterized in that: Also includes: By obtaining the weight assignment of the core field information in the context information, a core field optimization vector model is constructed. Specifically, the BERT-Base-Chinese model is used as the basic model, and the cosine distance is used as the loss function. Based on the data set after extracting the query and document, the vector representation model parameters based on Sentence-BERT are trained to calculate and generate the optimized core field information, and a set of optimized core fields is simultaneously generated for subsequent retrieval enhancement generation.
3. A method for matching semantic understanding with question and answer as claimed in claim 1, characterized in that: In the semantic understanding optimization process, selecting the core field information in the context information also includes evaluating the ranking results of the core field information matching, specifically using the average of precision, recall and F1 value as the evaluation index, as follows: Among them, TP is the number of samples predicted as positive examples by the core field information and labeled as positive examples, FP is the number of samples predicted as positive examples by the core field information but labeled as negative examples, and FN is the number of samples predicted as negative positive examples by the core field information but labeled as positive examples.
4. A method for matching semantic understanding with question and answer as claimed in claim 1, characterized in that: After combining the retrieved associated relevant information with the language big model, combined with the virtual expert group that generates a match by building answers based on the language big model, the virtual expert group determines the associated relevant information, and then fuses and selects the associated relevant information according to the classic covariance cross-fusion algorithm to determine the information retrieved by the language big model as the answer information of the language big model.
5. A method for matching semantic understanding with question and answer as claimed in claim 1, characterized in that: In answer generation and quality control, the semantic fields are determined and optimized based on the organizational structure characteristics, fluency characteristics, and factual consistency characteristics of the answer information, as follows: Among them, G i is the evaluation value of the i-th answer information; wp represents the weight coefficient of the answer information in the information retrieved by the language model, that is, the similarity between the information retrieved by the language model and the answer information; They represent the weight coefficients of α, β and χ indicators corresponding to the three characteristics of organizational structure, fluency and factual consistency respectively; U(xi) represents the accuracy parameter of the answer information, and U represents the set of accuracy parameters of the answer information.
6. A method for matching semantic understanding with question and answer as claimed in claim 5, characterized in that: The generation of the accuracy parameter of the answer information uses the deep learning neural network model for judging the accuracy as the deep learning neural network model, and the answer information is analyzed specifically by the following formula, as follows: Among them, U(xi) e k+1 represents the accuracy parameter output of the answer information of the e-th neuron in the k+1th layer, D represents the number of items of the d-th neuron, represents the connection weight between neuron d in the kth layer and neuron e in the k+1th layer, represents the bias term of the e-term neuron in the k+1th layer, and sig[*] represents the activation function.
7. A method for matching semantic understanding with question and answer as claimed in claim 6, characterized in that: When determining and optimizing the semantic field based on the organizational structure features, fluency features, and factual consistency features in the answer information, it also includes performing attention-based knowledge distillation on the generated optimized answer information and generating high-quality answer information. The loss function of knowledge distillation is as follows: Among them, KL and H represent the divergence and cross entropy of the loss function of knowledge distillation, respectively, and G i is a model parameter, a is a hyperparameter, and controls the ratio of the cross entropy of the true label to the KL divergence of the model distribution and the output distribution of the language model, P S The parameters of the answer information generated by the semantic understanding optimization module, is the smoothing value of the language model, The smoothed value of the parameters of the answer information generated by the semantic understanding optimization module.
8. A system applied to the method for matching semantic understanding and question answering as claimed in claim 1, characterized in that: include: An acquisition module is used to organize the collected semantic question and answer data through part-of-speech analysis, obtain semantic question and answer information in a unified format, and enter the semantic question and answer information in a unified format into a database; The database processing module is used to divide the fields of the unified format semantic question and answer information and divide the data sets into data sets, and pre-process and determine the data sets; A semantic understanding optimization module is used to use natural language processing to process the data set after data preprocessing, and to extract semantic features of queries and documents based on a deep learning model, capture context information and long-distance dependencies, and determine the mapping relationship between the context information and the long-distance dependencies, assign weights according to the mapping relationship between the context information and the long-distance dependencies, select core field information in the context information, and generate a set of core fields; A search enhancement generation module is used to retrieve the associated related information from the database, combine the retrieved associated related information with the language model, and generate corresponding answer information according to similarity analysis; The answer generation and quality control module is used to respond to the answer information and, based on the information retrieved by the language macro model, determine and optimize the semantic fields according to the organizational structure characteristics, fluency characteristics, and factual consistency characteristics in the answer information, generate and output the optimized answer information.
Citation Information
Patent Citations
Text semantic similarity calculation model based on deep reinforcement learning
CN109783817A
Intelligent question and answer implementation method and system based on big data
CN118211648A