Intelligent processing system for enhanced training of legal text small samples

By building a dynamic hierarchical term replacement knowledge base and a multi-level evaluation mechanism, the problems of professionalism and logic destruction in data enhancement in small sample scenarios of legal texts are solved, and the generalization ability of the model is improved, making it suitable for fields such as intellectual property law and financial securities law.

CN120706434AActive Publication Date: 2025-09-26GUANGDONG BENCHAO TECH DEV CO LTD

Patent Information

Application Number
CN202510886121.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-09-26
Estimated Expiration
2045-06-30

AI Technical Summary

Technical Problem

Existing technologies are unable to balance professionalism and rigor in scenarios with small samples of legal texts, resulting in the destruction of legal logical relationships during data augmentation and insufficient model generalization capabilities.

Method used

Build a dynamic hierarchical term replacement knowledge base, including a basic synonym library, a context adaptation library, and an extended interpretation library. Combine NLP, FastText, BERT, and knowledge graphs for text enhancement and evaluation, and optimize the system through automatic verification and manual review.

Benefits of technology

It achieves the professionalism and logical rigor of legal text data enhancement, improves the model's generalization ability under small sample training, and is applicable to fields such as intellectual property law and financial securities law.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120706434A_ABST
    Figure CN120706434A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent processing system for enhanced training of legal text small samples, and relates to the field of intelligent processing of legal texts. The system comprises a knowledge base module, a data enhancement module and a data quality evaluation module. The basic synonym library ensures standardization and authority of term replacement through an authoritative dictionary, judgment document mining and co-occurrence frequency calculation, scene accurate matching of term replacement is achieved, the legal relation qualitative change problem is reduced, scene classification is achieved through the context adaptation library based on an LSTM-CRF model, scene key terms are extracted in combination with an attention mechanism, and the scene key terms are extracted through the context adaptation library based on the LSTM-CRF model. The term replacement is more fit with the field context of the legal text, the expansion explanation library maintains the hyponymy of the legal concept through the knowledge graph, it is ensured that the replaced terms do not change the abstract-concrete level of the legal concept, and the preciseness of the legal logic is maintained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent processing of legal texts, and in particular to an intelligent processing system for enhanced training of small samples of legal texts. Background Art

[0002] Legal texts are highly professional and feature detailed domain divisions. Taking intellectual property law, financial securities law and other sub-fields as examples, each has a unique terminology system and logical architecture. Large-scale annotation requires the participation of legal experts, and the labor cost is 5-8 times that of general fields. As a result, obtaining large-scale annotated data requires a lot of manpower, time and economic costs. In existing technologies, legal text processing usually adopts general data enhancement technology in small sample scenarios. When performing data enhancement, general data enhancement technology is directly applied to legal texts, which cannot take into account the professionalism and rigor of legal texts. Simple word replacement can easily destroy the logical relationship and legal attributes of legal texts. For example, "contractual negligence liability" is mistakenly replaced with "breach of contract liability", resulting in a qualitative change in the legal relationship and difficulty in generating high-quality enhanced data. As a result, the model has insufficient generalization ability under small sample training and cannot effectively learn the characteristics of legal texts.

[0003] Therefore, we have made improvements to this and proposed an intelligent processing system for enhanced training of small samples of legal texts. Summary of the Invention

[0004] The present invention provides the following technical solutions: The specific application is as follows: An intelligent processing system for enhanced training of small samples of legal texts, including: a knowledge base module, a data enhancement module, and a data quality assessment module; Knowledge Base Module: This module is used to construct a dynamic hierarchical term replacement knowledge base and provide a set of term replacement candidates to the data enhancement module. It also receives feedback from the data quality assessment module to update the knowledge base. The knowledge base includes a basic synonym library, a contextual adaptation library, and an extended interpretation library. The basic synonym library stores standardized legal terms and their synonymous pairs, based on co-occurrence frequencies and authoritative dictionaries. The contextual adaptation library constructs a term-scenario mapping matrix based on a legal scenario classification model, providing scenario-specific adaptation terms. The extended interpretation library stores the hierarchical relationships and logical rules of legal concepts in the form of a knowledge graph. Data Enhancement Module: This module performs text enhancement operations based on the terminology library of the knowledge base module, including term replacement, redundancy removal, and fragment insertion in legal texts, and sends the enhancement results to the data quality assessment module, including text replacement, text deletion, and text insertion units. Data Quality Assessment Module: This module is used to evaluate the legal attributes, logical consistency, and semantic coherence of the enhanced text, and to feed dispute cases back to the knowledge base module to optimize system performance. It includes an automatic verification unit, a classification sampling unit, a manual review unit, and a feedback optimization unit. Wherein, the classification sampling unit performs stratified sampling on the enhanced text according to the automatic verification result. For texts with a logic verification confidence level less than 60%, samples will be drawn using a random number generation algorithm at a 60% sampling ratio and sent to a manual review unit. The logic verification confidence level is generated using the legal knowledge graph logic verification algorithm. The manual review unit pushes the sampled text to the legal expert annotation interface. The expert views the original text and the enhanced text through a visual interface. After comparing the original text and the enhanced text, the expert fills in the review opinion and marks the dispute type. The manual review unit automatically records the review opinion and dispute type and stores them in the dispute case library. The feedback optimization unit dynamically updates the knowledge base through the following mechanism: when there are ≥5 cases in the dispute case library where the legal attributes have changed due to the replacement of similar terms, the scenario mapping matrix of the context adaptation library is automatically triggered to retrain, the legal element features in the logically contradictory cases are extracted, and new knowledge graph verification rules are generated and added to the extended interpretation library.

[0005] The basic synonym library is as follows: We extracted standardized legal terms and official definitions from various authoritative dictionaries, crawled over 100,000 judgment documents from the China Judgment Documents Network, extracted terms and context using OCR technology, removed unstructured content from the judgment documents, used regular expressions to match sentences with the same terminology, and preliminarily extracted synonymous pairs. Based on the synonymy list in the "Legal Terminology Standards", we used regular expressions to batch match candidate synonymous pairs. For term pairs that were not explicitly included, we calculated their co-occurrence frequency in the judgment documents. Term pairs that appeared ≥10 times were considered potential synonyms. We used a sliding window method to The window size is set to 50 words. The co-occurrence counts of term pairs are counted to generate a co-occurrence matrix. A synonym confidence threshold is set: term pairs with a co-occurrence frequency ≥ 50 times and a co-occurrence probability > 0.8 are included in the basic synonym database. The Communiqué of the Standing Committee of the National People's Congress is regularly crawled to identify terms in new or revised legal provisions. These terms are added to the synonym database after manual review, and feedback from legal experts on the term replacement results is collected. If a synonym pair is marked as "logically contradictory" ≥ 3 times, it is removed from the database or marked with a risk level. Unstructured content includes punctuation errors and paragraphs with poor formatting. The context adaptation library is specifically as follows: Collect more than 100,000 contract texts and judgments, annotate them by field, and have legal experts perform scene classification and annotation on 20,000 texts. Use the Jieba word segmentation tool to segment the text, remove stop words, generate a scene-text mapping table, extract the bag-of-words features, TF-IDF features, and syntactic features of the text, and construct a legal scene feature vector, including field keywords and term frequency. Use an 8:1:1 ratio to divide the training set, validation set, and test set. Train the LSTM-CRF model with a hidden layer dimension of 256, a learning rate of 0.001, and 50 iterations. Adjust the dropout rate through the validation set and set the dropout rate to 0.3 to avoid overfitting. The scene classification accuracy of the model on the test set must be ≥90%, otherwise readjust the features or hyperparameters. For the text in each scene, use The attention mechanism calculates the scenario relevance score of a term, with higher weights indicating greater criticality. The top 100 scoring terms in each scenario are extracted to form a set of scenario-critical terms. A mapping matrix is ​​constructed, with the row dimension representing the legal scenario and the column dimension representing the term. The matrix values ​​represent the probability of a term appearing in the corresponding scenario. The matrix values ​​are weighted by TF-IDF and scenario frequency. When the probability of a term in a scenario is ≥0.2, it is marked as an adapted term for that scenario. The LSTM-CRF model is trained by dividing the training, validation, and test sets in an 8:1:1 ratio. This parameter combination is optimized based on cross-validation: the hidden layer dimension is 256 to balance model capacity and training efficiency, and the learning rate is 0.001 to avoid gradient explosion. After 50 iterations, the model's scenario classification accuracy on the test set is stable at ≥90%. The extended interpretation library is specifically as follows: Define entity types: legal subjects, legal acts, legal consequences and legal concepts; define relationship types: hierarchical relationships, causal relationships and rights and obligations relationships; extract entity relationship pairs from legal texts and judicial interpretations; use Neo4j graph database to store knowledge graphs; nodes include entity names, definitions and domain labels; edges include relationship types and confidence levels, and are confirmed through expert review; for abstract legal concepts, traverse all their subordinate concepts through the knowledge graph, extract the key elements of the subordinate concepts, and generate a concrete expression framework; based on the template filling method, combine the definition framework of the abstract concept with the terms in the basic synonym library, and perform syntactic correctness verification on the generated expression to ensure semantic fluency; update the knowledge graph annually, add concepts from newly enacted laws, and establish their hierarchical relationships through expert review; if a concrete expression is manually reviewed and marked as "semantically ambiguous" after text insertion, update the subordinate relationship of the concept in the graph and add more limiting elements.

[0006] The specific steps of the text replacement unit are as follows: SA1, start; SA2: Input legal text and use NLP technology to perform part-of-speech tagging, syntactic analysis, and semantic role identification on the input legal text; SA3: Based on the grammatical structure and semantic function of the term, determine whether the term is a non-core legal relationship node. If so, search for candidate terms based on the basic synonym database and context adaptation database. If not, proceed to step SA4. Non-core legal relationship nodes are terms that do not directly affect legal entities or rights and obligations. SA4, using FastText's legal attribute multi-classification model to detect changes in legal attributes and judge ,like , then proceed to SA5, if , then cancel the replacement and record the exception, and feed the exception case back to the knowledge base module for optimization; SA5: A logical verification algorithm based on the legal knowledge graph determines whether there are logical contradictions between the legal entities, rights and obligations, and legal facts involved in the text before and after the replacement. If not, the replacement is performed. If so, the replacement is canceled and the exception is recorded. The exception case is also fed back to the knowledge base module for optimization. SA6, end; The specific steps of the text deletion unit are as follows: SB1, start; SB2, using dependency parsing and rule engines to decompose text into sentence text, node type, parent node, child node list, information entropy, and element contribution; SB3. Construct a logic tree and extract the key element set E = {subject, behavior, consequence, time, location, subject matter, other} using the legal element identification model. Identify redundant branches, including repeated explanations of legal principles and repeated interpretations of the same catch-all clauses. SB4. Use the TF-IDF weighted method to calculate the information entropy of each sentence; SB5. Calculate the contribution of the legal elements of the sentence based on the ratio of the number of elements in E to the total number of elements included in the sentence; SB6. Determine whether the sentence information entropy is lower than the information entropy mean and whether the contribution of legal elements is less than 20%. If not, trigger the manual review process, and legal professionals will determine whether to delete it. If so, compare the topological structure changes of the legal relationship map before and after deletion to determine whether the key legal relationship is damaged. If so, trigger the manual review process, and legal professionals will determine whether to delete it. If not, perform the deletion operation. The damage to the key legal relationship includes the interruption of the connection between the rights and obligations of the subjects and the break of the causal chain of legal facts. The information entropy mean is the arithmetic mean of the information entropy of all sentences in the text to be processed. The information entropy of each sentence is calculated using the TF-IDF weighted method.

[0007] SB7, end.

[0008] The specific steps of the text insertion unit are as follows: SC1, start; SC2: Obtain candidate fragments and texts, retrieve matching fragments from the legal case database, judicial interpretation database, and typical clause database, construct an OWL ontology model, use the legal ontology semantic similarity calculation method, and calculate the conceptual semantic distance and relationship path similarity between the text and the candidate fragments based on the OWL ontology model; SC3: Determine whether the similarity is ≥ 0.7. If not, the process proceeds to manual review, where legal professionals will determine the similarity between the candidate segment and the text and modify the candidate segment. If so, it is considered a candidate segment. SC4. Use the BERT language model to calculate the coherence score of the text before and after the insertion position. The formula is: , where ti is the i-th word in the text, Score(ti, ti+1) is the semantic association score of adjacent words, and k is the number of words in the text; SC5: Determine whether the score is less than 0.8. If so, adjust the insertion position or reselect the fragment. If not, enter manual review, and legal professionals will adjust the insertion position or reselect the fragment. After insertion, legal logic verification will be conducted again, and the knowledge graph will be used to verify whether there are any contradictions in the causal chain of legal facts. If there are contradictions, manual correction will be carried out, and legal professionals will modify the inserted text based on the text before and after the insertion position. SC6, end.

[0009] The automatic verification unit is specifically as follows: SD1, start; SD2. Perform legal attribute consistency detection and use the FastText multi-classification model to calculate the legal attribute probability distribution P before enhancement, P after enhancement, and the attribute change threshold before and after enhancement. ,when When an early warning is triggered, manual modification is performed; SD3: Identify logical contradictions. Build rules based on the legal knowledge graph and use a graph traversal algorithm to detect whether the logical graph contains contradictions. If there are contradictions in the logical graph, an alert is triggered and manual modification is performed. The rules for building the legal knowledge graph include subject consistency, time logic, and the correspondence between rights and obligations. SD4: Perform semantic coherence assessment. Calculate the perplexity based on the RoBERTa-large model and compare the rate of change of dependency syntactic structure using the syntactic tree similarity algorithm. If the rate of change is > 0.4, it is judged as "significant change in syntactic structure," triggering a semantic coherence warning and manual modification. SD5, end.

[0010] Compared with the prior art, the present invention has the following beneficial effects: 1. The basic synonym library ensures the standardization and authority of term replacement through authoritative dictionaries, judicial document mining, and co-occurrence frequency calculation, achieving accurate matching of term replacement scenarios, thereby reducing the problem of qualitative changes in legal relations. The context adaptation library implements scenario classification based on the LSTM-CRF model and combines the attention mechanism to extract key scenario terms, making term replacement more in line with the domain context of legal texts. The expanded interpretation library maintains the hierarchical relationship of legal concepts through knowledge graphs, ensuring that the replaced terms do not change the abstract-concrete hierarchy of legal concepts and maintaining the rigor of legal logic.

[0011] 2. The text replacement unit uses NLP technology to identify non-core legal relationship nodes, combines it with the FastText model to detect changes in legal attributes, and verifies logical contradictions such as legal entities, rights and obligations based on the knowledge graph, reducing the damage to legal logic caused by simple vocabulary replacement.

[0012] 3. The text deletion unit accurately identifies redundant content through dependency syntax analysis, information entropy, and legal element contribution calculation, reducing the damage to key legal relationships during deletion. The text insertion unit calculates semantic similarity based on the OWL ontology model and evaluates coherence using the BERT model to ensure that the inserted fragment is logically consistent with the original text. At the same time, it verifies causal chain contradictions through knowledge graphs to improve the rationality of data enhancement.

[0013] 4. The automatic verification unit uses FastText to detect consistency in legal attributes, knowledge graphs to identify logical contradictions, and the RoBERTa-large model to evaluate semantic coherence to achieve quality control of enhanced text. The classified sampling unit samples high-risk texts at a ratio of 60%, which are reviewed by legal experts through a visual interface, and the dispute types are recorded and stored in the case library to make up for the limitations of automatic verification. When there are ≥5 cases in the dispute case library where the legal attributes have changed due to the replacement of similar terms, the context adaptation library is automatically triggered to be retrained, and new knowledge graph verification rules are generated, so that the system can adapt to the dynamic changes of legal texts and continuously improve the quality of data enhancement.

[0014] 5. The generated enhanced data takes into account both legal professionalism and logical rigor, which can effectively help machine learning models learn the characteristics of legal texts and improve the generalization ability under small sample training. It is suitable for legal text processing in sub-fields such as intellectual property law and financial securities law. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 This is a schematic diagram of the system architecture of this application; Figure 2 This is a flowchart of the text replacement unit of this application; Figure 3This is a flowchart of the text deletion unit of this application; Figure 4 This is a flowchart of the text insertion unit of this application; Figure 5 This is a flow chart of the data quality assessment module for this application; Figure 6 This is a schematic diagram of the automatic verification unit process of this application; Figure 7 This is a flow chart of the feedback optimization unit of this application. DETAILED DESCRIPTION

[0016] To make the purpose, technical solutions and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them.

[0017] Therefore, the following detailed description of the embodiments of the present invention is not intended to limit the scope of the claimed invention, but merely represents some embodiments of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort shall fall within the scope of protection of the present invention.

[0018] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features and technical solutions therein may be combined with each other.

[0019] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.

[0020] In the description of the present invention, it should be noted that the terms "upper" and "lower" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, or the orientations or positional relationships in which the inventive product is typically placed when in use, or the orientations or positional relationships commonly understood by those skilled in the art. Such terms are intended solely to facilitate the description of the present invention and simplify the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, be constructed, or operate in a specific orientation. Therefore, they should not be construed as limitations on the present invention. Furthermore, the terms "first" and "second" and the like are used solely for distinction and should not be construed as indicating or implying relative importance.

[0021] The present invention provides the following technical solutions: Please refer to Figure 1-Figure 7 , an intelligent processing system for enhanced training of small samples of legal texts, including: a knowledge base module, a data enhancement module and a data quality assessment module; Knowledge Base Module: This module is used to construct a dynamic hierarchical term replacement knowledge base and provide a set of term replacement candidates to the data enhancement module. It also receives feedback from the data quality assessment module to update the knowledge base. The knowledge base includes a basic synonym library, a contextual adaptation library, and an extended interpretation library. The basic synonym library stores standardized legal terms and their synonymous pairs, based on co-occurrence frequencies and authoritative dictionaries. The contextual adaptation library constructs a term-scenario mapping matrix based on a legal scenario classification model, providing scenario-specific adaptation terms. The extended interpretation library stores the hierarchical relationships and logical rules of legal concepts in the form of a knowledge graph. Data enhancement module: performs text enhancement operations based on the terminology library of the knowledge base module, which is used for term replacement, redundant deletion and fragment insertion of legal texts, and sends the enhancement results to the data quality assessment module, including text replacement unit, text deletion unit and text insertion unit; when the text replacement unit needs to retrieve candidate terms, it first queries the context adaptation library to obtain the set of adapted terms for the current scenario. If there is no suitable term in the context adaptation library, it switches to the basic synonym library to check whether there are common synonyms across scenarios. For the replaced terms, its hierarchical relationship is queried through the extended interpretation library to ensure that the replacement does not change the abstract-concrete level of the legal concept. After each term replacement, if the quality assessment module finds a logical contradiction, it automatically feeds back the case to the corresponding sub-library: the basic synonym library updates the confidence of the synonym pair, the context adaptation library adjusts the scenario probability of the term, and the extended interpretation library corrects the relationship path of the knowledge graph.

[0022] Data Quality Assessment Module: This module is used to evaluate the legal attributes, logical consistency, and semantic coherence of the enhanced text, and to feed dispute cases back to the knowledge base module to optimize system performance. It includes an automatic verification unit, a classification sampling unit, a manual review unit, and a feedback optimization unit. Among them, the classification sampling unit performs stratified sampling on the enhanced text according to the automatic verification results. For texts with a logic verification confidence level less than 60%, samples will be drawn using a random number generation algorithm at a 60% sampling ratio and sent to a manual review unit. The logic verification confidence level is generated using the legal knowledge graph logic verification algorithm. The manual review unit pushes the sampled text to the legal expert annotation interface. The expert views the original text and the enhanced text through a visual interface. After comparing the original and enhanced texts, the expert fills in the review opinion and annotates the dispute type. The manual review unit automatically records the review opinion and dispute type and stores them in the dispute case library. The feedback optimization unit dynamically updates the knowledge base through the following mechanism: when there are ≥5 cases in the dispute case library where the legal attributes have changed due to the replacement of similar terms, the scenario mapping matrix of the context adaptation library is automatically triggered to retrain, the legal element features in the logically contradictory cases are extracted, and new knowledge graph verification rules are generated and added to the extended interpretation library.

[0023] The basic synonym library is as follows: We extracted standardized legal terms and official definitions from various authoritative dictionaries, crawled over 100,000 judgment documents from the China Judgment Documents Network, extracted terms and context using OCR technology, removed unstructured content from the judgment documents, used regular expressions to match sentences with the same terminology, and preliminarily extracted synonymous pairs. Based on the synonymy list in the "Legal Terminology Standards", we used regular expressions to batch match candidate synonymous pairs. For term pairs that were not explicitly included, we calculated their co-occurrence frequency in the judgment documents. Term pairs that appeared ≥10 times were considered potential synonyms. We used a sliding window method to The window size is set to 50 words. The co-occurrence counts of term pairs are counted to generate a co-occurrence matrix. A synonym confidence threshold is set: term pairs with a co-occurrence frequency ≥ 50 times and a co-occurrence probability > 0.8 are included in the basic synonym database. The Communiqué of the Standing Committee of the National People's Congress is regularly crawled to identify terms in new or revised legal provisions. These terms are added to the synonym database after manual review, and feedback from legal experts on the term replacement results is collected. If a synonym pair is marked as "logically contradictory" ≥ 3 times, it is removed from the database or marked with a risk level. Unstructured content includes punctuation errors and paragraphs with poor formatting. The context adaptation library is as follows: Collect more than 100,000 contract texts and judgments, annotate them by field, and have legal experts perform scene classification and annotation on 20,000 texts. Use the Jieba word segmentation tool to segment the text, remove stop words, generate a scene-text mapping table, extract the bag-of-words features, TF-IDF features, and syntactic features of the text, and construct a legal scene feature vector, including field keywords and term frequency. Use an 8:1:1 ratio to divide the training set, validation set, and test set. Train the LSTM-CRF model with a hidden layer dimension of 256, a learning rate of 0.001, and 50 iterations. Adjust the dropout rate through the validation set and set the dropout rate to 0.3 to avoid overfitting. The scene classification accuracy of the model on the test set must be ≥90%, otherwise readjust the features or hyperparameters. For the text in each scene, use The attention mechanism calculates the scenario relevance score of a term, with higher weights indicating greater criticality. The top 100 scoring terms in each scenario are extracted to form a set of scenario-critical terms. A mapping matrix is ​​constructed, with the row dimension representing the legal scenario and the column dimension representing the term. The matrix values ​​represent the probability of a term appearing in the corresponding scenario. The matrix values ​​are weighted by TF-IDF and scenario frequency. When the probability of a term in a scenario is ≥0.2, it is marked as an adapted term for that scenario. The LSTM-CRF model is trained by dividing the training, validation, and test sets in an 8:1:1 ratio. This parameter combination is optimized based on cross-validation: the hidden layer dimension is 256 to balance model capacity and training efficiency, and the learning rate is 0.001 to avoid gradient explosion. After 50 iterations, the model's scenario classification accuracy on the test set is stable at ≥90%. The expanded interpretation library is as follows: Define entity types: legal subjects, legal acts, legal consequences and legal concepts; define relationship types: hierarchical relationships, causal relationships and rights and obligations relationships; extract entity relationship pairs from legal texts and judicial interpretations; use Neo4j graph database to store knowledge graphs; nodes include entity names, definitions and domain labels; edges include relationship types and confidence levels, and are confirmed through expert review; for abstract legal concepts, traverse all their subordinate concepts through the knowledge graph, extract the key elements of the subordinate concepts, and generate a concrete expression framework; based on the template filling method, combine the definition framework of the abstract concept with the terms in the basic synonym library, and perform syntactic correctness verification on the generated expression to ensure semantic fluency; update the knowledge graph annually, add concepts from newly enacted laws, and establish their hierarchical relationships through expert review; if a concrete expression is manually reviewed and marked as "semantically ambiguous" after text insertion, update the subordinate relationship of the concept in the graph and add more limiting elements.

[0024] The specific steps of text replacement unit are as follows: SA1, start; SA2: Input legal text and use NLP technology to perform part-of-speech tagging, syntactic analysis, and semantic role identification on the input legal text; SA3: Based on the grammatical structure and semantic function of the term, determine whether the term is a non-core legal relationship node. If so, search for candidate terms based on the basic synonym database and context adaptation database. If not, proceed to step SA4. Non-core legal relationship nodes are terms that do not directly affect legal entities or rights and obligations. SA4, using FastText's legal attribute multi-classification model to detect changes in legal attributes and judge ,like , then proceed to SA5, if , then cancel the replacement and record the exception, and feed the exception case back to the knowledge base module for optimization; SA5: A logical verification algorithm based on the legal knowledge graph determines whether there are logical contradictions between the legal entities, rights and obligations, and legal facts involved in the text before and after the replacement. If not, the replacement is performed. If so, the replacement is canceled and the exception is recorded. The exception case is also fed back to the knowledge base module for optimization. SA6, end; The specific steps of the text deletion unit are as follows: SB1, start; SB2, using dependency parsing and rule engines to decompose text into sentence text, node type, parent node, child node list, information entropy, and element contribution; SB3. Construct a logic tree and extract the key element set E = {subject, behavior, consequence, time, location, subject matter, other} using the legal element identification model. Identify redundant branches, including repeated explanations of legal principles and repeated interpretations of the same catch-all clauses. SB4. Use the TF-IDF weighted method to calculate the information entropy of each sentence; SB5. Calculate the contribution of the legal elements of the sentence based on the ratio of the number of elements in E to the total number of elements included in the sentence; SB6. Determine whether the sentence information entropy is lower than the information entropy mean and whether the contribution of legal elements is less than 20%. If not, trigger the manual review process, and legal professionals will determine whether to delete it. If so, compare the topological structure changes of the legal relationship map before and after deletion to determine whether the key legal relationship is damaged. If so, trigger the manual review process, and legal professionals will determine whether to delete it. If not, perform the deletion operation. The damage to the key legal relationship includes the interruption of the connection between the rights and obligations of the subjects and the break of the causal chain of legal facts. The information entropy mean is the arithmetic mean of the information entropy of all sentences in the text to be processed. The information entropy of each sentence is calculated using the TF-IDF weighted method.

[0025] SB7, end.

[0026] The specific steps of the text insertion unit are as follows: SC1, start; SC2: Obtain candidate fragments and texts, retrieve matching fragments from the legal case database, judicial interpretation database, and typical clause database, construct an OWL ontology model, use the legal ontology semantic similarity calculation method, and calculate the conceptual semantic distance and relationship path similarity between the text and the candidate fragments based on the OWL ontology model; SC3: Determine whether the similarity is ≥ 0.7. If not, the process proceeds to manual review, where legal professionals will determine the similarity between the candidate segment and the text and modify the candidate segment. If so, it is considered a candidate segment. SC4. Use the BERT language model to calculate the coherence score of the text before and after the insertion position. The formula is: , where ti is the i-th word in the text, Score(ti, ti+1) is the semantic association score of adjacent words, and k is the number of words in the text; SC5: Determine whether the score is less than 0.8. If so, adjust the insertion position or reselect the fragment. If not, enter manual review, and legal professionals will adjust the insertion position or reselect the fragment. After insertion, legal logic verification will be conducted again, and the knowledge graph will be used to verify whether there are any contradictions in the causal chain of legal facts. If there are contradictions, manual correction will be carried out, and legal professionals will modify the inserted text based on the text before and after the insertion position. SC6, end.

[0027] The automatic verification unit is as follows: SD1, start; SD2. Perform legal attribute consistency detection and use the FastText multi-classification model to calculate the legal attribute probability distribution P before enhancement, P after enhancement, and the attribute change threshold before and after enhancement. ,when When an early warning is triggered, manual modification is performed; SD3: Identify logical contradictions. Build rules based on the legal knowledge graph and use a graph traversal algorithm to detect whether the logical graph contains contradictions. If there are contradictions in the logical graph, an alert is triggered and manual modification is performed. The rules for building the legal knowledge graph include subject consistency, time logic, and the correspondence between rights and obligations. SD4: Perform semantic coherence assessment. Calculate the perplexity based on the RoBERTa-large model and compare the rate of change of dependency syntactic structure using the syntactic tree similarity algorithm. If the rate of change is > 0.4, it is judged as "significant change in syntactic structure," triggering a semantic coherence warning and manual modification. SD5, end.

[0028] Example 1: Application scenario: A law firm needs to perform data augmentation on the "liability for breach of contract" clauses in a small sample of sales contracts to train a model and extract the compensation calculation method.

[0029] Specific operations: Knowledge base module: The context adaptation library collects more than 100,000 contract texts, and has legal experts annotate the "sales contract-breach of contract liability" scenario, extracting key terms such as "liquidated damages" and "compensation for losses" with a scenario probability of 0.21. A mapping matrix is ​​constructed, and the interpretation library is expanded to maintain the hierarchical relationships of "breach of contract liability", such as "continue to perform" and "take remedial measures". A template filling method is used to generate concrete expressions, such as "the breaching party shall compensate the performing party for the direct losses caused by the breach of contract, including but not limited to..."

[0030] Data enhancement module: The text deletion unit decomposes the contract terms and calculates the information entropy of the repeated "dispute resolution" clause as 0.51, with an average of 0.55 and an element contribution of 15% < 20%. After deletion, it is confirmed that the connection between rights and obligations is not interrupted. The text replacement unit replaces "force majeure" with "unforeseeable, unavoidable and insurmountable objective circumstances". After FastText detection, ΔP=0.27, and the knowledge graph verification shows that the legal facts are logically consistent.

[0031] Data quality assessment module: The automatic verification unit uses the syntactic tree similarity algorithm to calculate the change rate of 0.38 < 0.4 and determines the semantic coherence; the classification sampling unit samples 60% of the high-risk texts with ΔP = 0.29 and a confidence level of 55%, and updates the dispute case database after expert review.

[0032] Example 2: Application scenario: A securities company needs to perform data enhancement on the "Risk Factors" section in a small sample of prospectuses to train a model to identify compliance statements.

[0033] Specific operations: Knowledge Base Module: The expanded interpretation library uses the Neo4j graph database to store the hierarchical relationships of legal concepts such as "insider trading" and "information disclosure." For example, the sub-concept of "illegal disclosure" includes "failure to disclose major matters in a timely manner," and generates a concrete expression framework. The basic synonym library includes official definitions from the Securities Law of the People's Republic of China. For example, the synonym pair "continuous supervision" and "subsequent supervision" has a co-occurrence frequency of 58 times and a co-occurrence probability of 0.82. The library regularly crawls updated terminology from CSRC announcements. Data augmentation module: The text insertion unit retrieves relevant fragments on "false statement liability" from the judicial interpretation database, calculates a semantic similarity of 0.72 ≥ 0.7 based on the OWL ontology model, and a coherence score of 0.85 ≥ 0.8 using the BERT model. After insertion, the knowledge graph verifies the causal chain, such as the correspondence between violations and legal consequences. The text replacement unit replaces non-core terms such as "corporate governance" with "enterprise governance." FastText detection results in a ΔP of 0.18, indicating no conflicts in rights and obligations. Verification of the data quality assessment module: The automatic verification unit detects legal attribute changes ΔP=0.15≤0.3 and there are no contradictions in the logical graph; if the feedback optimization unit finds ≥5 cases of attribute changes caused by the replacement of similar terms, such as "related transactions" mistakenly replaced with "internal transactions", it automatically triggers retraining of the context adaptation library.

[0034] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.

[0035] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features and technical solutions therein may be combined with each other.

[0036] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.

[0037] The above embodiments are only used to illustrate the present invention and are not intended to limit the technical solutions described in the present invention. Although this specification has described the present invention in detail with reference to the above embodiments, the present invention is not limited to the above specific implementation methods. Therefore, any modification or equivalent replacement of the present invention; and all technical solutions and improvements thereof that do not depart from the spirit and scope of the invention are included in the scope of the claims of the present invention.

Claims

1. An intelligent processing system for enhanced training of small samples of legal texts, characterized by: include: Knowledge base module, data enhancement module and data quality assessment module; Knowledge Base Module: This module is used to build a dynamic hierarchical term replacement knowledge base and provide a set of term replacement candidates to the data enhancement module. It also receives feedback from the data quality assessment module to update the knowledge base. The knowledge base includes a basic synonym library, a contextual adaptation library, and an extended interpretation library. The basic synonym library stores standardized legal terms and their synonymous pairs, based on co-occurrence frequencies and authoritative dictionaries. The contextual adaptation library constructs a term-scenario mapping matrix based on a legal scenario classification model, providing scenario-specific adaptation terms. Expand the interpretation database to store the hierarchical relationships and logical rules of legal concepts in the form of a knowledge graph; Data Enhancement Module: This module performs text enhancement operations based on the terminology library of the knowledge base module, including term replacement, redundancy removal, and fragment insertion in legal texts, and sends the enhancement results to the data quality assessment module, including text replacement, text deletion, and text insertion units. Data quality assessment module: used to evaluate the legal attributes, logical consistency and semantic coherence of enhanced text, and feed back dispute cases to the knowledge base module to optimize system performance, including automatic verification unit, classification sampling unit, manual review unit and feedback optimization unit.

2. The intelligent processing system for enhanced training of small sample sizes of legal texts according to claim 1 is characterized in that: The basic synonym library is as follows: We extracted standardized legal terms and official definitions from various authoritative dictionaries, crawled over 100,000 judgment documents from the China Judgment Documents Network, extracted terms and context using OCR technology, removed unstructured content from the judgment documents, used regular expressions to match sentences with the same terminology, and preliminarily extracted synonymous pairs. Based on the synonymy list in the "Legal Terminology Standards", we used regular expressions to batch match candidate synonymous pairs. For term pairs that were not explicitly included, we calculated their co-occurrence frequency in the judgment documents. Term pairs that appeared ≥10 times were considered potential synonyms. We used a sliding window method to The window size is set to 50 words. The co-occurrence counts of term pairs are counted to generate a co-occurrence matrix. A synonym confidence threshold is set: term pairs with a co-occurrence frequency ≥50 times and a co-occurrence probability >0.8 are included in the basic synonym database. The NPC Standing Committee Bulletin is regularly crawled to identify terms in new or revised legal provisions. These terms are added to the synonym database after manual review. Feedback from legal experts on the term replacement results is collected. If a synonym pair is marked as "logically contradictory" ≥3 times, it is removed from the database or assigned a risk level. Unstructured content includes punctuation errors and poorly formatted paragraphs. The context adaptation library is specifically as follows: We collected over 100,000 contract texts and judgments, annotated them by field, and had legal experts perform scene classification and annotation on 20,000 texts. We used the Jieba word segmentation tool to segment the texts, removed stop words, generated a scene-text mapping table, extracted bag-of-words features, TF-IDF features, and syntactic features from the texts, constructed a legal scene feature vector, including field keywords and term frequency, and used an 8:1:1 ratio to divide the training, validation, and test sets. We trained the LSTM-CRF model with a hidden layer dimension of 256, a learning rate of 0.001, and 50 iterations. We adjusted the dropout rate using the validation set, and the d The ropout rate was set to 0.3 to avoid overfitting. The model's scene classification accuracy on the test set must be ≥90%. Otherwise, features or hyperparameters were readjusted. For the text in each scene, the attention mechanism was used to calculate the scene relevance score of the term. The higher the weight, the more critical it is. The top 100 scoring terms in each scene were extracted to form a scene key term set. A mapping matrix was constructed with the row dimension representing the legal scene and the column dimension representing the term. The matrix value represents the probability of the term appearing in the corresponding scene. The matrix value is calculated by weighting the TF-IDF and the scene frequency. When the probability of a term in a scene is ≥0.2, it is marked as an adaptation term for that scene. The extended interpretation library is specifically as follows: Define entity types: legal subjects, legal acts, legal consequences, and legal concepts; define relationship types: hierarchical relationships, causal relationships, and rights and obligations relationships; extract entity relationship pairs from legal texts and judicial interpretations; use the Neo4j graph database to store the knowledge graph; nodes include entity names, definitions, and domain labels; edges include relationship types and confidence levels, and are confirmed through expert review; for abstract legal concepts, traverse all their subordinate concepts through the knowledge graph, extract the key elements of the subordinate concepts, and generate a concrete expression framework; based on the template filling method, combine the definition framework of the abstract concept with the terms in the basic synonym library, and perform syntactic correctness verification on the generated expression to ensure semantic fluency; update the knowledge graph annually, add concepts from newly enacted laws, and establish their hierarchical relationships through expert review; if a concrete expression is manually reviewed and marked as "semantically ambiguous" after text insertion, update the subordinate relationships of the concept in the graph and add more qualifying elements.

3. The intelligent processing system for enhanced training of small sample sizes of legal texts according to claim 1 is characterized in that: The specific steps of the text replacement unit are as follows: SA1, start; SA2: Input legal text and use NLP technology to perform part-of-speech tagging, syntactic analysis, and semantic role identification on the input legal text; SA3: Based on the grammatical structure and semantic function of the term, determine whether the term is a non-core legal relationship node. If so, search for candidate terms based on the basic synonym database and context adaptation database. If not, proceed to step SA4. Non-core legal relationship nodes are terms that do not directly affect legal entities or rights and obligations. SA4, using FastText's legal attribute multi-classification model to detect changes in legal attributes and judge ,like , then proceed to SA5, if , then cancel the replacement and record the exception, and feed the exception case back to the knowledge base module for optimization; SA5: A logical verification algorithm based on the legal knowledge graph determines whether there are logical contradictions between the legal entities, rights and obligations, and legal facts involved in the text before and after the replacement. If not, the replacement is performed. If so, the replacement is canceled and the exception is recorded. The exception case is also fed back to the knowledge base module for optimization. SA6, end.

4. The intelligent processing system for enhanced training of small sample sizes of legal texts according to claim 1 is characterized in that: The specific steps of the text deletion unit are as follows: SB1, start; SB2, using dependency parsing and rule engines to decompose text into sentence text, node type, parent node, child node list, information entropy, and element contribution; SB3. Construct a logic tree and extract the key element set E = {subject, behavior, consequence, time, location, subject matter, other} using the legal element identification model. Identify redundant branches, including repeated explanations of legal principles and repeated interpretations of the same catch-all clauses. SB4. Use the TF-IDF weighted method to calculate the information entropy of each sentence; SB5. Calculate the contribution of the legal elements of the sentence based on the ratio of the number of elements in E to the total number of elements included in the sentence; SB6. Determine whether the sentence information entropy is lower than the information entropy mean and whether the contribution of legal elements is less than 20%. If not, trigger the manual review process, and legal professionals will determine whether to delete it. If so, compare the topological structure changes of the legal relationship map before and after deletion to determine whether the key legal relationship is damaged. If so, trigger the manual review process, and legal professionals will determine whether to delete it. If not, perform the deletion operation. The damage to the key legal relationship includes the interruption of the connection between the rights and obligations of the subjects and the break of the causal chain of legal facts. The information entropy mean is the arithmetic mean of the information entropy of all sentences in the text to be processed. The information entropy of each sentence is calculated using the TF-IDF weighted method. SB7, end.

5. The intelligent processing system for enhanced training of small sample sizes of legal texts according to claim 1 is characterized in that: The specific steps of the text insertion unit are as follows: SC1, start; SC2: Obtain candidate fragments and texts, retrieve matching fragments from the legal case database, judicial interpretation database, and typical clause database, construct an OWL ontology model, use the legal ontology semantic similarity calculation method, and calculate the conceptual semantic distance and relationship path similarity between the text and the candidate fragments based on the OWL ontology model; SC3: Determine whether the similarity is ≥ 0.

7. If not, the process proceeds to manual review, where legal professionals will determine the similarity between the candidate segment and the text and modify the candidate segment. If so, it is considered a candidate segment. SC4. Use the BERT language model to calculate the coherence score of the text before and after the insertion position. The formula is: , where ti is the i-th word in the text, Score(ti, ti+1) is the semantic association score of adjacent words, and k is the number of words in the text; SC5: Determine whether the score is less than 0.

8. If so, adjust the insertion position or reselect the fragment. If not, enter manual review, and legal professionals will adjust the insertion position or reselect the fragment. After insertion, legal logic verification will be conducted again, and the knowledge graph will be used to verify whether there are any contradictions in the causal chain of legal facts. If there are contradictions, manual correction will be carried out, and legal professionals will modify the inserted text based on the text before and after the insertion position. SC6, end.

6. The intelligent processing system for enhanced training of small sample sizes of legal texts according to claim 1 is characterized in that: The automatic verification unit is specifically as follows: SD1, start; SD2, perform legal attribute consistency detection, use FastText multi-classification model to calculate the legal attribute probability distribution P before enhancement, P after enhancement, attribute change threshold ,when When an early warning is triggered, manual modification is performed; SD3: Identify logical contradictions. Build rules based on the legal knowledge graph and use a graph traversal algorithm to detect whether the logical graph contains contradictions. If there are contradictions in the logical graph, an alert is triggered and manual modification is performed. The rules for building the legal knowledge graph include subject consistency, time logic, and the correspondence between rights and obligations. SD4: Perform semantic coherence assessment. Calculate the perplexity based on the RoBERTa-large model and compare the rate of change of dependency syntactic structure using the syntactic tree similarity algorithm. If the rate of change is > 0.4, it is judged as "significant syntactic structure change," triggering a semantic coherence warning and manual modification. SD5, end.

7. The intelligent processing system for enhanced training of small sample sizes of legal texts according to claim 1 is characterized in that: The classification sampling unit performs stratified sampling on the enhanced text according to the automatic verification result. For texts with a logic verification confidence of less than 60%, samples will be drawn using a random number generation algorithm at a sampling ratio of 60%, and the drawn samples will be sent to the manual review unit. The logic verification confidence is generated using the legal knowledge graph logic verification algorithm.

8. The intelligent processing system for enhanced training of small sample sizes of legal texts according to claim 1 is characterized in that: The manual review unit pushes the sampling samples to the legal expert annotation interface. The expert views the original text and the enhanced text through the visual interface, and fills in the review opinion and marks the dispute type after comparing the original text and the enhanced text. The manual review unit automatically records the review opinion and dispute type and stores them in the dispute case library.

9. The intelligent processing system for enhanced training of small sample sizes of legal texts according to claim 1 is characterized in that: The feedback optimization unit dynamically updates the knowledge base through the following mechanism: when there are ≥5 cases in the dispute case library where the legal attributes have changed due to the replacement of similar terms, the scenario mapping matrix of the context adaptation library is automatically triggered to retrain, the legal element features in the logically contradictory cases are extracted, and new knowledge graph verification rules are generated and added to the extended interpretation library.

Citation Information

Patent Citations

  • Commodity classification method and system for cargo data, and storage medium

    CN118035849A

  • Graph knowledge enhanced paraphrase generation method and system oriented to legal instruments

    CN118552358A

  • Intelligent legal text analysis method based on legal concept pedigree

    CN119990290A

  • Automatic legal knowledge graph construction system and method based on machine learning

    CN120181214A

  • Deep data processing method and system combined with knowledge base

    WO2015042930A1

Cited By

  • Financial knowledge base construction method and system based on large model

    CN121031761A

  • Literature classification method and system based on large language model

    CN121388161A

  • Method and system for recognizing and optimizing file content driven by noun explanation update

    CN121562606A

  • Updating driven file content identification optimization method and system

    CN121562606B

  • Text data intelligent labeling system and method based on large language model

    CN121787363A