A large language model knowledge extraction method and system without search assistance
By employing a large-scale language model knowledge extraction method without retrieval assistance, we have solved the problems of inaccurate information and low efficiency caused by the reliance on external resources in traditional knowledge extraction, and achieved efficient and accurate knowledge acquisition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-05
- Publication Date
- 2026-03-24
AI Technical Summary
Traditional knowledge extraction methods rely on external auxiliary means, which makes it difficult to guarantee the accuracy of information, results in low knowledge acquisition efficiency, and is prone to bias.
A large-scale language model knowledge extraction method without retrieval assistance is adopted. Through steps such as question reconstruction, text segmentation and semantic analysis, ambiguity scoring and semantic matching, accurate knowledge extraction is achieved.
It improves the accuracy and efficiency of knowledge extraction, avoids deviations caused by the unavailability of external resources and textual ambiguity, and ensures that the knowledge extraction results are highly matched with user needs.
Smart Images

Figure CN121255967B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the field of large model knowledge extraction, in particular to a large language model knowledge extraction method and system without retrieval assistance. BACKGROUND
[0002] With the increasing demand for efficient and accurate knowledge acquisition in the fields of scientific research and enterprise decision-making, the reliability and efficiency of knowledge extraction have become key technical requirements to support business promotion.
[0003] Currently, traditional knowledge extraction methods often rely on external assistance, which is limited by the availability of external resources and is prone to bias, thus not only difficult to guarantee information accuracy, but also significantly reducing knowledge acquisition efficiency and increasing potential risks in subsequent decision-making based on extracted knowledge. SUMMARY
[0004] The application provides a large language model knowledge extraction method and system without retrieval assistance, which improves the current situation that traditional knowledge extraction relies on external assistance, is limited by external resources and is prone to bias, thus leading to difficulty in guaranteeing information accuracy and low knowledge acquisition efficiency.
[0005] The embodiments of the application disclose the following technical solutions:
[0006] In a first aspect, the embodiments of the application provide a large language model knowledge extraction method without retrieval assistance, which comprises:
[0007] Obtaining a user search question, obtaining a reconstructed search question based on a search analysis template, inputting a large language model, and obtaining a target text, wherein the large language model is a local model;
[0008] Pretreating and segmenting the target text to obtain a plurality of basic text segments, and analyzing the semantic integrity of the plurality of basic text segments to obtain a plurality of text segments and a plurality of semantic integrity parameters;
[0009] Obtaining a plurality of ambiguity confidence parameters of the plurality of text segments, combining the plurality of semantic integrity parameters to score the effectiveness of the segments, and obtaining a plurality of candidate text segments;
[0010] Respectively performing semantic matching on the plurality of candidate text segments and the user search question, obtaining a plurality of candidate text segments with the highest semantic matching parameters as the knowledge extraction result;
[0011] Combining a result output template, reconstructing the knowledge extraction result, and obtaining a structured knowledge extraction result.
[0012] In a second aspect, the embodiments of the application provide a large language model knowledge extraction system without retrieval assistance, which comprises:
[0013] question acquisition module, configured to acquire a user search question, acquire a reconstructed search question based on a search analysis template, and input a large language model to acquire a target text, wherein the large language model is a local model;
[0014] text segmentation semantic analysis module, configured to preprocess and segment the target text, acquire a plurality of basic text segments, and analyze semantic integrity of the plurality of basic text segments to obtain a plurality of text segments and a plurality of semantic integrity parameters;
[0015] ambiguity scoring candidate acquisition module, configured to acquire a plurality of ambiguity confidence parameters of the plurality of text segments, combine the plurality of semantic integrity parameters to score segment effectiveness, and acquire a plurality of candidate text segments;
[0016] semantic matching result selection module, configured to perform semantic matching on the plurality of candidate text segments and the user search question respectively, acquire a plurality of candidate text segments with the highest semantic matching parameters as knowledge extraction results;
[0017] template reconstruction result output module, configured to combine a result output template to reconstruct the knowledge extraction results and acquire structured knowledge extraction results.
[0018] One or more technical solutions provided in the present application have at least the following technical effects or advantages:
[0019] The present application provides a large language model knowledge extraction method and system without search assistance. Through the steps of question reconstruction and target text acquisition, text segmentation semantic analysis, ambiguity scoring candidate acquisition, semantic matching result selection, and template reconstruction result output, precise knowledge extraction is realized without external search resource dependence. First, the user search question is analyzed semantically to extract keywords and core demands, and the search analysis template is reconstructed into a clear question before being input into the local large language model to acquire the target text. Then, the target text is preprocessed and segmented, the semantic integrity parameters of each segment are analyzed, and the segments with incomplete semantics are re-segmented to obtain an optimized text segment set. Subsequently, an ambiguity confidence analyzer is acquired to analyze the ambiguity of the text segments and calculate the corrected ambiguity confidence in combination with the semantic integrity parameters, and then the segment effectiveness score is obtained to screen out the candidate text segments. Then, the core semantic features of the candidate segments and the user question are extracted for matching, the matching parameters are sorted, the number of selected segments is determined in combination with the segment effectiveness score, and the knowledge extraction results are obtained. Finally, the knowledge extraction results are structured and reconstructed in combination with the result output template containing keywords, related databases, and conclusions to form a regular and unified knowledge output.
[0020] The technical scheme of the application solves the problems of traditional knowledge extraction, such as dependence on external search resources, rough text processing leading to information distortion, and low matching degree of extraction results and user needs, avoids knowledge extraction deviation caused by unavailability of external resources, text ambiguity or semantic breakage, and improves the accuracy and practicality of large language model knowledge extraction in a non-retrieval assistance scenario. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0022] Figure 1 A flowchart of a large language model knowledge extraction method without retrieval assistance provided by the embodiment of the present application;
[0023] Figure 2 A structural diagram of a large language model knowledge extraction system without retrieval assistance provided by the embodiment of the present application.
[0024] In the drawings, the components represented by the numbers are described as follows:
[0025] The problem reconstruction target acquisition module 01, the text segmentation semantic analysis module 02, the ambiguity scoring candidate acquisition module 03, the semantic matching result selection module 04, and the template reconstruction result output module 05. DETAILED DESCRIPTION
[0026] The present application provides a large language model knowledge extraction method and system without retrieval assistance, which is used to solve the technical problems in the prior art that traditional knowledge extraction often depends on external assistance, is limited by external resources and is prone to deviation, thereby causing difficulty in guaranteeing information accuracy and significantly reducing knowledge acquisition efficiency.
[0027] The technical solutions in the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0028] In the description of the present application, the terms "first", "second" are only for descriptive purposes and cannot be understood to indicate or imply relative importance or implicitly indicate the number of indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise explicitly specified.
[0029] In the description of the present application, the term "for example" is used to indicate "as an example, illustration or description". Any embodiment described as "for example" in the present application is not necessarily interpreted as more preferred or more advantageous than other embodiments. The following description is given in order to enable any person skilled in the art to implement and use the present application. In the following description, details are listed for the purpose of explanation. It should be understood that those skilled in the art can recognize that the present application can be implemented without using these specific details. In other examples, well-known structures and processes will not be described in detail to avoid unnecessary details making the description of the present application obscure. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope in accordance with the principles and characteristics disclosed in the present application.
[0030] Embodiment one, as shown in the accompanying Figure 1 The present application provides a large language model knowledge extraction method without search assistance, which comprises the following steps:
[0031] S110: obtaining a user search question, reconstructing a search question based on a search analysis template, inputting a large language model, and obtaining a target text, wherein the large language model is a local model;
[0032] In the embodiments of the present application, in the scenario where the user obtains accurate knowledge through a large language model, in order to make the knowledge extraction process more targeted and reduce the extraction deviation caused by ambiguous problem expression, the user search question needs to be reconstructed based on a search analysis template first, and then the reconstructed question is input into the local large language model to obtain the target text, so as to ensure that the text processed subsequently can better meet the core needs of the user.
[0033] Specifically, first, a search analysis template is obtained, which contains multiple search questions and related databases. Then, the search question proposed by the user is processed to extract the search semantic features therein, including keywords and core demands, so as to clarify the information direction that the user really wants to obtain.
[0034] Further, based on the search analysis template, the original search question of the user is adjusted and optimized in combination with the extracted search semantic features to form a reconstructed search question, so that the problem expression is clearer and more consistent with the understanding logic of the large language model.
[0035] Finally, the reconstructed search question is input into the pre-deployed local large language model, and the local model responds to the search question to generate and output the target text.
[0036] This step provides high-quality initial text materials for subsequent text preprocessing, segmentation, and semantic matching by reconstructing the user search question and calling the local model, ensuring that subsequent steps can focus on the user's core demands and reducing irrelevant information interference with knowledge extraction results.
[0037] The step S110 in the method provided by the embodiment of the application comprises:
[0038] Obtaining a search analysis template, wherein the search analysis template comprises a plurality of search questions and related databases;
[0039] Extracting search semantic features of the user search question, wherein the search semantic features comprise keywords and core demands;
[0040] Reconstructing the user search question based on the search analysis template and the search semantic features to obtain a reconstructed search question;
[0041] Inputting the reconstructed search question into a large language model to obtain a target text.
[0042] In the embodiment of the application, in order to avoid the deviation of subsequent knowledge extraction caused by the ambiguous and loose structure of the user question, the user question needs to be semantically deconstructed and reconstructed based on the search analysis template, and then input into the local large language model to obtain the target text, so as to ensure that the subsequent steps can be efficiently carried out around the user's core demands, and the accuracy and efficiency of knowledge extraction are improved.
[0043] Specifically, first, a search analysis template is obtained. The search analysis template is a pre-constructed knowledge search guide framework, which contains typical question patterns for different domain knowledge needs, and the related databases clearly define the information classification corresponding to each domain knowledge, such as company law, civil code in the legal field, artificial intelligence, big data, etc. in the technical field.
[0044] In actual application, the corresponding search analysis template needs to be called according to the general field to which the user question belongs, for example, when the user question involves legal knowledge, the template containing the database of company law, civil code, and legal question patterns is called to provide direction and boundary for the semantic analysis and reconstruction of the subsequent user question, avoiding domain deviation.
[0045] Further, the retrieval semantic features of the user search question are extracted. Among them, the user question may have long expression, logical implication and multi-intention mixed situations, for example, what are the provisions of the subsidiary company in the company law on the legal person setup, and what is the difference between the branch company.
[0046] At this time, the current user question needs to be semantically disassembled word by word and sentence by sentence, and key words such as subsidiary company, company law, legal person setup, and branch company are identified. At the same time, the core demands such as clarifying the legal provisions of the legal person setup of the subsidiary company and distinguishing the differences in the legal person setup between the subsidiary company and the branch company are mined. In the extraction process, the syntax structure and semantic association are analyzed by combining the existing natural language processing technology semantic analysis algorithm to ensure that there is no omission in key word extraction and no deviation in core demand judgment.
[0047] Further, based on the retrieved retrieval analysis template and combined with the extracted retrieval semantic features, the user search question is reconstructed to obtain a reconstructed search question.
[0048] Specifically, taking the search question paradigm in the retrieval analysis template as a reference, the key words and core demands are structured and reorganized to generate 1-3 more specific and directional search questions. For example, “Is it possible for a subsidiary company not to set up a legal representative?” Combined with the company law template, it is reconstructed as “1. What are the legal representative setup requirements for a subsidiary company? 2. What are the mandatory provisions of the company law on the organizational structure of a subsidiary company? 3. What are the differences in legal person setup between a subsidiary company and a branch company?”.
[0049] At the same time, when reconstructing, it is necessary to ensure that each question accurately corresponds to the core demand, the expression conforms to the understanding logic of the large model, and does not deviate from the original question, which is a refinement and extension of the original question.
[0050] Finally, the reconstructed search question is input into the large language model to obtain the target text. Among them, the local large language model is deployed on the local server or terminal and has the ability of autonomous knowledge reasoning and generation without relying on external retrieval tools.
[0051] After inputting the reconstructed question, the large language model generates answer texts for each reconstructed question based on its knowledge graph and semantic understanding ability, for example, inputting the above three questions about the legal person setup of the subsidiary company, the model outputs the legal provision interpretation of the legal representative setup of the subsidiary company, the specific provisions of the company law on the organizational structure of the subsidiary company, and the comparative analysis of the differences in legal person setup between the subsidiary company and the branch company.
[0052] At the same time, when inputting, it is necessary to ensure that the model input format is standardized and the calling parameters are adapted to the knowledge extraction demand to ensure that the output target text information is accurate, complete and semantically coherent.
[0053] The step provides initial text materials for subsequent text segmentation, ambiguity analysis, and semantic matching by template guiding, semantic deconstruction, reconstruction, and knowledge generation of a local large language model on a user question, to ensure that the knowledge extraction process efficiently operates around the real needs of the user without external retrieval assistance, and improves accuracy and efficiency from the source.
[0054] S120: preprocessing and text segmentation of the target text, obtaining a plurality of basic text segments, and analyzing semantic integrity of the plurality of basic text segments to obtain a plurality of text segments and a plurality of semantic integrity parameters;
[0055] In the embodiments of the present application, in order to avoid the fact that the subsequent candidate segment screening, semantic matching and other links deviate from the core demands of the user due to the semantic fragmentation or incompleteness of the text unit, the target text needs to be preprocessed and segmented first, and the semantic integrity of each basic text segment is analyzed and optimized to ensure that the text unit in the subsequent processing has complete semantics and to improve the accuracy and efficiency of knowledge extraction.
[0056] Specifically, the target text is first preprocessed, and the preprocessed target text is split into a plurality of basic text segments. The preprocessing process can remove irrelevant symbols in the text and unify the text format to reduce the interference of format chaos on the segmentation result.
[0057] Further, the semantic integrity of the plurality of basic text segments is analyzed, and the corresponding semantic integrity parameters are obtained. In the specific analysis, the semantic integrity threshold of the quantitative single text semantic unit completeness degree is obtained by weighted calculation based on the sentence correlation degree and the syntactic structure completeness degree. The semantic integrity threshold has a value range of [0, 1], and the higher the value, the better the semantic integrity of the segment.
[0058] After obtaining the semantic integrity parameters, the basic text segments with semantic integrity parameters lower than the preset segmentation threshold are screened out for re-segmentation. Usually, such segments are merged with adjacent segments to make up for the problem of incomplete single segment semantics, and finally a text segment set suitable for long text processing is obtained, as well as the semantic integrity parameters corresponding to each text segment.
[0059] The step provides a semantic complete text basis for subsequent acquisition of ambiguity confidence parameters and scoring of segment effectiveness by preprocessing, segmenting and optimizing the semantic integrity of the target text, so that the subsequently screened candidate text segments meet the needs of knowledge extraction.
[0060] The step S120 in the method provided by the embodiments of the present application includes:
[0061] preprocessing the target text to obtain a plurality of basic text segments;
[0062] analyze semantic integrity of the plurality of basic text segments to obtain a plurality of semantic integrity parameters;
[0063] segment the plurality of basic text segments with a low semantic integrity parameter below a semantic integrity threshold to obtain a plurality of text segments and the plurality of semantic integrity parameters.
[0064] In the embodiments of the present application, in order to prevent the knowledge extraction result from deviating from the user's core demand, the target text needs to be preprocessed, segmented and optimized for semantic integrity first, so as to ensure that the text unit processed subsequently has complete semantics and provides a reliable basis for high-quality knowledge extraction.
[0065] Specifically, the target text is first preprocessed. The preprocessing process needs to remove irrelevant special symbols, redundant spaces and repetitive expressions in the text, and unify the text format at the same time, so as to reduce the interference of format disorder on subsequent segmentation.
[0066] Further, after the preprocessing is completed, the text is segmented based on the existing technology, for example, divided by sentence, with the end punctuation (period, question mark, exclamation mark, etc.) as the separation mark, so as to divide the complete target text into a plurality of independent basic text segments, so as to ensure that each basic segment initially has the attribute of an independent expression unit.
[0067] After obtaining the plurality of basic text segments, the semantic integrity of each basic text segment is further analyzed to obtain the corresponding semantic integrity parameter.
[0068] Specifically, the analysis is based on the sentence correlation degree and the syntactic structure integrity degree as the core basis for weighted calculation, wherein the sentence correlation degree is used to evaluate the logical connection degree between the sentences in the segment, and the syntactic structure integrity degree is used to judge whether the segment contains a complete subject-predicate-object structure or core expression elements.
[0069] The semantic integrity parameter obtained by the weighted calculation is an index for quantifying the completeness of the semantic unit of a single text segment, and the value range is between 0 and 1. The closer the value of the semantic integrity parameter is to 1, the more complete the semantics of the basic text segment is. On the contrary, the closer the value is to 0, the more prominent the problem of semantic rupture or lack is.
[0070] For example, if a basic segment only contains "in the legal provisions", lacks the core element "specific content of the provisions", the syntactic structure is incomplete and the semantic correlation degree is insufficient, the calculated semantic integrity parameter may be only 0.3.
[0071] Further, after obtaining the semantic integrity parameters of all basic text segments, the basic text segments with semantic integrity parameter values lower than a preset semantic integrity threshold are screened out for re-segmentation. The preset semantic integrity threshold needs to be determined in combination with the accuracy requirement of knowledge extraction, for example, the semantic integrity threshold is set to 0.6, and the segment with a semantic integrity parameter lower than 0.6 is determined as a segment with incomplete semantics.
[0072] The re-segmentation operation aims to supplement complete semantics, and usually merges the segment with incomplete semantics with adjacent segments. For example, a certain basic segment is "the legal person setup of a subsidiary company needs to meet" (semantic integrity parameter 0.4), and the corresponding adjacent segment is "registered capital, personnel allocation, and other basic conditions" (semantic integrity parameter 0.5). After merging, the segment "the legal person setup of a subsidiary company needs to meet registered capital, personnel allocation, and other basic conditions" is formed, and the semantic integrity of the merged segment is complete, and the re-calculated semantic integrity parameter can be improved to 0.85.
[0073] Through the re-segmentation operation in the above steps, a text segment set suitable for long text processing is finally obtained, and the semantic integrity parameter of each final text segment is re-calculated and recorded, so that each segment meets the semantic quality requirement of the subsequent link.
[0074] Meanwhile, in the re-segmentation process, over-merging to cause the segment to be too long and the core semantics to be diluted needs to be avoided. For example, if two adjacent segments of a segment with incomplete semantics are both complete semantic segments, only the segment with closer logical association needs to be merged with the incomplete segment, instead of merging the two adjacent segments at the same time, so as to prevent the merged segment from containing too many independent semantic units and affecting the accuracy of subsequent ambiguity analysis.
[0075] Finally, through the steps of preprocessing, basic segmentation, semantic integrity analysis, and re-segmentation, the output text segment not only has complete semantics but also maintains a reasonable length, providing a high-quality text basis for subsequent acquisition of ambiguity confidence parameters and segmentation effectiveness scoring.
[0076] S130: Obtain a plurality of ambiguity confidence parameters of the plurality of text segments, perform segmentation effectiveness scoring in combination with the plurality of semantic integrity parameters, and obtain a plurality of candidate text segments;
[0077] In the embodiment of the application, in order to avoid deviation in subsequent matching with user questions due to ambiguity or insufficient semantic integrity of the text segment, the ambiguity confidence parameter of each text segment needs to be obtained first, and the effectiveness scoring is performed in combination with the semantic integrity parameter, so as to screen out candidate text segments with qualified quality and lay a foundation for accurate matching of user requirements.
[0078] Specifically, first, an ambiguity confidence analyzer is acquired. The ambiguity confidence analyzer is trained in advance through sample text and has the ability to judge whether there is ambiguity in text segmentation. It can output corresponding ambiguity confidence parameters based on the semantic expression and expression method of the text.
[0079] Further, the ambiguity confidence analyzer is used to analyze the ambiguity confidence of each text segment, and an ambiguity confidence parameter is generated for each text segment to reflect the possibility of ambiguity in the text segment.
[0080] Further, after obtaining the ambiguity confidence parameter, an ambiguity severity correction coefficient is obtained based on the semantic integrity parameter of each text segment obtained in advance. Since the ambiguity severity correction coefficient and the semantic integrity parameter are positively correlated, that is, the higher the semantic integrity parameter of the text segment, the higher the corresponding ambiguity severity correction coefficient. The semantic integrity parameter is used to correct the ambiguity confidence parameter to obtain multiple corrected ambiguity confidence parameters to more accurately reflect the ambiguity influence degree of different text segments.
[0081] Further, the multiple corrected ambiguity confidence parameters and the semantic integrity parameters are weighted and summed, and the segment effectiveness score of each text segment is calculated according to a preset weight distribution rule. The higher the score, the better the comprehensive quality of the text segment in ambiguity control and semantic integrity.
[0082] Finally, based on the multiple segment effectiveness scores, a score threshold is set, and multiple text segments with scores higher than the threshold are selected as candidate text segments for the subsequent semantic matching link.
[0083] This step selects high-quality candidate units from numerous text segments by ambiguity analysis and effectiveness scoring of the text segments, eliminates segments with obvious ambiguity and poor semantic quality, ensures that the subsequent semantic matching with the user's search question can be carried out on the basis of reliable text, and further improves the accuracy of the knowledge extraction result.
[0084] The method provided in the embodiment of the application includes the following steps:
[0085] An ambiguity confidence analyzer is acquired.
[0086] The ambiguity confidence analyzer is used to analyze the ambiguity confidence of each text segment, and an ambiguity confidence parameter is generated for each text segment to reflect the possibility of ambiguity in the text segment.
[0087] Based on the semantic integrity parameter, an ambiguity severity correction coefficient is obtained, the ambiguity confidence is corrected, and multiple corrected ambiguity confidence parameters are obtained. The ambiguity severity correction coefficient and the semantic integrity parameter are positively correlated.
[0088] performing weighted summation on the plurality of the ambiguity resolution confidence parameters and the semantic integrity parameter to obtain a plurality of segment validity scores of the plurality of text segments;
[0089] performing screening based on the plurality of segment validity scores to obtain a plurality of candidate text segments.
[0090] In the embodiments of the present application, in order to avoid the matching deviation caused by the ambiguity or insufficient semantic quality of the text segment, ambiguity analysis and validity evaluation need to be carried out on the text segment first, and the candidate segment with qualified comprehensive quality is screened out to improve the accuracy of subsequent semantic matching and guarantee the reliability of the final knowledge extraction result.
[0091] Specifically, first, an ambiguity confidence analyzer is obtained, and ambiguity confidence analysis is carried out on each of the plurality of text segments obtained in the previous stage by using the ambiguity confidence analyzer, and an ambiguity confidence parameter corresponding to each segment is output to preliminarily judge whether each text segment has problems such as ambiguous expression and polysemy.
[0092] In the method provided by the embodiments of the present application, the ambiguity confidence analyzer is obtained, including:
[0093] a plurality of paraphrased texts are generated for each of the sample text segments, and semantic feature vectors of the plurality of paraphrased texts are obtained, a cosine similarity is calculated, and an ambiguity confidence label is obtained;
[0094] The ambiguity confidence analyzer is constructed, the plurality of sample text segments are taken as input, the ambiguity confidence label is taken as supervision, and the ambiguity confidence analyzer is trained until convergence.
[0095] Specifically, first, a plurality of sample text segments are obtained. The sample text segments need to cover a plurality of fields commonly used in knowledge extraction, such as law, technology, education, etc., and contain contents with different expression complexities, both short sentence type simple segments and long sentence type complex segments are included to ensure the diversity of samples.
[0096] At the same time, the number of samples needs to meet the training accuracy requirement, usually not less than 5000 sample text segments are prepared, and the proportion of samples in each field is adjusted according to the actual business focus of knowledge extraction. If the focus is on legal knowledge extraction, the proportion of legal samples can be set to 40%, and the proportions of samples in other fields are 60% in total.
[0097] After obtaining the sample text segments, a plurality of paraphrased texts are generated for each sample text segment. The generation process needs to be based on the natural language understanding technology in the prior art to ensure that each paraphrased text can accurately convey the core semantics of the original segment, while avoiding completely consistent expression.
[0098] For each sample text segment, three paraphrased texts are generated, for example, the original segment is "the legal representative of the subsidiary company needs to bear legal responsibility for the company's business behavior", and the three generated paraphrased texts can be "the legal representative of the subsidiary company needs to bear legal responsibility for the company's business behavior" "the legal representative of the subsidiary company needs to bear legal responsibility for the company's business behavior" "the legal representative of the subsidiary company needs to bear legal responsibility for the company's business behavior".
[0099] Among them, if the original segment has ambiguity, the three generated paraphrased texts will show different semantic tendencies, such as "Party A needs to deliver goods by the end of the month, Party B will pay after passing the acceptance check" "Party A needs to deliver goods by the end of the next month, Party B will pay after passing the acceptance check" "Party A needs to deliver goods by the end of the month agreed by both parties, Party B will pay after passing the acceptance check", in order to reflect the ambiguity characteristics of the original segment.
[0100] Further, the semantic feature vectors of the plurality of paraphrased texts are obtained and the cosine similarity is calculated. Specifically, the existing technology of bidirectional encoder representation technology (BERT) pre-training model is used to encode each paraphrased text, and the text is converted into a 768-dimensional semantic feature vector, which can accurately capture the semantic information of the text.
[0101] In specific calculation, for the three paraphrased texts of the same original segment, the cosine similarity is calculated pairwise to obtain three groups of similarity values (i.e. the similarity of paraphrase 1 and paraphrase 2, the similarity of paraphrase 1 and paraphrase 3, and the similarity of paraphrase 2 and paraphrase 3), and then the average of the three groups of values is taken as the overall semantic similarity of the sample text segment.
[0102] Further, the ambiguity confidence label is determined according to the overall semantic similarity. If the overall semantic similarity is higher than 0.9, it means that the three paraphrased texts are highly consistent in semantics, the original segment has no ambiguity, and the ambiguity confidence label is set to 0.9 (the label value range is [0, 1], and the higher the value represents the higher the degree of no ambiguity); if the overall semantic similarity is between 0.7 and 0.9, it means that the original segment has slight ambiguity, and the ambiguity confidence label is set to 0.6; if the overall semantic similarity is lower than 0.7, it means that the original segment has obvious ambiguity, and the ambiguity confidence label is set to 0.3. Through the above method, the corresponding ambiguity confidence label is labeled for each sample text segment, forming a complete sample training set.
[0103] Further, the network architecture of the ambiguity confidence analyzer is constructed. Combined with the requirements of text semantic understanding and classification, "BERT encoding layer + fully connected layer" is selected as the core architecture, wherein the BERT encoding layer adopts a pre-trained basic model, which is responsible for converting the input text segment into a semantic feature vector. This layer can effectively capture the context semantic association of the text and adapt to the fine-grained semantic analysis required for ambiguity judgment.
[0104] In addition, the full connection layer is set to two layers, the first layer contains 256 neurons, uses a linear rectifier function activation function, reduces the 768-dimensional vector output by the BERT encoding layer to 256 dimensions, and at the same time enhances the nonlinear fitting ability of the model. The second layer contains one neuron, uses a sigmoid growth curve activation function, and maps the output result to the [0, 1] interval. The output result is the ambiguity confidence prediction value of the text segmentation, which corresponds to the ambiguity confidence label marked before.
[0105] At the same time, during the architecture building process, the first 8 layers of the BERT encoding layer parameters need to be frozen, and only the last 4 layers and the full connection layer parameters are fine-tuned to reduce the size of the training parameters, avoid overfitting, and at the same time preserve the semantic understanding ability of the pre-trained model.
[0106] After completing the architecture building, multiple sample text segments are used as input, and ambiguity confidence labels are used as supervision to train the ambiguity confidence analyzer to convergence.
[0107] Specifically, during training, the sample training set is divided into a training set, a validation set, and a test set in a ratio of 7:2:1. The training set is used for iterative updating of model parameters, the validation set is used to monitor the performance of the model during training, and the test set is used for final evaluation of model accuracy. The mean square error loss function is used to calculate the error between the ambiguity confidence predicted by the model and the true label, and the adaptive moment estimation optimizer is used to adjust the model parameters. The initial learning rate is set to 2e -5 , and the batch size is set to 32.
[0108] During training, the performance of the model is evaluated every 10 rounds of training using the validation set, and the average absolute error on the validation set is calculated. If the average absolute error decreases by less than a predetermined threshold for 5 consecutive rounds, or the average absolute error stabilizes below 0.05, the model is considered to have converged and training is stopped.
[0109] In addition, periodic verification and parameter adjustment are required during training. For example, if the average absolute error of the validation set increases from 0.04 to 0.06 after 20 rounds of training, it indicates that the model has overfitting. At this time, a dropout layer is added (a dropout layer is added between the full connection layers, with a dropout probability of 0.3), and the learning rate is adjusted to 1e -5 , and training is continued.
[0110] If it is found that the ambiguity judgment error of text segmentation containing professional terms in the legal field is large, 1000 sample text segments in the legal field are supplemented, re-labeled and added to the training set, and then trained again to convergence to ensure the ambiguity judgment accuracy of the analyzer for text segmentation in the professional field.
[0111] Finally, the ambiguity confidence analyzer after training converges can accurately output the ambiguity confidence parameters of the text segmentation, providing a reliable tool for subsequent ambiguity evaluation of the text segmentation to ensure that the segmentation validity score can accurately reflect the ambiguity of the text segmentation.
[0112] Further, after obtaining the ambiguity confidence parameters, based on the semantic integrity parameters of each text segment obtained in the previous step, an ambiguity severity correction coefficient is obtained to correct the obtained ambiguity confidence parameters to obtain a plurality of corrected ambiguity confidence parameters.
[0113] Wherein, the ambiguity severity correction coefficient and the semantic integrity parameter are positively correlated. Specifically, a preset correction coefficient (determined according to the accuracy requirement of the knowledge extraction scene, and the preset correction coefficient is 0.7 here) is set first, and then the ambiguity severity correction coefficient is calculated by the formula "ambiguity severity correction coefficient = semantic integrity parameter / preset correction coefficient", and finally the correction result is obtained by "corrected ambiguity confidence parameter = ambiguity severity correction coefficient x ambiguity confidence parameter".
[0114] For example, the semantic integrity parameter of a certain text segment is 0.9, and the ambiguity confidence parameter is 0.7, then the ambiguity severity correction coefficient = 0.9 / 0.7, and the corrected ambiguity confidence parameter = (0.9 / 0.7) x 0.7 = 0.9. This result not only retains the ambiguity evaluation basis of the original segment, but also incorporates the influence of semantic integrity, which is more suitable for actual application scenarios.
[0115] In addition, the semantic integrity parameter of another text segment is 0.6, and the ambiguity confidence parameter is 0.7, the corresponding ambiguity severity correction coefficient = 0.6 / 0.7, and the corrected ambiguity confidence parameter = (0.6 / 0.7) x 0.7 = 0.6. Through correction, it is clear that this text segment has a higher ambiguity risk due to insufficient semantic integrity, even if the original ambiguity confidence is consistent with the previous segment.
[0116] Further, after obtaining the corrected ambiguity confidence parameters, the plurality of corrected ambiguity confidence parameters and the semantic integrity parameters are weighted and summed to obtain a plurality of segmentation validity scores of a plurality of text segments.
[0117] Wherein, the weight distribution needs to be combined with the priority of knowledge extraction for no ambiguity and semantic integrity. Specifically, considering that ambiguity will directly lead to deviation of the extraction result from the user's core demand, the weight of the corrected ambiguity confidence parameter is set to 0.6; semantic integrity is the basis for ensuring the effectiveness of the extracted information, and the weight is set to 0.4. The segmentation validity score is calculated by the formula "segmentation validity score = (corrected ambiguity confidence parameter x 0.6) + (semantic integrity parameter x 0.4)".
[0118] For example, the correction ambiguity confidence parameter of a certain text segment is 0.9, and the semantic integrity parameter is 0.9. Then the segment validity score of the text segment = (0.9 x 0.6) + (0.9 x 0.4) = 0.9, which represents that the comprehensive quality of the segment is excellent. In addition, the correction ambiguity confidence parameter of another text segment is 0.6, and the semantic integrity parameter is 0.6. The segment validity score of the text segment = (0.6 x 0.6) + (0.6 x 0.4) = 0.6, which reflects that there is room for improvement in ambiguity control and semantic integrity of the text segment.
[0119] The segment validity score result has a value range of [0, 1], and the higher the value, the better the comprehensive quality of the text segment, and the more suitable it is as a candidate unit for subsequent semantic matching.
[0120] Finally, based on the segment validity scores, a plurality of candidate text segments are screened and obtained. Before screening, a score threshold needs to be set. The determination of the score threshold needs to balance the accuracy of knowledge extraction and the number of candidate segments.
[0121] Specifically, if the accuracy requirement of the extraction result is high, the score threshold can be set to 0.8. If more potential effective information needs to be covered while ensuring accuracy, the score threshold can be set to 0.7. For example, when the score threshold is set to 0.75, the validity scores of all text segments are sorted, and the segments with scores higher than 0.75 are selected as candidate text segments. For example, segments with scores of 0.9, 0.88 and 0.79 are included in the candidate set, while segments with scores of 0.73 and 0.69 are excluded because they do not meet the score threshold.
[0122] In addition, special cases need to be handled during the screening process. If the validity score of a part of the text segment is slightly lower than the threshold, but it contains the core keywords in the user search question, and after manual review confirms that the core information is effective, the ambiguity and semantic missing problem has little effect on the interpretation of the core information, it can also be included in the candidate set to avoid missing key information.
[0123] Through the above screening method, the final candidate text segments can not only guarantee the comprehensive quality, but also cover the core points of user demand, which lays a good foundation for subsequent semantic matching with the user search question.
[0124] S140: performing semantic matching on the plurality of candidate text segments and the user search question respectively, and obtaining a plurality of candidate text segments with the highest semantic matching parameter as the knowledge extraction result;
[0125] In the embodiments of the present application, in order to avoid the final knowledge extraction result deviating from the core demand of the user due to the low semantic correlation between the text segmentation and the user search question, the semantic features of the candidate segmentation and the user search question are extracted and matched first, and then the number of selected segments is determined in combination with the previous score, so as to ensure that the extraction result accurately reflects the user demand and improves the effectiveness of knowledge acquisition.
[0126] Specifically, first, the core semantic features of a plurality of candidate text segments are acquired, which include keywords and key conclusions in the segments, and the search semantic features of the user search question extracted previously are recalled. Through semantic analysis technology, the two types of semantic features are compared, the semantic correlation degree of each candidate text segment and the user search question is calculated, and the corresponding semantic matching parameters are acquired. The higher the parameter value is, the higher the matching degree of the candidate segment and the user question is.
[0127] Further, the plurality of candidate text segments are arranged in descending order of the semantic matching parameters to form a candidate text sequence, so that the candidate segments with high matching degrees are placed in the front position of the sequence, which facilitates subsequent preferential selection.
[0128] Further, based on the segmentation effectiveness score of each candidate text segment, the number of selected candidate texts is determined. Generally, the candidate set with a higher overall segmentation effectiveness score can appropriately increase the number of selected segments to cover more effective information, and if the overall segmentation effectiveness score is low, the number of selected segments is reduced to preferentially retain the text segments with high scores and semantic matching parameters.
[0129] Finally, in the candidate text sequence, the corresponding candidate text segments are selected from front to back according to the determined number of selected segments, and these segments are the final knowledge extraction result.
[0130] This step ensures that the final output knowledge extraction result is highly matched with the user demand and has good text quality, and provides accurate and effective knowledge information for the user.
[0131] The method provided in the embodiments of the present application includes the following steps S140:
[0132] The core semantic features of a plurality of candidate text segments are acquired, and the search semantic features are subjected to semantic matching to acquire a plurality of semantic matching parameters, wherein the core semantic features include keywords and key conclusions;
[0133] The plurality of candidate text segments are sorted in descending order of the semantic matching parameters to acquire a candidate text sequence;
[0134] Based on the segment effectiveness score, the number of candidate text selections is obtained, and the candidate text sequence is selected to obtain a plurality of candidate text segments as the knowledge extraction result.
[0135] In the embodiments of the present application, in order to accurately locate the content most suitable for the core needs of the user's search question from the candidate text segments screened in the early stage, the steps of semantic feature extraction, matching calculation, sorting and quantitative selection are required to screen high-quality and high-matching-degree text segments, so as to ensure the accuracy and practicality of the final knowledge extraction result.
[0136] Specifically, first, the core semantic features of a plurality of candidate text segments are obtained, and semantic matching is performed with the search semantic features to obtain a plurality of semantic matching parameters.
[0137] Among them, the core semantic features focus on the key information in the candidate text segments, and the keywords are the words carrying the core concepts in the segments, such as subsidiaries, legal liability, registered capital in legal segments, model training, semantic coding, etc. in technical segments.
[0138] In addition, the key conclusions are explicit responses to the core problems in the segments, such as the subsidiary legal person not bearing the responsibility for the parent company's debt, and the bidirectional encoder representation technology (BERT) can improve the semantic capture accuracy. The search semantic features are the keywords and core demands extracted from the user's search question in the early stage, and the two need to form accurate correspondence.
[0139] When performing matching calculation, the keyword similarity and the demand-conclusion matching degree are weighted and summed as two dimensions. Among them, the keyword similarity is obtained by calculating the coincidence degree and semantic association degree of the candidate segment keywords and the search keywords. For example, the candidate segment keywords are "subsidiary legal liability", and the search keywords are "subsidiary legal representative responsibility". The two have a high semantic association, and the keyword similarity can be calculated as 0.9.
[0140] In addition, the demand-conclusion matching degree is obtained by judging whether the candidate segment key conclusion can respond to the search core demand. For example, the user's demand is "to clarify the scope of the subsidiary legal person's responsibility", and the candidate segment key conclusion is "the subsidiary legal person only bears limited responsibility for the company's operating behavior". The demand-conclusion matching degree can be calculated as 0.95.
[0141] At the same time, combined with the priority demand of knowledge extraction for accurate response to the demand, the keyword similarity weight is set to 0.4, and the demand-conclusion matching degree weight is set to 0.6. The formula calculation result is "semantic matching parameter = (keyword similarity x 0.4) + (demand-conclusion matching degree x 0.6)".
[0142] Exemplarily, a certain candidate segment keyword similarity is 0.85, the appeal-conclusion matching degree is 0.9, and the corresponding semantic matching parameter = (0.85 x 0.4) + (0.9 x 0.6) = 0.88; another candidate segment keyword similarity is 0.9, the appeal-conclusion matching degree is 0.7, and the corresponding semantic matching parameter = (0.9 x 0.4) + (0.7 x 0.6) = 0.78, which clearly reflects the degree of fit between the candidate segment and the user demand through the numerical difference.
[0143] Further, after obtaining the semantic matching parameters of all candidate text segments, the plurality of candidate text segments are sorted in descending order of the semantic matching parameters to obtain a candidate text sequence. During the sorting process, it is necessary to ensure the accuracy of the order of segments with adjacent parameter values, for example, the candidate segments with semantic matching parameters of 0.92, 0.88, 0.85, 0.78 and 0.72 are sequentially sorted to form a candidate text sequence, so that the segment with the highest degree of fit with the user demand is at the front end of the sequence, facilitating subsequent preferential selection.
[0144] Further, based on the segment effectiveness score, the number of candidate text selections is obtained. The segment effectiveness score is a text quality quantitative index obtained by combining the ambiguity confidence parameter and the semantic integrity parameter, and the overall level determines the availability of the candidate set.
[0145] Specifically, if the segment effectiveness scores in the candidate set are generally high, it indicates that the overall text quality is good, and the number of selections can be appropriately increased to cover more effective information, for example, the first 5 segments in the selection sequence; if only a few segment effectiveness scores in the candidate set are high, the number of selections is reduced, and only the first 3 segments are selected to avoid affecting the accuracy of knowledge extraction results due to the selection of too many low-quality segments.
[0146] In addition, the number of selections needs to be set with an upper and lower limit, the lower limit being 1 to ensure that at least one effective result is output, and the upper limit being 10 to avoid information redundancy caused by too many selections. For example, when the overall score of the candidate set is high and the gradient of the semantic matching parameter is flat, the number of selections is set to 8; when only the first 4 segments have high effectiveness scores and matching degrees, and the quality of the subsequent segments decreases significantly, the number of selections is set to 4.
[0147] Finally, a plurality of candidate text segments are obtained as the knowledge extraction result by selecting the candidate text sequence according to the determined number of selections. The selection strictly follows the sequence order, and the corresponding number of segments are selected from the front end, for example, when the number of selections is determined to be 3, the first 3 segments with the highest semantic matching parameters in the selection sequence are selected.
[0148] If it is found in the selection process that a segment is at the front end of the sequence but the segment validity score suddenly drops significantly, the score calculation process of the segment needs to be re-verified to confirm whether there is an error; if it is confirmed that the score is correct, the number of selected segments can be appropriately adjusted to 2, and the segment with both high quality and high matching degree is preferentially retained to ensure that the knowledge extraction result not only meets the user's needs but also has reliable text quality.
[0149] Finally, through the above steps of semantic matching, sorting and quantitative selection, the knowledge extraction result obtained can accurately respond to the user's search question, while avoiding information redundancy, providing a high-quality content basis for subsequent structured reconstruction of the result output template, and further improving the practical value of knowledge extraction.
[0150] S150: Reconstructing the knowledge extraction result by combining the result output template to obtain a structured knowledge extraction result.
[0151] In the embodiments of the present application, in order to avoid the user's difficulty in quickly grasping the core information and reducing the efficiency of using knowledge due to the scattered and disordered results, a result output template containing a key information module needs to be obtained first, and then the knowledge extraction result is restructured according to the template to form a clear and intuitive structured result.
[0152] Specifically, first, the result output template is obtained. The result output template contains three core parts: keywords, related databases and conclusions.
[0153] Further, the knowledge extraction result is reconstructed based on the result output template. That is, the core vocabulary is extracted from the extraction result and filled into the keyword part, the related database is determined and labeled according to the knowledge attribute, and the scattered key conclusions are sorted and integrated and filled into the conclusion part to ensure that the information in each module is complete and logically coherent.
[0154] This step converts the originally fragmented extraction result into a structured content through template reconstruction, facilitates the user to quickly understand the core information, and provides a unified format basis for the storage and reuse of subsequent knowledge, thereby guaranteeing the practical application value of the knowledge extraction result.
[0155] The step S150 in the method provided in the embodiments of the present application includes:
[0156] Obtaining a result output template, wherein the result output template at least contains keywords, related databases and conclusions;
[0157] Reconstructing the knowledge extraction result by combining the result output template to obtain a structured knowledge extraction result.
[0158] In the embodiments of the present application, in order to present the knowledge extraction result to the user in a clear and regular form, avoid the user's understanding difficulty caused by scattered content, and reduce the knowledge use efficiency, a result output template containing a key information module needs to be acquired first, and then the knowledge extraction result is reconstructed according to the result output template to form a structured knowledge extraction result with clear structure and clear information, thereby improving the intuitiveness and practicality of knowledge transmission.
[0159] Specifically, first, the result output template is acquired. The result output template needs to cover three parts of keywords, related databases and conclusions, the keywords are used to refine the core concept of knowledge, the related databases are used to mark the field to which the knowledge belongs, and the conclusions are used to clearly respond to the user's question.
[0160] Exemplarily, in the legal knowledge scene, the result output template can preset a keyword column for storing the words such as subsidiary company, legal person setting, company law, a related database column for marking the company law, and a conclusion column for integrating the answer content to the question.
[0161] Further, after the result output template is acquired, the knowledge extraction result is reconstructed in combination with the template to finally form a structured content with uniform format and intuitive information, so that the user can quickly grasp the core of knowledge and improve the convenience of knowledge use.
[0162] Specifically, first, the core keywords are extracted from the knowledge extraction result, which need to accurately correspond to the core demand of the user's search question, for example, the user's question is around the legal person setting of the subsidiary company, and the keywords such as subsidiary company and legal representative are extracted and filled into the keyword part of the template.
[0163] Further, the related database is determined according to the knowledge attribute, for example, the knowledge related to the legal person provision of the company is marked as the company law in the related database column. Finally, the key conclusions in the knowledge extraction result are sorted and integrated, and are filled into the conclusion part of the result output template according to the logic, so that the conclusion is expressed completely. For example, the extraction result of the requirement of the legal representative setting of the subsidiary company is presented in the conclusion column as "Article 13 of the Company Law provides that the legal representative of the subsidiary company needs to be appointed according to the company charter".
[0164] Through the reconstruction based on the result output template, the originally scattered knowledge extraction result is converted into regular structured content, which facilitates the user to quickly understand the core information, and provides a uniform format basis for the storage and reuse of knowledge, thereby effectively guaranteeing the practical application value of the knowledge extraction result.
[0165] The embodiments of the present application achieve the following technical effects through the specific implementation manner described above.
[0166] This application proposes a knowledge extraction method for large-scale language models without retrieval assistance. First, semantic analysis is performed on the user's retrieval question. Based on the retrieval analysis template, the question is reconstructed into a clear question and input into a local large-scale language model to obtain the target text. Next, the target text undergoes preprocessing, segmentation, and semantic integrity analysis. Segments with incomplete semantics are re-segmented and optimized. Then, an ambiguity confidence analyzer is obtained to perform ambiguity analysis on the text segments and calculate corrected ambiguity confidence based on semantic integrity parameters, thereby obtaining a segmentation effectiveness score to filter candidate text segments. Next, the core semantic features of the candidate segments are extracted and matched with the user's question. The segments are sorted according to matching parameters, and the number of segments selected is determined based on the segmentation effectiveness score, resulting in the knowledge extraction result. Finally, the knowledge extraction result is structurally reconstructed using a result output template containing keywords, relevant databases, and conclusions, forming a unified knowledge output.
[0167] The method provided in this application, through the technical solution of "problem reconstruction - text quality control - dual-dimensional screening of ambiguity and semantics - accurate semantic matching - structured output", solves the problems of traditional knowledge extraction relying on external retrieval resources, information distortion caused by rough text processing, and low matching degree between extraction results and user needs. It avoids knowledge extraction deviations caused by unavailable external resources, text ambiguity, or semantic breaks, and provides an efficient knowledge acquisition solution for enterprise internal knowledge management, information organization, and other scenarios.
[0168] Example 2, as shown in the appendix Figure 2 As shown, based on the inventive concept of a large-scale language model knowledge extraction method without retrieval assistance provided in Embodiment 1, this application also provides a large-scale language model knowledge extraction system without retrieval assistance, specifically including:
[0169] The question reconstruction target acquisition module 01 is used to acquire the user's search question, acquire the reconstructed search question based on the search analysis template, input a large language model, and acquire the target text, wherein the large language model is a local model;
[0170] The text segmentation semantic analysis module 02 is used to preprocess and segment the target text, obtain multiple basic text segments, analyze the semantic integrity of the multiple basic text segments, and obtain multiple text segments and multiple semantic integrity parameters.
[0171] The ambiguity scoring candidate acquisition module 03 is used to acquire multiple ambiguity confidence parameters of multiple text segments, combine multiple semantic integrity parameters to score the segment validity, and acquire multiple candidate text segments.
[0172] The semantic matching result selection module 04 is configured to perform semantic matching on the plurality of candidate text segments and the user search question respectively, and obtain a plurality of candidate text segments with the highest semantic matching parameters as the knowledge extraction result.
[0173] The template reconstruction result output module 05 is configured to reconstruct the knowledge extraction result by combining a result output template, and obtain a structured knowledge extraction result.
[0174] In an embodiment, the question reconstruction target acquisition module 01 is further configured to:
[0175] acquire a search analysis template, wherein the search analysis template comprises a plurality of search questions and related databases; extract search semantic features of the user search question, wherein the search semantic features comprise keywords and core appeals; reconstruct the user search question based on the search analysis template and the search semantic features, and acquire a reconstructed search question; and input the reconstructed search question into a large language model, and acquire a target text.
[0176] In an embodiment, the text segment semantic analysis module 02 is further configured to:
[0177] preprocess the target text to obtain a plurality of basic text segments; analyze semantic integrity of the plurality of basic text segments to obtain a plurality of semantic integrity parameters; and segment the plurality of basic text segments with a semantic integrity parameter lower than a semantic integrity threshold to obtain the plurality of text segments and the plurality of semantic integrity parameters.
[0178] In an embodiment, the ambiguity scoring candidate acquisition module 03 is further configured to:
[0179] acquire an ambiguity confidence analyzer; perform ambiguity confidence analysis on the plurality of text segments by using the ambiguity confidence analyzer to obtain a plurality of ambiguity confidence parameters; acquire an ambiguity severity correction coefficient based on the semantic integrity parameters, correct the plurality of ambiguity confidences by using the ambiguity severity correction coefficient to obtain a plurality of corrected ambiguity confidence parameters, wherein the ambiguity severity correction coefficient is positively correlated with the semantic integrity parameters; perform weighted summation on the plurality of corrected ambiguity confidence parameters and the semantic integrity parameters to obtain a plurality of segment effectiveness scores of the plurality of text segments; and select a plurality of candidate text segments based on the plurality of segment effectiveness scores.
[0180] Further, the ambiguity scoring candidate acquisition module 03 further comprises:
[0181] A plurality of sample text segments are obtained, a plurality of paraphrased texts are generated for each of the sample text segments, and semantic feature vectors of the plurality of paraphrased texts are obtained. A cosine similarity is calculated, and an ambiguity confidence label is obtained. An ambiguity confidence analyzer is constructed, taking the plurality of sample text segments as input and taking the ambiguity confidence label as supervision. The ambiguity confidence analyzer is trained until convergence.
[0182] In one embodiment, the semantic matching result selection module 04 is further configured to:
[0183] Core semantic features of the plurality of candidate text segments are obtained, and semantic matching is performed between the core semantic features and the search semantic features to obtain a plurality of semantic matching parameters. The core semantic features include keywords and key conclusions. The plurality of candidate text segments are sorted in descending order of semantic matching parameters to obtain a candidate text sequence. Based on the segment effectiveness score, a candidate text selection quantity is obtained, and the candidate text sequence is selected to obtain a plurality of candidate text segments as the knowledge extraction result.
[0184] In one embodiment, the template reconstruction result output module 05 is further configured to:
[0185] A result output template is obtained, wherein the result output template at least includes keywords, related databases, and conclusions. The knowledge extraction result is reconstructed based on the result output template to obtain a structured knowledge extraction result.
[0186] It should be noted that the above-mentioned sequence of embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. Moreover, the above describes specific embodiments of the present application. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are possible or can be advantageous.
[0187] The above only describes the preferred embodiments of the present application and does not limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0188] The present application is only an exemplary description of the present application, and should be considered to cover any and all modifications, changes, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art can make various modifications and changes to the present application without departing from the scope of the present application. Thus, if these modifications and changes of the present application belong to the scope of the present application and its equivalents, the present application is intended to include these modifications and changes.
Claims
1. A method for knowledge extraction from large-scale language models without retrieval assistance, characterized in that, include: The user's search question is obtained, and based on the search analysis template, the search question is reconstructed. The reconstructed search question is then input into a large language model to obtain the target text, wherein the large language model is a local model. The target text is preprocessed and segmented to obtain multiple basic text segments. The semantic integrity of the multiple basic text segments is analyzed to obtain multiple text segments and multiple semantic integrity parameters. Multiple ambiguity confidence parameters of multiple text segments are obtained, and multiple semantic integrity parameters are combined to score the segment validity and obtain multiple candidate text segments. Semantic matching is performed on multiple candidate text segments and user retrieval questions respectively, and the multiple candidate text segments with the highest semantic matching parameters are obtained as knowledge extraction results. Based on the output template, the knowledge extraction results are reconstructed to obtain structured knowledge extraction results; Obtain the user's search question, and based on the search analysis template, obtain a reconstructed search question. Input this into a large language model to obtain the target text, including: Obtain the search analysis template, which includes multiple search questions and related databases; Extract the retrieval semantic features of the user's search question, wherein the retrieval semantic features include keywords and core demands; Based on the retrieval analysis template and combined with the retrieval semantic features, the user's retrieval question is reconstructed to obtain the reconstructed retrieval question; The reconstructed retrieval problem is input into a large language model to obtain the target text; Semantic matching is performed on multiple candidate text segments and the user's retrieval question. The candidate text segments with the highest semantic matching parameters are obtained as the knowledge extraction results, including: Obtain the core semantic features of multiple candidate text segments and perform semantic matching with the retrieval semantic features to obtain multiple semantic matching parameters, wherein the core semantic features include keywords and key conclusions; The candidate text segments are sorted from largest to smallest according to the semantic matching parameters to obtain a candidate text sequence; Based on the segment validity score, the number of candidate texts selected is obtained, and multiple candidate text segments are selected from the candidate text sequence as knowledge extraction results.
2. The method for knowledge extraction from a large language model without retrieval assistance as described in claim 1, characterized in that, The target text is preprocessed and segmented to obtain multiple basic text segments. The semantic integrity of these basic text segments is then analyzed to obtain multiple text segments and multiple semantic integrity parameters, including: The target text is preprocessed to obtain multiple basic text segments; Analyze the semantic integrity of multiple basic text segments to obtain multiple semantic integrity parameters; Multiple basic text segments with semantic integrity parameters lower than the semantic integrity threshold are re-segmented to obtain multiple text segments and multiple semantic integrity parameters.
3. The method for knowledge extraction from a large language model without retrieval assistance as described in claim 1, characterized in that, Multiple ambiguity confidence parameters of the multiple text segments are obtained, and the segment validity is scored by combining multiple semantic integrity parameters to obtain multiple candidate text segments, including: Obtain the ambiguity confidence analyzer; The ambiguity confidence analyzer is used to perform ambiguity confidence analysis on multiple text segments to obtain multiple ambiguity confidence parameters; Based on the semantic integrity parameter, an ambiguity severity correction coefficient is obtained, and multiple ambiguity confidences are corrected to obtain multiple corrected ambiguity confidence parameters, wherein the ambiguity severity correction coefficient and the semantic integrity parameter are positively correlated. The multiple corrected ambiguity confidence parameters and the semantic integrity parameters are weighted and summed to obtain multiple segment validity scores for multiple text segments; Based on the validity scores of the segmentation, multiple candidate text segments are selected.
4. The method for knowledge extraction from a large language model without retrieval assistance as described in claim 3, characterized in that, Obtain the ambiguity confidence analyzer, including: Multiple sample text segments are obtained, multiple explanatory texts are generated for each sample text segment, and the semantic feature vectors of the multiple explanatory texts are obtained. The cosine similarity is calculated, and the ambiguity confidence label is obtained. An ambiguity confidence analyzer is constructed by taking multiple sample text segments as input and the ambiguity confidence labels as supervision, and training the ambiguity confidence analyzer until convergence.
5. The method for knowledge extraction from a large language model without retrieval assistance according to claim 1, characterized in that, Based on the output template, the knowledge extraction results are reconstructed to obtain structured knowledge extraction results, including: Obtain a result output template, wherein the result output template includes at least keywords, relevant databases, and conclusions; Based on the output template, the knowledge extraction results are reconstructed to obtain structured knowledge extraction results.
6. A large-scale language model knowledge extraction system without retrieval assistance, characterized in that, The system is used to execute the large-scale language model knowledge extraction method without retrieval assistance as described in any one of claims 1-5, the system comprising: The question reconstruction target acquisition module is used to acquire the user's search question, acquire the reconstructed search question based on the search analysis template, input a large language model, and acquire the target text, wherein the large language model is a local model; The text segmentation semantic analysis module is used to preprocess and segment the target text, obtain multiple basic text segments, and analyze the semantic integrity of the multiple basic text segments to obtain multiple text segments and multiple semantic integrity parameters. The ambiguity scoring candidate acquisition module is used to acquire multiple ambiguity confidence parameters of multiple text segments, combine multiple semantic integrity parameters to score the segment validity, and acquire multiple candidate text segments. The semantic matching result selection module is used to perform semantic matching on the multiple candidate text segments and the user's retrieval question, and obtain the multiple candidate text segments with the highest semantic matching parameters as knowledge extraction results. The template reconstruction result output module is used to reconstruct the knowledge extraction result by combining the result output template to obtain structured knowledge extraction result.
Citation Information
Patent Citations
Geological domain named entity recognition and classification method based on thinking chain and hybrid experts
CN120387454A