Artificial Intelligence-Based Text Compliance Audit Methods and Systems
By performing multi-dimensional semantic expansion and vectorization of legal provisions, combined with large language models and deterministic rule checks, the problem of insufficient semantic matching between legal provisions and contract terms has been solved, achieving efficient and accurate compliance auditing and adapting to the risk assessment needs of different users.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JUJIAOXINCHUANG MEDICAL ELECTRONICS (SHANGHAI) CO LTD
- Filing Date
- 2026-03-04
- Publication Date
- 2026-05-26
Smart Images

Figure CN122087084A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of artificial intelligence and natural language processing technology, and in particular to text compliance auditing technology based on artificial intelligence. Background Technology
[0002] With the increasing frequency of business activities and the growing complexity of contractual relationships, contract auditing has become a core component of corporate legal management. The main objective of contract auditing is to identify legal risks in contract texts, including clauses that violate mandatory legal provisions, clauses lacking essential legal elements, and risky clauses unfavorable to specific contracting parties. Traditional contract auditing relies primarily on manual review by legal professionals, which suffers from low efficiency, high labor costs, and inconsistent review standards, making it difficult to meet the demands of rapid review of large volumes of contracts.
[0003] In recent years, Large Language Model (LLM) technology has made significant progress, demonstrating powerful capabilities in natural language understanding and text generation, thus driving technological development in the field of intelligent contract auditing. To compensate for the limitations of LLM in terms of domain-specific knowledge, Retrieval-Augmented Generation (RAG) technology has been introduced into contract auditing scenarios. The basic idea of RAG is to retrieve relevant reference information from an external knowledge base before the LLM performs inference tasks. This retrieved information is then input into the model as context, enabling the model to generate more accurate output based on specific professional knowledge. In contract auditing applications, the external knowledge base typically consists of legal and regulatory provisions. Through vectorized encoding and semantic similarity matching, the terms of the contract under review are correlated with these legal provisions.
[0004] However, existing contract auditing solutions based on retrieval-enhanced generation technology still face significant technical bottlenecks in the retrieval stage. In existing solutions, the knowledge base is typically constructed by directly segmenting and encoding the original legal texts into vectors and storing them. This approach results in vectors stored in the knowledge base only reflecting the semantic representation of the original legal provisions. Since legal texts are usually highly abstract and normative, while contract clauses under review are often expressed in specific business scenarios and factual descriptions, there are significant differences in their semantic expression. When semantic similarity retrieval is performed on the knowledge base after vectorizing the contract clauses under review, the semantic space distance between the specific business descriptions and the abstract legal norms is large, making it difficult to accurately retrieve the legal basis actually related to the clauses under review, resulting in low retrieval recall. The deficiencies in the retrieval stage directly affect the accuracy of subsequent compliance determinations by large language models, as the model struggles to make reliable compliance judgments without sufficient and relevant legal context. Summary of the Invention
[0005] This application provides an artificial intelligence-based text compliance auditing method and system, which addresses the technical problem of how to improve the accuracy and recall rate of legal basis retrieval.
[0006] This application discloses an artificial intelligence-based text compliance auditing method, including: In the knowledge base construction phase, a set of legal provisions in the legal field is obtained. For each legal provision in the set, the following multi-dimensional semantic expansion processing is performed using a large language model: generating at least one application scenario text that is semantically associated with the legal provision, wherein the application scenario text expresses the behavioral situation regulated by the legal provision in the form of a specific fact description; generating a popular interpretation text of the legal provision; and extracting key terms from the legal provision. The original text of the legal provisions, the application scenario text, the interpretation text, and the key terms are vectorized respectively to construct a multi-dimensional vector index containing multiple semantic dimensions and store it in a vector database. Each semantic dimension vector index corresponds to the original text, the application scenario text, the interpretation text, and the key terms, and each vector index carries a dimension type identifier. In the compliance retrieval phase, target text fragments are obtained from the text to be audited, the target text fragments are vectorized, and semantic similarity retrieval is performed in the multidimensional vector index to obtain legal provisions that semantically match the target text fragments and their associated derived texts as retrieval results. In the compliance determination stage, the search results are used as context and input together with the target text fragment into the large language model. The large language model then performs a compliance determination on the target text fragment and outputs the determination result.
[0007] In a preferred embodiment, the application scenario text includes compliant example scenario text and non-compliant example scenario text generated in response to the legal provisions, wherein the compliant example scenario text describes specific factual situations that comply with the provisions of the legal provisions, and the non-compliant example scenario text describes specific factual situations that violate the provisions of the legal provisions.
[0008] In a preferred embodiment, when performing semantic similarity retrieval in the multidimensional vector index, the retrieval is preferentially performed in the vector index corresponding to the application scenario text, and the matching priority of the retrieval results of the application scenario text dimension is set higher than that of the retrieval results of the original text dimension; each dimension vector corresponding to each legal provision in the multidimensional vector index constitutes a knowledge node, and each knowledge node contains a source provision association identifier, so that after retrieving a vector of any dimension, it is possible to trace back to the corresponding original legal provision.
[0009] In a preferred embodiment, the compliance determination stage further includes: performing deterministic rule checks and semantic compliance determination based on the large language model in parallel on the target text fragment; the deterministic rule checks perform hard indicator checks on the target text fragment through preset rule logic, the hard indicator checks including at least one of the following: checking for missing essential clauses based on contract type, identifying invalid clauses based on predefined keyword patterns, and verifying the subject's qualifications based on preset rules; the results of the deterministic rule checks are fused with the results of the semantic compliance determination to generate a comprehensive compliance determination result for the target text fragment.
[0010] In a preferred embodiment, the text to be audited contains multiple target text fragments. The method distributes the multiple target text fragments simultaneously through a parallel task distribution mechanism, performs the deterministic rule check and the semantic compliance determination in parallel on each target text fragment, and summarizes the comprehensive compliance determination results of all target text fragments to generate an audit report.
[0011] In a preferred embodiment, the method further includes: receiving user-defined stance parameters, which identify the user's role in the text to be audited; obtaining user-defined unstructured review rules, vectorizing and storing the unstructured review rules; when performing compliance determination on the target text fragment, performing semantic retrieval on the target text fragment in the vector corresponding to the unstructured review rules to obtain the matched personalized review rules; and combining the stance parameters and the matched personalized review rules to perform risk rating on the target text fragment, so that the same target text fragment is assigned different risk levels under different stance parameters.
[0012] In a preferred embodiment, during the compliance determination phase, a reverse semantic consistency check is performed on the forward inference conclusion output by the large language model. The reverse semantic consistency check includes: The positive reasoning conclusion is reversed as the premise, and a reverse verification prompt is constructed. The reverse verification prompt requires the large language model to output the set of legal conditions that must be satisfied for the premise to be true. Each condition in the set of legal conditions is semantically aligned and matched with the target text fragment and its context to determine whether the target text fragment satisfies each condition, thus obtaining the satisfaction status of each condition; A consistency score is calculated based on the satisfaction status of each condition in the set of legal conditions. The consistency score represents the degree of agreement between the forward reasoning conclusion and the reverse semantic consistency verification result. The fewer conditions in the set of legal conditions that are satisfied, the higher the consistency score. The consistency score and the confidence level of the forward reasoning conclusion are weighted and fused to obtain the final confidence level. Different levels of audit conclusions are output for the target text fragment according to the value range of the final confidence level.
[0013] In a preferred embodiment, during the compliance retrieval stage, semantic stripping preprocessing is performed on the target text fragment before hierarchical retrieval, wherein the semantic stripping preprocessing and hierarchical retrieval include: The target text fragment is decomposed into a structured representation of multiple semantic sub-layers using a large language model. The semantic sub-layers include at least a subject layer, an action layer, a condition layer, and a responsibility layer. The text content of each semantic sub-layer is independently vectorized and encoded to generate a sub-vector corresponding to each semantic sub-layer. The first priority channel retrieval is performed in the multidimensional vector index using the sub-vector corresponding to the responsibility layer as the query vector. The sub-vector corresponding to the behavior layer and the sub-vector corresponding to the responsibility layer are combined to obtain a combined vector. The combined vector is used as the query vector to perform the second priority channel retrieval. The third priority channel fallback retrieval is performed using the overall vector of the target text fragment. The search results from each channel are deduplicated and merged. The relevance score of results that are repeatedly hit in multiple channels is improved, and the merged result is used as the search result.
[0014] This application also discloses an artificial intelligence-based text compliance auditing system, including: Memory, used to store computer-executable instructions; and, A processor, coupled to the memory, is configured to implement the steps of the method as described above when executing the computer-executable instructions.
[0015] This application also discloses a non-transitory computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the method described above.
[0016] In the embodiments of this application, multi-dimensional semantic augmentation processing is performed on each legal provision in the legal provision set using a large language model to generate various derived texts, including application scenario text, popular interpretation text, and key terms. The original legal provisions and each derived text are vectorized to construct a multi-dimensional vector index carrying dimension type identifiers. In the compliance retrieval stage, the target text fragment of the text to be audited is vectorized and then semantic similarity is retrieved in the multi-dimensional vector index. The retrieval results are then used as context and input together with the target text fragment into the large language model for compliance determination. This can solve the technical problem of low retrieval recall caused by the large semantic space distance between user natural language queries and abstract legal provisions in existing retrieval enhancement generation technologies. It enables the contract terms to be audited to be directly semantically matched with application scenario text expressed in the knowledge base in the form of specific fact descriptions, thereby significantly improving the accuracy and recall of legal basis retrieval and thus improving the reliability of compliance determination conclusions.
[0017] Furthermore, by subdividing the application scenario text into compliant example scenario text and non-compliant example scenario text, the knowledge base can simultaneously cover the specific factual descriptions of both legal and illegal situations. This enables semantic retrieval to match the clauses under review from both positive and negative perspectives, further improving the comprehensiveness of the retrieval results and the accuracy of the judgment conclusions.
[0018] Furthermore, by setting the matching priority of the application scenario text dimension to be higher than that of the original text dimension during multi-dimensional vector index retrieval, and setting source text association identifiers in each knowledge node to enable backtracking from any dimension vector to the original legal text, it can be ensured that the search results closest to the business scenario of the clause under review are returned first, while ensuring that the search results can always be traced back to the authoritative source of the legal text, thus balancing the accuracy of the search with the traceability of the legal basis.
[0019] Furthermore, by performing deterministic rule checks and semantic compliance judgments based on a large language model in parallel on the target text fragments, and then fusing the results of the two to generate a comprehensive compliance judgment result, the deterministic advantage of the rule engine in checking hard indicators and the ability of the large language model to understand complex semantic clauses can be taken into account. This avoids the omission of hard rules such as missing essential clauses, invalid clauses, and subject qualifications, while also being able to handle semantically ambiguous contract clauses, thereby improving the rigor and comprehensiveness of the audit results.
[0020] Furthermore, by distributing multiple target text fragments simultaneously for parallel processing through a parallel task distribution mechanism, the problem of time consumption in processing long contract texts by large language models can be solved, significantly improving the overall processing efficiency of contract auditing.
[0021] Furthermore, by receiving user-defined position parameters to identify the user's role in the text to be audited, and by vectorizing and storing user-defined unstructured review rules for semantic retrieval and matching during auditing, and combining position parameters and matched personalized review rules to perform risk rating on target text fragments, it is possible to dynamically adjust risk assessment strategies based on the user's different roles in the contract. This allows the same clause to output differentiated risk levels for users with different positions, meeting the needs of different contract parties with different risk concerns in actual business.
[0022] Furthermore, by performing reverse semantic consistency verification on the forward inference conclusions output by the large language model, including reversing the forward conclusions to construct reverse verification prompts to obtain a set of legal conditions, performing semantic alignment matching between each condition and the target text segment to determine the satisfaction status, and calculating the consistency score based on the condition satisfaction status and weighting and fusing it with the positive confidence score to obtain the final confidence score, a closed-loop verification path of "forward judgment - reverse questioning - cross-verification" can be constructed. This significantly reduces the false alarm rate caused by the illusion of the large language model, while generating an interpretable evidence chain containing both forward and reverse inference paths, thereby improving the credibility and interpretability of the audit conclusions.
[0023] Furthermore, by using a large language model to decompose the target text fragment into a structured representation of multiple semantic sub-layers such as the subject layer, behavior layer, condition layer, and responsibility layer before compliance retrieval, and independently vectorizing and encoding each semantic sub-layer, the first priority channel retrieval is performed using the responsibility layer sub-vector, the second priority channel retrieval is performed using the combined vector of the behavior layer and the responsibility layer, and the third priority channel fallback retrieval is performed using the overall vector. Then, the results of each channel are deduplicated and merged, and the relevance score of the results with repeated hits in multiple channels is improved. This can avoid the problem of key violation signals being diluted by information from other semantic layers when composite semantic clauses are vectorized as a whole, ensuring that the responsibility layer semantics most relevant to compliance determination are focused on for retrieval. At the same time, the integrity of the retrieval results is guaranteed by the multi-channel fault tolerance mechanism and full-text fallback matching, which significantly improves the retrieval recall rate of key legal basis. Attached Figure Description
[0024] Figure 1 This is a schematic diagram of an AI-based text compliance auditing method according to an embodiment of this application. Detailed Implementation
[0025] In the following description, numerous technical details are presented to enable the reader to better understand this application. However, those skilled in the art will understand that the technical solutions claimed in this application can be implemented even without these technical details and various variations and modifications based on the following embodiments.
[0026] Example 1 This embodiment provides an artificial intelligence-based text compliance auditing method, the overall process of which is as follows: Figure 1 As shown, the process mainly includes three stages: knowledge base construction, compliance retrieval, and compliance determination. The knowledge base construction stage involves multi-dimensional preprocessing and vectorized storage of legal knowledge; the compliance retrieval stage performs semantic matching between the text to be audited and the knowledge base; and the compliance determination stage conducts compliance analysis on the text based on the retrieved legal evidence. The following section uses contract text compliance auditing as an application scenario to explain the specific steps of each stage in detail.
[0027] Step 101, Knowledge Base Construction Phase – Legal Provision Acquisition and Multi-Dimensional Semantic Expansion Processing.
[0028] First, the system obtains a set of legal provisions in the legal field. In this embodiment, the sources of the legal provisions set include texts of laws and regulations such as the Contract Law section of the Civil Code of the People's Republic of China, the Labor Contract Law of the People's Republic of China, and the Bidding Law of the People's Republic of China. The system reads the electronic texts of the above-mentioned laws and regulations through a document parsing engine, and segments them according to "articles" as the basic unit to obtain a structured set of legal provisions. For example, Article 577 of the Civil Code is extracted as an independent legal provision record, containing fields such as article number, the name of the relevant law, and the original text of the article.
[0029] Then, for each legal provision in the legal provision set, multi-dimensional semantic augmentation processing is performed using a large language model. In this embodiment, a large language model is used, such as DeepSeek or other large language models with equivalent text generation capabilities (such as Doubao, Qwen, etc.), which is accessed through API calls or local deployment. The multi-dimensional semantic augmentation processing includes the following three aspects.
[0030] Firstly, the system generates application scenario text semantically related to the legal provision. This application scenario text expresses the behavioral situations regulated by the legal provision in a concrete factual description manner, transforming abstract legal norms into specific scenario descriptions closely aligned with actual business operations. Specifically, the system sends the following prompt to the large language model: "Please generate two specific application scenarios based on the following legal provision, presenting the behavioral situations regulated by this provision in a factual description manner. The scenario description should include specific subjects, behaviors, and consequences, and the language style should closely resemble actual commercial contract situations. Legal provision: {Original text}". The large language model outputs the application scenario text based on this prompt. For example, regarding Article 577 of the Civil Code (the clause on liability for breach of contract), the application scenario text generated by the large language model is as follows: "A supplier signed a raw material supply contract with a manufacturing enterprise, agreeing to deliver 500 tons of steel of a specified specification before the 15th of each month. Due to its own production scheduling reasons, the supplier delayed delivery by 6 days, causing the manufacturing enterprise's production line to be forced to stop, resulting in a direct economic loss of 800,000 yuan." This scenario text describes the breach of contract and its consequences with specific facts, forming a semantic bridge with the abstract expression in the legal provision of "failure to perform contractual obligations or performance of contractual obligations not in accordance with the agreement."
[0031] Secondly, the system generates a simplified interpretation of the legal provision. The system sends a prompt to the large language model: "Please interpret the following legal provision in plain and easy-to-understand language, avoiding legal jargon, so that business people without a legal background can also understand its meaning. Legal provision: {Original text}". The large language model outputs the interpretation. For example, for Article 577 of the Civil Code, the generated interpretation is: "Once a contract is signed, the parties must act as agreed. If one party fails to do so, the other party may demand that the other party continue to perform, take remedial measures, or compensate for the losses caused thereby. These three liabilities can be claimed individually or together." Thirdly, key terms are extracted from the legal provisions. The system sends a prompt to the large language model: "Please extract the core legal terms from the following legal provisions, each term separated by a comma. Legal provisions: {original text}". For example, for Article 577 of the Civil Code, the extracted key terms are: "liability for breach of contract, specific performance, remedial measures, compensation for losses, contractual obligations". It should be noted that key term extraction can also be achieved using traditional natural language processing algorithms such as TF-IDF and TextRank; the large language model approach is merely a preferred implementation in this embodiment.
[0032] The above three aspects of processing are applied to each legal provision in the legal text set one by one, ultimately enabling each legal provision to be expanded into related application scenario texts, popular interpretation texts, and key terms.
[0033] Step 102, Knowledge Base Construction Phase – Multidimensional Vector Index Construction and Storage.
[0034] After completing the multi-dimensional semantic augmentation process in step 101, the system vectorizes the original text, application scenario text, interpretation text, and key terms of each legal provision. In this embodiment, the vectorization process uses a pre-trained text embedding model, such as the BGE-Large-zh model, which maps text to a dense vector representation of 1024 dimensions. Those skilled in the art can also choose other text embedding models, such as text-embedding-ada-002 (outputting a 1536-dimensional vector), M3E, Sentence-BERT, etc., with the vector dimension selected between 768 and 1536 dimensions; this invention does not limit this selection.
[0035] Specifically, for each legal provision, the system encodes the following four types of text using an embedding model: original legal provision text generating original text vector. Application scenarios: text generation, scenario vectors To simplify the interpretation of text and generate interpretation vectors Key terms are concatenated to generate term vectors. These four vectors together constitute the multi-dimensional representation of the legal provision in vector space.
[0036] The system constructs a multidimensional vector index containing multiple semantic dimensions based on the aforementioned vectors and stores it in a vector database. In this embodiment, the vector database is ChromaDB, but those skilled in the art can also choose other vector databases such as Milvus, Pinecone, Weaviate, and FAISS. In the vector database, the four vector indexes corresponding to each legal provision are respectively labeled with their dimension type identifiers, namely "original," "scenario," "interpretation," and "keyword," so that dimensions can be specified for targeted retrieval or cross-dimensional fusion retrieval during subsequent searches. In this embodiment, the above four types of vectors and their metadata for each legal provision are encapsulated into a knowledge node. The data structure of the knowledge node includes: a unique identifier (node_id), a source legal provision number (source_article_id), a dimension type identifier (dimension_type), vector data (embedding), and original text content (text_content). The source legal provision number in this knowledge node serves as an association identifier, linking vectors of different dimensions of the same legal provision together.
[0037] At this point, the knowledge base construction phase is complete. Taking the Contract Law section of the Civil Code as an example, assuming it contains approximately 200 legal provisions, after the above processing, the vector database will store approximately 800 knowledge nodes (each legal provision corresponds to a node in four dimensions), forming a multi-dimensional vector index covering the four semantic dimensions of original text, scenario, interpretation, and terminology.
[0038] Step 103, Compliance Retrieval Stage – Acquisition of Target Text Fragments and Semantic Similarity Retrieval.
[0039] During the compliance retrieval phase, the system first obtains the target text fragments from the text to be audited. In this embodiment, the text to be audited is a contract document in PDF or Word format. The system reads the contract text content using a document parsing engine (e.g., using Python's pdfplumber library to parse PDF files, or using the python-docx library to parse Word files), and segments it according to the natural segmentation of the contract clauses, treating each independent clause as a target text fragment. For example, a procurement contract containing 50 clauses is parsed into 50 target text fragments.
[0040] Then, the system vectorizes each target text fragment, using the same text embedding model as in step 102 (such as BGE-Large-zh), encoding the target text fragment into a vector representation with the same dimension as the knowledge base. .
[0041] Next, the system uses As the query vector, semantic similarity is retrieved within the multidimensional vector index constructed in step 102. Semantic similarity is measured using cosine similarity, calculated using the following formula: ,in This represents the vector of each knowledge node in the knowledge base. The system searches across all dimensions of the multidimensional vector index and returns the top K knowledge nodes by similarity score as the search results. The value of K can range from 3 to 10, and in this embodiment, K=5 is preferred. The search results include the matched legal provisions and their associated derived texts (i.e., application scenario texts, interpretation texts, etc. associated with the legal provisions). This content is obtained by tracing back through the source legal provision number in the knowledge node.
[0042] It should be noted that the cosine similarity described above is only a preferred similarity measurement method in this embodiment. Those skilled in the art can also use other vector similarity measurement methods such as Euclidean distance and inner product. In addition, when the knowledge base is large, approximate nearest neighbor (ANN) algorithms (such as HNSW, IVF, etc.) can be used to accelerate the retrieval process.
[0043] Step 104, Compliance Determination Stage – Compliance Determination and Result Output Based on Large Language Model.
[0044] During the compliance determination phase, the system uses the search results obtained in step 103 as context, and inputs them together with the target text fragment into the large language model. The large language model then performs a compliance determination on the target text fragment and outputs the determination result.
[0045] Specifically, the system constructs a prompt word input large language model with the following structure: "You are a professional legal compliance audit expert. Please conduct a compliance analysis of the contract terms to be audited based on the legal basis provided below."
[0046] [Legal Basis]: {Retrieved legal provisions and derived texts} [Pending Review Clause]: {Original Target Text Fragment} Please provide the following: 1) Risk level (high risk / medium risk / low risk / compliant); 2) Basis for judgment (referenced legal provisions and reasons for analysis); 3) Suggested modifications (if risks exist, provide specific modification plans). Based on the legal context provided in the aforementioned prompts, the large language model performs compliance analysis and reasoning on the target text fragment, outputting a structured judgment result. For example, regarding the clause under review, "If Party B delivers goods late, it shall not bear any liability," after obtaining Article 577 of the Civil Code and its associated violation scenario description in the context, the large language model outputs the judgment result as: Risk level "High Risk," Judgment basis "This clause stipulates that Party B shall not bear liability for late delivery, which violates the mandatory provisions of Article 577 of the Civil Code regarding liability for breach of contract, and is an invalid exemption clause," and the modification suggestion "This exemption clause should be deleted, or modified to 'If Party B delivers goods late, it shall pay Party A a penalty of 0.05% of the total contract price per day.'"
[0047] After the system processes each target text fragment in the audit document using steps 103 and 104, it summarizes the judgment results of all clauses and generates a structured compliance audit report. The audit report includes contract overview information, risk level distribution of each clause, detailed analysis of high-risk clauses, and modification suggestions, and is output in Markdown or HTML format.
[0048] Steps 101 to 104 described above constitute the complete technical solution of this embodiment. Those skilled in the art can follow these four steps to achieve a complete audit process, from the multi-dimensional construction of a legal knowledge base to the semantic retrieval of contract terms, and finally to compliance determination based on a large language model. Several optional improvements to this solution are described below.
[0049] In some optional implementations, the application scenario text generated in step 101 can be further subdivided into two types: compliant example scenario text and non-compliant example scenario text. Specifically, when the system sends the prompt words for generating application scenarios to the large language model, it explicitly requires the generation of one "compliant example" and one "non-compliant example." The compliant example scenario text describes specific factual situations that conform to the provisions of the law. For example, for a breach of contract clause, a compliant example would be "the supplier voluntarily assumes liquidated damages and takes remedial measures after delaying delivery." The non-compliant example scenario text describes specific factual situations that violate the provisions of the law. For example, "the supplier stipulates in the contract that it does not need to bear any responsibility for overdue delivery." With this distinction, during the retrieval process in step 103, the potential non-compliant content in the clauses under review can form a stronger semantic match with the "non-compliant example scenarios" in the knowledge base, thereby further improving the accuracy of the retrieval. It should be noted that the above distinction between compliant and non-compliant example scenarios is not a necessary condition for implementing this method. Without making this distinction, the comprehensive application scenario text generated in step 101 can also support the subsequent retrieval and judgment process.
[0050] As a preferred but not mandatory improvement, step 103, when performing semantic similarity retrieval in the multidimensional vector index, can employ a dimensional priority retrieval strategy. Specifically, the system prioritizes retrieval in the vector index corresponding to the application scenario text, setting the matching priority of scenario-dimensional retrieval results higher than that of original text-dimensional retrieval results. This is implemented as follows: the system first... The search retrieves Top-K results for the "scenario" dimension from knowledge nodes with the "interpretation" dimension; then, it retrieves Top-K results for the "interpretation" dimension from nodes with the "original" dimension; finally, it searches the "original" dimension as a supplement. When merging and ranking the multi-dimensional search results, results matching the scenario dimension are given higher weight (e.g., their similarity scores are multiplied by a weighting coefficient of 1.2), making them more likely to rank higher in the final merged ranking. Furthermore, in this preferred scheme, each dimension vector corresponding to each legal provision in the multi-dimensional vector index constitutes a knowledge node. Each knowledge node contains a source provision association identifier (i.e., the aforementioned `source_article_id` field), allowing the retrieval of any dimension's vector to trace back to the corresponding original legal provision and all its derived texts through this association identifier. It should be noted that even without employing the above-mentioned dimensional priority retrieval strategy, the unified retrieval method across all dimensions described in step 103 can also achieve the technical objective of this method. In addition to the dimensional priority strategy, those skilled in the art can also adopt an adaptive strategy that dynamically adjusts the weight of each dimension based on the query text type, or use a method of retrieval with equal weight for each dimension and then merging the results.
[0051] Example 2 This embodiment improves the audit architecture of the compliance determination stage based on Embodiment 1. It introduces a hybrid compliance check engine that executes deterministic rule checks and semantic compliance determination in parallel, and further achieves simultaneous processing of multiple target text fragments through a parallel task distribution mechanism. The knowledge base construction stage and compliance retrieval stage of this embodiment are the same as those of Embodiment 1. The following focuses on describing the improved compliance determination stage.
[0052] In this embodiment, the system executes two processing paths in parallel for each target text segment during the compliance determination phase: one is a deterministic rule checking path, and the other is a semantic compliance determination path based on a large language model. The two paths run independently and do not block each other, and finally the results are fused together.
[0053] The deterministic rule-based inspection path performs hard-metric checks on the target text fragment using pre-defined rule logic. In this embodiment, the pre-defined rule logic is stored in the system's rule base as a set of rules. Each rule contains five fields: rule number, applicable contract type, matching pattern, risk level, and legal basis. The matching pattern of the rule is implemented using regular expressions or a keyword list. The hard-metric checks include the following three categories.
[0054] The first category is the check for missing essential clauses based on contract type. The system loads a list of essential clauses for the contract type (e.g., procurement contract, employment contract, lease contract, etc.) from the rule base. For example, the essential clauses list for a procurement contract includes "name and specifications of the subject matter," "quantity," "price or remuneration," "performance period, place and method," "liability for breach of contract," and "dispute resolution method." The system iterates through all target text fragments, using keyword semantic matching to determine if clauses covering the above essential elements exist. Missing essential clauses are marked as "missing" and a corresponding risk warning is generated.
[0055] The second category involves identifying invalid clauses based on predefined keyword patterns. The system pre-defines a set of clause expression patterns in its rule base that correspond to those explicitly prohibited or restricted by law. For example, the rule "The final interpretation right belongs to Party A" is matched using the regular expression "The final interpretation right.* belongs to.*". Once matched, it is directly marked as a high-risk invalid clause and associated with the legal basis Article 497 of the Civil Code regarding the invalidity of standard form clauses. Similarly, the rule "either arbitration or litigation" matches dispute resolution clauses in contracts that simultaneously stipulate arbitration and litigation, and upon matching, it is marked as high-risk, associated with Article 26 of the Arbitration Law.
[0056] The third category is entity qualification verification based on preset rules. The system extracts the name information of the contracting entity from the contract text and checks whether it meets the requirements for legal person status format (e.g., whether it contains legal organizational form suffixes such as "Limited Company" or "Joint-Stock Company"), or whether it matches a known list of dishonest entities.
[0057] In parallel with the deterministic rule checking path, the system simultaneously executes the semantic compliance determination path based on the large language model. The processing flow of this path is consistent with the compliance retrieval process described in step 103 and the compliance determination process described in step 104 of Example 1.
[0058] After both paths are completed, the system merges the results of the deterministic rule check with the semantic compliance determination to generate a comprehensive compliance determination result for each target text fragment. The fusion strategy is as follows: if a clause is marked as high-risk by both the rule path and the semantic path, the final comprehensive result is high-risk (confirmed); if it is marked as high-risk by only one path, the comprehensive result is high-risk (pending review); if the determination results of the two paths conflict (e.g., the rule path marks it as compliant while the semantic path determines it as medium-risk), the higher risk level is taken, and the analysis conclusions of both paths are displayed in the report for legal personnel to refer to.
[0059] In this embodiment, the text to be audited typically contains multiple target text fragments (i.e., multiple contract clauses). To improve audit efficiency, the system distributes multiple target text fragments simultaneously to the aforementioned dual-path processing flow for parallel processing through a parallel task distribution mechanism. Specifically, the system uses a thread pool (ThreadPoolExecutor) to implement concurrency control. The size of the thread pool is set according to available computing resources; in this embodiment, it is set to 8 worker threads. The system encapsulates all target text fragments into independent task objects and submits them to the thread pool. Each task executes two paths in parallel in an independent thread: deterministic rule checking and semantic compliance judgment. After all tasks are completed, the system summarizes the comprehensive compliance judgment results of all target text fragments, arranges them in descending order of risk level, and generates a structured audit report. The audit report includes basic contract information, a risk statistics summary, detailed audit conclusions for each clause (including risk level, judgment basis, legal references, and modification suggestions), and a list of missing essential clauses. Those skilled in the art can also use a process pool (ProcessPoolExecutor) or an asynchronous coroutine mechanism based on asyncio to replace the thread pool for parallel processing. This invention does not limit the specific implementation form of the parallel mechanism.
[0060] This embodiment's hybrid compliance inspection engine combines the determinism of a rule engine with the semantic understanding capabilities of a large language model. For clauses explicitly prohibited by law (such as "final interpretation right," "either arbitration or litigation," etc.), deterministic rules can directly identify them with extremely high accuracy, without relying on large language model reasoning, thus avoiding potential missed detections by the model. For clauses with complex semantics and ambiguous expressions, the semantic analysis capabilities of the large language model can compensate for the shortcomings of rule matching. The parallel task distribution mechanism enables contracts containing 50 to 100 clauses to be fully audited within seconds to tens of seconds, improving efficiency by approximately 5 to 8 times compared to serial processing methods.
[0061] Example 3 This embodiment, building upon Embodiment 1, introduces a dynamic risk assessment mechanism based on user perspective, enabling the system to dynamically adjust review standards and risk ratings according to the user's role in the contract. The knowledge base construction phase of this embodiment is the same as in Embodiment 1; the following focuses on describing the newly added perspective awareness and dynamic assessment process.
[0062] First, the system receives user-defined position parameters. These position parameters identify the user's role in the text to be audited, such as "Party A" (buyer / procurator / principal) or "Party B" (seller / supplier / contractor). Position parameters are entered through the system's user interface and stored as structured fields, including the user's name (e.g., "XX Technology Co., Ltd.") and role identifier (e.g., "Party A" or "Party B"). The introduction of position parameters allows for differentiated risk assessment results for the same contract from different user perspectives.
[0063] Secondly, the system obtains user-defined unstructured review rules. These unstructured review rules refer to personalized review standards described by the user in natural language, such as "payment period shall not exceed 60 days," "penalty rate shall not exceed 30% of the total contract price," and "warranty period shall not be less than 24 months." These rules differ from the pre-defined deterministic rules in Example 2—they are non-standardized natural language expressions and cannot be directly matched using regular expressions. The system vectorizes these unstructured review rules and stores them in an independent rule vector index, using the same text embedding model as in step 102.
[0064] During the compliance assessment phase, when assessing the compliance of each target text fragment, in addition to executing the legal knowledge base retrieval and assessment process described in steps 103 to 104 of Example 1, the system also simultaneously performs semantic retrieval on the target text fragment within the vector index corresponding to the unstructured review rules to obtain personalized review rules that are semantically relevant to the clause. For example, for the clause "Party A shall complete payment within 90 days of receiving the invoice," the system retrieves the user-defined rule "Payment period shall not exceed 60 days" from the rule vector index, with a semantic similarity score of 0.87, and determines it to be a match.
[0065] Finally, the system combines positional parameters and the applied personalized review rules to assess the risk of the target text fragment. The logic of dynamic risk assessment is as follows: the system determines whether the clause is beneficial or detrimental to the user based on their role and adjusts the risk score accordingly. For example, regarding the clause "the penalty for breach of contract is 20% of the total contract price," if the user's position is Party A (the rights holder), this penalty clause is favorable to Party A, and the system assesses it as low risk. If the user's position is Party B (the obligations holder), this penalty percentage may be too high. The system, combined with the applied personalized rule "the penalty percentage shall not exceed 30% of the total contract price," assesses it as medium risk, even though 20% does not exceed the user-set 30% limit. Considering Party B's risk-bearing position, the system still assesses it as medium risk and notes in the audit report that "this penalty clause places high pressure on Party B to fulfill its obligations; it is recommended to negotiate a reduction to 10%-15%." Through this mechanism, the same target text fragment is assigned different risk levels under different positional parameters, achieving personalized output of audit conclusions. When constructing the decision prompts for the large language model, the system injects the stance parameters and the personalized rules of the hit into the context, so that the large language model can fully consider the user's role perspective when performing compliance analysis.
[0066] This embodiment addresses the problem that traditional contract auditing tools, which employ uniform risk standards, cannot adapt to the needs of different user roles. By using vectorized storage and semantic retrieval of unstructured rules, the system can flexibly handle personalized review requests described by users in natural language without converting them into structured rule expressions, significantly lowering the barrier to entry for users.
[0067] Example 4 Based on Example 1, this embodiment introduces a bidirectional semantic consistency verification mechanism to the judgment conclusion output by the large language model in the compliance judgment stage, in order to reduce the risk of misjudgment caused by the "illusion" phenomenon of the large language model. The improvement of this embodiment focuses on the reverse verification process added after step 104.
[0068] In step 104 of Embodiment 1, the large language model outputs a positive reasoning conclusion (hereinafter referred to as the "positive reasoning conclusion") based on the retrieved legal context of the clause under review. This conclusion includes the risk level, a summary of the judgment basis, and the legal provision number cited. However, the large language model suffers from an "illusion" phenomenon, meaning that the model may still output a high-confidence risk judgment conclusion even when the retrieved legal basis and the clause under review are not sufficiently related. To automatically verify the reliability of the positive reasoning conclusion, this embodiment adds a bidirectional semantic consistency verification module (ConsistencyVerifier) after step 104. This module is only triggered to execute clauses marked as "high-risk" by the positive reasoning. The workflow of this module is described in detail below.
[0069] The first step is to construct a reverse verification prompt. After receiving the forward reasoning conclusion output in step 104, the ConsistencyVerifier module automatically constructs a reverse verification prompt. The construction rule for the reverse verification prompt is: take the inverse of the forward reasoning conclusion as the premise, and require the large language model to demonstrate the set of sufficient conditions required for the assumption to be valid. Specifically, the template for the reverse verification prompt is: "Assume the following contract clause is completely legal and valid: '{Original text of the clause to be reviewed}'. Please analyze: What specific conditions must this clause meet simultaneously to be legally valid? Please list these necessary conditions one by one and cite the relevant legal basis." For example, for the clause to be reviewed, "If Party B delivers the goods late, it shall not bear any responsibility," the forward reasoning conclusion is "High risk - invalid disclaimer clause." The reverse verification prompt then assumes that the disclaimer clause is legal and valid, and requires the model to analyze the conditions for its legal validity.
[0070] The second step is reverse reasoning. The aforementioned reverse verification prompts are input into the large language model, which outputs a set of legality conditions. For example, the model might output the following legal conditions: Condition 1: The disclaimer must be determined through negotiation between both parties on an equal and voluntary basis, and it is not a standard clause (according to Article 497 of the Civil Code); Condition 2: The type of liability involved in the disclaimer does not fall within the scope of liability mandated by law (according to Article 506 of the Civil Code); Condition 3: The disclaimer does not involve situations causing personal injury to the other party or property damage due to intentional or gross negligence.
[0071] The third step is condition-clause semantic alignment matching. The ConsistencyVerifier module performs semantic alignment matching between each condition in the set of legal conditions and the original text of the clause under review and its context in the contract. The matching process includes two steps: First, each legal condition and the clause under review are vectorized and encoded, and the cosine similarity is calculated as a reference indicator of semantic relevance; then, a large language model is used to judge each condition one by one, determining whether the text content of the clause under review and the contract context can satisfy the condition. The judgment result for each condition is one of three states: "satisfied", "not satisfied", or "cannot be determined". For example, for condition one, if the clause is located in the standard clauses section of the contract and there is no trace of negotiation, it is judged as "not satisfied"; for condition two, since the exempted liability is a breach of contract liability, it falls within the scope of mandatory legal provisions, and is judged as "not satisfied"; for condition three, if the contract context does not involve any relevant provisions on personal injury, it is judged as "cannot be determined".
[0072] The fourth step is the calculation of the consistency score and confidence level. Based on the matching results from the previous step, the system calculates the consistency score. The formula for calculating the consistency score is as follows: ,in The number of conditions for which the result is "satisfied" This represents the total number of valid conditions in the set of valid conditions. It should be noted that the formula above only includes conditions whose result is "satisfied". Conditions that result in "not satisfied" or "cannot be determined" are not included. The "Cannot be determined" status indicates that the contextual information of the current contract text is insufficient to confirm whether the condition is met. In the consistency score calculation, this is treated the same as "not met," meaning the clause under review fails to prove it meets the legality condition, thus leading to a higher consistency score and reflecting a conservative risk assessment strategy. The meaning of this score is: the more difficult it is for the clause under review to meet the conditions required for its "legality" (i.e., the fewer conditions are "met"), the more reliable the conclusion that "the clause is illegal" in the forward reasoning, and the higher the consistency score. In the example above, zero of the three conditions are determined to be "met," then... This indicates that the conclusions drawn from forward reasoning are highly reliable.
[0073] The system further weights and fuses the consistency score with the original confidence score of the forward inference to obtain the final confidence score. ,in The confidence level of the positive reasoning output (e.g., 0.9). The preset fusion coefficient has a value range of 0.4 to 0.8, and is preferably set in this embodiment. In the example above, .
[0074] The fifth step is to output the tiered results based on the final confidence level. The system outputs different levels of audit conclusions based on the range of values for [value]. When [value] is within the range of values for [value], [the system] will output different levels of audit conclusions. When a high-confidence risk conclusion is directly output and marked as "Confirmed Risk," the positive reasoning conclusion is presented in the audit report as the primary basis for judgment; when When a risk conclusion is reached and marked as "suspected risk," the report should include both forward and reverse reasoning paths as an interpretable chain of evidence for legal personnel to review; when If this happens, the risk level is lowered, marked as "manual review recommended," and the contradictions between the positive and negative reasoning results are recorded in the report. In the example above, The system marks the clause as "Confirmed Risk".
[0075] This embodiment constructs an automated illusion detection and correction mechanism by introducing a closed-loop verification path of "forward judgment - reverse questioning - cross-verification". In typical contract audit scenarios, the proportion of clauses marked as "high-risk" by forward reasoning usually does not exceed 15% of the total number of clauses. Therefore, this embodiment only triggers reverse verification for this small number of clauses, and the increased amount of large language model calls is controllable and will not significantly affect the overall audit efficiency. At the same time, the final audit report not only includes forward arguments of "why the clause is illegal", but also reverse analysis of "what conditions must be met for the clause to be legal, and whether they are actually met", enabling legal personnel to quickly understand and verify the reliability of the conclusions, significantly enhancing the credibility and interpretability of the audit system.
[0076] Example 5 This embodiment improves upon Embodiment 1 by introducing a hierarchical semantic stripping preprocessing mechanism and a multi-channel priority retrieval strategy to address the issue of key semantic information being diluted during the overall vectorization of complex contract terms. The improvements in this embodiment focus on the semantic stripping and hierarchical retrieval process added before semantic similarity retrieval in step 103 of Embodiment 1.
[0077] In step 103 of Embodiment 1, each target text fragment is vectorized and encoded as a whole for retrieval. However, actual contract terms are usually long sentences or paragraphs composed of multiple semantic elements, and their overall vector is an "averaged" representation of information at each semantic level, which may cause key violation signals to be diluted by other semantic information. To solve this problem, this embodiment adds a clause semantic decomposition module (ClauseSemanticDecomposer) before performing vectorized retrieval of target text fragments. This module decomposes each target text fragment into a structured representation of multiple semantic sub-layers and performs multi-channel retrieval based on the hierarchical vectors. The process is described in detail below.
[0078] The first step is four-layer semantic decomposition. The ClauseSemanticDecomposer module receives each independent target text fragment after contract parsing and decomposes it into a structured representation of four semantic sub-layers using a large language model: the Actor layer, the Action layer, the Condition layer, and the Consequence layer. The Actor layer records the rights and obligations of the parties involved in the clause; the Action layer records the core actions or events stipulated in the clause; the Condition layer records the preconditions or limiting conditions that trigger the clause's effectiveness; and the Consequence layer records the legal consequences or liability assumption methods stipulated in the clause. Semantic decomposition is achieved by sending structured extraction prompts to the large language model. The prompt template is: "Please decompose the following contract clauses into four semantic levels and output them in JSON format: Original clause: '{target text fragment}'. Output format: {"actor": "rights and obligations parties", "action": "core action description", "condition": "triggering condition", "consequence": "legal consequences / liability"}. For example, for the target text fragment "If Party B's delivery is delayed by more than 3 days, Party A has the right to terminate the contract without incurring any liability for compensation", the module outputs: actor is "Party B, Party A", action is "delivery delayed", condition is "more than 3 days", and consequence is "Party A has the right to terminate the contract without incurring any liability for compensation".
[0079] The second step is hierarchical vectorization encoding. The text content of the four semantic sub-layers output from the previous step is independently vectorized using the same text embedding model as in step 102, generating four sub-vectors: the main layer sub-vector. Behavioral layer subvectors Conditional layer subvectors and responsibility layer subvector At the same time, the overall vector representation of the original target text fragment is preserved. .
[0080] The third step is multi-channel priority retrieval. The system performs hierarchical retrieval within the multidimensional vector index constructed in step 102 of Example 1, employing a priority channel mechanism and executing three retrieval channels sequentially in the following order. The first priority channel is the responsibility layer matching channel, with... As a query vector, it searches within the "scenario" type node of the knowledge base, returning the top K1 results based on similarity. The design intent of this channel is that the responsibility layer is the key semantic layer for determining the compliance of clauses, directly corresponding to mandatory provisions in laws and regulations; prioritizing this search ensures that key legal grounds are not overlooked. The second priority channel is a behavior and responsibility combination matching channel, which will... and Vector concatenation is performed, and the concatenated vector is used as the query vector. The query is then performed within the "Interpretation" type node of the knowledge base, returning the top K2 results based on similarity. The combination of behavior and responsibility allows for more precise targeting of specific legal application scenarios. The third priority channel is a full-text catch-all matching channel, using... As a query vector, it searches all type nodes in the knowledge base and returns the top K3 results based on similarity, serving as a fallback mechanism to ensure that contextual information that may be fragmented in hierarchical matching is not overlooked. K1, K2, and K3 are preset search quantity parameters. The value of K1 ranges from 2 to 5, with K1=3 preferred in this embodiment; the value of K2 ranges from 1 to 3, with K2=2 preferred; and the value of K3 ranges from 1 to 3, with K3=2 preferred.
[0081] The fourth step is the deduplication and fusion of search results. The system merges the search results from the three channels and deduplicates them according to the unique identifier (node_id) of the knowledge nodes. For knowledge nodes that are repeatedly matched in multiple channels, the system improves their final relevance score. Specifically, if a knowledge node is matched in two channels, its final score is increased by 0.1 based on the original highest similarity score; if it is matched in all three channels, it is increased by 0.2. The deduplicated and fused results are sorted in descending order of final relevance score, and the top N results (N ranges from 5 to 10, preferably N=7) are used as the context for inputting the large language model for compliance judgment. In addition, in each search result, the system marks the source of the matched channel (such as "responsibility layer matching", "behavior + responsibility combination matching" or "full text matching"). This marking information will be written into the final report along with the audit conclusion, enabling legal personnel to trace "which semantic layer of the clause was retrieved because of this legal basis", enhancing the interpretability and traceability of the audit conclusion.
[0082] This embodiment significantly improves the retrieval recall rate of key legal bases by introducing semantic stripping preprocessing before vectorized retrieval, decomposing complex clauses with multiple interpretations into independent semantic sub-layers and employing a multi-channel priority retrieval strategy. In traditional overall vectorization schemes, the key violation signal "no liability for compensation" in the clause "If Party B's delivery is delayed by more than 3 days, Party A has the right to terminate the contract without incurring any liability for compensation" is diluted by other semantic information, resulting in a decrease in the matching degree of legal provisions related to "breach of contract exemption". This embodiment focuses and amplifies this violation signal through independent retrieval of the liability layer priority channel, pushing the relevant legal bases to the forefront of the search results. At the same time, the full-text catch-all matching of the third priority channel ensures that even if the hierarchical results of the semantic stripping module are not accurate enough on some complex clauses, the basic integrity of the search results can still be guaranteed, exhibiting good fault tolerance.
[0083] It should be noted that the search dimension range of each priority channel mentioned above is only a preferred implementation of this embodiment. Those skilled in the art can also search for nodes of all dimension types in each channel, or adjust the search dimension range of each channel according to actual needs.
[0084] Accordingly, one embodiment of this application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps in the above-described method embodiments. The computer-readable storage medium may include any type of volatile or non-volatile memory, or any combination thereof, storing computer program code. Specifically, the computer-readable storage medium may include, but is not limited to: magnetic storage devices (e.g., magnetic tape, hard disk, floppy disk), optical storage devices (e.g., optical disc (CD), digital versatile optical disc (DVD)), magneto-optical storage devices (e.g., magneto-optical disc), semiconductor memory (e.g., read-only memory (ROM), random access memory (RAM), electrically erasable programmable read-only memory (EEPROM), flash memory, etc.) or other storage technologies. In this application, the computer-readable storage medium refers to a non-transitory readable storage medium, excluding the transient propagation signal itself (e.g., modulated data signals, carrier waves, etc.).
[0085] Furthermore, one embodiment of this application provides an artificial intelligence-based text compliance auditing system, comprising: a memory and a processor. The memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the steps in the above-described method embodiments of this application. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM.
[0086] Furthermore, one embodiment of this application also provides a computer program product, including computer-executable instructions that, when executed by a processor, implement the steps in the above-described method embodiments.
[0087] It should be noted that the terms "first," "second," etc., used in this specification are only used to distinguish similar objects, and the elements defined by them do not necessarily require or imply any actual relationship or order between these elements, nor are they used to describe a specific order or sequence.
[0088] The phrase "execute according to a certain element" as used in this specification means at least according to that element, including both "execute only according to that element" and "execute according to that element and other elements".
[0089] Those skilled in the art will understand that variations of the above-described method steps can be obtained based on the embodiments disclosed in this application without any inventive effort. For example, the sequence numbers of the steps described in the method embodiments of this specification do not themselves constitute a limitation on the execution order of these steps. Unless there is an explicit specific limitation in the context, the steps may be executed in a different order than in the embodiments (e.g., the steps with larger sequence numbers are executed first, followed by the steps with smaller sequence numbers), or they may be executed in parallel. Furthermore, other steps may be inserted between multiple steps with consecutively numbered sequence numbers.
[0090] The above description is merely a specific embodiment of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application. Contents not described in detail in this specification belong to prior art known to those skilled in the art.
Claims
1. A text compliance auditing method based on artificial intelligence, characterized in that, include: In the knowledge base construction phase, a set of legal provisions in the legal field is obtained. For each legal provision in the set, the following multi-dimensional semantic expansion processing is performed using a large language model: at least one application scenario text is generated that is semantically associated with the legal provision, wherein the application scenario text expresses the behavioral situation regulated by the legal provision in the form of a specific fact description. Generate a simplified interpretation of the legal provisions; and extract key terms from the legal provisions; The original text of the legal provisions, the application scenario text, the interpretation text, and the key terms are vectorized respectively to construct a multi-dimensional vector index containing multiple semantic dimensions and store it in a vector database. Each semantic dimension vector index corresponds to the original text, the application scenario text, the interpretation text, and the key terms, and each vector index carries a dimension type identifier. In the compliance retrieval phase, target text fragments are obtained from the text to be audited, the target text fragments are vectorized, and semantic similarity retrieval is performed in the multidimensional vector index to obtain legal provisions that semantically match the target text fragments and their associated derived texts as retrieval results. In the compliance determination stage, the search results are used as context and input together with the target text fragment into the large language model. The large language model then performs a compliance determination on the target text fragment and outputs the determination result.
2. The method according to claim 1, characterized in that, The application scenario text includes compliant example scenario text and non-compliant example scenario text generated in response to the legal provisions. The compliant example scenario text describes specific factual situations that comply with the provisions of the legal provisions, and the non-compliant example scenario text describes specific factual situations that violate the provisions of the legal provisions.
3. The method according to claim 1, characterized in that, When performing semantic similarity retrieval in the multidimensional vector index, the retrieval is prioritized in the vector index corresponding to the application scenario text, and the matching priority of the retrieval results in the application scenario text dimension is set higher than that in the original text dimension. Each dimension vector corresponding to each legal provision in the multidimensional vector index constitutes a knowledge node, and each knowledge node contains a source provision association identifier, so that after retrieving a vector in any dimension, it is possible to trace back to the corresponding original legal provision.
4. The method according to any one of claims 1 to 3, characterized in that, The compliance determination stage further includes: performing deterministic rule checks and semantic compliance determination based on the large language model in parallel on the target text fragment; the deterministic rule checks perform hard indicator checks on the target text fragment through preset rule logic, and the hard indicator checks include at least one of the following: checking for missing essential clauses based on contract type, identifying invalid clauses based on predefined keyword patterns, and verifying the subject's qualifications based on preset rules; the results of the deterministic rule checks are fused with the results of the semantic compliance determination to generate a comprehensive compliance determination result for the target text fragment.
5. The method according to claim 4, characterized in that, The text to be audited contains multiple target text fragments. The method distributes the multiple target text fragments simultaneously through a parallel task distribution mechanism, performs the deterministic rule check and the semantic compliance determination in parallel on each target text fragment, and summarizes the comprehensive compliance determination results of all target text fragments to generate an audit report.
6. The method according to any one of claims 1 to 3, characterized in that, Also includes: Receive user-defined stance parameters, which are used to identify the user's role in the text to be audited; The system acquires user-defined unstructured review rules, vectorizes and stores these rules, and performs semantic retrieval on the target text fragment when determining its compliance. This retrieves the matched personalized review rules by performing a risk rating on the target text fragment based on the stance parameters and the matched personalized review rules. This allows the same target text fragment to be assigned different risk levels under different stance parameters.
7. The method according to any one of claims 1 to 3, characterized in that, In the compliance determination phase, a reverse semantic consistency check is performed on the forward reasoning conclusion output by the large language model. The reverse semantic consistency check includes: The positive reasoning conclusion is reversed as the premise, and a reverse verification prompt is constructed. The reverse verification prompt requires the large language model to output the set of legal conditions that must be satisfied for the premise to be true. Each condition in the set of legal conditions is semantically aligned and matched with the target text fragment and its context to determine whether the target text fragment satisfies each condition, thus obtaining the satisfaction status of each condition; A consistency score is calculated based on the satisfaction status of each condition in the set of legal conditions. The consistency score represents the degree of agreement between the forward reasoning conclusion and the reverse semantic consistency verification result. The fewer conditions in the set of legal conditions that are satisfied, the higher the consistency score. The consistency score and the confidence level of the forward reasoning conclusion are weighted and fused to obtain the final confidence level. Different levels of audit conclusions are output for the target text fragment according to the value range of the final confidence level.
8. The method according to any one of claims 1 to 3, characterized in that, In the compliance retrieval stage, semantic stripping preprocessing is performed on the target text fragment before hierarchical retrieval. The semantic stripping preprocessing and hierarchical retrieval include: The target text fragment is decomposed into a structured representation of multiple semantic sub-layers using a large language model. The semantic sub-layers include at least a subject layer, an action layer, a condition layer, and a responsibility layer. The text content of each semantic sub-layer is independently vectorized and encoded to generate a sub-vector corresponding to each semantic sub-layer. The first priority channel retrieval is performed in the multidimensional vector index using the sub-vector corresponding to the responsibility layer as the query vector. The sub-vector corresponding to the behavior layer and the sub-vector corresponding to the responsibility layer are combined to obtain a combined vector. The combined vector is used as the query vector to perform the second priority channel retrieval. The third priority channel fallback retrieval is performed using the overall vector of the target text fragment. The search results from each channel are deduplicated and merged. The relevance score of results that are repeatedly hit in multiple channels is improved, and the merged result is used as the search result.
9. A text compliance auditing system based on artificial intelligence, characterized in that, include: Memory is used to store executable instructions for a computer; as well as, A processor, coupled to the memory, is configured to implement the steps of the method as described in any one of claims 1 to 8 when executing the computer-executable instructions.
10. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium stores computer-executable instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1 to 8.