A large model-based labor contract proofreading and risk identification method and system

By constructing a multivariate semantic vector index and training a DPO model, the labor contract compliance review system solves the problems of professional adaptability, real-time legal knowledge, and stability in existing labor contract review technologies, and achieves efficient and accurate labor contract risk identification and compliance assessment.

CN122453147APending Publication Date: 2026-07-24上海市普陀区城市运行管理中心 +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
上海市普陀区城市运行管理中心
Filing Date
2026-04-30
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing technologies for labor contract review and risk identification suffer from insufficient professional adaptability, inadequate real-time and relevance of legal knowledge, lack of structured and traceable risk assessment, weak heterogeneous data analysis capabilities, and a lack of stability and fault tolerance mechanisms, resulting in insufficient accuracy and credibility of review results.

Method used

By using semantically enhanced retrieval and DPO model training, a multi-variant semantic vector index and retrieval strategy are constructed. Combined with a large language model, labor contract compliance review is carried out to achieve multi-dimensional risk identification and structured assessment. Error handling and degradation mechanisms are also provided to ensure stable system operation.

Benefits of technology

It enables professional and intelligent review of labor contracts, improves the accuracy and efficiency of risk identification, reduces the cost of manual review, and provides structured compliance assessment reports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122453147A_ABST
    Figure CN122453147A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on big model's labor contract proofreading and risk identification method and system, the method includes: obtaining first data, and it is preprocessed to obtain second data;Based on the second data generates multiple variant semantic vectors, and based on the multiple variant semantic vectors constructs retrieval index and retrieval strategy;Based on big language model, using DPO algorithm constructs and trains labor contract compliance proofreading model;The labor contract text to be proofread is input into the labor contract compliance proofreading model of training completion, the model combines the retrieval strategy and the second data, outputs structured labor contract risk assessment report.The method and system provided by the application, through semantic enhancement retrieval and DPO model training, realize the accurate identification of labor contract risk and structured compliance assessment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of labor contract review and risk identification, and in particular to a method and system for labor contract review and risk identification based on a large model. Background Technology

[0002] The mainstream technical solutions in the field of labor contract review and risk identification can be mainly divided into three categories: manual review, rule- or template-driven automated software, and direct reasoning using general large models. The specific technical implementation and application scenarios of each solution are as follows:

[0003] (1) Manual proofreading mode

[0004] This approach relies on the experience of corporate legal counsel, practicing lawyers, or professionals with labor law knowledge. Reviewers meticulously read through the labor contract text, combining their memory and understanding of current legal provisions such as the Labor Law and the Labor Contract Law, to manually identify illegal clauses, ambiguous clauses, and compliance loopholes in the contract, ultimately providing modification suggestions and risk assessments.

[0005] (2) Rule-based or template-based automated review software

[0006] This type of software uses keyword matching and standard template comparison as its core technical logic. The system pre-builds a database of prohibited or illegal keywords, a database of compliant standard clauses, and standardized labor contract templates. It then uses a preset rule engine to search and match the input contract text. If the system detects that the contract contains prohibited words, is missing core legal clauses from the standard template, or deviates from the template specifications in its overall structure, a risk warning is triggered.

[0007] (3) General large model direct reasoning review

[0008] Users can directly input the labor contract text into a general generative artificial intelligence model (such as DeepSeek, Tongyi Qianwen, etc.). Based on the general legal knowledge and natural language processing capabilities learned in its pre-training stage, the model can directly generate contract modification suggestions and compliance analysis conclusions without the need for additional domain-specific training.

[0009] While the aforementioned existing technical solutions meet the basic requirements for labor contract review, they have significant shortcomings in terms of deep adaptation to professional fields, real-time performance, structured output, and stability. They cannot meet the requirements for professional, precise, and large-scale application of labor contract review. Specifically:

[0010] (1) Insufficient professional suitability and prominent problem of "factual illusion"

[0011] The general model has not undergone customized training in the vertical field of labor law. Its knowledge system is mainly based on general legal knowledge and general language. It lacks sufficient understanding of mandatory provisions with strong social law attributes in the labor field (such as "the probation period shall not exceed 6 months" and "the minimum wage standard shall not be lower than the local statutory lower limit"). It is prone to factual illusions. It may not only cite non-existent legal provisions and confuse old and new legal provisions, but also misinterpret the application boundaries of mandatory provisions, resulting in fundamental legal errors in the review conclusions.

[0012] (2) Insufficient timeliness and relevance of legal knowledge

[0013] Traditional rule or template software can only handle simple keyword matching and template comparison logic, and cannot parse complex legal logic relationships; while the knowledge reserves of general large models are fixed at the deadline of pre-training data, and cannot obtain and associate the latest local regulations, judicial interpretations and industry standards in real time, resulting in delayed risk identification results and failure to cover the latest legal revisions and local compliance requirements.

[0014] (3) Risk assessment lacks structure and traceability

[0015] Existing review conclusions are mostly fragmented, single-item modification suggestions, lacking a unified, structured evaluation system. They cannot quantify and classify labor contract risks (such as high, medium, and low risk) or score compliance, nor can they trace the legal basis for risk assessment, making it difficult to form a complete chain of evidence. This results in insufficient intuitiveness and credibility of the review results.

[0016] (4) Weak ability to parse heterogeneous data and long documents

[0017] Labor contracts often exist in heterogeneous formats such as PDF (including scanned copies or text files) and DOCX, and contain complex hierarchical numbering, chapter structures, and long text content. Existing tools are prone to problems such as formatting errors, incorrect identification of clause numbers, and incomplete or missing content extraction when parsing this type of data. This directly leads to missed or false detections in subsequent risk identification, affecting the accuracy of the review results.

[0018] (5) Lack of stability and fault tolerance mechanism

[0019] Current AI review tools mostly adopt a single "model + retrieval" collaborative path, lacking a robust fault handling and degradation strategy. When problems such as model loading failure or corrupted retrieval index occur, they often directly report errors or become unavailable, failing to ensure the continuity of the review process through degradation strategies, and resulting in insufficient service availability in complex network or hardware environments. Summary of the Invention

[0020] In view of the above-mentioned shortcomings in the field of labor contract review and risk identification, this invention provides a method and system for labor contract review and risk identification based on a large model. Through semantic enhancement retrieval and DPO model training, it can achieve accurate identification of labor contract risks and structured compliance assessment.

[0021] To achieve the above objectives, the embodiments of the present invention adopt the following technical solutions:

[0022] A method for labor contract review and risk identification based on a large model, the method comprising:

[0023] Obtain the first data and preprocess it to obtain the second data;

[0024] Based on the second data, generate multivariate semantic vectors, and construct a retrieval index and retrieval strategy based on the multivariate semantic vectors;

[0025] Based on a large language model, a labor contract compliance review model is constructed and trained using the DPO algorithm.

[0026] The labor contract text to be reviewed is input into the trained labor contract compliance review model. The model combines the retrieval index and retrieval strategy with the second data to output a structured labor contract risk assessment report.

[0027] According to one aspect of the present invention, in the process of preprocessing the first data to obtain the second data, the preprocessing specifically includes: file format sorting, file content parsing, clause structure extraction, and data cleaning and sorting.

[0028] According to one aspect of the present invention, generating a multivariate semantic vector based on the second data specifically involves:

[0029] Based on the second data, semantically enhanced variants are generated for each clause, including original combined variants, enhanced variants, simplified variants, and question-oriented variants;

[0030] The semantically enhanced variants are semantically vectorized using a pre-trained BERT-based Transformer model, generating multi-variant semantic vectors.

[0031] According to one aspect of the present invention, the construction of the retrieval index and retrieval strategy based on the multivariate semantic vector specifically includes:

[0032] Based on the multivariate semantic vectors, a tiling index based on L2 distance and a clustering index based on a clustering algorithm are constructed respectively; wherein, the clustering index generates multiple cluster centers through a clustering algorithm, and creates a corresponding tiling sub-index for each cluster center;

[0033] Configure a traversal retrieval strategy for the flat index; configure a hierarchical retrieval strategy for the clustering index. The hierarchical retrieval strategy is to first match the cluster center to select the target cluster, then perform a local precise retrieval in the flat sub-index corresponding to the target cluster, and finally merge all retrieval results and return them in order of similarity.

[0034] According to one aspect of the present invention, the construction and training of the labor contract compliance review model based on a large language model and using the DPO algorithm specifically includes: constructing a training dataset based on a labor contract review scenario, wherein the training dataset includes preference training data and logic reinforcement data; and, based on the large language model and the preference training data, optimizing the probability distribution of the output of the labor contract compliance review model at the preference pair level using the DPO algorithm.

[0035] According to one aspect of the present invention, the labor contract compliance review model constructed and trained using the DPO algorithm based on a large language model further includes a dedicated logic enhancement step, specifically:

[0036] Based on the aforementioned logic-enhanced data, the labor contract compliance review model is trained to identify mandatory provisions and learn the judgment criteria for fuzzy legal concepts, thereby strengthening the deep analysis capabilities of the labor contract compliance review model.

[0037] According to one aspect of the present invention, the step of inputting the labor contract text to be reviewed into the trained labor contract compliance review model, combined with the retrieval strategy and the second data, specifically includes:

[0038] Based on the labor contract text to be reviewed, the labor contract compliance review model calls the retrieval index and retrieval strategy to retrieve relevant data from the second data and construct a background library; the labor contract compliance review model, in conjunction with the background library, performs multi-dimensional risk identification on the labor contract text to be reviewed.

[0039] According to one aspect of the present invention, the step of inputting the labor contract text to be reviewed into the trained labor contract compliance review model, combined with the retrieval index and retrieval strategy and the second data, further includes a risk classification and quantitative scoring step: the labor contract compliance review model classifies the identified multi-dimensional risks into three levels: high risk, medium risk and low risk, and performs weighted calculations based on the number and weight of the multi-dimensional risks and the completeness of the labor contract to complete the quantitative scoring.

[0040] According to one aspect of the present invention, the labor contract review and risk identification method further includes error handling and degradation strategy steps, specifically including: labor contract compliance review model loading failure handling, retrieval index and retrieval strategy usage failure handling, double failure handling, and cache or historical session failure handling.

[0041] A labor contract review and risk identification system based on a large model, wherein the labor contract review and risk identification system is implemented based on the aforementioned labor contract review and risk identification method, and the system includes:

[0042] Data preprocessing module: Acquires the first data and preprocesses it to obtain the second data;

[0043] Vector retrieval module: Generates multivariate semantic vectors based on the second data, and constructs a retrieval index and retrieval strategy based on the multivariate semantic vectors;

[0044] Model building module: Based on a large language model, the DPO algorithm is used to build and train a labor contract compliance review model;

[0045] Result generation module: Input the labor contract text to be reviewed into the trained labor contract compliance review model. The model combines the retrieval index and retrieval strategy with the second data to output a structured labor contract risk assessment report.

[0046] The advantages of this invention are as follows: By structuring labor law-related data, constructing multi-variant semantic vectors and retrieval indexes and strategies, and combining a labor contract compliance review model trained by the DPO algorithm, it effectively overcomes problems such as factual illusion and outdated legal knowledge. It can conduct multi-dimensional risk identification on contracts to be reviewed, complete risk rating and quantitative scoring, and output a structured assessment report with legal basis. At the same time, with error handling and degradation mechanisms, it ensures that the system can still operate stably in abnormal scenarios, realizing the professional, intelligent and highly reliable operation of labor contract review, significantly improving review efficiency and compliance judgment accuracy, and reducing the cost of manual legal review. Attached Figure Description

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

[0048] Figure 1 This is a schematic flowchart illustrating a labor contract review and risk identification method based on a large model, as described in this invention.

[0049] Figure 2 This is a schematic flowchart of the first data preprocessing step in the labor contract review and risk identification method based on a large model according to the present invention.

[0050] Figure 3This is a schematic flowchart illustrating the construction of a retrieval index and retrieval strategy for a labor contract review and risk identification method based on a large model, as described in this invention.

[0051] Figure 4 This is a schematic diagram of the error handling and degradation strategy of a labor contract review and risk identification method based on a large model as described in this invention.

[0052] Figure 5 This is a schematic diagram of the structure of a labor contract review and risk identification system based on a large model, as described in this invention.

[0053] Figure 6 This is a screenshot of the login and registration interface of a labor contract review and risk identification system based on a large model, as described in this invention.

[0054] Figure 7 This is a visual interface diagram of a labor contract review and risk identification system based on a large model, as described in this invention.

[0055] Figure 8 This invention provides a risk warning interface for a labor contract review and risk identification system based on a large model. Figure 1 ;

[0056] Figure 9 This invention provides a risk warning interface for a labor contract review and risk identification system based on a large model. Figure 2 ;

[0057] Figure 10 This is a diagram of the clause completion interface of a labor contract review and risk identification system based on a large model, as described in this invention.

[0058] Figure 11 This is an analysis and summary interface diagram of a labor contract review and risk identification system based on a large model, as described in this invention. Detailed Implementation

[0059] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0060] Example 1

[0061] like Figure 1 , Figure 2 ,and Figure 3 As shown, a method for labor contract review and risk identification based on a large model is proposed, the method comprising the following steps:

[0062] Step S1: Obtain the first data and preprocess it to obtain the second data;

[0063] Step S1 involves obtaining the first data and preprocessing it to obtain the second data, specifically including:

[0064] Step S11: Data Collection

[0065] We obtain first-hand data on labor laws, administrative regulations, policy documents, employers' internal rules and regulations, and industry standards from official public online platforms. Specifically, this includes: obtaining the original text and revision records of laws such as the *Labor Law of the People's Republic of China* and the *Labor Contract Law of the People's Republic of China* from the website of the National People's Congress of China; obtaining supporting administrative regulations such as the *Regulations on Labor Security Supervision* and the *Special Provisions on Labor Protection for Female Employees* from the website of the Ministry of Human Resources and Social Security; obtaining labor-related policy documents issued by the State Council and its ministries from the website of the Chinese government; and obtaining internal rules such as *Employee Handbooks*, *Attendance Management Systems*, and *Salary Management Systems*, as well as industry standards such as *Labor Safety and Health Standards* and *Occupational Health Standards* from the official websites of employers such as universities and hospitals.

[0066] Step S12: File format sorting

[0067] The unified title format for the first data is "Chapter-Section-Article" (e.g., "Chapter 1 General Provisions, Article 1"), preserving the original title hierarchy for each type of text. For example, "Chapter 3 Labor Contracts and Collective Contracts" is set as a first-level title, and "Section 1 Conclusion of Labor Contracts" is set as a second-level title. For labor-related laws and administrative regulations, the content is reorganized according to the logical order of "General Provisions-Specific Provisions-Supplementary Provisions," adding a unique source identifier to each legal / administrative regulation clause (e.g., "Article 3 of the Labor Law"), and labeling each clause with attribute tags (e.g., "Labor Contracts," "Wages"). For policy documents, internal rules, and industry standards, corresponding identifiers and tags are added according to their original structure.

[0068] Step S13: Parsing the file content

[0069] For PDF documents, the PyMuPDF (fitz) library is used to distinguish between scanned documents and text-based PDFs and extract the main text content; for DOCX documents, their underlying XML structure is parsed to obtain plain text content, completing the conversion from heterogeneous documents to structured text.

[0070] Step S14: Structured extraction of terms, data cleaning and sorting

[0071] The Chinese numerals in the text are converted into Arabic numerals, and the clause content is extracted using multiple matching rules. The clause content is fingerprinted using hash algorithms such as MD5 to identify and merge duplicate clauses. Then, the clauses are arranged according to the original chapter / style order of the corresponding text to obtain the second data.

[0072] Step S2: Generate a multivariate semantic vector based on the second data, and construct a retrieval index and retrieval strategy based on the multivariate semantic vector;

[0073] Step S2, which generates a multivariate semantic vector based on the second data, specifically includes:

[0074] Step S211: Generate multiple semantic enhancement variants

[0075] The second data output from step S1 is processed to overcome the semantic limitations of traditional retrieval. Four types of semantically enhanced variants are generated for each legal clause, including original combined variants, enhanced variants, simplified variants, and question-oriented variants. Specifically:

[0076] 1. Original combination variant: directly combine the clause title and content (e.g., "Article 3 Workers have the right to equal employment"), preserving the original semantic structure of the legal text;

[0077] 2. Enhanced variant: Combines document title (e.g., "Labor Law of the People's Republic of China") with clause title + content (e.g., "Article 3 of the Labor Law: Workers have the right to equal employment"), enhances semantic relevance through document context, and enables clause identifiers to be accurately identified within the corresponding legal framework;

[0078] 3. Simplified variant: Extract core keywords (such as "equal employment" and "rest and leave") using TF-IDF or NLP entity recognition technology, retaining only "Article 3 Equal Employment Rest and Leave", reducing text redundancy and focusing on core legal concepts;

[0079] 4. Problem-oriented variant: Based on a large model, it simulates user queries in labor law scenarios (such as "How is overtime pay calculated?" matching "Overtime pay calculation rules"), transforming professional legal expressions (such as "overtime pay") into natural language query sentences, directly matching actual business problems of enterprises.

[0080] Step S212: Semantic Vectorization Processing in the Legal Domain

[0081] The semantically enhanced variants are semantically vectorized using a Transformer model based on the BERT architecture trained in the labor law domain, generating multi-variant semantic vectors. Specifically:

[0082] The four types of semantically enhanced variants described in step S211 are obtained, and a Transformer model trained in the labor law domain (such as LawBERT) is used to semantically vectorize the clause text. This model, based on the BERT architecture, uses a large-scale legal text corpus (such as over 500,000 legal articles from Peking University's Legal Database) for domain-adaptive training to learn deep semantic relationships between labor law terms. For example, it significantly shortens the semantic distance between near-legal terms such as "dismissal" and "unlawful termination" in the vector space. Specifically, the input text of any type of semantically enhanced variant generated in step S21 (such as "Enhanced variant: Article 3 of the Labor Law: Workers have the right to equal employment") is processed by a token segmenter into a token sequence recognizable by the Transformer model. A 768-dimensional dense semantic vector is generated through the model's encoding layer. Finally, L2 normalization is performed on the output vector to ensure the effectiveness and stability of subsequent cosine similarity calculations.

[0083] Further, step S2 involves constructing a retrieval index and retrieval strategy based on the multivariate semantic vector; specifically including:

[0084] Step S221: Construct the retrieval index

[0085] Based on the multivariate semantic vectors generated in step S212, a tiling index based on L2 distance and a clustering index based on clustering algorithms are constructed, specifically as follows:

[0086] Flat index: Uses L2 distance (such as flat.indexFlatL2) to store all multivariate semantic vectors, and traverses the entire database during retrieval. Suitable for small-scale data scenarios (data volume less than 100,000 records).

[0087] Clustering Index: This index uses a clustering algorithm (such as K-Means) to cluster all semantic vectors, suitable for large-scale data scenarios. Specifically, the clustering index generates multiple cluster centers and creates a corresponding flat sub-index for each cluster center. The process involves setting the number of clusters n_clusters=128, performing clustering operations through the faiss.Clustering module to generate 128 cluster centers, creating an independent flat index (faiss.IndexFlatL2, vector dimension dim=768) for each cluster, forming 128 sub-indexes, and storing all sub-indexes and their corresponding cluster centers in the faiss.IndexIVFFlat container.

[0088] Step S222: Retrieval Strategy Generation and Execution

[0089] Configure the corresponding retrieval strategies for the flat index and clustered index constructed in step S221, specifically as follows:

[0090] Flat index retrieval strategy: Directly perform a full database traversal retrieval (i.e., all multivariate semantic vectors) without requiring additional hierarchical logic;

[0091] Clustering Index Retrieval Strategy: A hierarchical retrieval strategy is adopted to balance retrieval accuracy and efficiency. This strategy involves first matching cluster centers to select the target cluster, then performing a local precise retrieval in the corresponding flat sub-index of the target cluster, and finally merging all retrieval results and returning them sorted by similarity. Specifically: First, the cosine similarity between the semantic vector of the query text and the 128 cluster centers is calculated. The results are then sorted from high to low similarity, and the Top-10 most relevant clusters are selected (nprobe=10). A local precise retrieval is performed in the sub-index corresponding to each selected cluster, with each sub-index returning the Top-50 results (k=50). After merging all local retrieval results (a total of 500), they are re-sorted by comprehensive similarity, and finally, the Top-5 most relevant labor law clauses are returned.

[0092] Step S3: Based on the large language model, construct and train the labor contract compliance review model using the DPO algorithm;

[0093] In step S3, a labor contract compliance review model is constructed and trained based on a large language model using the DPO algorithm, specifically as follows:

[0094] Step S31: Training Data Preparation and Divide

[0095] For labor contract review scenarios, training and validation data are prepared for the construction and training of the labor contract compliance review model, specifically:

[0096] 1. Preference Training Data: Construct a preference comparison dataset including positive samples (Chosen) and negative samples (Rejected). Chosen samples represent review conclusions and suggested modifications approved by senior lawyers and consistent with judicial practice logic. Rejected samples are model-generated responses containing legal logic errors, outdated citations, or factual illusions. After standardizing the format, denoising, and cleaning the samples, the training and validation sets are randomly divided according to a preset ratio (e.g., 9:1).

[0097] 2. Logic-enhanced data: Includes cases with mandatory provisions of labor law (such as obvious illegal scenarios such as "probation period exceeding 6 months") and a large number of labor dispute judgment documents. After cleaning and deduplication, the training set and validation set are randomly divided according to a preset ratio (such as 9:1).

[0098] 3. Validation data: Merge the validation subsets of the above two types of data to form a unified validation set, which is used to evaluate the effectiveness of the trained labor contract compliance review model.

[0099] Step S32: Preference Alignment Training Based on DPO

[0100] A labor contract compliance review model based on a large language model (such as Qwen3) is constructed, and based on the preference training data constructed in step S31, the Direct Preference Optimization (DPO) algorithm is introduced to conduct preference alignment training. Specifically:

[0101] By directly optimizing the probability distribution of the model output at the pairwise level through the DPO algorithm, the logic of the model output is aligned with the judgment logic of judges and lawyers. Compared with traditional reinforcement learning (PPO), this algorithm can significantly reduce the probability of overfitting in the vertical scenario of labor law, improve the robustness and professionalism of the output results, and effectively solve the problems of "illusion" or "overly broad suggestions" that occur in existing models in labor contract review.

[0102] Step S33: Strengthening the Specific Logic of Labor Law

[0103] Building upon DPO preference alignment and using the logically enhanced data prepared in step S31, the deep analytical capabilities of the labor contract compliance review model are further strengthened for labor law scenarios. Specifically:

[0104] Mandatory Provision Identification: Based on cases involving mandatory provisions of labor law, the model is trained to identify "inviolable rules" in labor law (such as minimum wage, maximum working hours, etc.), enabling the model to effectively identify obviously illegal clauses such as "probation period exceeding 6 months".

[0105] Judicial Practice Simulation: Based on a massive amount of labor dispute judgment documents, the model learns the judgment standards of judges in judicial practice for vague concepts such as "serious violation of rules and regulations," making the risk assessment closer to the real judicial situation.

[0106] Step S34: Efficient Training Configuration and Validation

[0107] The labor contract compliance review model is trained using the Parameter-Efficient Fine-Tuning (PEFT) method, which updates only some key parameters of the large language model (such as LoRA weights). While retaining the general language capabilities of the basic model, it injects labor law professional attributes, effectively avoiding the problem of forgetting general knowledge caused by full parameter fine-tuning. After training, based on the validation set divided in step S31, the "risk identification accuracy" and "reasonableness of modification suggestions" of the labor contract compliance review model are verified by combining automated indicators (such as ROUGE scores) with human legal evaluation, ensuring that the model meets commercial standards.

[0108] Step S35: Model Deployment

[0109] The validated labor contract compliance review model is deployed in a GPU resource environment (such as an 8GB VRAM configuration) to generate a dedicated API endpoint and access key for the "Labor Contract Review and Risk Identification System" to call.

[0110] Step S4: Input the labor contract text to be reviewed into the trained labor contract compliance review model. The model combines the retrieval strategy and the second data to output a structured labor contract risk assessment report.

[0111] In step S4, the text of the labor contract to be reviewed is input into the trained labor contract compliance review model. This model, combined with the retrieval strategy and the second data, outputs a structured labor contract risk assessment report, specifically as follows:

[0112] Step S41: Input of text to be reviewed and basic knowledge base

[0113] The system receives the text data of the labor contract to be reviewed from the user, and at the same time uses the second data (including laws, regulations, internal rules, etc.) preprocessed in step S1 as a basic knowledge base to provide data support for subsequent risk identification.

[0114] Step S42: Precise legal knowledge retrieval based on the retrieval index and corresponding retrieval strategy

[0115] The labor contract compliance review model calls upon the retrieval index and corresponding retrieval strategy constructed in step S2. Using the labor contract text to be reviewed as the retrieval basis, it retrieves the top-5 relevant labor law provisions, judicial rulings, and industry standards from the second data in step S1, constructing a legal knowledge background database corresponding to the text to be reviewed, and providing legal and compliant basis support for risk identification.

[0116] Step S43: Multi-dimensional In-depth Risk Identification

[0117] The labor contract compliance review model, combined with a retrieved legal knowledge background database, performs multi-dimensional and in-depth risk identification on the labor contract text to be reviewed, specifically including:

[0118] Mandatory Clause Verification: Regarding the "inviolable rules" in labor law, such as minimum wage standards and maximum overtime hours limits, the labor contract compliance review model compares contract clauses with retrieved mandatory legal provisions to directly identify obviously illegal clauses. For example, if a contract stipulates an 8-month probationary period, the model will, based on Article 19 of the Labor Contract Law (which states that the probationary period shall not exceed 6 months), directly determine it as an illegal clause.

[0119] Ambiguous semantic risk identification: For clauses in contracts that are unclear or prone to ambiguity, the labor contract compliance review model combines judicial practice logic to determine their risk attributes and classify them as medium risk. For example, for clauses such as "adjusting positions as needed," the model will identify them as "unfair clauses" or "ambiguous expressions" that may infringe on workers' rights and classify them as medium risk.

[0120] Missing Items Check: Simultaneously check whether the contract is missing any necessary legal clauses (such as instructions on social insurance payments, instructions on work location, etc.) to identify risks related to missing clauses.

[0121] Step S44: Risk Rating and Quantitative Scoring

[0122] The labor contract compliance review model classifies and quantifies the identified issues based on the degree of risk identification and the potential harm to employees. Specifically:

[0123] 1. Risk rating

[0124] High Risk: Involves direct illegality, lack of clear compensation standards, or unfair terms that are seriously unbalanced;

[0125] Medium Risk: Terms that are vaguely described, open to multiple interpretations, or involve unequal rights and obligations;

[0126] Low Risk: A fully compliant and standardized term that conforms to legal regulations and industry practices.

[0127] 2. Quantitative scoring

[0128] A weighted calculation is performed based on the number and weight of various risks and the completeness of the contract, and a quantitative scoring threshold is set:

[0129] like (High Risk): The contract contains multiple serious violations or lacks core clauses. It is recommended to terminate the signing or make major legal revisions.

[0130] like (Medium risk): The contract is basically usable, but there are potential legal pitfalls, and the ambiguous clauses need to be carefully revised;

[0131] like (Low Risk): The contract is generally rigorous and compliant, and is recommended for signing.

[0132] Step S45: Intelligent Modification Suggestion Generation and Report Output

[0133] The labor contract compliance review model, based on risk identification and quantitative scoring results, generates intelligent modification suggestions with a chain of evidence and outputs a structured labor contract risk assessment report, specifically including:

[0134] Evidence tracing: The report highlights the risk clauses and directly lists the original legal provisions or summaries of judgments that serve as the basis for the decisions, clearly defining the legal basis for the risks;

[0135] Generative modification suggestions: For high-risk and medium-risk clauses, the labor contract compliance review model generates targeted "modification suggestions" or "model clauses" based on legal grounds. For example, "employees are required to work overtime unconditionally" can be modified to "due to production and operation needs, working hours may be extended after consultation with the labor union and employees, but shall not exceed three hours per day, and overtime pay shall be paid."

[0136] Example 2

[0137] like Figure 1 , Figure 2 , Figure 3 and Figure 4 As shown, this embodiment adds step S5: error handling and degradation strategy, based on the labor contract review and risk identification method described in Embodiment 1, to ensure the continuity and availability of the review process in the event of a failure. Specifically, it includes:

[0138] 1. Handling loading failures in the labor contract compliance review model

[0139] When the labor contract compliance review model fails to load, it automatically reverts to pure search mode, displaying only the original text of relevant legal provisions retrieved from the second dataset, allowing users to compare and analyze them themselves; the final review result is generated by splicing predefined text templates to ensure that users can obtain basic legal basis.

[0140] 2. Troubleshooting the use of search indexes and search strategies

[0141] When the retrieval index and retrieval strategy malfunction, it automatically reverts to the direct model response mode: directly using the parameterized knowledge of the labor contract compliance review model to generate labor contract review suggestions, and marking "not enhanced by retrieval, for reference only" in the output results, clearly indicating the limitations of the results.

[0142] 3. Handling of dual failures

[0143] When the labor contract compliance review model fails to load and retrieve indexes and search strategies, it switches to keyword warning mode: based on a preset labor law keyword library, it performs keyword matching on the labor contract text to be reviewed and returns static predefined general legal advice to ensure the most basic risk warning capability.

[0144] 4. Handling cache or historical session failures

[0145] When database read / write anomalies cause cached or historical session data to fail to persist, the current session state is maintained in memory without data persistence, ensuring the complete execution of the current labor contract review process and avoiding process interruption.

[0146] Example 3

[0147] like Figure 5 , Figure 6 , Figure 7 , Figure 8 , Figure 9 , Figure 10 and Figure 11 As shown, a labor contract review and risk identification system based on a large model is presented in this embodiment. This embodiment is implemented based on the labor contract review and risk identification method described in Embodiment 1. The system includes:

[0148] Data preprocessing module M1: Acquires the first data and preprocesses it to obtain the second data;

[0149] Vector retrieval module M2: Generates multivariate semantic vectors based on the second data, and constructs a retrieval index and retrieval strategy based on the multivariate semantic vectors;

[0150] Model building module M3: Based on a large language model, it uses the DPO algorithm to build and train a labor contract compliance review model;

[0151] Result generation module M4: Inputs the labor contract text to be reviewed into the trained labor contract compliance review model. The model combines the retrieval index and retrieval strategy with the second data to output a structured labor contract risk assessment report.

[0152] The advantages of this invention are as follows: By structuring labor law-related data, constructing multi-variant semantic vectors and retrieval indexes and strategies, and combining a labor contract compliance review model trained by the DPO algorithm, it effectively overcomes problems such as factual illusion and outdated legal knowledge. It can conduct multi-dimensional risk identification on contracts to be reviewed, complete risk rating and quantitative scoring, and output a structured assessment report with legal basis. At the same time, with error handling and degradation mechanisms, it ensures that the system can still operate stably in abnormal scenarios, realizing the professional, intelligent and highly reliable operation of labor contract review, significantly improving review efficiency and compliance judgment accuracy, and reducing the cost of manual legal review.

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

Claims

1. A method for labor contract review and risk identification based on a large model, characterized in that, The method includes: Obtain the first data and preprocess it to obtain the second data; Based on the second data, generate multivariate semantic vectors, and construct a retrieval index and retrieval strategy based on the multivariate semantic vectors; Based on a large language model, a labor contract compliance review model is constructed and trained using the DPO algorithm. The labor contract text to be reviewed is input into the trained labor contract compliance review model. The model combines the retrieval index and retrieval strategy with the second data to output a structured labor contract risk assessment report.

2. The method for reviewing and identifying risks in labor contracts according to claim 1, characterized in that, The preprocessing of the first data to obtain the second data specifically includes: file format sorting, file content parsing, clause structure extraction, and data cleaning and sorting.

3. The method for reviewing and identifying risks in labor contracts according to claim 2, characterized in that, The specific steps of generating multivariate semantic vectors based on the second data are as follows: Based on the second data, semantically enhanced variants are generated for each clause, including original combined variants, enhanced variants, simplified variants, and question-oriented variants; The semantically enhanced variants achieve semantic vectorization through a pre-trained BERT-based Transformer model, generating multi-variant semantic vectors.

4. The method for reviewing and identifying risks in labor contracts according to claim 2, characterized in that, The specific steps for constructing the retrieval index and retrieval strategy based on the multivariate semantic vector are as follows: Based on the multivariate semantic vectors, a tiling index based on L2 distance and a clustering index based on a clustering algorithm are constructed respectively; wherein, the clustering index generates multiple cluster centers through a clustering algorithm, and creates a corresponding tiling sub-index for each cluster center; Configure a traversal retrieval strategy for the flat index; configure a hierarchical retrieval strategy for the clustering index. The hierarchical retrieval strategy is to first match the cluster center to select the target cluster, then perform a local precise retrieval in the flat sub-index corresponding to the target cluster, and finally merge all retrieval results and return them in order of similarity.

5. The method for reviewing and identifying risks in labor contracts according to claim 1, characterized in that, The specific steps of constructing and training a labor contract compliance review model based on a large language model and using the DPO algorithm include: constructing a training dataset based on labor contract review scenarios, wherein the training dataset includes preference training data and logic reinforcement data; and optimizing the probability distribution of the labor contract compliance review model output at the preference pair level using the DPO algorithm based on the large language model and the preference training data.

6. The method for reviewing and identifying risks in labor contracts according to claim 5, characterized in that, The labor contract compliance review model, built and trained using the DPO algorithm based on a large language model, also includes a dedicated logic enhancement step, specifically: Based on the aforementioned logic-enhanced data, the labor contract compliance review model is trained to identify mandatory provisions and learn the judgment criteria for fuzzy legal concepts, thereby strengthening the deep analysis capabilities of the labor contract compliance review model.

7. The method for reviewing and identifying risks in labor contracts according to claim 1, characterized in that, The step of inputting the labor contract text to be reviewed into the trained labor contract compliance review model, combined with the retrieval index and retrieval strategy and the second data, specifically involves: Based on the labor contract text to be reviewed, the labor contract compliance review model calls the retrieval index and retrieval strategy to retrieve relevant data from the second data and construct a background library; the labor contract compliance review model, in conjunction with the background library, performs multi-dimensional risk identification on the labor contract text to be reviewed.

8. The method for reviewing and identifying risks in labor contracts according to claim 7, characterized in that, The process of inputting the labor contract text to be reviewed into the trained labor contract compliance review model, combined with the retrieval index and retrieval strategy and the second data, also includes a risk classification and quantitative scoring step: the labor contract compliance review model classifies the identified multi-dimensional risks into three levels: high risk, medium risk, and low risk, and performs weighted calculations based on the number and weight of the multi-dimensional risks and the completeness of the labor contract to complete the quantitative scoring.

9. The method for reviewing and identifying risks in labor contracts according to any one of claims 1 to 8, characterized in that, The labor contract review and risk identification method also includes error handling and degradation strategy steps, specifically including: labor contract compliance review model loading failure handling, retrieval index and retrieval strategy usage failure handling, double failure handling, and cache or historical session failure handling.

10. A labor contract review and risk identification system based on a large model, characterized in that, The labor contract review and risk identification system is implemented based on the labor contract review and risk identification method according to any one of claims 1 to 9, and the system includes: Data preprocessing module: Acquires the first data and preprocesses it to obtain the second data; Vector retrieval module: Generates multivariate semantic vectors based on the second data, and constructs a retrieval index and retrieval strategy based on the multivariate semantic vectors; Model building module: Based on a large language model, the DPO algorithm is used to build and train a labor contract compliance review model; Result generation module: Input the labor contract text to be reviewed into the trained labor contract compliance review model. The model combines the retrieval index and retrieval strategy with the second data to output a structured labor contract risk assessment report.