A legal document risk identification method and system and a storage medium
By employing content feature matching and knowledge enhancement methods, this approach addresses the issues of rigid rule organization and cross-domain integration in legal document analysis, enabling efficient and accurate identification of legal document risks and meeting the interpretability and auditability requirements of legal scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 陈道远
- Filing Date
- 2026-06-20
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies for legal document analysis suffer from problems such as rigid rule organization, lack of cross-domain integration, duplicate submissions, and legal "illusions," resulting in inefficiency and insufficient accuracy.
By matching content features to identify review rule groups in the legal field, cross-domain rule integration is carried out, and accurate legal texts are injected before submission, enabling the submission of all rules together and knowledge enhancement.
It enables the dynamic determination and integration of rules across multiple domains, reduces the number of submissions and costs, improves the accuracy and efficiency of analysis, and meets the interpretability and auditability requirements of legal scenarios.
Smart Images

Figure CN122492402A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of natural language processing and legal information technology, specifically relating to a method, system, and storage medium for automated risk identification of legal documents using language models. Background Technology
[0002] With economic and social development, the demand for reviewing various legal documents is increasing. Taking commercial contracts as an example, a single contract may involve multiple legal fields, including contract law, labor law, intellectual property law, personal information protection law, and data security law. Traditionally, contract review relies on legal professionals to read and judge each clause. Reviewing a moderately complex service contract typically takes 2 to 4 hours and is prone to overlooking cross-disciplinary risks due to the reviewer's limited knowledge. In recent years, language models have been increasingly used in the legal field. However, existing language model-based methods for legal document analysis have the following shortcomings: First, the rule organization method is rigid. Existing systems typically use a fixed set of full rules or a single review template for review. For example, some solutions divide contract terms into "risky" and "no-risk" categories by training a binary classification model (see Chinese Patent CN119048295A). This solution only performs binary classification and cannot organize differentiated review rules according to different legal fields. Some solutions generate review rules in real time through language models (such as Alibaba Cloud FaRui API). The quality of the review rules in this solution depends on the result generated by the language model in that particular instance, and does not have the determinism and auditability of pre-set rules. Second, there is a lack of mechanisms for integrating cross-domain rules. When a legal document involves multiple legal domains, the review rules of different domains may overlap or duplicate. Existing solutions do not provide integration and deduplication of cross-domain rules, leading to wasted computational resources due to duplicate reviews or overlooking risks of cross-domain overlap. Third, rules and documents should be submitted separately. Most existing solutions submit the contract text in segments or line by line to the language model for review (such as the "question-by-line" mode), or submit it after retrieving relevant data. Each submission loses the global context information of the contract, and multiple API calls cause delays and costs to increase linearly with the number of rules. Fourth, there is a lack of pre-analysis knowledge enhancement. When answering legal questions, language models may generate inaccurate legal citations (i.e., "illusions") based on statistical patterns in the training data. Existing solutions often fail to include the accurate original text of relevant legal provisions as the basis for analysis when submitting analysis tasks, resulting in a lack of reliability in the analysis results. Therefore, there is a need for a legal document risk identification method that can dynamically determine the relevant review rule groups based on the content of legal documents, integrate cross-group rules, submit the integrated rules along with the full text of the document to the language model, and inject accurate legal original text before submission. Summary of the Invention
[0003] I. Technical problems to be solved This invention aims to solve the following technical problems existing in the prior art: First, how to automatically determine the review rule group for the relevant legal field based on the content of the input legal document through content feature matching, so as to avoid noise and quality uncertainty caused by full rules or dynamically generated rules. Second, how to integrate review rules from multiple legal fields to avoid duplicate reviews and omissions of cross-field risks. Third, how to submit the integrated set of review rules along with the full text of the legal documents to the language model, complete the full rule analysis in a single submission, reduce delays and costs, and preserve the global context of the contract. Fourth, how to automatically inject the accurate original text of relevant legal provisions as the basis for analysis before submitting the analysis, so as to reduce the risk of legal "illusion" generated by the language model. II. Technical Solution To address the aforementioned technical problems, this invention provides a method for identifying risks in legal documents, comprising the following steps: Step S1: Content feature matching and rule group determination. The input legal documents are matched for content features, and one or more review rule groups associated with the content of the legal documents are determined from a preset set of rules. The rule set contains multiple rule groups divided by legal field. Each rule group corresponds to a legal field, including but not limited to: general contract rule group, service contract rule group, sales contract rule group, lease contract rule group, labor contract rule group, intellectual property rule group, data compliance rule group, etc. Each rule group includes the following attributes: (1) matching conditions: conditional information used to determine whether the rule group is related to the content of legal documents, such as a set of feature keywords, or a semantic vector template, or the parameters of a text classification model; (2) priority attribute: used to sort when multiple rule groups are determined; (3) review rule set: including hard constraint rules and agreed rules, each rule contains fields such as rule identifier, review clause name, legal basis, mandatory requirements or default rules, risk score, and inspection points. The specific process of content feature matching is as follows: For each rule group in the rule set, based on the matching conditions of the rule group, it is determined whether the content of the legal document meets the matching conditions; when it does, it is determined that the rule group is associated with the content of the legal document. The matching conditions may include, but are not limited to: keyword hit count reaching a preset threshold, semantic vector similarity exceeding a preset threshold, or text classification model output probability exceeding a preset threshold. In one implementation, the content feature matching is keyword matching. For each rule group other than the always associated general rule group, the number of times the keywords in its matching conditions appear in the first N characters of the legal document is counted; when the number of occurrences is greater than or equal to a preset threshold (e.g., 2), the rule group is determined to be associated with the content of the legal document. All determined rule groups are arranged in descending order of their respective priorities. In another implementation, the content feature matching is semantic similarity matching. The content of the legal document is converted into a semantic vector, and the similarity between this semantic vector and the semantic vectors corresponding to the matching conditions of each rule group is calculated; when the similarity exceeds a preset threshold, the rule group is determined to be associated. In another implementation, the content feature matching is text classification. A pre-trained text classification model is used to classify the legal documents, outputting the probability that each rule group belongs to a corresponding legal domain; when the probability exceeds a preset threshold, the rule group is determined to be associated. Step S2: Rule integration. The review rules in each review rule group determined in step S1 are integrated to form a review rule set. Specifically, the determined rule groups are traversed in descending order of priority. For each review rule in each rule group, it is checked whether the rule's identifier already exists in the review rule set: if it does not exist, the rule is added; if it already exists, the rule is skipped. Thus, rules in rule groups with higher priority are retained first, and duplicate rules across rule groups are removed. Step S3: Knowledge Enhancement (optional). Before submitting the review rule set to the language model, the legal provisions referenced are extracted from the review rule set (e.g., "Personal Information Protection Law_Article 4"). The corresponding legal text information (the original legal text and / or the key points of guiding cases) is retrieved from a pre-defined legal knowledge base. The retrieved legal text information is then appended to the description of the corresponding rule in the review rule set, serving as the basis for the language model's analysis. Step S4: Submit the analysis together. The set of review rules (including knowledge enhancement content) and the full text of the legal document are submitted to the language model. The analysis task instructs the language model to: check the correspondence of each review rule in the legal document item by item to determine whether the corresponding clause is found; determine the compliance status based on the attached original legal text; identify the risk category and risk level; and return the analysis results of each rule in a structured data format. Since all review rules and the full text of legal documents are sent to the language model in a single submission, the number of submissions is reduced from O(N) in the traditional line-by-line mode to O(1). Step S5: Review report generation. The structured analysis results returned by the language model are received and processed as follows: (1) Risk classification: the identified matters are classified according to their severity (e.g., three levels: blocking, important, and marked); (2) Tendency determination: the distribution of interest tendencies in the clauses of the legal documents is statistically analyzed to determine the overall tendency; (3) Processing suggestions: a list of processing suggestions is generated according to priority. This invention also provides a legal document risk identification system, comprising: a rule storage module, a content matching module, a rule integration module, an analysis and submission module, and a report generation module. Optionally, it may also include a knowledge enhancement module. The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method. III. Differences from existing technologies The technical solution of this invention differs from the prior art in the following essential ways: (1) Difference from CN119048295A (Yonyou Network "Intelligent Contract Review"): This solution trains a risk clause identification model to classify contract clauses into two categories (risky / no risk), and then analyzes the prompt generated by the large model. This solution does not have the ability to preset rule groups according to legal fields, nor does it involve cross-rule group integration and deduplication. This invention realizes the dynamic determination and integration of multi-field differentiated review rules through preset rule groups divided by legal fields and content feature matching mechanism. (2) Difference from Alibaba Cloud Legal API (Dynamic Rule Generation): This solution generates review rules in real time through a language model. The quality and coverage of the rules depend on the current generation result and are not deterministic. This invention uses a pre-defined set of review rules. The content of the rules is predefined by legal professionals and is deterministic, auditable, and iterable. (3) Difference from CN202511958087 (Yonyou Network "Intelligent Contract Review"): The solution divides the review items into simple review items (processed by the language model) and complex review items (processed by the rule engine), and processes the two types of review items separately. This invention does not perform simple / complex division, but submits the integrated full set of review rules and the full text of the document to the language model together, taking into account both simple and complex reviews and preserving the global context of the contract. (4) Difference from CN202510377678 (Kingdee Software "Contract Review Method"): This scheme extracts review data through segmentation, feature tag allocation, and multi-dimensional retrieval, and then inputs it into the contract review model. This scheme relies on a retrieval-extraction-submission pipeline, and the rules are externally retrieved rather than pre-integrated. This invention directly determines and integrates review rules from a pre-set rule group, without requiring an external retrieval step to extract review data. IV. Beneficial Effects Compared with the prior art, the present invention has the following beneficial technical effects: (1) **Supports multiple content feature matching methods.** By abstracting the matching conditions into "content feature matching", it supports simple keyword matching (low cost, interpretable), semantic similarity matching (high precision, resistant to expression variation), and text classification (trainable, adaptive), achieving full coverage from simple to intelligent. (2) **Eliminate cross-domain rule duplication and omission.** Through a rule integration mechanism that prioritizes and deduplicates identifiers, when legal documents involve multiple legal domains, the review rules of each domain are automatically merged to ensure that each rule is reviewed only once, and rules from higher-priority domains are retained first. (3) **Reduce the number of submissions and costs.** By submitting the integrated set of review rules along with the full text of the legal document, the number of submissions is reduced from O(N) in the traditional line-by-line mode to O(1). For a scenario containing 40 review rules, the number of submissions is reduced from 40 to 1, the cost is reduced by approximately 97.5%, and the language model can obtain the global context of the full contract text, resulting in higher analysis quality. (4) **Improve the accuracy of analysis.** Through the knowledge enhancement step, the accurate original text of relevant legal provisions and the key points of guiding case judgments are automatically injected into the analysis task before the analysis is submitted, so that the language model makes judgments based on accurate legal original texts rather than training memory, which significantly reduces the risk of legal "illusion". (5) **Definitiveness and auditability of pre-defined rules.** Compared with dynamically generated rule schemes, the content of pre-defined rule groups is predefined and verified by legal professionals, and the review results are certain and traceable, meeting the strict requirements of legal scenarios for interpretability and auditability. Attached image description: Figure 1 A flowchart of a legal document risk identification method provided in an embodiment of the present invention. Figure 2 This is a schematic diagram of the data structure of the rule set in an embodiment of the present invention. Figure 3 This is a detailed logical flowchart of the content feature matching and rule group determination steps in an embodiment of the present invention. Figure 4 This is a detailed logic flowchart of the rule integration step in an embodiment of the present invention. Figure 5 This is a schematic diagram comparing the effects of existing technology (without content feature matching) and the present invention (with content feature matching). Figure 6 This is a flowchart of the knowledge enhancement steps in an embodiment of the present invention. Figure 7 This is a structural block diagram of a legal document risk identification system provided in an embodiment of the present invention. IV. Detailed Implementation The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. The described embodiments are some, but not all, of the embodiments of the present invention. Example 1: Overall Method Flow See Figure 1 This embodiment provides a method for identifying risks in legal documents, including the following steps: Step S101: Content feature matching and rule group determination. It receives the full text of a legal document input by the user (e.g., a software development service contract) and performs feature matching on the content of the document. The rule set has 7 pre-defined rule groups divided by legal field: general contract rule group (always associated), service contract rule group, sales contract rule group, lease contract rule group, labor contract rule group, intellectual property rule group, and data compliance rule group. In this embodiment, keyword matching is used for content feature matching. Taking the data compliance rule group as an example, the keywords in its matching conditions include: "personal information", "privacy", "data security", "ID card", "sensitive information", "de-identification", "anonymization", "data protection", "user information", "network security", "mobile phone number", "biometric identification", "location trajectory", "financial account", "consumption record", "raw data", "data processing", "data mining", "cross-border data", "information transmission", "separate consent", etc. If the document content contains the keywords "personal information" and "data security" (occurring twice, reaching the preset threshold), then the data compliance rule group is determined to be associated with this document. Similarly, if the document content contains "development" and "delivery" (reaching the threshold), then the service contract rule group is determined to be associated. The final rule groups are: General Contracts (priority=0), Service Contracts (priority=10), and Data Compliance (priority=12), arranged in descending order of priority. In other embodiments, semantic similarity matching can also be used: the document content is converted into a semantic vector, and the cosine similarity between the semantic vector and the semantic vector of each rule group matching condition is calculated. When the similarity is >0.7, the association is determined. Alternatively, text classification can be used: a pre-trained BERT classification model is used to predict the probability that the document belongs to each legal domain, and when the probability is >0.5, the association is determined. Step S102, rule integration. The three rule groups are iterated through. First, the highest priority data compliance rule group (priority=12) is processed, adding all 10 hard constraint rules and 3 contractual rules to the review rule set. Next, the service contract rule group (priority=10) is processed, adding the non-overlapping portions of its 5 hard constraint rules and 6 contractual rules to the review rule set. Finally, the general contract rule group (priority=0) is processed, adding the non-overlapping portions of its 5 hard constraint rules and 3 contractual rules to the review rule set. Ultimately, the review rule set contains approximately 25 deduplicated review rules. Step S103, knowledge enhancement. Extract legal provision identifiers from the review rules set, such as "Article 4 of the Personal Information Protection Law," "Article 10 of the Personal Information Protection Law," and "Article 27 of the Data Security Law" from the hard constraint rules of the data compliance rules group. Retrieve the original text of the legal provisions and the key points of guiding cases corresponding to these legal provision identifiers from a pre-set legal knowledge base. The retrieved original legal text is appended to the description of the corresponding rule. For example, the description of the data compliance rule "Definition of Personal Information and Anonymization Requirements" includes: "[Original Legal Text] Article 4 of the Personal Information Protection Law: Personal information refers to various information recorded electronically or otherwise that relates to an identified or identifiable natural person, excluding information that has been anonymized." Step S104: Submit for analysis together. The analysis task is structured, including system instructions and user input. System instructions direct the language model, acting as a legal document risk analyst, to examine each review rule in the document, determine compliance status based on the attached legal text, and return the results as a JSON array. User input includes: the document type name, the full text of the legal document clauses, and a list of all review rules containing the legal text information. All approximately 25 rules and legal documents are sent in full to the language model for analysis in a single submission. The language model returns a JSON array containing 25 objects, each corresponding to a review rule, including the following fields: rule identifier (id), whether the corresponding clause was found (found), compliance status (status), risk category (riskCategory), analysis findings (finding), legal basis (legalBasis), modification suggestion (recommendation), clause bias (bias), and risk score (riskScore). Step S105: Review report generated. Parse the JSON array returned by the language model and classify each result into different levels: those with a compliance status of "serious violation" are marked as blocking level, those with a status of "high risk" are marked as important level, and those with a status of "require attention" are marked as flagged level. The distribution of clause bias across all results is analyzed. If the number of "biased towards Party A" clauses significantly exceeds the number of "biased towards Party B" clauses, the clauses are deemed "seriously biased towards Party A," and vice versa. A list of suggested actions is automatically generated based on the analysis results. Each suggestion includes priority, suggested action, reason, and deadline. Example 2: Rule Set Data Structure See Figure 2 This embodiment demonstrates the data structure of the rule set. A rule set is a data collection consisting of multiple rule group objects. Each rule group object contains the following fields: ``` { id: 'data-compliance', / / Unique identifier for the rule group name: 'Data Compliance', / / Rule group name priority: 12, / / Priority (the higher the value, the higher the priority) matchCondition: { / / Matching conditions (the basis for content feature matching) type: 'keyword', / / Matching method: keyword / semantic / classification Keywords: ['Personal Information', 'Privacy', 'Data Security', 'ID Card', ...] / / Or semanticTemplate: [...], / / Semantic vector template / / Or classifierParams: {...} / / Classification model parameters }, lawRefs: [ / / Related legal references { name: 'Personal Information Protection Law', path: '...'}, { name: 'Data Security Law', path: '...'} ], hardLaw: [ / / Set of hard constraint rules] { id: 'data_h1', / / Unique identifier for the rule Clause: 'Definition of Personal Information and Anonymization Requirements' Law: Article 4 of the Personal Information Protection Law Mandatory: 'Data transmitted to third parties that contains information that can identify natural persons must be anonymized.' riskScore: 3, Check: 'Has the data in the document been anonymized?' }, / / ... More hard constraint rules ], negotiable: [ / / Set of convention rules] { id: 'data_n1', Clause: 'Necessity of Data Processing Protocol (DPA)' Law: Article 21 of the Personal Information Protection Law defaultRule: 'A separate data processing agreement should be signed', riskFactors: [ { deviation: 'No independent DPA', impact: 'Unclear data processing obligations', risk: 3} ] }, / / ... More conventions and rules ] } ``` The priority of the general contract rules group (id='general') is set to 0 (the lowest), and the type in matchCondition is set to 'always', indicating that it is always associated. Example 3: Content Feature Matching Process See Figure 3 This embodiment describes in detail the specific implementation of content feature matching in step S101. Input: full text of legal documents (text), rule groups (ruleGroups). Process (taking keyword matching as an example): (1) Extract the first 8000 characters of text as searchText. (2) Initialize the list of determined rule groups, determinedGroups. (3) For each rule group in the rule set: a) If group.matchCondition.type is 'always' (general rule group), directly add the group to determinedGroups; b) Otherwise, retrieve group.matchCondition.keywords; c) Initialize the hit counter hits=0; d) Iterate through each keyword kw in keywords: If kw appears in searchText, then hits++; e) If hits >= the preset threshold (e.g., 2), add the group to determinedGroups. (4) Sort determinedGroups in descending order of priority. Output: List of determined rule groups (determinedGroups). For example, consider a software development service contract containing keywords such as "development," "service," "commission," "delivery," "intellectual property," "personal information," and "data security." After matching: the service contract rule group matches multiple keywords (reaching the threshold), thus determining association; the data compliance rule group matches "personal information" and "data security" (reaching the threshold), thus determining association; the general contract rule group remains associated. The sales contract rule group, lease contract rule group, and employment contract rule group do not reach the threshold and are not associated. The final determinedGroups = [Data Compliance (P12), Service Contract (P10), General Contract (P0)]. In other embodiments, if semantic similarity matching is used, the searchText is encoded as a semantic vector, and the cosine similarity with each rule group's .matchCondition.semanticTemplate is calculated; if the similarity exceeds a threshold (e.g., 0.7), an association is determined. If text classification is used, the searchText is input into a pre-trained classification model, which outputs the probability of belonging to the corresponding domain of each rule group; if the probability exceeds a threshold (e.g., 0.5), an association is determined. Example 4: Rule Integration See Figure 4 This embodiment describes in detail the specific implementation of rule integration in step S102. Input: A list of determined rule groups (in descending order of priority). process: (1) Initialization results: hardLaw=[] (list of hard constraint rules), negotiable=[] (list of convention rules), lawRefs=[] (list of legal references), seen={} (set of seen rule identifiers). (2) For each rule group in determinedGroups: a) Iterate through each rule in group.hardLaw: If rule.id is not in seen, then mark seen[rule.id] as true and add rule to hardLaw; b) Iterate through each rule in group.negotiable: If rule.id is not in seen, then mark seen[rule.id] as true and add rule to negotai; c) Add all legal references in group.lawRefs to lawRefs. Output: { hardLaw, negotiable, lawRefs} (the integrated set of review rules). Because the rules are traversed in descending order of priority, when two rule groups contain rules with the same identifier, the version from the higher-priority rule group is retained, and the version from the lower-priority rule group is discarded. This ensures that if a rule in a higher-priority domain has a stricter requirement, that requirement will not be overridden by a more lenient version in a lower-priority domain. Example 5: Effect Comparison See Figure 5 This embodiment compares the effects of existing technologies (which do not perform domain matching on document content) with the present invention (which determines the association rule group through content feature matching). The existing technical solution involves applying all 7 rule groups and approximately 50 review rules to a single rental contract. Of these, 10 rules related to data compliance, 11 to service contracts, 6 to labor contracts, and 6 to intellectual property are largely absent from the rental contract, resulting in approximately 33 invalid rules (noise). These invalid rules are submitted to the language model, wasting valuable input information and potentially generating false risk labels in the analysis results. This invention's solution: For the same housing rental contract, by matching content features and identifying keywords such as "rent," "lease," "lease," "tenancy," and "rent," only the general contract rule group and the rental contract rule group are identified as relevant, totaling approximately 8 review rules. All rules are relevant to the document content, with no noisy rules. The amount of information submitted is reduced by approximately 84%, and the analysis results are more accurate. In another scenario, a software development service contract involves three areas: service contracts, intellectual property, and data compliance. All three rule groups were identified as related, and approximately 30 review rules were integrated and submitted for analysis. Specifically, the clause regarding "ownership of intellectual property" triggered relevant rules from both the service contract rule group and the intellectual property rule group. These two rules were deduplicated during the integration phase to ensure they were not analyzed repeatedly. Meanwhile, the clause regarding "personal information processing" triggered multiple rules from the data compliance rule group, achieving comprehensive identification of cross-domain risks. In contrast, the existing solution CN119048295A only categorizes clauses as "risky / no risk," failing to differentiate the nature of risks in different areas; the Alibaba Cloud FaRui API solution relies on language models to dynamically generate rules, which cannot guarantee the certainty and completeness of the review rules. V. Industrial Applicability This invention has been implemented and put into practical use in the contract risk identification module of the "lawdiffusion.com" legal intelligence analysis platform. This platform provides online legal document risk identification services for corporate legal personnel, lawyers, and individual users. Practical operation has verified that this invention can correctly identify common contract types such as service contracts, sales contracts, lease contracts, and labor contracts, dynamically activate corresponding legal review rules, and complete full rule analysis in a single large language model call, significantly reducing API call costs and analysis latency, demonstrating good industrial applicability.
Claims
1. A method for identifying risks in legal documents, characterized in that, Includes the following steps: Step S1: Perform content feature matching on the input legal document and determine one or more review rule groups associated with the content of the legal document from a preset rule set; wherein, the rule set contains multiple rule groups divided by legal field, and each rule group includes matching conditions and review rules; Step S2: Integrate the review rules in each of the determined review rule groups to form a review rule set; Step S3: Submit the review rule set and the full text of the legal document to the language model, and the language model analyzes the legal document based on the review rule set. Step S4: Receive the analysis results returned by the language model and generate a review report based on the analysis results.
2. The method according to claim 1, characterized in that, In step S1, the content feature matching includes: performing at least one of keyword matching, semantic similarity matching, or text classification on the legal document based on the matching conditions.
3. The method according to claim 2, characterized in that, The keyword matching includes: counting the number of times the keywords in the matching conditions appear in the legal document, and when the number of occurrences reaches a preset threshold, determining that the rule group is associated with the content of the legal document.
4. The method according to claim 1, characterized in that, Each rule group also includes a priority attribute; in step S1, the determined rule groups are arranged in descending order of priority.
5. The method according to claim 4, characterized in that, In step S2, the integration includes: traversing each determined rule group in descending order of priority; for each review rule, if the identifier of the review rule does not appear in the review rule set, then add it; if it has already appeared, then skip it.
6. The method according to claim 1, characterized in that, The review rules include hard constraint rules and agreed rules; the hard constraint rules are the review rules corresponding to mandatory legal provisions, and the agreed rules are the default rules that can be adjusted by the parties through negotiation.
7. The method according to claim 1, characterized in that, Before step S3, a knowledge enhancement step is also included: extracting the referenced legal provision identifiers from the review rule set and retrieving the original legal text information corresponding to the legal provision identifiers from a preset legal knowledge base; The retrieved legal text information is appended to the description of the corresponding rule in the review rule set, serving as the basis for the analysis of the language model.
8. The method according to claim 7, characterized in that, The legal knowledge base also stores the key points of judgments in guiding cases; the knowledge enhancement step further retrieves the key points of judgments associated with the legal provision identifier and appends them to the description of the corresponding rule.
9. The method according to claim 1, characterized in that, In step S3, the analysis task of the language model includes: checking the correspondence of each review rule in the legal document, judging the compliance status based on the attached legal text, identifying risk categories, and returning the analysis results of each rule in a structured format.
10. The method according to claim 9, characterized in that, The risk categories include legal violations, imbalances in business risk, and procedural deficiencies.
11. The method according to claim 1, characterized in that, In step S4, the review report includes: classifying the issues in the analysis results according to their severity; statistically analyzing the distribution of interest bias in the clauses of the legal documents; and generating a list of processing recommendations according to priority.
12. A legal document risk identification system, characterized in that, include: The rule storage module stores multiple rule groups divided by legal field, with each rule group including matching conditions and review rules; The content matching module is used to perform content feature matching on the input legal document and determine one or more rule groups associated with the content of the legal document from the rule storage module; The rule integration module is used to integrate the review rules in the identified rule groups to form a review rule set; The analysis and submission module is used to submit the review rule set and the full text of the legal document to the language model, and to receive the analysis results returned by the language model. The report generation module is used to generate a review report based on the analysis results.
13. The system according to claim 12, characterized in that, It also includes a knowledge enhancement module, which is used to extract legal provision identifiers from the set of review rules, retrieve the corresponding legal text information from a preset legal knowledge base, and append the retrieved legal text information to the description of the corresponding rule.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 11.