Special knowledge base fragmented slicing and semantic understanding answer matching method

By slicing and serializing the legal knowledge base with fine granularity, and combining cross-clause logical chain judgment and trajectory link construction, the problem of insufficient fragmented organization of knowledge base in existing technologies is solved, and high-precision and logical answer matching is achieved.

CN121189324APending Publication Date: 2025-12-23HANGZHOU JINGSHENG HANGXING TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511338585.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-18
Publication Date
2025-12-23

AI Technical Summary

Technical Problem

Existing technologies lack sufficient fragmented organization of knowledge bases, resulting in excessively large or vague matching ranges during fine-grained retrieval, making it difficult to handle complex legal relationships, and causing redundancy or omissions in the answer generation process, thus failing to meet the high requirements of legal or knowledge processing scenarios.

Method used

By acquiring document, table, and image data from a dedicated legal knowledge base, OCR recognition is performed and the data is segmented into serialized fragments of applicable conditions, legal obligations, legal consequences, and time limits. By combining condition and obligation comparisons with cross-clause logical chain judgments, a hierarchical weighted sequence is generated. Correlation analysis and trajectory link construction are then performed, and missing information is interpolated to finally generate an optimized answer.

Benefits of technology

It enables fine-grained dynamic linking and semantic alignment of knowledge content, improving the accuracy and logic of answer matching and ensuring the completeness and scalability of answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121189324A_ABST
    Figure CN121189324A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of semantic understanding, in particular to a special knowledge base fragmented slicing and semantic understanding answer matching method, which comprises the following steps of: obtaining document table images, identifying, segmenting and marking as a fragment set, generating a layered weight sequence by combining question comparison condition obligation and consequence aging reasoning, and obtaining a semantic understanding result; the method comprises the following steps of: identifying and segmenting a text to generate a fragment set, analyzing a connection relationship to form a trajectory link, segmenting candidate answers and performing semantic alignment to supplement missing, calculating a score accumulation result according to a weight sequence, adjusting a parameter sequence and priority, and generating and outputting an optimized answer, and comprises the following steps of: identifying and segmenting the text to generate the fragment set, comparing question contents with conditional obligations and combining consequence aging reasoning; a weighted logic chain is formed, a fragment connection relation dominantly constructs a link, candidate answers are segmented, tracks are aligned, a missing part dependency relation is supplemented, semantic precise alignment is performed on the whole, reasoning is coherent and complete, answer coverage is comprehensive, the integrating degree and precision are improved, and effectiveness and integrity in a complex scene are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of semantic understanding technology, and in particular to a method for matching fragmented slices of a dedicated knowledge base with semantically understood answers. Background Technology

[0002] The field of semantic understanding technology encompasses research on structured parsing and semantic hierarchical analysis of natural language text. Its core lies in establishing a mapping relationship between language and knowledge representation through lexical analysis, syntactic analysis, and contextual modeling. It covers areas such as semantic feature extraction, semantic similarity calculation, knowledge representation and reasoning, and information retrieval, forming a complete technical system for language understanding and knowledge processing to support various application scenarios such as intelligent question answering, knowledge base construction, and semantic search.

[0003] Among them, the fragmented slicing and semantic understanding answer matching method for dedicated knowledge bases refers to fine-grained slicing and organization of stored knowledge in a specific knowledge base to achieve a semantic correspondence between questions and answers. The segmentation and reorganization of knowledge content, annotation and indexing of semantic features, calculation of semantic similarity, and reasoning for answer matching are mainly accomplished through fragmented storage of knowledge items, retrieval mechanisms based on semantic units, and the construction of semantic matching rules. This allows the content in the knowledge base to be effectively organized and utilized according to semantic relationships.

[0004] While existing technologies can establish a mapping between language and knowledge through lexical, syntactic, and contextual modeling, they suffer from insufficient fragmented organization in practice. Knowledge entries are typically stored as whole blocks, leading to overly broad or vague matching ranges during fine-grained retrieval, reducing the relevance between questions and answers. In multi-clause scenarios, existing methods lack cross-clause logical chain processing, often only matching within a single entry, resulting in insufficient reasoning depth and difficulty in covering complex legal relationships. Semantic similarity calculations are prone to bias at the fragment granularity, leading to redundancy or omissions in answer generation. Even in scenarios involving legal obligations and statutes of limitations, existing technologies often provide only a single-dimensional answer, failing to consider the connections between different dimensions, resulting in incomplete answers that require users to consult additional clauses to piece together a complete conclusion. These shortcomings mean that existing technologies often lack accuracy and logical chains when facing complex question-answering needs, failing to support demanding legal or knowledge processing scenarios. Summary of the Invention

[0005] To address the technical problems existing in the prior art, embodiments of the present invention provide a method for matching fragmented knowledge base slices with semantic understanding answers, including the following steps: To achieve the above objectives, the present invention adopts the following technical solution: a method for matching fragmented slices of a dedicated knowledge base with semantically understood answers, comprising the following steps: S1: Obtain document, table and image data from the legal knowledge base and recognize the text content using OCR technology. Segment the recognized text content according to applicable conditions, legal obligations, legal consequences and time limits, and input it into the conditional random field model for serialization annotation to generate a serialized fragment set. S2: In the clause comparison stage, the applicable conditions and legal obligations of the serialized fragment set are compared with the questions asked by the user. In the cross-clause reasoning stage, the logical chain judgment is combined with the legal consequences and time limit provisions, and the comparison results are weighted and merged to generate a hierarchical weighted sequence. S3: Based on the hierarchical weight sequence and the serialized fragment set, perform correlation analysis, deduce the connection relationship between applicable conditions, legal obligations, legal consequences and time limits, and connect them to generate a trajectory link set; S4: Obtain candidate answer text and segment it to construct candidate answer fragments. Perform semantic position alignment on the candidate answer fragment set through the trajectory link set. Perform interpolation calculation and filling on the missing positions in the trajectory according to the neighbor parameter dependency relationship to generate a preliminary matching answer. S5: Based on the preliminary matching answer and the hierarchical weight sequence, calculate the weight conformity of the multi-parameter positions in the preliminary matching answer and accumulate it into a total score. Adjust the internal order and weight priority of the same parameter categories in the preliminary matching answer according to the total score to generate an optimized answer matching result.

[0006] As a further aspect of the present invention, the serialized fragment set includes applicable condition fragments, legal obligation fragments, legal consequence fragments, and time limit provision fragments; the hierarchical weight sequence includes legal obligation semantic vectors and question semantic vectors; the trajectory link set includes condition obligation connection, obligation consequence connection, and consequence time limit connection; the preliminary matching answer includes semantic alignment fragments and interpolation completion fragments; and the optimized answer matching result includes optimization order, answer matching score, and priority weight.

[0007] As a further aspect of the present invention, the specific steps of S1 are as follows: S101: Obtain documents, tables and images from the legal knowledge base, perform character region detection on the image data, perform text recognition with the document data and table data, decode the character encoding information and transcribe it into a continuous text sequence, and generate a recognized text sequence. S102: Based on the identified text sequence, perform semantic condition splitting, extract multiple fragments of applicable conditions, legal obligations, legal consequences and time limits, and segment and recombine multiple fragments at syntactic boundaries to obtain a set of classified text fragments; S103: Call the classified text fragment set, input the conditional random field model to serialize and label the fragment sequence positions, analyze the parsable tag structure of the same type of fragments according to the sentence order, and concatenate all the tag results to obtain the serialized fragment set.

[0008] As a further aspect of the present invention, the specific steps of S2 are as follows: S201: Obtain the question asked by the user, and call the applicable conditions and legal obligations in the serialized fragment set. Calculate the similarity between the question semantic vector and the semantic vectors of the applicable conditions and legal obligations. Combine the semantic similarity threshold to filter the corresponding matching items and obtain the condition and obligation comparison results. S202: Based on the comparison results of the aforementioned conditional obligations, obtain the legal consequences and statute of limitations provisions, and make layer-by-layer judgments on the triggering conditions and statute of limitations provisions of the legal consequences in accordance with the logical chain order of the problem, and obtain the logical chain judgment set; S203: Based on the comparison results between the logical chain judgment set and the conditional obligation, the two types of results are weighted, and the semantic matching score and logical chain judgment score under the same problem are numerically merged and arranged in a hierarchical manner to generate a hierarchical weight sequence. The semantic similarity threshold is set statistically by analyzing the cosine similarity distribution between the question vector of a preset sample and the condition vector of a serialized fragment set.

[0009] As a further aspect of the present invention, the specific steps of S3 are as follows: S301: Based on the hierarchical weight sequence and the serialized fragment set, the correlation degree of the multi-weight level entries in the hierarchical weight sequence and the conditional data frames in the serialized fragment set is calculated, and the entries that exceed the similarity judgment benchmark are recorded to obtain the conditional correlation set. S302: Call the condition association set, and according to the applicable condition data frame index, retrieve the legal obligations, legal consequences and time limit provisions parameter set in the serialized fragment set, connect and determine the three types of parameter sets according to the condition index order, and obtain the connection mapping set; S303: Based on the aforementioned connection mapping set, the applicable conditions, legal obligations, legal consequences, and time limits are sequentially arranged in a chain structure, the order of multiple connection results on the logical path is spliced ​​together, and the spliced ​​path sequence is aggregated to generate a trajectory link set.

[0010] As a further aspect of the present invention, the similarity determination criterion is determined by statistically analyzing the Euclidean distance distribution between the numerical vectors of the hierarchical weight sequence entries and the conditional numerical vectors of the serialized fragment set, and then calculating the mean of the normalized interval by combining the maximum and minimum distances in the distribution.

[0011] As a further aspect of the present invention, the specific steps of S4 are as follows: S401: Obtain candidate answer text, perform character-level segmentation on the text content and reorganize it according to semantic boundaries, aggregate the multiple sequences according to the index order to obtain a set of candidate answer fragments; S402: Call the candidate answer fragment set, and calculate the semantic cosine similarity between the position vectors of multiple fragments in the fragment set and the node vectors in the path sequence according to the semantic path sequence in the trajectory link set. Filter out semantics that exceed the semantic similarity threshold and map them to generate a semantic alignment mapping set. S403: Based on the semantic alignment mapping set, retrieve the locations of missing nodes in the trajectory link set, and calculate and fill in the missing location parameter values ​​using linear interpolation based on the parameter dependency relationship between adjacent nodes to obtain a preliminary matching answer.

[0012] As a further aspect of the present invention, the semantic similarity threshold is set by statistically analyzing the cosine similarity distribution between the candidate answer fragment vector and the trajectory link set node vector, combined with the upper and lower boundaries of the distribution interval and the median.

[0013] As a further aspect of the present invention, the specific steps of S5 are as follows: S501: Based on the preliminary matching answer and the hierarchical weight sequence, extract the weight values ​​of the multi-parameter positions in the preliminary matching answer, and compare them with the corresponding weight coefficients in the hierarchical weight sequence. Calculate the conformity value of the multi-parameter positions under the comparison to obtain the parameter position conformity sequence. S502: Call the parameter position conformity sequence, accumulate the position conformity values ​​of multiple parameters in the sequence, analyze the cumulative score sequence of the parameter set in the whole range and aggregate it to generate the total answer matching score; S503: Based on the total score of the answer matching, retrieve fragments with the same parameter category in the preliminary matching answers, and adjust and rearrange the internal order and weight values ​​of the fragments in the same category according to the priority relationship in the total score to generate optimized answer matching results.

[0014] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, during the processing, textual information is uniformly acquired and transformed into structured content using recognition technology. It is then further subdivided and labeled according to dimensions such as applicable conditions, obligations, consequences, and timeliness, forming a fine-grained, serialized fragment set. This approach establishes a stable semantic mapping at the initial stage of knowledge entries, ensuring the information is searchable and matchable in subsequent comparisons. During the question comparison stage, the question content is precisely associated with the conditions and obligations in the fragmented knowledge. Consequences and timeliness dimensions are introduced into cross-clause logical judgments, forming dynamic logical chains that are weighted and merged. This ensures that answer reasoning does not rely solely on a single clause but generates more accurate results based on multi-level information fusion. Relevance analysis further makes the connections between fragments of different dimensions explicit, promoting the construction of trajectory-based links between conditions, obligations, and consequences, improving the completeness and coherence of reasoning. In candidate answer processing, answer fragments are aligned to the positions of the trajectory links, achieving a precise semantic correspondence between questions and answers. For missing information, interpolation is performed using proximity dependencies to ensure complete answer coverage. The collaborative innovation of the above processing logic and participating items enables fine-grained dynamic linking and semantic alignment of knowledge content throughout the entire process of storage, comparison, reasoning and generation, thereby bringing higher accuracy and stronger logical answer matching effect, and ensuring that the answer has scalability and integrity. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is a schematic diagram of the steps of the present invention; Figure 2 This is a detailed schematic diagram of S1 of the present invention; Figure 3 This is a detailed schematic diagram of S2 of the present invention; Figure 4 This is a detailed schematic diagram of S3 of the present invention; Figure 5 This is a detailed schematic diagram of S4 of the present invention; Figure 6 This is a detailed schematic diagram of S5 of the present invention. Detailed Implementation

[0017] The technical solution of the present invention will now be described with reference to the accompanying drawings.

[0018] In embodiments of the invention, terms such as "exemplarily" and "including" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as an example in the invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the term "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the invention, the meaning expressed and / or may be both, or either one may be preferred.

[0019] In this embodiment of the invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing their distinction, their intended meanings are consistent. Similarly, the terms "of," "corresponding," and "relevant" may sometimes be used interchangeably. It should be noted that, without emphasizing their distinction, their intended meanings are consistent.

[0020] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.

[0021] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0022] Please see Figure 1 This invention provides a method for matching fragmented knowledge base slices with semantically understood answers, including the following steps: S1: Obtain document, table and image data from the legal knowledge base and recognize the text content using OCR technology. Segment the recognized text content according to applicable conditions, legal obligations, legal consequences and time limits, and input it into the conditional random field model for serialization annotation to generate a serialized fragment set. S2: In the clause comparison stage, the applicable conditions and legal obligations of the serialized fragment set are compared with the questions asked by the user. In the cross-clause reasoning stage, the logical chain judgment is combined with the legal consequences and time limit provisions, and the comparison results are weighted and merged to generate a hierarchical weighted sequence. S3: Based on the hierarchical weighted sequence and serialized fragment set, perform correlation analysis to deduce and connect the connection between applicable conditions, legal obligations, legal consequences and time limits, and generate a trajectory link set; S4: Obtain candidate answer text and segment it to construct candidate answer fragments. Perform semantic position alignment on the candidate answer fragment set through the trajectory link set. Perform interpolation calculation and filling in the missing positions in the trajectory according to the neighbor parameter dependency relationship to generate a preliminary matching answer. S5: Based on the preliminary matching answer and the hierarchical weight sequence, calculate the weight conformity of the multi-parameter positions in the preliminary matching answer and accumulate it into a total score. Adjust the internal order and weight priority of the same parameter categories in the preliminary matching answer according to the total score to generate the optimized answer matching result.

[0023] The serialized fragment set includes fragments of applicable conditions, legal obligations, legal consequences, and time limits. The hierarchical weighted sequence includes semantic vectors of legal obligations and semantic vectors of questions. The trajectory link set includes connection of conditions and obligations, connection of obligations and consequences, and connection of consequences and time limits. The preliminary matching answer includes semantically aligned fragments and interpolated complete fragments. The optimized answer matching result includes optimization order, answer matching score, and priority weight.

[0024] Please see Figure 2 The specific steps of S1 are as follows: S101: Obtain documents, tables and images from the legal knowledge base, perform character region detection on the image data, perform text recognition with the document data and table data, decode the character encoding information and transcribe it into a continuous text sequence, and generate a recognized text sequence. Retrieve the legal document numbered LG-CF-2023-007 from the special knowledge base of laws and regulations. This document includes images in tif format, tables in xlsx format, and documents in txt format. For the tif image data with a resolution of 600 DPI and a size of 7016*9921 pixels, perform character region detection. The detection process first applies an edge detection algorithm. By calculating the gradient of pixel gray values, pixels with a gradient greater than 150 are identified as edges and connected into an initial contour. Subsequently, the contours are filtered, and the effective area range of the contours is set to 50 to 2500 square pixels. A noise contour with an area of 45 square pixels at the image coordinate (512, 340) is filtered out because its area is less than the lower limit of 50; a seal contour with an area of 2800 square pixels at the coordinate (620, 410) is filtered out because its area is greater than the upper limit of 2500. And a contour representing the Chinese character "合" with an area of 485 square pixels is within the set effective range and is thus determined as a valid character region. Next, independent character regions are merged. The threshold for the horizontal merging distance is set to 0.8 times the average character width, and the threshold for the vertical merging distance is set to 0.5 times the average character height. The horizontal distance between the character "合" region and the character "同" region is 8 pixels, which is less than 33.6 pixels obtained by multiplying the average character width of 42 pixels by 0.8, so these two regions are merged. After completing the region detection, text recognition is performed on all data sources. An optical character recognition engine is used to process the image regions, and a confidence score is generated for each recognized character. The confidence threshold is set to 0.95, and the value is determined through experiments on an image test set containing 10,000 standard legal characters. Experimental data shows that when the threshold is 0.95, the recognition accuracy rate of the system is 99.8%, the recall rate is 99.5%, and the F1 score is 0.9965, with balanced performance. For example, the recognition confidence of the character "法" is 0.99, which is greater than 0.95, and the recognition result is accepted. While the recognition result of a blurred character "律" has a confidence of 0.91, which is lower than 0.95, and the result is marked and transferred for manual proofreading. Subsequently, the character encoding information of the recognized text stream is decoded. For example, a byte sequence \xD6\xD0\xBB\xAA\xBA\xcl encoded in GBK is transcribed into the corresponding continuous text sequence "中华合同". Finally, the text data from all sources are spliced in the order of the original document to generate the recognized text sequence: The parties conclude a contract by way of offer and acceptance. An offer is a manifestation of intention to conclude a contract with another person, and the manifestation of intention shall be specific and definite in content. Acceptance is a manifestation of intention by the offeree to agree to the offer. If there is no acceptance, the contract is not established. The breaching party shall pay liquidated damages of 100,000 yuan.

[0025] S102: Based on the identified text sequence, perform semantic condition decomposition, extract multiple fragments of applicable conditions, legal obligations, legal consequences and time limits, and segment and recombine multiple fragments at syntactic boundaries to obtain a set of classified text fragments; Based on the generated recognized text sequence, semantic conditions are decomposed to extract four categories of fragments: applicable conditions, legal obligations, legal consequences, and statute of limitations. Initial matching is performed using a predefined legal keyword dictionary. For example, the first sentence in the text sequence, "The parties entered into a contract, adopting the offer and acceptance method," is initially labeled as an applicable conditions fragment because it includes the keyword "party." The fifth sentence, "The breaching party should pay a penalty of 100,000 yuan," is initially labeled as a legal consequences fragment because it includes the keyword "pay a penalty." To ensure classification accuracy, a membership score mechanism is introduced. The membership score of a fragment to a certain category is obtained by multiplying the keyword weight by the frequency of keyword occurrences, adding the syntactic structure weight by the syntactic structure matching score, and then summing the results. The keyword weight is set to 0.65, and the syntactic structure weight is set to 0.35. These weight values ​​are determined based on the results of a regression analysis experiment on 500 manually annotated legal documents. The acceptance threshold for the membership score is set to 0.7. Taking the example of a fragment stating that the breaching party should pay 100,000 yuan in liquidated damages, the fragment includes the keyword "pay liquidated damages" related to legal consequences, appearing once. Its syntactic structure perfectly matches a typical legal consequence statement, with a matching score of 1.0. Therefore, the membership score is 0.65*1 + 0.35*1.0, resulting in 1.0. Since the score is greater than the threshold of 0.7, this fragment is formally classified as a legal consequence. Similarly, for the fragment stating that the meaning of the expression should be specific and definite, its membership score is also calculated to be 1.0, and it is classified as a legal obligation. After all fragments are classified, they are segmented and recombined at syntactic boundaries, including periods, to obtain a set of classified text fragments. The data structure of this set is: (Parties enter into a contract, using offer and acceptance methods, applicable conditions), (The meaning of the expression should be specific and definite, legal obligation), (If no acceptance is made, the contract is not established, legal consequences), (The breaching party should pay 100,000 yuan in liquidated damages, legal consequences).

[0026] S103: Call the set of classified text fragments, input the conditional random field model to serialize and label the position of the fragment sequence, analyze the parsable tag structure of the same type of fragments according to the sentence order, and concatenate all the tag results to obtain the serialized fragment set; The generated set of categorized text fragments is called and input into a Conditional Random Field (CRF) model to serialize and label the positions of the fragment sequences. This labeling process uses the BIOES labeling system, aiming to parse the fine-grained semantic components within each fragment. Taking the fragment "legal consequences" (the breaching party should pay a penalty of 100,000 yuan, legal consequences) as an example, the CRF model evaluates the current word and its context information during labeling. When processing the word "breaching party," the model calculates a probability of labeling it as an S-responsible party (representing a single word constituting a responsible party) based on features such as its part of speech being a noun and its position at the beginning of the sentence, with a probability of 0.982. For the word "payment," the model calculates a probability of labeling it as a B-behavior (representing the start of an action) with a probability of 0.975. For the word "100,000 yuan," the model calculates a probability of labeling it as an S-amount with a probability of 0.996. The label acceptance probability threshold is set to 0.90 here. The threshold setting was obtained by performing a grid search experiment on the validation set. When the threshold is 0.90, the model achieves a peak F1 score of 0.94 on the entity recognition task. Since the calculated probability values ​​of 0.982, 0.975, and 0.996 are all greater than 0.90, the corresponding labels S-responsible party, B-behavior, and S-amount for the defaulting party, payment, and 100,000 yuan are all accepted. The auxiliary verb should be labeled as O (indicating not belonging to any entity), with a probability of 0.999, and is also accepted. After labeling, the tagging structure of this fragment is: (defaulting party, S-responsible party)(should, O)(payment, B-behavior)(penalty, S-type of penalty)(100,000 yuan, S-amount). This process is applied to all fragments in the categorized text fragment set. Finally, the marked results of all fragments are sequentially assembled according to their order in the original document to obtain the final serialized fragment set: (Parties, S-Applicable Subject), (Conclusion, B-Action), (Specific and Determined, E-Obligation Content), (No Commitment Made, S-Triggering Condition), (Contract, B-Object), (Not Established, E-State), (Breaching Party, S-Liable Subject), (Should, O), (Payment, B-Action), (Liquidation Penalty, S-Type of Penalty), (Ten Thousand Yuan, S-Amount).

[0027] Please see Figure 3 The specific steps of S2 are as follows: S201: Obtain the question asked by the user, and call the applicable conditions and legal obligations in the serialized fragment set. Calculate the similarity between the semantic vector of the question and the semantic vectors of the applicable conditions and legal obligations. Combine the semantic similarity threshold to filter the corresponding matching items and obtain the condition and obligation comparison results. The system retrieves the user's question, "What are the consequences of a contract not making a promise?", and retrieves all entries categorized as applicable conditions and legal obligations from the generated set of serialized fragments. First, a pre-trained 300-dimensional word vector model converts the text content of the user's question and each applicable condition and legal obligation entry into semantic vectors. For example, the vector representation of the user's question is Vq, the vector representing the applicable condition (ID AC-01) of parties entering into a contract using offer and acceptance is V-ac1, and the vector representing the legal obligation (ID LO-01) of the expression of intent being specifically defined is V-lo1. Then, cosine similarity is calculated between the question's semantic vector and the semantic vectors of each applicable condition and legal obligation. The calculation process involves dividing the dot product of the vectors by the product of their respective vector moduli. Taking the calculation of Vq and V-ac1 as an example, with the simplified three-dimensional vectors set to [0.8, 0.5, 0.1] and [0.7, 0.6, 0.2], their cosine similarity result is 0.95. The simplified vectors of Vq and V-lo1 are [0.8, 0.5, 0.1] and [0.2, 0.3, 0.9], respectively, with a calculated similarity score of 0.45. Next, the calculated similarity score is compared with a preset semantic similarity threshold to filter out matching entries. Here, the semantic similarity threshold is set to 0.85. This threshold setting is based on an experiment conducted on a test set containing 1000 labeled question-legal clause pairs. By adjusting the threshold and evaluating the precision and recall of the filtering results, the F1 score reached a peak of 0.92 when the threshold was set to 0.85.

[0028] Table 1: Experimental Data Table for Semantic Similarity Threshold Setting

[0029] As shown in Table 1, the optimal comprehensive performance index was obtained when the threshold was set to 0.85. In this example, the similarity between Vq and V-ac1 (0.95) is greater than the threshold of 0.85, therefore item AC-01 is determined to be a match. The similarity between Vq and V-lo1 (0.45) is less than the threshold of 0.85, so item LO-01 is filtered out. After traversing all applicable conditions and legal obligations items, all filtered matching items and their similarity scores are summarized to obtain the conditional obligation comparison results. The resulting data structure is (AC-01, 0.95).

[0030] S202: Based on the comparison results of conditional obligations, obtain the legal consequences and statute of limitations, and make a step-by-step judgment on the triggering conditions and the scope of the statute of limitations of the legal consequences in accordance with the logical chain of the problem, and obtain the logical chain judgment set; Based on the generated conditional obligation comparison result (AC-01, 0.95), the legal consequences and statute of limitations items associated with AC-01 are obtained from the serialized fragment set. In this embodiment, the associated legal consequences items are LC-01: Without a commitment, the contract is not valid and LC-02: The breaching party shall pay liquidated damages of RMB 100,000. There are no associated statute of limitations items. Next, based on the logical chain of "no commitment" extracted from the user question "What are the consequences of not making a commitment in a contract," the triggering conditions of the obtained legal consequences items are judged layer by layer. For LC-01, the triggering condition included in the text is "no commitment." By performing exact string matching and entity relationship analysis on the logical chain of "no commitment" and the triggering condition of the question, it is determined that the two are a perfect match. Therefore, the logical triggering judgment score of LC-01 is 1.0. For LC-02, the hidden triggering condition is the existence of a breach of contract. Compared with the logical chain of "no commitment" of the question, the two do not constitute a direct causal or triggering relationship semantically. Therefore, the logical triggering judgment score of LC-02 is 0.0. If a statute of limitations exists, including a requirement that the promise must reach the offeror within the period specified in the offer, the system will further determine whether the current date is within the specified range. If the current date is set to September 10, 2025, and the deadline specified in the offer is September 1, 2025, then the current date is outside the specified range, and the statute of limitations score is 0.0. If the deadline is September 15, 2025, then it is within the specified range, and the statute of limitations score is 1.0. Since there is no statute of limitations in this example, all statute of limitations scores are defaulted to 1.0. Combining the above judgment process, each legal consequence is combined with its logical trigger score and statute of limitations score to obtain a logical chain judgment set. The data structure of this set is (LC-01, logical trigger score: 1.0, statute of limitations score: 1.0), (LC-02, logical trigger score: 0.0, statute of limitations score: 1.0).

[0031] S203: Based on the comparison results between the logical chain decision set and the conditional obligation, the two types of results are weighted, and the semantic matching score and logical chain decision score under the same problem are numerically merged and arranged in a hierarchical manner to generate a hierarchical weight sequence. The semantic similarity threshold is set statistically by analyzing the cosine similarity distribution between the question vector of a preset sample and the condition vector of a serialized fragment set. Based on the comparison between the generated logical chain decision set and the generated conditional obligation, the two types of results are weighted and merged. First, the weight of the semantic matching score is set to 0.6, and the weight of the logical chain decision score is set to 0.4. These two weight values ​​are based on the results of optimization experiments on a benchmark dataset containing 500 sorted legal question-answer pairs. In this experiment, by adjusting the two weights and calculating the normalized depreciation cumulative gain (nDCG) of the sorting results, the nDCG score reaches the highest of 0.95 when the weight combination is 0.6 and 0.4. Next, for each potential answer entry under the same question, its semantic matching score and logical chain decision score are numerically merged. The score is calculated as follows: semantic matching score multiplied by the weight, plus logical chain decision score multiplied by the weight. For legal consequence LC-01, the associated semantic matching score is 0.95 (from AC-01), and the logical chain decision score is 1.0. The final merged score is 0.95*0.6 + 1.0*0.4 = 0.57 + 0.40 = 0.97. For legal consequence LC-02, the semantic matching score is 0.95, but the logical chain judgment score is 0.0. The final merged score is 0.95*0.6 + 0.0*0.4 = 0.57. All legal consequence items and the calculated final scores are arranged hierarchically from highest to lowest score to generate a hierarchical weight sequence: (LC-01, 0.97), (LC-02, 0.57).

[0032] Please see Figure 4 The specific steps of S3 are as follows: S301: Based on the hierarchical weight sequence and serialized fragment set, the correlation degree of multi-weight level entries in the hierarchical weight sequence and conditional data frames in the serialized fragment set is calculated, and entries that exceed the similarity judgment benchmark are recorded to obtain the conditional correlation set. Based on the generated hierarchical weight sequences (LC-01, 0.97), (LC-02, 0.57) and the generated serialized fragment set, correlation calculation is performed. First, entries with weight scores higher than 0.9 in the hierarchical weight sequence are extracted, in this case, LC-01 (score of 0.97). The weight interval is defined as follows: scores in the range [0.9, 1.0] are defined as high-weight levels, (0.7, 0.9) as medium-weight levels, and scores below 0.7 as low-weight levels. Subsequently, the high-weight level entry LC-01 is correlated with all applicable condition data frames in the serialized fragment set, i.e., AC-01 (the parties enter into a contract, adopting the offer and acceptance method). The correlation here is quantified based on the distance between two nodes in a pre-constructed legal concept graph; the closer the distance, the higher the correlation. The path length between the invalidity of the node contract in LC-01 and the node commitment method in AC-01 is 2. After normalization using a reciprocal function 1 / (1+path length), its correlation score is 1 / (1+2)≈0.33. The advantage of this calculation method is that by transforming abstract logical relationships into quantifiable graph distances, it achieves an objective assessment of the closeness of the relationship between legal provisions. Next, the calculated correlation score is compared with the similarity judgment benchmark. The similarity judgment benchmark is set at 0.3.

[0033] Table 2: Experimental Data Table for Similarity Judgment Benchmark Validation

[0034] The baseline value was set based on experimental verification results on a dataset containing 5000 pairs of labeled legal consequences-applicable conditions entries. As shown in Table 2, when the baseline value was set to 0.3, the system achieved a peak F1 score of 0.933 when identifying valid related entries. In this example, the calculated association score of 0.33 was greater than the similarity judgment baseline of 0.3, so the entry pair (LC-01, AC-01) was recorded. This process was repeated for the next entry in the hierarchical weight sequence, LC-02, whose association score with AC-01 was 0.21, less than 0.3, and therefore not recorded. The conditional association set was obtained, containing (LC-01, AC-01).

[0035] S302: Call the condition association set, and according to the applicable condition data frame index, retrieve the legal obligations, legal consequences and statute of limitations parameter sets in the serialized fragment set, connect and determine the three types of parameter sets according to the condition index order, and obtain the connection mapping set; The generated condition association set (LC-01, AC-01) is invoked. Based on the applicable condition data frame index AC-01 in this set, a search is performed in the serialization fragment set of S103 to find the set of legal obligations, legal consequences, and statute of limitations parameters directly associated with AC-01. The search is based on the logical dependencies between entries recorded in the metadata of the serialization fragment set. The search results are as follows: the legal obligation associated with AC-01 is LO-02 (acceptance is the offeree's expression of agreement to the offer.), the associated legal consequence is LC-01 (without acceptance, the contract is not valid.), and there are no directly associated statute of limitations parameters. Next, the three types of parameter sets retrieved are connected according to the condition index order of AC-01. The determination process is as follows: verify whether there is a complete and uninterrupted logical path starting from AC-01, sequentially passing through the legal obligations and legal consequences. The system confirms that in the legal logic knowledge graph, there exists an edge pointing from AC-01 to LO-02, indicating that AC-01 is a prerequisite for LO-02; simultaneously, there exists an edge pointing from the negative state of LO-02 (i.e., no commitment) to LC-01, indicating that LC-01 is a direct consequence of violating the obligations stipulated in LO-02. This path AC-01->LO-02->LC-01 is determined to be a valid connection. If the retrieved parameter sets lack direct logical dependencies, for example, LO-02 cannot be logically derived from AC-01, the connection determination fails, and the path is discarded. In this example, since the path is valid, the system records this connection relationship and obtains the connection mapping set. The data structure of the set is Chain-01: [AC-01, LO-02, LC-01].

[0036] S303: Based on the connection mapping set, the applicable conditions, legal obligations, legal consequences and time limits are sequentially arranged in a chain structure, the order of multiple connection results on the logical path is spliced, and the spliced ​​path sequence is aggregated to generate a trajectory link set; Based on the generated connection mapping set Chain-01: [AC-01, LO-02, LC-01], the applicable conditions, legal obligations, legal consequences, and statutes of limitations defined therein are serialized and arranged in a chain structure. Specifically, the text fragments corresponding to each ID in Chain-01 are extracted and arranged in the order [AC-01, LO-02, LC-01]. The arrangement result is: [Parties enter into a contract by means of offer and acceptance. Acceptance is the offeree's expression of agreement to the offer. Without acceptance, the contract is not established]. If there are multiple connection results in the connection mapping set, such as Chain-02: [AC-01, LO-02, LC-03], the system will first serialize and arrange each independent logical path, and then concatenate them. The concatenation operation is performed at the end of the logical paths, merging them based on their common logical predecessor node. For example, if LC-01 and LC-03 are both parallel consequences directly caused by a violation of LO-02, the concatenated path sequence would be AC-01, LO-02, (LC-01, LC-03). In this example, there is only one connection result, so concatenation is unnecessary. Finally, the concatenated path sequence is aggregated. The aggregation operation integrates the serialized text fragments into a coherent, structured data object. This object retains the original text, category (applicable conditions, legal obligations, legal consequences), and logical order of each fragment. The final generated trajectory link set is a collection of single logical links with the following content: {ID: AC-01, Category: Applicable Conditions, Content: Parties enter into a contract by means of offer and acceptance}, {ID: LO-02, Category: Legal Obligations, Content: Acceptance is the offeree's expression of agreement to the offer}, {ID: LC-01, Category: Legal Consequences, Content: Without acceptance, the contract is not valid}.

[0037] Please see Figure 5 The specific steps of S4 are as follows: S401: Obtain candidate answer text, perform character-level segmentation on the text content and reorganize it according to semantic boundaries, aggregate the multiple sequences according to the index order to obtain a set of candidate answer fragments; Obtain a candidate answer text generated by an external Q&A system: If one party does not make a commitment, the contract is not established, and thus no contractual obligations are generated. The party making the offer may revoke the offer. First, perform an initial character-level segmentation on the text content to obtain the character sequence [If, one, party, does, not, make, a, commitment, then, the, contract, is, not, established, thus, no, contractual, obligations, are, generated, the, party, making, the, offer, may, revoke, the, offer]. Subsequently, reorganize the character sequence according to a predefined semantic boundary dictionary in the legal domain. This dictionary includes words, word types, and boundary weights, including contract / n / 0.9, commitment / v / 0.8. The reorganization process is to scan the character sequence from left to right and use the maximum forward matching method to find the longest word existing in the dictionary. When a word is matched, set a semantic boundary at the end of the word. For example, when scanning to "合", the word "合同" in the dictionary is matched, so a boundary is set after the character "同". For punctuation marks, directly regard them as independent semantic boundaries. After this process, the first sentence is reorganized into the sequence [If, one party, does not make a commitment, then, the contract, is not established, thus, no, contractual obligations are generated]. The second sentence is reorganized into [The party making, the offer, may, revoke, the offer]. Next, assign a unique index to each reorganized semantic segment. The format of the index is period index - segment index. For example, the "does not make a commitment" segment in the first sentence is assigned the index S1-F3, and the "revoke" segment in the second sentence is assigned the index S2-F5. Finally, aggregate all the indexed semantic segments in the order they appear in the original text to form a structured data set. This set is the candidate answer segment set, and its data structure is {S1-F1: If}, {S1-F2: one party}, {S1-F3: does not make a commitment}, {S1-F4: ,}, {S1-F5: then}, {S1-F6: the contract}, {S1-F7: is not established}, {S1-F8: ,}, {S1-F9: thus}, {S1-F10: no}, {S1-F11: contractual obligations are generated}, {S1-F12: .}, {S2-F1: The party making}, {S2-F2: the offer}, {S2-F3: may}, {S2-F4: revoke}, {S2-F5: the offer}, {S2-F6: .}.

[0038] S402: Invoke the candidate answer segment set, and calculate the semantic cosine similarity between the multi-segment position vectors in the segment set and the node vectors in the semantic path sequence according to the semantic path sequence in the trajectory link set. Screen the semantics exceeding the semantic similarity threshold for mapping to generate a semantic alignment mapping set; The generated candidate answer fragment set and the trajectory link set generated in S303 are called: {S1-F1: If}, {S1-F2: One party}, {S1-F3: No commitment}, {S1-F4: ,}, {S1-F5: Then}, {S1-F6: Contract}, {S1-F7: Not valid}, {S1-F8: ,}, {S1-F9: Therefore}, {S1-F10: Not generated}, {S1-F11: Contractual obligation}, {S1-F12: .}, {S2-F1: Issued}, {S2-F2: Offer}, {S2-F3: Of}, {S2-F4: One party}, {S2-F5: May}, {S2-F6: Withdrawn}, {S2-F7: Offer}, {S2-F8: .}. First, for each segment in the candidate answer segment set and each node in the semantic path sequence of the trajectory link set, a corresponding 300-dimensional semantic vector is calculated. This calculation is performed using a pre-trained word vector model. For segments or nodes with multiple words, the overall vector is the average of the vectors of all the words that constitute it. For example, the vector V-f3 of the candidate segment S1-F3 (not committed) is obtained by averaging the vectors of the words "not" and "committed." The vector Vn-lc01 of the node LC-01 (not committed, contract not valid) in the trajectory link set is obtained by averaging the vectors of all the included words. Next, the cosine similarity between the position vector of each candidate segment and the vector of each node in the path sequence is calculated. This calculation involves dividing the dot product of the two vectors by the product of their respective moduli. Taking V-f3 and Vn-lc01 as examples, setting their simplified 3D vectors to [0.1, 0.9, 0.2] and [0.1, 0.88, 0.21] respectively, their cosine similarity is calculated to be 0.99. The similarity between the merged contract of segments S1-F6 and S1-F7 and node Vn-lc01 is calculated to be 0.97. The similarity between segment S1-F11 (contractual obligation) and node LO-02 (a promise is an offeree's expression of acceptance of the offer) is calculated to be 0.91. The calculated similarity scores are then compared with a preset semantic similarity threshold of 0.90.

[0039] Table 3: Experimental Data for Semantic Alignment Similarity Threshold Validation

[0040] The threshold setting was based on an experiment involving a sample set of 2000 manually aligned answer fragments—legal clauses. As shown in Table 3, by testing the mapping accuracy and recall at different thresholds, the F1 score reached 0.942 when the threshold was 0.90, achieving an acceptable recall while maintaining high accuracy. In this example, the similarity scores of 0.99, 0.97, and 0.91 all exceeded the threshold of 0.90. Therefore, these semantics exceeding the threshold were mapped. The generated semantic alignment mapping set is (S1-F3):(LC-01), (S1-F6, S1-F7):(LC-01), (S1-F11):(LO-02).

[0041] S403: Based on the semantic alignment mapping set, retrieve the locations of missing nodes in the trajectory link set, and calculate and fill in the missing location parameter values ​​using linear interpolation based on the parameter dependency relationship between adjacent nodes to obtain a preliminary matching answer; Based on the generated semantic alignment mapping sets (S1-F3):(LC-01), (S1-F6, S1-F7):(LC-01), (S1-F11):(LO-02), the system first retrieves the locations of missing nodes in the trajectory link set [AC-01, LO-02, LC-01]. By comparing the mapped node set {LC-01, LO-02} in the mapping set with the complete node set {AC-01, LO-02, LC-01} in the trajectory link set, node AC-01 is identified as the missing node. Subsequently, the missing positions are filled in according to the parameter dependencies between adjacent nodes. In this context, parameter values ​​refer to the text content of the node, and linear interpolation refers to inserting the missing text content into the corresponding position in the answer text according to the linear order of the nodes in the logical link. The system analyzes the trajectory links and determines that the missing node AC-01 is a prerequisite for node LO-02 and is logically preceding LO-02. Therefore, the text content of AC-01 is retrieved, indicating that the parties entered into a contract using the offer and acceptance method, and it is decided to insert it into the candidate answer before the segment mapped to LO-02 (i.e., S1-F11 contractual obligations). Specifically, the insertion point is chosen before the first segment related to LO-02, i.e., at the beginning of the entire text. This text completion method, based on logical order, integrates the original candidate answer text with the inserted text content after the completion operation. The initial matching answer obtained is: The parties entered into a contract using the offer and acceptance method. If one party does not accept, the contract is not established, and therefore no contractual obligations arise. The party making the offer may withdraw the offer.

[0042] Please see Figure 6 The specific steps of S5 are as follows: S501: Based on the preliminary matching answer and the hierarchical weight sequence, extract the weight values ​​of the multi-parameter positions in the preliminary matching answer, and compare them with the corresponding weight coefficients in the hierarchical weight sequence. Calculate the conformity value of the multi-parameter positions under the comparison to obtain the parameter position conformity sequence. Based on the generated preliminary matching answer, "Parties enter into a contract through offer and acceptance. If one party does not accept, the contract is not established, and therefore no contractual obligations arise. The party making the offer may withdraw the offer," and the generated hierarchical weight sequence [(LC-01, 0.97), (LC-02, 0.57)], the parameter position conformity is calculated. First, the positions corresponding to each parameter in the hierarchical weight sequence are extracted from the preliminary matching answer and assigned a weight value. This weight value characterizes the existence of the parameter in the answer text. If the core semantic meaning corresponding to the parameter appears in the text, its weight value is 1.0; otherwise, it is 0.0. The preliminary matching answer includes the core semantic meaning "the contract is not established," corresponding to parameter LC-01. Therefore, the position weight value of LC-01 in this answer is 1.0. The preliminary matching answer does not include the core semantic meaning "pay liquidated damages," corresponding to parameter LC-02. Therefore, the position weight value of LC-02 in this answer is 0.0. Next, the extracted position weight values ​​of each parameter are compared with the corresponding weight coefficients in the hierarchical weight sequence to calculate the conformity value. The conformity value is calculated by subtracting the absolute value of the difference between the position weight value and the weight coefficient from 1. For parameter LC-01, the position weight value is 1.0, and the weight coefficient in the hierarchical weight sequence is 0.97, so the conformity value is calculated as 1 - |1.0 - 0.97| = 0.97. For parameter LC-02, the position weight value is 0.0, and the weight coefficient in the hierarchical weight sequence is 0.57, so the conformity value is calculated as 1 - |0.0 - 0.57| = 0.43. Combining all parameters and their calculated conformity values ​​yields the parameter position conformity sequence: (LC-01, 0.97), (LC-02, 0.43).

[0043] S502: Call the parameter position conformity sequence, accumulate the position conformity values ​​of multiple parameters in the sequence, analyze the cumulative score sequence of the parameter set in the whole range and aggregate it to generate the total score for answer matching; The generated parameter position conformity sequences (LC-01, 0.97) and (LC-02, 0.43) are invoked. First, a cumulative operation is performed on the conformity values ​​of all parameter positions in the sequence. This operation involves summing the conformity values ​​in the sequence. In this embodiment, the cumulative operation is performed by adding 0.97 and 0.43, resulting in a cumulative value of 1.40. Subsequently, this cumulative value is analyzed and aggregated across the entire parameter set to generate the final answer matching total score. The analysis process calculates the theoretically maximum possible cumulative value. The maximum possible cumulative value is obtained under the ideal condition that the initial matching answer completely matches all parameter positions, at which point the conformity value of each parameter position is 1.0. Since the parameter position conformity sequence includes two parameters (LC-01 and LC-02), the maximum possible cumulative value is 1.0 + 1.0 = 2.0. The aggregation process divides the actually calculated cumulative value by the maximum possible cumulative value and performs normalization. In this embodiment, the calculation process for the answer matching total score is 1.40 / 2.0 = 0.70. The overall score is a value between 0 and 1, where 1 indicates that the initial matching answer is completely consistent with the expectation of the hierarchical weight sequence in terms of content completeness. The result of 0.70 indicates that the initial matching answer includes the most core legal consequences, but is missing information regarding secondary legal consequences.

[0044] S503: Based on the total score of answer matching, retrieve fragments with the same parameter category in the preliminary matching answers, and adjust and rearrange the internal order and weight values ​​of fragments in the same category according to the priority relationship in the total score to generate optimized answer matching results; Based on the generated answer matching total score of 0.70, the initial matching answer of S403 is optimized. First, the total score is compared with a preset optimization trigger threshold of 0.65. The threshold is set based on statistical analysis of 1000 scored answers, selecting the value corresponding to the top 80% percentile in the distribution curve. When the score is higher than this value, the answer is considered to have the basic quality for optimization. Since 0.70 is greater than 0.65, the optimization process is initiated. Next, fragments belonging to the same parameter category are retrieved from the initial matching answers. In this example, "Parties enter into a contract by means of offer and acceptance" belongs to the "Applicable Conditions" category; "If one party does not accept, the contract is not established" belongs to the "Legal Consequences" category; "The party making the offer may withdraw the offer" has no corresponding node in the trajectory link set and is identified as a non-core fragment. Then, adjustments and rearrangements are made according to the priority relationship reflected by the answer matching total score. The priority relationship here is inherited from the hierarchical weight sequence, that is, LC-01 has a higher priority than LC-02. The adjustment process includes: First, removing non-core segments from the initial matching answer, specifically deleting "The party making the offer may withdraw the offer." Second, supplementing missing segments that exist in the logical chain according to the complete logical order of the trajectory link set [AC-01, LO-02, LC-01] generated by S303. Upon verification, the initial matching answer was missing a segment corresponding to LO-02 ("Acceptance is the offeree's expression of agreement to the offer."). Therefore, the text content of this segment was added to the answer. The rearrangement operation arranged all core segments according to the authoritative logical order of "Applicable Conditions -> Legal Obligations -> Legal Consequences" determined by the trajectory link set [AC-01, LO-02, LC-01]. The optimized answer matching result was generated as follows: "When parties enter into a contract, they adopt the method of offer and acceptance. Acceptance is the offeree's expression of agreement to the offer. Without acceptance, the contract is not established."

[0045] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for matching fragmented knowledge base segments with semantic understanding answers, characterized in that: Includes the following steps: S1: Obtain document, table and image data from the legal knowledge base and recognize the text content using OCR technology. Segment the recognized text content according to applicable conditions, legal obligations, legal consequences and time limits, and input it into the conditional random field model for serialization annotation to generate a serialized fragment set. S2: In the clause comparison stage, the applicable conditions and legal obligations of the serialized fragment set are compared with the questions asked by the user. In the cross-clause reasoning stage, the logical chain judgment is combined with the legal consequences and time limit provisions, and the comparison results are weighted and merged to generate a hierarchical weighted sequence. S3: Based on the hierarchical weight sequence and the serialized fragment set, perform correlation analysis, deduce the connection relationship between applicable conditions, legal obligations, legal consequences and time limits, and connect them to generate a trajectory link set; S4: Obtain candidate answer text and segment it to construct candidate answer fragments. Perform semantic position alignment on the candidate answer fragment set through the trajectory link set. Perform interpolation calculation and filling in the missing positions in the trajectory according to the neighbor parameter dependency relationship to generate a preliminary matching answer.

2. The method for matching fragmented knowledge base slices with semantic understanding answers according to claim 1, characterized in that, The serialized fragment set includes applicable condition fragments, legal obligation fragments, legal consequence fragments, and time limit provision fragments. The hierarchical weight sequence includes legal obligation semantic vectors and question semantic vectors. The trajectory link set includes condition obligation connection, obligation consequence connection, and consequence time limit connection. The preliminary matching answer includes semantic alignment fragments and interpolation completion fragments.

3. The method for matching fragmented knowledge base segments with semantic understanding answers according to claim 1, characterized in that, The specific steps of S1 are as follows: S101: Obtain documents, tables and images from the legal knowledge base, perform character region detection on the image data, perform text recognition with the document data and table data, decode the character encoding information and transcribe it into a continuous text sequence, and generate a recognized text sequence. S102: Based on the identified text sequence, perform semantic condition splitting, extract multiple fragments of applicable conditions, legal obligations, legal consequences and time limits, and segment and recombine multiple fragments at syntactic boundaries to obtain a set of classified text fragments; S103: Call the classified text fragment set, input the conditional random field model to serialize and label the fragment sequence positions, analyze the parsable tag structure of the same type of fragments according to the sentence order, and concatenate all the tag results to obtain the serialized fragment set.

4. The method for matching fragmented knowledge base slices with semantic understanding answers according to claim 1, characterized in that, The specific steps of S2 are as follows: S201: Obtain the question asked by the user, and call the applicable conditions and legal obligations in the serialized fragment set. Calculate the similarity between the question semantic vector and the semantic vectors of the applicable conditions and legal obligations. Combine the semantic similarity threshold to filter the corresponding matching items and obtain the condition and obligation comparison results. S202: Based on the comparison results of the aforementioned conditional obligations, obtain the legal consequences and statute of limitations provisions, and make layer-by-layer judgments on the triggering conditions and statute of limitations provisions of the legal consequences in accordance with the logical chain order of the problem, and obtain the logical chain judgment set; S203: Based on the comparison results between the logical chain judgment set and the conditional obligation, the two types of results are weighted, and the semantic matching score and logical chain judgment score under the same problem are numerically merged and arranged in a hierarchical manner to generate a hierarchical weight sequence. The semantic similarity threshold is set statistically by analyzing the cosine similarity distribution between the question vector of a preset sample and the condition vector of a serialized fragment set.

5. The method for matching fragmented knowledge base slices with semantic understanding answers according to claim 1, characterized in that, The specific steps for S3 are as follows: S301: Based on the hierarchical weight sequence and the serialized fragment set, the correlation degree of the multi-weight level entries in the hierarchical weight sequence and the conditional data frames in the serialized fragment set is calculated, and the entries that exceed the similarity judgment benchmark are recorded to obtain the conditional correlation set. S302: Call the condition association set, and according to the applicable condition data frame index, retrieve the legal obligations, legal consequences and time limit provisions parameter set in the serialized fragment set, connect and determine the three types of parameter sets according to the condition index order, and obtain the connection mapping set; S303: Based on the aforementioned connection mapping set, the applicable conditions, legal obligations, legal consequences, and time limits are sequentially arranged in a chain structure, the order of multiple connection results on the logical path is spliced ​​together, and the spliced ​​path sequence is aggregated to generate a trajectory link set.

6. The method for matching fragmented knowledge base slices with semantic understanding answers according to claim 5, characterized in that, The similarity determination criterion is set by statistically analyzing the Euclidean distance distribution between the numerical vectors of the hierarchical weighted sequence entries and the conditional numerical vectors of the serialized fragment set, and then calculating the mean of the normalized interval by combining the maximum and minimum distances in the distribution.

7. The method for matching fragmented knowledge base slices with semantic understanding answers according to claim 1, characterized in that, The specific steps of S4 are as follows: S401: Obtain candidate answer text, perform character-level segmentation on the text content and reorganize it according to semantic boundaries, aggregate the multiple sequences according to the index order to obtain a set of candidate answer fragments; S402: Call the candidate answer fragment set, and calculate the semantic cosine similarity between the position vectors of multiple fragments in the fragment set and the node vectors in the path sequence according to the semantic path sequence in the trajectory link set. Filter out semantics that exceed the semantic similarity threshold and map them to generate a semantic alignment mapping set. S403: Based on the semantic alignment mapping set, retrieve the locations of missing nodes in the trajectory link set, and calculate and fill in the missing location parameter values ​​using linear interpolation based on the parameter dependency relationship between adjacent nodes to obtain a preliminary matching answer.

8. The method for matching fragmented knowledge base slices with semantic understanding answers according to claim 7, characterized in that, The semantic similarity threshold is set by statistically analyzing the cosine similarity distribution between candidate answer fragment vectors and trajectory link set node vectors, combined with the upper and lower boundaries of the distribution interval and the median.

9. The method for matching fragmented knowledge base slices with semantic understanding answers according to claim 1, characterized in that, The method further includes: S5: Based on the preliminary matching answer and the hierarchical weight sequence, calculate the weight conformity of the multi-parameter positions in the preliminary matching answer and accumulate it into a total score. Adjust the internal order and weight priority of the same parameter categories in the preliminary matching answer according to the total score to generate an optimized answer matching result. The optimized answer matching results include the optimization order, answer matching score, and priority weight.

10. The method for matching fragmented slices and semantically understood answers in a dedicated knowledge base according to claim 9, characterized in that, The specific steps of S5 are as follows: S501: Based on the preliminary matching answer and the hierarchical weight sequence, extract the weight values ​​of the multi-parameter positions in the preliminary matching answer, and compare them with the corresponding weight coefficients in the hierarchical weight sequence. Calculate the conformity value of the multi-parameter positions under the comparison to obtain the parameter position conformity sequence. S502: Call the parameter position conformity sequence, accumulate the position conformity values ​​of multiple parameters in the sequence, analyze the cumulative score sequence of the parameter set in the whole range and aggregate it to generate the total answer matching score; S503: Based on the total score of the answer matching, retrieve fragments with the same parameter category in the preliminary matching answers, and adjust and rearrange the internal order and weight values ​​of the fragments in the same category according to the priority relationship in the total score to generate optimized answer matching results.

Citation Information

Cited By

  • Operation and maintenance technology service intelligent dialogue question answering method and system based on large model knowledge base

    CN121561069A