Method for recommending legal provisions, electronic device, and program product
By generating dynamic graphs using a legal big language model and combining them with weight adjustment factors, the problem of inaccurate matching of traditional legal clauses is solved, enabling precise recommendation and transparency of legal clauses, and improving the accuracy and reliability of legal analysis.
Patent Information
- Application Number
- CN202510855799.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2045-06-25
AI Technical Summary
Traditional legal clause matching methods struggle to identify complex elements and logical conflicts between elements, leading to inaccurate matching. Furthermore, they are unable to dynamically adapt to the regional and temporal nature of laws and regulations, affecting the accuracy and reliability of legal analysis.
By generating a dynamic legal knowledge graph based on a vertical domain-based legal language model, labeling it with timeliness and regional tags, and combining judicial logical reasoning and weight adjustment factors, the target legal clauses are identified and a recommendation report is generated.
It improves the accuracy and interpretability of legal clause recommendations, ensures that the recommended clauses are currently valid and applicable, and enhances the transparency and credibility of legal analysis.
Smart Images

Figure CN120744092B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to a recommended method for legal provisions, electronic devices, and program products. Background Technology
[0002] In the field of legal clause analysis and matching, traditional methods mainly rely on keyword matching, which struggles to identify complex elements and logical conflicts between elements. This crude extraction approach easily overlooks key information, leading to inaccurate legal clause matching. Furthermore, it is weak in handling the logical relationships between elements, making it difficult to identify contradictions or connections, which directly affects the accuracy and reliability of legal analysis. Summary of the Invention
[0003] This disclosure provides a recommended method for legal provisions, as well as electronic devices and program products.
[0004] According to one aspect of this disclosure, a method for recommending legal clauses is provided, comprising: parsing collected legal texts based on a vertical domain legal language model to generate a dynamic legal knowledge graph, wherein the dynamic legal knowledge graph includes logical relationships, conflict relationships, and dynamic revision relationships among legal clauses, and the nodes in the dynamic legal knowledge graph are labeled with time-limited tags and regional tags; performing judicial logical reasoning on received case descriptions based on the legal language model and the dynamic legal knowledge graph to determine target legal clauses that match the case descriptions; adjusting the weight values corresponding to the target legal clauses based on a weight adjustment factor, wherein the weight adjustment factor is used to describe the degree of correlation between the target legal clauses and the case descriptions; and generating a legal clause recommendation report based on the target legal clauses with adjusted weight values.
[0005] According to one technical solution, a vertical domain-based legal language model is used to parse collected legal texts and generate a dynamic legal knowledge graph. This dynamic legal knowledge graph includes logical relationships, conflict relationships, and dynamic revision relationships between legal clauses. Furthermore, the nodes in the dynamic legal knowledge graph are labeled with time-sensitive and regional tags. This allows the dynamic legal knowledge graph to dynamically reflect changes in laws and regulations, avoiding biases in legal analysis caused by the citation of invalid or inapplicable clauses.
[0006] Next, by utilizing a legal language model combined with a dynamic legal knowledge graph, judicial logic reasoning is applied to the case description. This accurately extracts key legal elements from the case description and matches them with appropriate target legal provisions. Then, based on a weight adjustment factor, the weight values corresponding to the target legal provisions are adjusted. Based on the adjusted target legal provisions, a corresponding legal provision recommendation report is generated. This enhances the interpretability and transparency of the recommendation results, thereby improving their accuracy and reliability.
[0007] According to at least one embodiment of this disclosure, based on the legal big language model and the legal knowledge dynamic graph, judicial logical reasoning is performed on the received case description to determine the target legal clause matching the case description, including: parsing the received case description according to the legal big language model to determine the legal elements in the case description and the logical relationships between the legal elements; querying the legal clauses in the legal knowledge dynamic graph according to the legal elements and the logical relationships between the legal elements to generate a corresponding hypothetical reasoning chain, the hypothetical reasoning chain containing factual assumptions and their corresponding unverified legal clauses; performing legality verification on the legal clauses in the hypothetical reasoning chain, the legality verification including semantic alignment between legal entities and legal clauses in the hypothetical reasoning chain, and spatiotemporal validity verification on the legal clauses in the hypothetical reasoning chain; modifying the legal clauses contained in the hypothetical reasoning chain according to the verification results of the legality verification; and converting the modified hypothetical reasoning chain into a syllogistic structure containing the target legal clause, case facts, and legal evaluation.
[0008] The technical solution of this embodiment can improve the clarity of legal logic and the credibility of legal conclusions. The transformation of the syllogistic structure can clearly demonstrate the logical relationship between legal provisions and the facts of the case, making the legal reasoning process more transparent and easier to understand.
[0009] According to at least one embodiment of this disclosure, the spatiotemporal validity verification of legal provisions in a hypothetical reasoning chain includes: verifying the spatiotemporal validity of legal provisions contained in the hypothetical reasoning chain based on the timeliness and regionality tags of nodes in the dynamic graph of legal knowledge.
[0010] According to the technical solution of this embodiment, by verifying the timeliness label, it can be ensured that the cited legal provisions are currently valid, avoiding erroneous analysis caused by outdated legal provisions. By verifying the territorial label, it can be ensured that the cited legal provisions are applicable to the territory of the current case, avoiding legal risks caused by inapplicability to the territory.
[0011] According to at least one embodiment of this disclosure, determining the weight value corresponding to the target legal clause based on a weight adjustment factor includes: determining the weight value corresponding to the target legal clause based on a timeliness decay factor, a regional adaptation factor, and a hotspot enhancement factor; sorting the target legal clauses according to the determined weight values to generate a legal clause recommendation list, wherein the legal clause recommendation list includes the target legal clauses and their corresponding weight values, timeliness tags, and regional tags.
[0012] According to the technical solution of this embodiment, by comprehensively considering the timeliness decay factor, regional adaptation factor and hot topic enhancement factor, the applicability and importance of the target legal provisions can be more comprehensively evaluated, so that the recommended legal provisions are more in line with the current legal environment and the actual needs of specific cases, and avoid the problem of inaccurate recommendations due to the timeliness, regionality or weak relevance of legal provisions to hot issues.
[0013] According to at least one embodiment of this disclosure, a corresponding legal clause recommendation report is generated based on the target legal clauses after weight adjustment, including: generating a legal clause recommendation report based on the legal clause recommendation list, wherein the legal clause recommendation report includes the corresponding legal clauses, cases, and reasons for recommending the legal clauses.
[0014] The technical solution of this embodiment can improve the interpretability and readability of the legal clause recommendation report and ensure the reliability of the legal clause recommendation results.
[0015] According to at least one embodiment of this disclosure, after generating the corresponding legal clause recommendation report, the method further includes: annotating the legal clause recommendation reasons, evidence chain sources, and key segments in the case that trigger the legal clause in the legal clause recommendation report.
[0016] According to the technical solution of this implementation, by annotating the reasons for recommending legal clauses, the source of evidence chains, and the key fragments in cases that trigger legal clauses, the key points of the legal clause recommendation report are highlighted, making it easier for legal professionals to verify the basis and rationality of the recommendation results, thereby improving the credibility and authority of the legal clause recommendations.
[0017] According to at least one embodiment of this disclosure, the collected legal text is parsed based on a vertical domain legal language model to generate a dynamic legal knowledge graph, including: parsing the legal text based on the vertical domain legal language model to determine legal clause nodes, case element nodes, and legal entity nodes; constructing relationship edges between nodes based on the citation, revision, and conflict logic between legal clauses, wherein the relationship edges include logical relationship edges, conflict relationship edges, and dynamic revision relationship edges; marking each node with a timeliness label according to the effective or repeal time of the legal clauses; and marking each legal clause node with a regional label according to the applicable region of the legal clauses.
[0018] According to the technical solution of this embodiment, automated and intelligent parsing and analysis of legal texts can be achieved, constructing an accurate and dynamically updated legal knowledge dynamic map. This map not only covers key nodes such as legal clauses, case elements, and legal entities, but also comprehensively marks timeliness and regional information. This greatly improves the efficiency of legal knowledge management, reduces errors and inconsistencies that may be caused by manual operation, and saves a significant amount of manpower and time costs.
[0019] According to at least one embodiment of this disclosure, the method further includes: constructing a hybrid training corpus based on collected legal provisions, judgments, and legal interpretations; and training a general large language model based on the hybrid training corpus to obtain a vertical domain legal large language model.
[0020] According to the technical solution of this embodiment, by pre-training and fine-tuning a general-purpose large language model in the legal field, it can deeply understand and master the professional terminology, legal concepts, logical structure, and semantic relationships in legal texts, thereby realizing the transformation from a general-purpose language model to a vertical domain legal large language model. This specialized model can process legal texts more accurately and provide high-quality language understanding and generation services for legal-related tasks.
[0021] According to at least one embodiment of this disclosure, when training a general large language model based on the hybrid training corpus, a legal entity dictionary is injected, and the distinguishability of legal terms is enhanced based on contrastive learning.
[0022] According to the technical solution of this embodiment, by injecting a legal entity dictionary, the model acquires accurate legal terminology standards and semantic information in the early stages of training, enabling it to more accurately identify legal entity terms when processing legal texts. Combining contrastive learning to enhance the distinguishability of legal terms allows the model to effectively differentiate similar legal terms, improving the accuracy of its understanding of legal terms and laying a solid foundation for subsequent legal text analysis and processing tasks.
[0023] According to another aspect of this disclosure, an electronic device is provided, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, such that the processor performs a recommended method of legal provisions according to any embodiment of this disclosure.
[0024] According to another aspect of this disclosure, a readable storage medium is provided that stores executable instructions, which, when executed by a processor, represent a recommended method for implementing legal provisions of any embodiment of this disclosure.
[0025] According to another aspect of this disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements the legal provisions of any embodiment of this disclosure in a recommended manner. Attached Figure Description
[0026] The accompanying drawings illustrate exemplary embodiments of the present disclosure and, together with the description thereof, serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.
[0027] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solutions of the present disclosure can be applied is shown.
[0028] Figure 2 A flowchart illustrating a recommended method for legal provisions according to one embodiment of this disclosure is shown.
[0029] Figure 3 A flowchart illustrating step S220 of the recommended method according to one embodiment of the present disclosure is shown.
[0030] Figure 4 A flowchart illustrating step S230 of a recommended method according to legal provisions of one embodiment of this disclosure is shown.
[0031] Figure 5 A flowchart illustrating step S210 of a recommended method according to legal provisions of one embodiment of this disclosure is shown.
[0032] Figure 6 A schematic diagram of a process for training a large language model is shown, which is also included in the recommended method of legal provisions according to one embodiment of this disclosure.
[0033] Figure 7 A schematic block diagram of a legal terms recommendation system according to one embodiment of this disclosure is shown.
[0034] Figure 8A schematic structural block diagram of an electronic device according to one embodiment of the present disclosure is shown. Detailed Implementation
[0035] The present disclosure will now be described in further detail with reference to the accompanying drawings and examples. It should be understood that the specific examples described herein are for illustrative purposes only and are not intended to limit the scope of the disclosure. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present disclosure are shown in the accompanying drawings.
[0036] It should be noted that, where there is no conflict, the embodiments and features described in this disclosure can be combined with each other. The technical solutions of this disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0037] In real-world legal applications, legal professionals need to conduct precise analyses of complex cases and match appropriate legal provisions. However, existing technological solutions have revealed numerous shortcomings when dealing with these scenarios. For example, when faced with case descriptions containing numerous complex elements and logical relationships between them, traditional methods can only perform simple keyword matching, failing to accurately identify key legal elements and their interrelationships, leading to inaccurate provision matching.
[0038] Moreover, when dealing with cases involving regulations in multiple regions or the transition between old and new regulations, it is difficult to dynamically adapt to the regional and time-sensitive requirements of laws and regulations, and it is easy to cite invalid or inapplicable clauses, which affects the accuracy of legal opinions.
[0039] Furthermore, when the system recommends legal clauses, it lacks a logical reasoning process that aligns with legal principles, making it difficult for arbitrators and judges to understand the basis for the recommendations and reducing their trust in the results.
[0040] To this end, this disclosure proposes the following technical solution, in which the constructed dynamic legal knowledge graph includes logical relationships, conflict relationships, and dynamic revision relationships among legal clauses, and the nodes in the dynamic legal knowledge graph are labeled with time-limited tags and regional tags. This enables the dynamic legal knowledge graph to dynamically reflect changes in laws and regulations, avoiding deviations in legal analysis due to invalid or inapplicable clauses.
[0041] Furthermore, by utilizing a legal language model combined with a dynamic legal knowledge graph to perform judicial logic reasoning on case descriptions, key legal elements can be accurately extracted from the case descriptions and matched with appropriate target legal provisions. Then, based on a weight adjustment factor, the weight values corresponding to the target legal provisions are adjusted, thereby generating a corresponding legal provision recommendation report based on the adjusted target legal provisions. This enhances the interpretability and transparency of the recommendation results, thereby improving their accuracy and reliability.
[0042] Here, we need to summarize the technical solution of this application in light of the aforementioned technical issues.
[0043] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solutions of the present disclosure can be applied is shown.
[0044] like Figure 1 As shown, the system architecture may include terminal devices (such as...) Figure 1 The device shown includes one or more of a smartphone 101, tablet 102, and portable computer 103 (which could also be a desktop computer, etc.), a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the terminal device and the server 105. The network 104 can include various connection types, such as wired communication links, wireless communication links, etc.
[0045] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, there can be any number of terminal devices, networks, and servers. For example, server 105 could be a server cluster composed of multiple servers.
[0046] Users can interact with server 105 via network 104 using terminal devices to receive or send messages, etc. Server 105 can be a server providing various services. For example, when a user uploads a case description to server 105 using a terminal device, server 105 can parse the collected legal text based on a vertical domain legal language model to generate a dynamic legal knowledge graph. This dynamic legal knowledge graph includes logical relationships, conflict relationships, and dynamic revision relationships between legal clauses, and the nodes in the dynamic legal knowledge graph are labeled with time-limited and regional tags. Based on the legal language model and the dynamic legal knowledge graph, judicial logic reasoning is performed on the received case description to determine the target legal clause that matches the case description. Based on a weight adjustment factor, the weight value corresponding to the target legal clause is adjusted. The weight adjustment factor is used to describe the degree of correlation between the target legal clause and the case description. Finally, based on the target legal clause with adjusted weight values, a legal clause recommendation report is generated.
[0047] It should be noted that the recommended method for implementing the legal terms provided in this application is generally executed by server 105. However, in other embodiments of this application, the terminal device may also have similar functions to the server, thereby executing the technical solution of the recommended method for implementing the legal terms provided in this application.
[0048] Figure 2 A flowchart illustrating a recommended method for legal provisions according to one embodiment of this disclosure is shown. Figure 2As shown, the method includes at least steps S210 to S240, which are described in detail below.
[0049] In step S210, the collected legal texts are parsed based on the vertical domain's legal big language model to generate a dynamic legal knowledge graph. The dynamic legal knowledge graph includes logical relationships, conflict relationships, and dynamic revision relationships between legal clauses, and the nodes in the dynamic legal knowledge graph are labeled with time-limited tags and regional tags.
[0050] Among them, the vertical domain legal big language model can refer to a big language model that is specifically trained and optimized for the legal field. Based on the general big language model, this model is further pre-trained and fine-tuned by introducing a large amount of legal text data, such as laws and regulations, judgments, and legal interpretations, so that it has the ability to understand, reason and generate legal professional language and can accurately analyze the key elements, logical relationships and legal concepts in legal texts.
[0051] A dynamic legal knowledge graph can be a dynamic structure used to represent the relationships between legal knowledge. It displays nodes such as legal clauses, case elements, and legal entities in the form of a graph, as well as various relationship edges between nodes.
[0052] The logical relationships between legal provisions include citation, revision, and substitution relationships. Conflict relationships refer to contradictions or inconsistencies in the content of different legal provisions, which may be due to conflicts between regulations at different levels or differences in the provisions of the same level of regulations in different regions or at different times. Dynamic revision relationships refer to the revision, repeal, or addition of legal provisions over time.
[0053] Timeliness labels are used to identify the effective date, revision date, and expiration date of legal provisions, ensuring that currently effective legal provisions can be accurately applied during legal analysis.
[0054] Geographical labels are used to identify the geographical scope of application of legal provisions, such as national regulations and local regulations, so as to accurately match the applicable legal provisions when handling cases involving different regions.
[0055] In this embodiment, textual data related to a specific legal field can be comprehensively collected from authoritative sources such as laws and regulations, administrative regulations, industry management regulations, judicial interpretations, and typical cases. The collected legal texts are then integrated and organized to form a legal knowledge base, providing foundational data support for subsequent legal text analysis and the construction of a dynamic legal knowledge graph.
[0056] By leveraging a vertical domain-specific legal language model, the collected legal texts undergo in-depth analysis. For instance, the model can use natural language processing techniques to preprocess the legal texts through word segmentation, part-of-speech tagging, and named entity recognition, extracting key information such as legal clauses, case elements (e.g., case facts, party actions, points of contention), and legal entities (e.g., legal subjects, legal acts, legal rights and obligations) as nodes in a graph. Then, based on its understanding of legal logic and semantics, the model identifies logical relationships, conflicting relationships, and dynamic revision relationships between legal clauses, establishing relationship edges between nodes.
[0057] The nodes and relationship edges obtained from the analysis are integrated to generate a dynamic legal knowledge graph. During the generation process, each node in the graph can be labeled with a time-sensitive tag and a regional tag. The time-sensitive tag can be based on information such as the effective date, revision date, and repeal date explicitly stipulated in the legal text. The regional tag can be based on the scope of application of the legal text.
[0058] In step S220, based on the legal big language model and the legal knowledge dynamic graph, judicial logic reasoning is performed on the received case description to determine the target legal clause that matches the case description.
[0059] The case description can be input by the user and may include key legal analysis information such as the facts of the case, the points of contention, and the claims of the parties involved. The case description can be presented in natural language and may contain technical terms and complex sentence structures.
[0060] Judicial logical reasoning can be the process of using legal logic and reasoning rules to analyze and reason about the description of a case in order to match it with legal provisions.
[0061] In this embodiment, based on the received case description, judicial logical reasoning can be performed on the case description by combining a legal big data language model and a dynamic legal knowledge graph, thereby determining the target legal provisions that match the case description. Specifically, the legal big data language model can be used to perform semantic understanding and element extraction on the case description. Based on natural language processing technology, the legal big data language model deeply analyzes the case description, extracts key legal elements such as case facts, party actions, and legal relationships, and understands the logical relationships between these elements. Simultaneously, the legal big data language model, combined with the dynamic legal knowledge graph, matches and associates the extracted legal elements with nodes such as legal provisions and case elements in the graph to determine the scope of legal provisions related to the case description.
[0062] In step S230, a weight value corresponding to the target legal clause is determined based on a weight adjustment factor, wherein the weight adjustment factor is used to describe the degree of correlation between the target legal clause and the case description.
[0063] The weighting adjustment factor can be a set of parameters used to quantify the close relationship between the target legal clause and the case description. It comprehensively considers the impact of multiple dimensions on the applicability of legal clauses, and can determine the weight value of the target legal clause through specific rules and algorithms to more accurately reflect the fit between the legal clause and the case.
[0064] Weight values can be used to measure the importance, relevance, and applicability of legal provisions in a specific case. It should be understood that a higher weight value indicates a closer connection between the legal provision and the case, and thus requires greater attention during legal analysis and decision-making.
[0065] In this embodiment, after identifying the target legal clause that matches the case description, the weight value corresponding to the target legal clause is determined based on weight adjustment factors. Specifically, the correlation between the target legal clause and the case description is first comprehensively analyzed from multiple dimensions, and various features and factors that can reflect the degree of correlation are extracted as weight adjustment factors. These factors may involve multiple aspects such as the degree of fit between the legal clause and the facts of the case, the degree of regional matching, and the degree of timeliness matching.
[0066] Next, based on the preset weighting calculation rules and the determined weighting adjustment factors, the initial weight value of the target legal clause can be calculated. During the calculation process, the importance and influence of each weighting adjustment factor can be fully considered, and different weight coefficients can be assigned to them to ensure that the final calculated weight value can accurately reflect the actual relevance between the target legal clause and the case description.
[0067] Thus, by determining the weight value of the target legal clause through weight adjustment factors, the accuracy and adaptability of the legal clause recommendation results can be significantly enhanced.
[0068] In step S240, a legal clause recommendation report is generated based on the weight value corresponding to the target legal clause.
[0069] The legal clause recommendation report can be a document or data structure used to present the results of legal clause recommendations. It can display legal clauses that match the case description and related recommendation information, thereby providing legal professionals with clear and accurate legal clause references to assist them in case analysis and decision-making.
[0070] In this embodiment, after calculating the weight values corresponding to the target legal clauses, the target legal clauses can be summarized and organized, and arranged in a certain logical order, such as in descending order of weight values. Then, auxiliary information related to the target legal clauses can be extracted from legal knowledge bases or case-related data sources, such as the specific content of the clauses, relevant judicial interpretations, and citations of similar past cases, to enrich the report's content and make it more persuasive and practical.
[0071] Then, based on the preset report template and format requirements, the compiled clauses and related supporting information are integrated to generate a corresponding legal clause recommendation report.
[0072] Thus, based on Figure 2 The illustrated embodiment parses collected legal texts using a vertical domain-based legal language model to generate a dynamic legal knowledge graph. This dynamic graph includes logical, conflicting, and dynamically revised relationships between legal clauses, and the nodes in the graph are labeled with time-sensitive and regional tags. This allows the dynamic legal knowledge graph to dynamically reflect changes in laws and regulations, preventing subsequent deviations in legal analysis due to invalid or inapplicable clauses.
[0073] Next, by utilizing a legal language model combined with a dynamic legal knowledge graph, judicial logic reasoning is applied to the case description. This accurately extracts key legal elements from the case description and matches them with appropriate target legal provisions. Then, based on a weight adjustment factor, the weight value corresponding to the target legal provision is determined. Based on the target legal provisions with determined weight values, a corresponding legal provision recommendation report is generated. This enhances the interpretability and transparency of the recommendation results, thereby improving their accuracy and reliability.
[0074] Figure 3 A flowchart illustrating step S220 of a recommended method according to one embodiment of the present disclosure is shown. Figure 2 As shown, step S220 includes at least steps S221 to S225, which are described in detail below.
[0075] In step S221, the received case description is parsed according to the legal big language model to determine the legal elements in the case description and the logical relationships between the legal elements.
[0076] Among them, legal elements can be core facts, behaviors, concepts and other key information that have legal significance in the case description, which are the basic units that constitute legal relationships and legal issues.
[0077] There are specific logical relationships between different legal elements, including but not limited to conditions and results, causal relationships, and parallel relationships.
[0078] In this embodiment, a legal big data language model can be used to perform semantic understanding and element extraction on the case description, thereby deeply analyzing the case description and extracting key legal elements. It can also understand the logical relationships between these legal elements. For example, it can identify legal elements such as "contract termination" and the logical connections such as causal relationships between them.
[0079] In step S222, based on the legal elements and the logical relationships between them, matching legal clauses are queried in the dynamic legal knowledge graph to generate a corresponding hypothetical reasoning chain. The hypothetical reasoning chain contains factual assumptions and their corresponding legal clauses to be verified.
[0080] Among them, the hypothetical reasoning chain can be a reasoning structure generated based on the legal elements and logical relationships in the case description, which includes factual assumptions and corresponding legal provisions to be verified, and is used to infer legal consequences.
[0081] In this embodiment, after extracting legal elements and logical relationships from the case description using a legal big data model, these elements can be matched with a dynamic legal knowledge graph. Specifically, the legal elements in the case description can be compared with nodes in the dynamic legal knowledge graph to identify legal provisions related to the case. Then, based on the logical relationships between the legal elements, a hypothetical reasoning chain is constructed to establish a connection between the facts of the case and potentially applicable legal provisions.
[0082] In this way, legal provisions can be accurately matched and a reasonable chain of hypothetical reasoning can be constructed, providing strong support for subsequent legal analysis and decision-making. It should be noted that this chain of hypothetical reasoning can be one or more, and this disclosure does not impose any special limitations on it.
[0083] In one example, assuming the case description is "AAA terminated BBB's contract without notifying CCC", the generated chain of hypothetical reasoning can be as follows: [ { Assumption: "AAA needs to prove that BBB violated the rules". Verification criteria: "Whether written evidence exists", Provisional Conclusion: "Lack of evidence → Substantive violation" }, { Assumption: "The termination procedure must be compliant". Verification criteria: "Whether to notify CCC", Provisional Conclusion: "Failure to notify → Procedural violation" } ] In step S223, the legality of the legal clauses in the hypothetical reasoning chain is verified. The legality verification includes semantic alignment between legal entities and legal clauses in the hypothetical reasoning chain, and spatiotemporal validity verification of the legal clauses in the hypothetical reasoning chain.
[0084] Among them, a legal entity can be a legal term or subject, which is the basic unit that constitutes a legal relationship.
[0085] Spatiotemporal validity verification can be used to verify whether legal provisions are valid within a specific time and space, in order to ensure that the cited legal provisions are applicable to the current legal environment.
[0086] In this embodiment, the legality of legal clauses in the hypothetical reasoning chain can be verified. First, semantic alignment is performed, that is, comparing the legal entities in the hypothetical reasoning chain with the corresponding entities in the legal clauses referenced in the hypothetical reasoning chain to ensure their semantic consistency. For example, verifying whether "AAA" refers to the same concept in the case facts and legal clauses.
[0087] In one example, prompt word engineering can guide the legal big language model to perform semantic alignment between legal entities and legal clauses. For example, inputting "verify whether "notified CCC" is directly related to Article X1 "notify CCC" into the legal big language model allows the model to perform semantic comparison based on this input.
[0088] Next, the legal provisions cited in the hypothetical reasoning chain are verified for their spatiotemporal validity, checking whether they are valid in the current time and place. This ensures the accuracy and applicability of the legal provisions, improving the reliability of the legal analysis. Semantic alignment ensures the accurate correspondence between legal entities and provisions in the case, avoiding misunderstandings or misapplications due to semantic differences. Spatiotemporal validity verification ensures that legal provisions are valid within the current time and place of the case, avoiding the citation of outdated or inapplicable provisions and reducing legal risks.
[0089] In some embodiments of this disclosure, the spatiotemporal validity of legal provisions in the hypothetical reasoning chain is verified, including: Based on the timeliness and location tags of nodes in the aforementioned dynamic graph of legal knowledge, the spatiotemporal validity of legal clauses contained in the hypothetical reasoning chain is verified.
[0090] In this embodiment, based on a dynamic legal knowledge graph, the validity of a legal provision can be determined by checking its expiration date tag. If a legal provision has expired or been amended, it can be marked as invalid. Next, the territorial tag of the legal provision is checked to determine its applicability to the geographic scope of the current case. If a legal provision is not applicable to the location of the case, it is marked as invalid.
[0091] This ensures the accuracy and relevance of legal analysis. Verifying the timeliness label ensures that the cited legal provisions are currently valid, avoiding errors caused by outdated provisions. Verifying the territoriality label ensures that the cited legal provisions are applicable to the current jurisdiction of the case, avoiding legal risks due to inapplicability. This verification mechanism helps improve the quality and reliability of legal analysis, providing strong support for legal decision-making.
[0092] In step S224, the legal clauses contained in the hypothesis reasoning chain are modified based on the verification result of the legality verification.
[0093] In this embodiment, the legal provisions contained in the hypothetical reasoning chain are modified based on the verification results of the legality verification corresponding to each legal provision. That is, if semantic alignment reveals inconsistencies, or spatiotemporal validity verification reveals that the legal provisions are inapplicable, these legal provisions are removed from the hypothetical reasoning chain or replaced with more suitable legal provisions.
[0094] In one example, based on the hypothesis reasoning chain illustrated in the previous example, the revised hypothesis reasoning chain can be as follows: [ { Assumption: "AAA needs to prove that BBB violated the rules". Verification criteria: Article X2 of the YYYY Law (evidence required) Conclusion: "Lack of evidence → Violation of Article X2 → Substantive violation", Related Clauses: ["Article X2 of YYYY Law", "Article X3 of YYY1 Law"] }, { Assumption: "The termination procedure must be compliant". Verification criteria: Article X1 of the YYYY Law Conclusion: "Failure to notify → Violation of Article X1 → Procedural violation", Related Clauses: ["Article X1 of the YYYY Law", "Article XX of the XX City Collective Contract Regulations"] } ] In step S225, the modified hypothetical reasoning chain is converted into a syllogistic structure containing the target legal clause, the facts of the case, and the legal evaluation.
[0095] The syllogistic structure can be a reasoning structure consisting of a major premise (the target legal provision), a minor premise (the facts of the case), and a conclusion (legal evaluation). The syllogistic structure combines general legal principles with specific facts of a case, thus facilitating the derivation of a legally binding conclusion.
[0096] Legal evaluation can be a judgment and analysis of the facts of a case based on legal provisions, used to determine the legal liability and legal consequences of the case.
[0097] In this embodiment, after revising the hypothetical reasoning chain, it can be converted into a syllogistic structure. Specifically, the legal provisions in the revised hypothetical reasoning chain can be taken as the major premise, and the facts of the case as the minor premise. Then, based on the applicable conditions of the legal provisions and the specific circumstances of the facts of the case, the corresponding legal evaluation is derived as the conclusion.
[0098] In one example, the syllogistic structure can be as follows: [ { "Major Premise": "Article X2 of the YYYY Law: AAA must prove BBB's violation to terminate the contract." Minor premise: "AAA failed to provide evidence in this case". Conclusion: "Entity violation" }, { "Major premise": "Article X1 of the YYYY Law: Termination of contract requires prior notice to CCC", Minor premise: "AAA did not notify CCC in this case". Conclusion: "Procedural violation" } ] This can improve the clarity of legal logic and the credibility of legal conclusions. The transformation of the syllogistic structure can clearly demonstrate the logical relationship between legal provisions and the facts of the case, making the legal reasoning process more transparent and easier to understand.
[0099] Figure 4 A flowchart illustrating step S230 of a recommended method according to one embodiment of the present disclosure is shown. Figure 4 As shown, step S230 includes at least steps S231 to S232, which are described in detail below.
[0100] In step S231, the weight value corresponding to the target legal clause is determined based on the time-effect decay factor, the regional adaptation factor, and the hotspot enhancement factor.
[0101] In this embodiment, the weighting adjustment factors include a timeliness decay factor, a regional adaptation factor, and a hotspot enhancement factor. Specifically, the timeliness decay factor can be a factor determined based on the time of legal revision. As the time of legal revision progresses, the weight of older legal provisions will automatically decrease. Therefore, the timeliness of legal provisions can be reflected in the time dimension based on the timeliness decay factor, ensuring that newer legal provisions have a higher priority in recommendations.
[0102] In one example, the time decay factor It can be determined based on the following formula: in, This is a predetermined coefficient; This represents the time interval between the time of the legal amendment and the current time. Therefore, based on the above formula, the weight of older legal provisions can be automatically reduced based on their amendment dates.
[0103] Next, the regional adaptation factor This can be a factor that assigns values to legal provisions in different regions based on the jurisdiction of the case. It can be assigned values according to three categories: jurisdiction, superior region, and inapplicable. For example, if the region corresponding to the legal provision is the jurisdiction of the current case, then the regional adaptation factor can be applied. Assign a value of 1.0. If the region corresponding to the legal clause is the superior region of the region where the current case is located, then the region adaptation factor will be adjusted. The value is assigned to 0.7. If the region corresponding to the legal provision is not applicable to the region where the current case is located, the geographic adaptation factor will be adjusted. The value is assigned to 0.1. It should be noted that the above numbers are merely illustrative examples, and this disclosure does not impose any special limitations on them.
[0104] Hotspot enhancement factors can be used to reflect the relevance between legal provisions and current social controversies. In one example, this can be achieved by real-time analysis of the aforementioned constructed legal knowledge base, based on the frequency of keywords in the case description appearing in the legal knowledge base over the past three months. And the number of associated edges of the node corresponding to the target legal clause. The maximum number of associated edges among all nodes in the legal knowledge base The ratio between them is used to determine the hotspot enhancement factor.
[0105] In one example, the hotspot enhancement factor corresponding to the target legal clause can be determined according to the following formula. : .
[0106] After determining the three factors mentioned above, a weighted sum can be calculated for them, as shown in the following formula: in, These are empirical coefficients, defined and adjusted via configuration files.
[0107] Please continue to refer to this. Figure 4 In step S232, the target legal clauses are sorted according to the determined weight values to generate a legal clause recommendation list. The legal clause recommendation list includes the target legal clauses and their corresponding weight values, timeliness tags, and regional tags.
[0108] In this embodiment, all target legal clauses are sorted according to determined weight values. For example, they are arranged in descending order of weight values to generate a recommended list of legal clauses. This recommended list of legal clauses not only includes the target legal clauses and their corresponding weight values, but may also include timeliness tags and regional tags.
[0109] In one example, a list of recommended legal terms might look like this: [ { Conclusion: "Entity violation" "Article": ["Article X2 of YYYY Law", "Article X4 of YYY1"], Weight: 9.8 }, { Conclusion: "Procedure violation" "Terms": ["Article X1 of the YYYY Law", "Article XX of the XX City Collective Contract Regulations"], Weight: 9.5 } ] In this way, by comprehensively considering factors such as time-lapse decay, regional suitability, and hot topic enhancement, the applicability and importance of target legal provisions can be assessed more comprehensively. This makes the recommended legal provisions more in line with the current legal environment and the actual needs of specific cases, avoiding inaccurate recommendations due to the timeliness, regionality, or weak relevance of legal provisions to hot issues.
[0110] Based on the foregoing embodiments, in some implementations of this disclosure, a corresponding legal clause recommendation report is generated according to the target legal clauses after weight adjustment, including: Based on the legal clause recommendation list, a legal clause recommendation report is generated, which includes the corresponding legal clauses, cases, and reasons for recommending the legal clauses.
[0111] In this embodiment, based on the aforementioned legal clause recommendation list, each target legal clause and its corresponding weight value, timeliness tag, and regional tag can be extracted sequentially from the legal clause recommendation list, and used as the basic content of the corresponding part of the legal clause recommendation report.
[0112] Then, based on the extracted legal provisions, relevant typical cases are selected from legal knowledge bases or case databases. These cases should fully illustrate the application of the legal provisions in actual judicial practice, including the basic facts of the case, the points of contention, the basis for the court's judgment, and the outcome.
[0113] Next, the logical structure of legal syllogism can be used to generate reasons for recommending the legal clause based on the facts of the case and the recommended legal clause. That is, the legal clause is taken as the major premise, the facts of the case as the minor premise, and a conclusion is drawn through logical reasoning, which serves as the reason for recommending the legal clause.
[0114] In some embodiments of this disclosure, the method further includes: The legal clause recommendation report includes the reasons for recommending the legal clauses, the sources of evidence, and the key segments in the cases that trigger the legal clauses.
[0115] In this embodiment, after generating the legal knowledge recommendation report, the reasons for recommending the legal provisions, the sources of the evidence chain (e.g., judgment document number, date of legal revision), and key fragments in the case that trigger the legal provisions (e.g., key facts, actions, or points of contention in the case) can be highlighted in the legal knowledge recommendation report, such as through highlighting, underlining, or other prominent methods.
[0116] In one example, annotations can be added as needed to indicate the specific connection between the clause and the legal provisions. For example, in the legal provisions recommendation report, annotations can be added to key segments that trigger the legal provisions: "Failure to provide specific evidence of violation" triggers Article X2 of the YYYY Law, which requires AAA to provide evidence of serious violation by BBB to terminate the contract; "Failure to give prior notice to CCC" triggers Article X1 of the YYYY Law, which requires prior notice to CCC to terminate the contract.
[0117] In this way, by highlighting the reasons for recommending legal provisions, the sources of evidence, and the key segments in cases that trigger the legal provisions, the key points of the legal provision recommendation report are made more prominent, making it easier for legal professionals to verify the basis and rationality of the recommendation results, thereby improving the credibility and authority of the legal provision recommendations.
[0118] Figure 5 A flowchart illustrating step S210 of a recommended method according to one embodiment of the present disclosure is shown. Figure 5 As shown, step S210 includes at least steps S211 to S214, which are described in detail below.
[0119] In step S211, the legal text is parsed based on the vertical domain's legal big language model to determine legal clause nodes, case element nodes, and legal entity nodes.
[0120] Among them, legal clause nodes can be clauses extracted from legal texts that have clear legal norms and clause numbers, such as Article X6 of the YYYY Law.
[0121] Case element nodes can be key factual information extracted from legal texts (such as typical cases), which can reflect the main plot and points of contention of the case. For example, "serious violation of rules and regulations" or "termination of YYYY".
[0122] Legal entity nodes can be legally related elements such as subjects, behaviors, and responsibilities extracted from legal texts, covering various objects and behaviors in legal relationships.
[0123] In this embodiment, the parsing function of the legal language model can be used to identify legal clause nodes, case element nodes, and legal entity nodes in the legal text. Specifically, the model can extract clauses with clear clause numbers and legal normative content as legal clause nodes based on the structure and format characteristics of the legal text. Based on key factual information in the case description, elements related to the case are identified as case element nodes. Then, combined with expressions of subjects, actions, and responsibilities in the legal text, legal entity nodes are extracted.
[0124] In step S212, based on the reference, revision and conflict logic between legal clauses, relationship edges between nodes are constructed, including logical relationship edges, conflict relationship edges and dynamic revision relationship edges.
[0125] Among them, logical relationship edges can refer to the relationship edges formed between legal provisions based on logical connections such as citation and revision. For example, Article Y1 of the YYYY Law cites Article Y2. This citation relationship is a logical relationship edge, reflecting the logical connection and dependence of legal provisions.
[0126] The conflict relationship edge can refer to the conflict relationship between different legal provisions due to inconsistencies or contradictions. For example, the local regulations on the period for retroactive payment of pension insurance conflict with the policy jointly issued by the Ministry of Human Resources and Social Security and the Supreme People's Court. This conflict relationship is reflected through the conflict relationship edge, which helps to identify potential contradictions in the application of law.
[0127] Dynamic revision relationships refer to the relationship between old and new versions of legal provisions resulting from revisions, including additions, deletions, and modifications. Dynamic revision relationships reflect the evolution and timeliness of legal provisions. The replacement of the old version by the new revision constitutes a dynamic revision relationship.
[0128] In this embodiment, after determining the aforementioned nodes, the logical relationship between the cited and quoted clauses can be determined based on the citation relationships between legal clauses by analyzing the citation expressions between clauses in the legal text, such as "in accordance with Article Y2 of the YYYY Law". Then, by comparing and analyzing the content of different legal clauses, conflicts arising from inconsistencies or contradictions between legal clauses can be identified.
[0129] In one example, this can be achieved through semantic understanding and conflict detection algorithms of the clause text using a legal big language model. For instance, the model can be used to determine whether two clauses contradict each other under the same legal concept or context. Once a conflict is found, the pair of legal clauses that cause the conflict is identified, and conflict relationship edges are constructed in a dynamic legal knowledge graph.
[0130] When constructing dynamic revision relationship edges, we can pay attention to the revision status of laws and regulations, obtain information such as the addition, deletion, and modification of legal clauses in a timely manner, and determine the correspondence and differences between the old and new clauses by analyzing the revised content through the legal big language model.
[0131] In one example, based on the revision, dynamic revision relationship edges are constructed in the dynamic legal knowledge graph. For newly added clauses, the "NEW_VERSION_OF" edge points to their possible source clauses or related old clauses; for deleted clauses, the "DELETED_VERSION_OF" edge indicates their relationship with subsequent replacement clauses; for modified clauses, the "MODIFIED_FROM" and "MODIFIED_TO" edges connect the clause versions before and after the modification, respectively, recording detailed information such as the content and location of the modifications, thus fully presenting the dynamic revision process of legal clauses.
[0132] In this way, by constructing logical relationship edges, conflict relationship edges, and dynamic revision relationship edges, we can more comprehensively and accurately reflect the complex relationships between legal clauses, enrich the content and structure of the legal knowledge graph, and make the knowledge graph not only contain isolated legal clause nodes, but also the rich semantic relationships between them, thereby improving the accuracy and completeness of the legal knowledge graph and providing a more solid foundation for legal analysis and reasoning.
[0133] In one implementation, the constructed relationship edges can be evaluated and optimized, checking for erroneous, duplicate, or outdated edges. Based on updates to legal knowledge and feedback from practical applications, the definitions and attributes of the relationship edges can be adjusted and corrected in a timely manner. Furthermore, when new revisions to laws and regulations occur or new typical cases emerge, the relationship edges in the knowledge graph can be updated promptly, ensuring that the knowledge graph accurately reflects the latest legal developments and practical situations, providing reliable support for legal analysis and decision-making.
[0134] Please continue to refer to this. Figure 5 In step S213, timeliness labels are marked for each legal clause node according to the effective or repeal time of the legal clause.
[0135] Among them, the timeliness label can be time-related information marked on the nodes of legal clauses, used to indicate the effective date, repeal date, and validity of legal clauses within a specific time range.
[0136] In this embodiment, time information such as the effective date and repeal date of legal clauses can be extracted from legal text. The effective date is usually explicitly stated in the publication information or content of the legal clause, while the repeal date may appear in subsequent amendments to laws and regulations or repeal decisions. Then, based on the extracted effective and repeal dates, a timeliness tag is added to each legal clause node.
[0137] In one implementation, timeliness tags can be stored as key-value pairs in the node's attributes, such as "Effective Date" corresponding to the effective date and "Repeal Date" corresponding to the repeal date. If a legal provision has not yet been repealed, the repeal date can be marked as "null" or other specific identifier.
[0138] In step S214, each legal clause node is labeled with a regional tag according to the applicable region of the legal clause.
[0139] Among them, the regional label can be the regional application information marked on the legal clause node, which is used to indicate which regions the legal clause applies to or in which regions it has legal effect.
[0140] In this embodiment, the applicable region information of legal clauses is extracted from the legal text. This information can typically be found in the publication information, scope of application clauses, or related interpretations of the legal clauses. Based on the extracted regional information, the specific applicable region of the legal clauses is determined. For national regulations, the applicable region is the entire country; for local regulations, the applicable region is a specific province, municipality, autonomous region, etc. Based on the determined applicable region, a regional label is added to each legal clause node.
[0141] In one embodiment, the geographic tag can be stored in the node's attributes as key-value pairs, such as "applicable region" corresponding to a specific region name.
[0142] Thus, based on Figure 5 The implementation method shown enables automated and intelligent parsing and analysis of legal texts, constructing an accurate and dynamically updated legal knowledge graph. This graph not only covers key elements such as legal clauses, case elements, and legal entities, but also comprehensively marks timeliness and regional information. This significantly improves the efficiency of legal knowledge management, reduces errors and inconsistencies that may arise from manual operations, and saves substantial human and time costs.
[0143] In some embodiments of this disclosure, extended tags can also be added to each node in the dynamic graph of legal knowledge. These extended tags can be used to indicate the scope of application, jurisdiction, and handling methods of legal provisions, as well as the refinement of higher-level laws.
[0144] Figure 6 A schematic diagram illustrating the process of training a large language model is shown, which is also included in the recommended method of legal provisions according to one embodiment of this disclosure. For example... Figure 6 As shown, training a large language model includes at least steps S250 to S260, which are detailed below.
[0145] In step S250, a hybrid training corpus is constructed based on the collected legal provisions, judgments, and legal interpretations.
[0146] In this embodiment, firstly, regarding the acquisition of legal provisions, various legal documents can be collected from authoritative channels such as official websites and government gazettes to ensure the accuracy and authority of the acquired legal provisions. Secondly, regarding the acquisition of judgments, judgments can be downloaded in batches from public platforms to obtain a wealth of judicial practice cases. As for the acquisition of legal interpretations, legal interpretation books published by authoritative publishers and interpretive articles by legal experts can be compiled. This resource can provide in-depth analysis and interpretation of legal provisions, helping the legal language model to understand the legislative intent and application points of legal provisions.
[0147] Based on the collected legal texts, they can be preprocessed, including but not limited to text cleaning, format standardization, and data annotation (optional). The preprocessed text data is then integrated to form a unified hybrid training corpus (i.e., the aforementioned legal knowledge base). In one example, the hybrid training corpus can be categorized and stored according to a specific directory structure or metadata information to facilitate subsequent access and management.
[0148] In some implementations, because the legal system is constantly evolving, new laws and regulations are introduced, court judgments are continuously increasing, and legal interpretations are constantly being updated. Therefore, it is necessary to regularly update and maintain the hybrid training corpus, incorporating the latest legal text data in a timely manner to ensure that the hybrid training corpus reflects the latest legal developments and practical situations.
[0149] In step S260, the general large language model is trained based on the hybrid training corpus to obtain a legal large language model for the vertical domain.
[0150] Among them, general-purpose large language models can refer to basic language models with extensive language understanding and generation capabilities, such as GPT-4 and DeepSeek-R1.
[0151] In this embodiment, a high-performance, well-designed general-purpose language model with suitable parameters can be selected as the starting model for training, such as a model with strong semantic understanding and text generation capabilities. Then, based on the constructed hybrid training corpus, the selected general-purpose language model is trained to obtain a legal language model for the vertical domain.
[0152] In one implementation, a hybrid training corpus can be input into the model. Through multiple rounds of iterative training, the model can be optimized using a large amount of legal text data, adjusting model parameters to allow the model to gradually learn the features and patterns of legal texts, thereby improving its ability to understand and generate legal texts. During the training process, distributed training and mixed precision training techniques are employed to improve training efficiency and model performance.
[0153] Thus, by pre-training and fine-tuning the general-purpose language model in the legal field, it can gain a deep understanding and mastery of the professional terminology, legal concepts, logical structures, and semantic relationships in legal texts, thereby achieving the transformation from a general-purpose language model to a vertical-domain legal language model. This specialized model can process legal texts more accurately, providing high-quality language understanding and generation services for law-related tasks.
[0154] based on Figure 6In the embodiments shown, in some implementations of this disclosure, a legal entity dictionary is injected when training a general large language model based on the hybrid training corpus, and the distinguishability of legal terms is enhanced based on contrastive learning.
[0155] Among them, the legal entity dictionary refers to a structured dictionary containing professional terms in the legal field and their standardized definitions, attributes, and relationships. It covers various legal entity concepts, such as legal subjects (e.g., natural persons, legal persons, state organs), legal acts (e.g., contract formation, torts), legal objects (e.g., things, intellectual property, behaviors), legal rights and obligations (e.g., ownership, creditor's rights, intellectual property rights), and legal events (e.g., natural disasters, social events), providing accurate legal terminology standards and semantic information for the legal language model.
[0156] In this embodiment, during the training of the general-purpose large language model, a legal entity dictionary can be embedded into the model's vocabulary. Specifically, the legal entity terms and their related attribute information in the dictionary can be converted into vector form compatible with the model's input format and added to the model's embedding layer. This allows the model to directly utilize the entity information provided in the dictionary when processing legal text, enhancing the initial semantic understanding of legal terms.
[0157] For each legal entity term, typical contextual phrases in different legal scenarios can be added to the model's vocabulary. For example, for the legal entity term "ownership," contextual phrases such as "property ownership," "transfer of ownership," and "ownership attribution" are added. This helps the model learn the usage and meaning of legal entity terms in different contexts during training, improving its adaptability to legal texts and its semantic understanding ability.
[0158] Furthermore, the model's discriminative power regarding legal terms can be enhanced based on contrastive learning. In one example, legal text fragments can be extracted from a hybrid training corpus and combined with terminology information from a legal entity dictionary to construct positive and negative sample pairs for contrastive learning. During the model's forward propagation, both the original training task (such as a masked language model task) and the contrastive learning task are performed simultaneously. For each input sample pair, the model calculates its loss in the training task and its loss in the contrastive learning task, respectively, and then weighted sums the two losses to obtain the final loss value.
[0159] Then, using the backpropagation algorithm and optimization methods such as gradient descent, the model parameters are updated based on the final loss value, thereby simultaneously optimizing the model's capabilities in language understanding and legal terminology differentiation. During training, the weight parameters of the contrastive learning task are continuously adjusted to balance its training progress with that of the pre-training task, ensuring that the model can fully learn the terminology differentiation features brought about by contrastive learning.
[0160] Thus, by injecting a legal entity dictionary, the model acquires accurate legal terminology standards and semantic information in the early stages of training, enabling it to more accurately identify legal entity terms when processing legal texts. Combining contrastive learning with enhanced legal terminology discrimination allows the model to effectively distinguish similar legal terms, improving the accuracy of its understanding of legal terms and laying a solid foundation for subsequent legal text analysis and processing tasks.
[0161] Based on the technical solutions of the above embodiments, the following describes a specific application scenario of an embodiment of this application: like Figure 7 As shown, according to some embodiments of this disclosure, a legal clause recommendation system 700 is provided that integrates legal element analysis, dynamic knowledge graph, and judicial logical reasoning, thereby solving the problems of accuracy, timeliness, and interpretability of legal analysis. First, the system needs to perform legal domain-adapted pre-training on general LLMs (such as DeepSeek-R1, Tongyi Qianwen Qwen-2.5B, etc.) to generate a vertical domain LLM (i.e., the aforementioned legal big language model, hereinafter referred to as "Chinese legal LLM").
[0162] In one example, the pre-training step includes the following.
[0163] 1. Construction of training corpus: Integrate legal provisions, judgments, and legal interpretations to construct a hybrid training corpus.
[0164] 2. Enhanced Terminology Training: A legal entity dictionary is injected into the LLM pre-training stage to enhance terminology differentiation through comparative learning.
[0165] The legal clause recommendation system 700 includes a legal element analysis and structuring module 710, a dynamic spatiotemporal knowledge graph module 720, a judicial logic reasoning engine module 730, and a clause dynamic recommendation and report generation module 740, which are detailed below.
[0166] (1) Legal Element Analysis and Structured Module 710 Using Chinese legal LLM, we can identify legal elements in the case description, such as probation period, AAA, contract termination, etc., as well as the logical relationships between legal elements, to form a structured description of the case description.
[0167] For example, the case description is as follows: AAA terminated its contract with BBB on the grounds of "breach of contract with B", but failed to provide evidence of BBB's breach of contract and did not notify CCC in advance. BBB filed for arbitration and claimed damages.
[0168] After element parsing and structuring, the generated structured description is as follows: { Reason for termination: "Violation of B", "Evidence Status": "No specific evidence provided" "Procedural Compliance": "Failure to notify CCC in advance" Jurisdiction: "XX City", Time: 2024 } (2) Dynamic Spatiotemporal Knowledge Graph Module 720 The system compiles laws and regulations, industry management rules, and typical cases to form a legal knowledge base. It uses Chinese legal LLM to parse the legal text of the knowledge base, generates graph nodes and relationships, and constructs a dynamic legal knowledge graph by adding node labels and dynamic relationship edges.
[0169] Node spatiotemporal tags include time-sensitive tags (legal revision time, expiration time) and geographical tags.
[0170] The dynamic relationship edge uses Chinese legal LLM to extract citation relationships from laws and regulations, such as Article 87 of the YYYY Law citing Article 47, and dynamically adds "high-frequency citation" edges; it detects legal revision documents and marks "clause conflict" edges, such as differences between the old and new social security regulations.
[0171] When constructing a dynamic graph of legal knowledge, nodes and dynamic edges are required to include time and location tags, as shown in the following example: { "Node Type": "Legal Provisions" "Name": "Article 42 of the YYYY Law", Effective Date: 2008-01-01 "Revision Date": ["2021-01-01"], Applicable Region: ["Nationwide"], "Exceptional Region": ["YY Zone"] } Example of a dynamic relationship edge (legal entity a → conflict relationship → legal entity b): (a:Law {name: "XX City Regulation A"}) -[r:CONFLICT_WITH {conflict_type: "conflict",effective_region: "XX city"}] ->(b:Law {name: "(YY Department Letter
[2025] No. 28)"}) It should be noted that dynamic spatiotemporal knowledge graphs can be constructed using NLP techniques, which will not be elaborated upon here.
[0172] (3) Judicial Logic Reasoning Engine Module 730 The Chain-of-Thought (CoT) framework guides the step-by-step verification of Chinese legal LLMs. A hybrid strategy algorithm is employed to query the dynamic legal knowledge graph, adjusting clause priorities based on timeliness, regionality, and judicial practice, and returning matching search results. This combination of CoT hints and a rule engine ensures that the recommended results are logically consistent.
[0173] The reasoning steps are as follows: Step 1: The Chinese legal LLM generates a preliminary reasoning chain that conforms to judicial logic: "hypothesis → verification → conclusion" (i.e., the aforementioned hypothesis reasoning chain). Input: Case description (e.g., "AAA terminated the contract without notifying CCC").
[0174] deal with: Chinese legal LLM identifies core elements (such as “termination of contract” and “notification of CCC”) and their logical relationships (such as “procedural violation”) through a legal element attention mechanism.
[0175] By combining the dynamic legal knowledge graph with the pre-retrieval of relevant clauses, a multi-branch hypothetical reasoning chain is generated (e.g., "Assuming the termination procedure is illegal → Article X1 of the YYYY Law needs to be verified").
[0176] Output: Preliminary inference chain results (JSON format).
[0177] Step 2: Achieve legal entity alignment and cross-modal validation; Input: Assume a legal entity in the chain of reasoning (e.g., "Article X1 of the YYYY Law").
[0178] Processing: Guide the LLM to perform entity-clause semantic alignment through prompt word engineering, for example, verify whether "notified CCC" is directly related to clause X1 "notify CCC".
[0179] The dynamic legal knowledge graph is used to verify the timeliness (e.g., whether it has been revised) and territoriality (e.g., whether it applies to the current jurisdiction).
[0180] Output: Corrected inference chain (excluding invalid / regionally inapplicable clauses).
[0181] Step 3: Logically link the conclusions and convert them into a legal syllogism: "major premise → minor premise → conclusion"; Input: The revised inference chain (e.g., "Assumption → Remove the procedural violation, Verification → Article X1 stipulates that the CCC must be notified, Conclusion → The procedural violation is established").
[0182] Processing: Mapping the chain of reasoning to a legal syllogistic framework: Major premise: legal provisions (such as Article X1 of the YYYY Law).
[0183] Minor premise: Facts of the case (e.g., "AAA failed to notify CCC").
[0184] Conclusion: Legal evaluation (e.g., "procedural violation"). The logic verification module is invoked to check the consistency of the reasoning chain (e.g., whether any elements are missing or conflicting). In principle, the logic verification module can work in conjunction with Chinese legal LLMs using prompts, such as "Please determine whether clause Y applies to case XXX".
[0185] Output: Structured syllogistic conclusion.
[0186] Step 4: Call the dynamic weighting factor algorithm to obtain a weighted list of legal conclusions. Input: Syllogistic conclusion (e.g., "Program violation, rule X1 applies").
[0187] deal with: A weighting adjustment factor is introduced to calculate the weight value of the legal clauses, thereby determining the priority of the clauses.
[0188] (4) Module for Dynamic Recommendation and Report Generation of Terms 740 By combining a weighted list of legal conclusions, an analysis / recommendation report in everyday natural language is generated, citing specific clauses and cases, outputting the reasons for recommending the clauses, marking the sources of the evidence chain (such as the judgment document number and the date of the regulation revision), and highlighting the key fragments in the case description that trigger the clauses.
[0189] This disclosure also provides an electronic device. Figure 8 A schematic diagram of the hardware implementation using the processing system is shown.
[0190] like Figure 8As shown, the hardware structure of electronic device 1000 can be implemented using a bus architecture. The bus architecture can include any number of interconnect buses and bridges, depending on the specific application and overall design constraints of the hardware. Bus 1100 connects various circuits including one or more processors 1200, memory 1300, and / or hardware modules. Bus 1100 can also connect various other circuits 1400 such as peripherals, voltage regulators, power management circuits, external antennas, etc. Bus 1100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, only one connection line is used in this figure, but this does not indicate that there is only one bus or one type of bus.
[0191] This disclosure also provides a readable storage medium storing a computer program that, when executed by a processor, is used to implement the methods described above. A "readable storage medium" can be any means that can contain a program for storage, communication, propagation, or transmission for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples of a readable storage medium include: an electrical connection with one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable read-only memory (CDROM), etc.
[0192] This disclosure also provides a computer program product, the methods of which can be implemented wholly or partially through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented wholly or partially as a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed, all or part of the processes or functions of this disclosure are performed.
[0193] Computer programs or instructions can be stored in a readable storage medium or transferred from one readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The readable storage medium can be any available medium capable of access, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; an optical medium, such as a digital video optical disc; or a semiconductor medium, such as a solid-state drive. The computer-readable storage medium can be a volatile or non-volatile storage medium, or it can include both volatile and non-volatile types of storage media.
[0194] Those skilled in the art will understand that embodiments of this disclosure can be provided as methods, systems, or computer program products. Therefore, this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this disclosure can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0195] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, systems, electronic devices, and computer program products according to this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0196] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0197] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0198] In the description of this specification, the references to terms such as "one embodiment / mode," "some embodiments / modes," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, or characteristic described in connection with that embodiment / mode or example is included in at least one embodiment / mode or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment / mode or example. Moreover, the specific features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments / modes or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments / modes or examples described in this specification, as well as the features of different embodiments / modes or examples.
[0199] Those skilled in the art should understand that the above embodiments are merely for illustrating the present disclosure and are not intended to limit the scope of the disclosure. Those skilled in the art can make other changes or modifications based on the above disclosure, and these changes or modifications still fall within the scope of the present disclosure.
Claims
1. A method for recommending legal provisions, characterized in that, include: Based on a vertical domain legal language model, the collected legal texts are analyzed to generate a dynamic legal knowledge graph. The dynamic legal knowledge graph includes logical relationships, conflict relationships, and dynamic revision relationships between legal clauses. The nodes in the dynamic legal knowledge graph are labeled with time-limited tags and regional tags. Based on the legal language model and the legal knowledge dynamic graph, judicial logical reasoning is performed on the received case description to determine the target legal clause that matches the case description. Specifically, this includes: parsing the received case description using the legal language model to determine the legal elements and logical relationships between them; querying the legal elements and their logical relationships in the legal knowledge dynamic graph to generate a corresponding hypothetical reasoning chain, which contains factual assumptions and their corresponding unverified legal clauses; verifying the legality of the legal clauses in the hypothetical reasoning chain, including semantic alignment between legal entities and legal clauses, and spatiotemporal validity verification of the legal clauses; revising the legal clauses in the hypothetical reasoning chain based on the verification results; and converting the revised hypothetical reasoning chain into a syllogistic structure containing the target legal clause, case facts, and legal evaluation. Based on weight adjustment factors, the weight values corresponding to the target legal clauses are determined, specifically including: determining the weight values corresponding to the target legal clauses based on timeliness decay factors, regional adaptability factors, and hot topic enhancement factors; sorting the target legal clauses according to the determined weight values to generate a legal clause recommendation list, the legal clause recommendation list including the target legal clauses and their corresponding weight values, timeliness tags, and regional tags, wherein the weight adjustment factors are used to describe the degree of relevance between the target legal clauses and the case description; and A legal clause recommendation report is generated based on the weight values corresponding to the target legal clauses.
2. The method as described in claim 1, characterized in that, Verify the spatiotemporal validity of legal provisions in the hypothetical reasoning chain, including: Based on the timeliness and location tags of nodes in the aforementioned dynamic graph of legal knowledge, the spatiotemporal validity of legal clauses contained in the hypothetical reasoning chain is verified.
3. The method as described in claim 1, characterized in that, Based on the weighted target legal provisions, a corresponding legal provision recommendation report is generated, including: Based on the legal clause recommendation list, a legal clause recommendation report is generated, which includes the corresponding legal clauses, cases, and reasons for recommending the legal clauses.
4. The method as described in claim 3, characterized in that, After generating the corresponding legal clause recommendation report, the method further includes: The legal clause recommendation report includes the reasons for recommending the legal clauses, the sources of evidence, and the key segments in the cases that trigger the legal clauses.
5. The method as described in claim 1, characterized in that, Based on a vertical domain-specific legal language model, the collected legal texts are analyzed to generate a dynamic legal knowledge graph, including: Based on a vertical domain legal language model, legal texts are analyzed to identify legal clause nodes, case element nodes, and legal entity nodes; Based on the citation, revision, and conflict logic among legal clauses, relationship edges between nodes are constructed, including logical relationship edges, conflict relationship edges, and dynamically revised relationship edges; Based on the effective and repeal dates of legal provisions, time-sensitive labels are marked for each node; According to the applicable region of the legal provisions, each legal provision node is labeled with a regional label.
6. The method as described in claim 1, characterized in that, The method further includes: A hybrid training corpus was constructed based on the collected legal provisions, judgments, and legal interpretations. The general large language model is trained using the hybrid training corpus to obtain a legal large language model for the vertical domain.
7. An electronic device, characterized in that, include: The memory stores execution instructions; as well as A processor that executes the execution instructions stored in the memory, causing the processor to perform the recommended method of the legal provisions of any one of claims 1 to 6.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the recommended method of the legal provisions of any one of claims 1 to 6.
Citation Information
Patent Citations
Government affair service field multi-strategy fusion dialogue method based on knowledge graph
CN116628172A
Intelligent legal text analysis method based on legal concept pedigree
CN119990290A
