Contract risk identification method and device, equipment, storage medium and program product
By building a contract knowledge graph and using a pre-trained contract base model, key information is extracted and prompt words are constructed, the problem of difficult to establish upstream and downstream relationships in the contract data is solved, and the accuracy of contract compliance risk identification is improved.
Patent Information
- Application Number
- CN202411310926.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2024-12-27
AI Technical Summary
The prior art cannot accurately establish the relationship between upstream and downstream contract signing companies in contract data, resulting in low accuracy of contract risk identification results, especially when there is an entry error in the contract data.
By building a contract knowledge graph, a pre-trained contract base model is used to extract key information, and compliance risk identification is carried out based on the thinking chain and prompt words, the structured contract data and the accurate output of compliance risk results are achieved.
It improves the accuracy of contract compliance risk identification, solves the problem of low accuracy of contract risk identification results, and achieves more accurate compliance risk identification through structured data and large-scale models.
Smart Images

Figure CN119205338A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a contract risk identification method, apparatus, device, storage medium and program product. Background Art
[0002] In order to review the company's contract data, we take the contracts signed within the company as the starting point, establish a relevant contract linkage chain based on the contracts within the company, and then identify the risks of false trade based on the signing time, gross profit margin differences, etc. of the upstream and downstream contracts in the chain.
[0003] Currently, the data and information related to project contracts are mainly obtained through the business system, and the upstream and downstream contracts of the project are associated according to the project code; after the contract association is completed, the contract information obtained in the centralized contract system is parsed, and the counterparty information of the associated contract is associated. Due to the huge and complex contract data in the business system, it is impossible to establish an accurate association relationship between upstream and downstream contract signing companies through project coding, especially when there are input errors in the contract data, which will lead to structural information errors, and ultimately lead to low accuracy of the contract risk identification results. Summary of the invention
[0004] The main purpose of this application is to provide a contract risk identification method, device, equipment, storage medium and program product, aiming to solve the technical problem of low accuracy of contract risk identification results.
[0005] To achieve the above objectives, this application proposes a contract risk identification method, which includes:
[0006] Construct a contract knowledge graph of cooperative business in contract data;
[0007] Based on the pre-trained contract base model, key information of the contract data is extracted according to the thought chain and the contract knowledge graph;
[0008] Constructing prompt words according to the thought chain and the key information;
[0009] Based on the prompt words, questions are asked to the contract base big model to obtain the compliance risk results of the cooperative business of the contract data output by the contract base big model based on the prompt words.
[0010] In one embodiment, the step of constructing a contract knowledge graph of cooperative business compliance risks includes:
[0011] Based on the pre-trained contract base large language model, extract the entities, entity attributes and relationships of the contract data in the preset database;
[0012] The contract knowledge graph is constructed based on the entities, entity attributes and relationships of the contract data.
[0013] In one embodiment, before the step of extracting entities, entity attributes and relationships of contract data based on the pre-trained contract base large language model, the step further includes:
[0014] Acquire original contract data, and divide the original contract data into document segments;
[0015] Creating an index for each of the document fragments;
[0016] The document fragment and the index are used as contract data and stored in a preset database.
[0017] In one embodiment, the step of extracting key information of the contract data based on the pre-trained contract base model according to the thought chain and the contract knowledge graph includes:
[0018] Based on the pre-trained contract base model, the contractual relationship between contract data is extracted according to the thought chain of different scenarios and the contract knowledge graph;
[0019] Based on the contract association relationship, key information of the contract data is determined.
[0020] In one embodiment, the step of constructing prompt words according to the thought chain and the key information further includes:
[0021] Calling an enterprise query tool to query the enterprise relationship corresponding to the contract data;
[0022] The prompt words are constructed according to the enterprise relationship, the thought chain and the key information.
[0023] In one embodiment, before the step of constructing a contract knowledge graph of cooperative business compliance risks, the step further includes:
[0024] Obtain contract domain data and general domain data;
[0025] Pre-training is performed based on the contract domain data and the general domain data to obtain the contract base large language model.
[0026] In addition, to achieve the above purpose, the present application also proposes a contract risk identification device, which includes:
[0027] A construction module is used to construct a contract knowledge graph of cooperative business in contract data;
[0028] An extraction module, for extracting key information of the contract data based on the pre-trained contract base model, according to the thought chain and the contract knowledge graph;
[0029] A determination module, used for constructing prompt words according to the thought chain and the key information;
[0030] The identification module is used to ask questions to the contract base model based on the prompt words, and obtain the compliance risk results of the cooperative business of the contract data output by the contract base model based on the prompt words.
[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes a contract risk identification device, which includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the contract risk identification method described above.
[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the contract risk identification method described above are implemented.
[0033] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the contract risk identification method described above.
[0034] One or more technical solutions proposed in this application have at least the following technical effects:
[0035] Construct the contract knowledge graph of the cooperative business in the contract data; extract the key information of the contract data based on the thought chain and the contract knowledge graph based on the pre-trained contract base big model; construct prompt words based on the thought chain and key information; ask questions to the contract base big model based on the prompt words, and obtain the compliance risk results of the cooperative business of the contract data output by the contract base big model based on the prompt words. By establishing the contract knowledge graph, the contract data is structured, the contract knowledge graph is called based on the pre-trained contract base big model, and the compliance risk results are output based on the prompt words. By constructing prompt words, the contract base big model is used to identify the compliance risk results in the structured contract data, which improves the accuracy of the compliance risk result identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0038] Figure 1 A flowchart of the first embodiment of the contract risk identification method of this application is provided;
[0039] Figure 2 A structural diagram provided for the contract risk identification method of this application;
[0040] Figure 3 A flowchart of the second embodiment of the contract risk identification method of this application is provided;
[0041] Figure 4 This is a schematic diagram of the schema of the contract knowledge graph for this application;
[0042] Figure 5 A flowchart of the third embodiment of the contract risk identification method of this application is provided;
[0043] Figure 6 This is the workflow diagram of the large model Agent in the contract risk identification method of this application;
[0044] Figure 7 A schematic diagram of the thought chain for judging compliance risks of cooperative business in the contract risk identification method of this application;
[0045] Figure 8 This is a schematic diagram of the contract thinking chain in the contract risk identification method of this application;
[0046] Fig. 9 A flowchart of the fourth embodiment of the contract risk identification method of this application is provided;
[0047] Fig.10 This is a schematic diagram of the module structure of the contract risk identification device according to an embodiment of the present application;
[0048] Fig.11 This is a schematic diagram of the device structure of the hardware operating environment involved in the contract risk identification method in the embodiment of the present application.
[0049] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0050] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0051] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0052] The main solutions of the embodiments of the present application are: constructing a contract knowledge graph for cooperative businesses in contract data; extracting key information of contract data based on the thought chain and the contract knowledge graph based on the pre-trained contract base big model; constructing prompt words based on the thought chain and key information; asking questions to the contract base big model based on the prompt words, and obtaining the compliance risk results of the cooperative businesses of the contract data output by the contract base big model based on the prompt words.
[0053] In this embodiment, for ease of description, the following description is made with the contract risk identification device as the execution entity.
[0054] As the contract data in the business system is huge and complex, it is impossible to establish accurate relationships between upstream and downstream contract signing companies through project coding. Especially when there are input errors in the contract data, it will lead to structured information errors, and ultimately result in low accuracy of the contract risk identification results.
[0055] The present application provides a solution, which realizes the structuring of contract data by establishing a contract knowledge graph, calls the contract knowledge graph based on a pre-trained contract base model, and outputs compliance risk results based on prompt words. By constructing prompt words and using the contract base model to identify compliance risk results in structured contract data, the accuracy of compliance risk result identification is improved.
[0056] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a contract risk identification device, etc. The following takes the contract risk identification device as an example to illustrate this embodiment and the following embodiments.
[0057] Based on this, the present application embodiment provides a contract risk identification method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the contract risk identification method of the present application.
[0058] In this embodiment, the contract risk identification method includes steps S10 to S40:
[0059] Step S10, constructing a contract knowledge graph of cooperative business in the contract data.
[0060] It should be noted that the contract knowledge graph is a contract knowledge graph specifically constructed for contract data. This embodiment solves the problem of being unable to establish accurate upstream and downstream associations of contracts by constructing a contract knowledge graph. Optionally, the contract knowledge graph includes associations between contract data. For example, the associations include associations between contracts and projects, and construction relationships between customers and contracts.
[0061] Step S20, based on the pre-trained contract base model, extract key information of the contract data according to the thought chain and the contract knowledge graph.
[0062] It should be noted that the pre-trained contract base model refers to a large-scale natural language processing (NLP) model that is pre-trained on a large amount of contract data. The model is usually based on deep learning technology, especially the Transformer architecture, which can understand and process natural language text.
[0063] At the same time, the pre-trained contract base model is a contract base model based on hundreds of billions of parameters trained using contract data. The pre-trained contract base model has a large number of parameters, which are constantly adjusted during the training process to better understand and generate text. The number of parameters usually reaches hundreds of millions or even billions.
[0064] The pre-trained Contract Base large model is specially trained for contract texts and has advantages in processing contract-specific terms, structures, and legal language. The pre-trained model can be fine-tuned on a specific task, that is, based on the pre-training, the model is further trained using data from a specific task to improve its performance on that task. The model is able to understand the terms, conditions, responsibilities, obligations, etc. in the contract text, and can identify key information in the contract, such as the contracting parties, amounts, dates, deadlines, etc. In addition to understanding the contract text, the pre-trained Contract Base large model is also able to generate text, such as automatically filling in contract templates, generating contract summaries, or proposing amendments. The model can perform a variety of contract-related tasks, including but not limited to contract content extraction, compliance checking, risk assessment, and contract negotiation support.
[0065] In this embodiment, the thinking chain is input into the pre-trained contract base model through the Agent, and the contract base model calls the contract knowledge graph to extract the key information of the contract data. Among them, the agent is an autonomous system or entity that can perceive the environment, make decisions and perform actions. Optionally, the thinking chain can be a thinking chain in different scenarios, such as a compliance risk scenario.
[0066] Optionally, key information may include the following information: Contract entity information, including the contracting parties (Party A and Party B), the companies or individuals involved, the intermediary or witness of the contract, etc. Contract terms, involving specific terms of the contract, such as price, payment terms, delivery time, liability for breach of contract, guarantees and warranties, etc. Transaction details, including the specific content of the transaction, transaction amount, payment method, delivery location and time, etc. Contract date, the signing date, effective date, performance period and any relevant deadlines of the contract. Affiliated relationships, the affiliated relationships between the contracting parties, such as parent-subsidiary relationship, cross-holding of equity, common directors or managers, etc. Legal and regulatory requirements, laws, regulations, industry standards or internal policies related to the contract, etc. Risk indicators, factors that may indicate compliance risks, such as abnormal transaction patterns, unreasonably low or high prices, terms that do not conform to market norms, etc. Historical transaction records, historical transaction records between related parties, used to identify transaction patterns and potential risk signals. External information, information that may affect contract compliance, such as the credit record, legal litigation history, regulatory penalty record, etc. of the parties involved.
[0067] Optionally, the key information may also include the relationship between contracts, for example, the relationship between upstream and downstream contracts.
[0068] Step S30, constructing prompt words according to the thought chain and the key information.
[0069] It should be noted that the prompt words are used to guide or stimulate the pre-trained contract base model to perform specific thinking, reasoning or generation tasks. Figure 2 As shown, the agent inputs prompt words into the pre-trained contract base model, where the prompt words include tools, thought chains, and key information. Figure 2 The overall architecture diagram includes several modules: "Contract preprocessing", "Pre-training contract base model", "Building contract knowledge graph" and "Agent model thinking chain".
[0070] Optionally, step S30 also includes: based on the pre-trained contract base large model, according to the thinking chain of different scenarios and the contract knowledge graph, extracting the contract association relationship between the contract data; according to the contract association relationship, determining the key information of the contract data. The enterprise letter interface is used to obtain the association information between enterprises, that is, the enterprise relationship, and the time difference and gross profit margin are calculated in combination with the signing time and amount of the upstream and downstream contracts. These calculation results provide an important basis for judging the compliance risks of cooperative business. For example, if the signing time is similar and the gross profit margin is abnormally low, or there are circular transactions, these may be signals of compliance risks in cooperative business.
[0071] Step S40, asking questions to the contract base big model based on the prompt words, and obtaining the compliance risk results of the cooperative business of the contract data output by the contract base big model based on the prompt words.
[0072] In this embodiment, the capabilities of the big model Agent are utilized to construct prompt words, call multiple tools, and ask questions to the contract base big model. The contract base big model returns the compliance risk results of the cooperative business of the contract data based on the prompt words.
[0073] Optionally, compliance risk results include the existence or non-existence of prohibition on business between enterprises with specific interests, the existence or non-existence of prohibition on conducting abnormal business that goes against common sense in transactions, and the existence or non-existence of prohibition on artificially adding unnecessary transaction links in the trade process.
[0074] In the technical solution of this embodiment, a contract knowledge graph of cooperative business in contract data is constructed; based on the pre-trained contract base large model, key information of contract data is extracted according to the thought chain and contract knowledge graph; prompt words are constructed according to the thought chain and key information; questions are asked to the contract base large model based on the prompt words, and compliance risk results of cooperative business of contract data output by the contract base large model based on the prompt words are obtained. By establishing a contract knowledge graph, contract data is structured, the contract knowledge graph is called based on the pre-trained contract base large model, and compliance risk results are output based on the prompt words. By constructing prompt words, the contract base large model is used to identify compliance risk results in structured contract data, thereby improving the accuracy of compliance risk result identification.
[0075] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , step S10 further includes:
[0076] Step S11, extracting entities, entity attributes and relationships of contract data in a preset database based on a pre-trained contract base large language model;
[0077] Step S12, constructing the contract knowledge graph based on the entities, entity attributes and relationships of the contract data.
[0078] Optionally, use the contract base model and / or natural language processing model to extract and expand entities, entity attributes and relationships in the contract fragment data. For example, identify key information such as contract number, date, amount, etc. in the text, the relationship between the contract and the project, and the construction relationship between the customer and the contract. Build a contract knowledge graph, convert unstructured contract data into structured data, extract key information, remove duplicate records, correct errors and inconsistencies, and handle missing values to ensure the quality and performance of the graph.
[0079] The schema of the contract knowledge graph, where schema refers to the data model of the graph. The schema of the contract knowledge graph defines the types of entities in the graph, the relationships between entities, and the properties of these relationships. In simple terms, the schema provides a structured framework for the contract knowledge graph so that the information in the graph can be effectively organized and queried. The schema of the contract knowledge graph usually contains the following key components:
[0080] Entity types define the different categories of entities that can exist in a graph. In a contract knowledge graph, entities may include individuals, organizations, products, services, contract terms, dates, amounts, etc.
[0081] Relationship types define the various connections between entities. For example, a Signed relationship might connect a Contract entity to the individual or organization entity that signed the contract. Attributes define specific characteristics that entities and relationships can have. For example, a Contract entity might have attributes such as Contract Number, Signed Date, Contract Amount, etc.
[0082] Constraints and rules define restrictions between entities and relationships to ensure that the data in the graph is consistent and accurate. For example, it can be stipulated that each contract must have a unique contract number.
[0083] Data types define data types for entity attributes, such as strings, dates, numbers, etc. Indexes: To improve query efficiency, the schema may define which entity attributes should be indexed.
[0084] Inheritance and Classification. In some cases, a schema may allow the definition of an inheritance structure of entities, where some entity types are subtypes of other types.
[0085] For example, the schema of the contract knowledge graph is as follows: Figure 4 As shown, the schema of the contract knowledge graph defines the node types and edge types, imports the preprocessed data into the Neo4j graph database, and uses Cypher query statements to retrieve and obtain data.
[0086] Optionally, regularly import new contract data, update entity and relationship information, continuously optimize entity recognition and relationship extraction based on user feedback and business needs, and monitor system performance to ensure query response time and data processing efficiency.
[0087] In a feasible embodiment, before step S11, it also includes: obtaining original contract data, and dividing the original contract data into document fragments; establishing an index for each of the document fragments; using the document fragments and the index as contract data, and storing them in a preset database to obtain structured contract data.
[0088] Before building the contract knowledge graph, it also includes: obtaining contract data and preprocessing the contract data. Preprocessing contract data mainly includes data cleaning, contract segmentation and contract storage to ensure the quality and consistency of the data and lay a solid foundation for subsequent analysis.
[0089] The purpose of data cleaning is to remove irrelevant information in the contract text, retain valuable data, ensure the quality and consistency of the contract data, and provide an accurate basis for subsequent segmentation and storage, which is helpful for the subsequent retrieval and generation process. Data cleaning mainly includes the following aspects: noise removal, including: deleting headers, footers, page numbers and other non-text elements in the contract text; text cleaning, including: removing extra spaces, line breaks, invisible characters, etc., to ensure the neatness of the text; text correction, including: correcting errors in the text, including spelling errors, grammatical errors and improper use of punctuation, etc.; format unification, including: converting the contract text into a unified TXT (Plain Text Format) format for subsequent processing.
[0090] Contract segmentation is to divide the contract data into smaller paragraphs or chapters, each of which contains a certain number of words or sentences. The purpose is to improve retrieval efficiency and generation quality, so that the subsequent large model can perform more detailed analysis. Each segmented part should maintain integrity and coherence as much as possible to facilitate understanding of the context, improve retrieval efficiency and generation quality. Contract segmentation mainly includes the following aspects: segmentation by paragraph, dividing the contract text into natural paragraphs, and each paragraph is treated as an independent processing unit; segmentation by sentence, within each paragraph, the text is segmented into separate sentences according to punctuation marks such as periods, question marks, exclamation marks, etc.; attachment part, if the contract contains attachments, such as drawings, technical specifications, etc., they are also segmented and stored separately.
[0091] Index construction is to perform inverted indexing on the segmented document fragments, recording the location information of each word in the document. Index construction helps to quickly retrieve document fragments related to the query. Index construction mainly includes: contract number, assigning a unique identifier to each contract; contract type, classifying contract types, such as income contracts, expenditure contracts, etc.; key date, extracting key date information such as the validity period and signing date in the contract; party information, extracting the name, address, contact information and other information of both parties to the contract; amount and terms, identifying key terms such as the amount, payment terms, and liability for breach of contract in the contract.
[0092] Contract storage is to store the segmented document fragments and indexes in a database or a special retrieval system. These storage systems need to support efficient query and update operations to quickly retrieve relevant information during the generation process. For structured data, such as contract terms, dates, amounts, etc., relational databases such as MySQL can be used for storage. For unstructured information, it is stored in a graph database.
[0093] Optionally, structured contract data can be stored in a contract database such as a MySQL relational database for easy retrieval. Unstructured information is stored in a graph database. Structuring of contract data includes: entity identification, identifying entities in contract data, such as contracts, party A, party B, products, terms, etc. Attribute definition, defining attributes for each entity, contract entities include attributes such as contract number, signing date, contract amount, etc. Relationship definition, defining the relationship between entities, such as the relationship between a contract and party A, party B, and the relationship between a contract and a product. Integrity constraints, defining data integrity rules, such as foreign key constraints, uniqueness constraints, check constraints, etc.
[0094] For example, the contract base model extracts an example of the contract database, such as the entity extraction prompt example shown in the following table:
[0095]
[0096] Give the sliced contract data to the contract base model and perform relationship extraction prompt. For example, as shown in the following table:
[0097]
[0098] In the technical solution of this embodiment, a contract knowledge graph is constructed for contract data, an accurate upstream and downstream relationship of the contract is established, and a relationship between the contract data is established, which facilitates the subsequent identification of compliance risk results through the contract knowledge graph and improves the accuracy of identification.
[0099] Based on the first or second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the above embodiment can be referred to the above introduction, and will not be repeated in the following. Figure 5 , step S20 further includes:
[0100] Step S21, based on the pre-trained contract base model, according to the thought chain of different scenarios and the contract knowledge graph, extract the contract association relationship between the contract data;
[0101] Step S22, determining key information of the contract data according to the contract association relationship.
[0102] Optionally, after preprocessing the contract data, the structured contract data can be stored in a contract database such as a MySQL relational database for easy retrieval. Unstructured information is stored in a graph database. The structuring of contract data includes: entity recognition, identifying entities in the contract data, such as contracts, Party A, Party B, products, terms, etc. Attribute definition, defining attributes for each entity, contract entities include attributes such as contract number, signing date, contract amount, etc. Relationship definition, defining the relationship between entities, such as the relationship between a contract and Party A, Party B, and the relationship between a contract and a product. Integrity constraints, defining data integrity rules, such as foreign key constraints, uniqueness constraints, check constraints, etc.
[0103] The contract base big model extracts the contract association relationship of the contract data from the preset database such as the contract database. It should be noted that in the Agent thinking chain, asking questions to the big model is an advanced technical solution, which involves decomposing complex problems into a series of executable tasks and completing these tasks by using different tools and models.
[0104] An agent is an agent that acts in an intelligent way. It perceives the environment, takes actions autonomously to achieve its goals, and can improve its performance by learning or acquiring knowledge. A simplified agent decision-making process is:
[0105] Agent: P (perception) → P (planning) → A (behavior)
[0106] Among them, perception refers to the ability of the agent to collect information from the environment and extract relevant knowledge from it. Planning refers to the decision-making process made by the agent for a certain goal. Action refers to the actions taken based on the environment and plan. For example, Figure 6 The large model Agent workflow diagram is shown.
[0107] The contract base model is the core and key to the compliance risk assessment of cooperative business. On the one hand, the understanding and generation capabilities of the contract base model are used to extract and generate key information and query statements. For example, the key information in the contract is extracted by combining the contract knowledge graph; the relationship of the contract is extracted by combining the knowledge graph; cypher statements are generated according to the logic of the thinking chain, etc. On the other hand, the understanding and analysis capabilities of the contract base model are used to conduct a comprehensive analysis of the key information extracted from the thinking chain to obtain the final compliance risk assessment results of the cooperative business.
[0108] CoT (Chain-of-Thought) can effectively increase the reasoning ability of large models. This method simulates the human thinking process, allowing the model to demonstrate more in-depth and coherent logical reasoning when solving problems. Activate the chain of thought ability method of the language large model, and give a step-by-step reasoning demonstration in the prompt as a condition for reasoning. When faced with complex queries or questions, CoT allows the model to build answers step by step, with each step building on the previous step, thus forming a complete chain of reasoning. This step-by-step reasoning method not only improves the accuracy of the model in solving problems, but also enhances its interpretability.
[0109] In addition, CoT can also promote the generalization ability of the model when facing novel or unseen situations, encouraging the model to use existing knowledge to infer new solutions, rather than relying solely on memory or pattern matching. Thinking chain is considered to be the "emergence ability" of large language models. Usually, only when the model parameter scale increases to a certain extent can it adopt the thinking chain ability. Figure 7 As shown, the process of judging the compliance risk of cooperative business includes the following steps:
[0110] Use the contract base model to generate Cypher statements, call the contract knowledge graph, and use the revenue contract as the initial contract in the massive contract data set to find the key information including the contract between Party A and Party B, and create the first layer of association.
[0111] The contract base model is used to generate Cypher statements, call the contract knowledge graph, and obtain key information including contract name, subject matter, delivery location, and other contract relationship information in the contract that has created the first layer of association.
[0112] Using the understanding and analysis capabilities of the contract base model, we can determine whether the contract name, subject matter, and delivery location are similar, and confirm the related contracts. Then, based on the confirmed party B of the related contract, we can use the contract base model to generate Cypher statements, call the contract knowledge graph, find the contract that is consistent with party A, and create a second-level relationship.
[0113] In the created second-layer associated contract, the contract base model is used to generate Cypher statements, and the contract knowledge graph is called to obtain contract relationship information such as contract name, subject matter, and delivery location.
[0114] Utilize the understanding and analysis capabilities of the contract base model to determine whether the contract name, subject matter, and delivery location are similar, confirm the related contracts, and repeat the above steps until the next contract cannot be found.
[0115] Call the corporate letter writing tool to query the corporate information of the party A company that signed the upstream contract and the party B company that signed the downstream contract. Based on the corporate information, use the understanding and analysis capabilities of the contract base big model to judge the corporate relationship between the upper and lower companies and identify whether there is a specific interest relationship between the party A company and the party B company, such as Figure 8 An example diagram of a contract thinking chain is shown.
[0116] Among them, the identification dimensions include: cross-holding, that is, the equity structure in which two or more companies hold shares in each other. The same contact information, whether the contact number, contact address, and contact email are consistent. Having common senior executives, whether there are common people in the staff of the two companies. Utilizing the understanding and analysis capabilities of the contract base big model, compare the signing time and signing amount of the upstream contract with the signing time and signing amount of the downstream contract to determine whether there is a situation where the signing time and signing amount are similar. The gross profit margin calculation rule is (the signing amount of the upstream contract-the signing amount of the downstream contract) / the signing amount of the upstream contract. The signing time difference calculation rule is the signing time of the upstream contract-the signing time of the downstream contract.
[0117] Finally, the contract base model conducts a comprehensive analysis and understanding of the above information, and identifies possible compliance risk scenarios for cooperative business based on the above analysis results. Among them, compliance risks may include: situations where specific interest-related enterprises are not allowed to conduct business. Business situations that are contrary to common sense of transactions, such as similar signing time and low gross profit margin. Business situations of circular transactions, that is, after the internal company signs a contract with an external company, the external company signs a contract with the internal company again.
[0118] Generate query statements using the contract base model, including: using the generation capability of the contract base model to generate nl2cypher statements and nl2sql statements. These statements can retrieve the required field information in the contract knowledge graph and relational database, and efficiently extract key information from a large amount of contract text. The following table shows an example of generating prompts using cypher statements:
[0119]
[0120] Take Siwei Chain's evaluation of compliance risks in cooperative business as an example. In the process of evaluating compliance risks in cooperative business, a series of tools and methods are used to identify and analyze potential improper transaction behaviors. By using the contract base model, contract knowledge graph, contract database and enterprise letter-writing interface, the relationship between contracts can be established, and the possible compliance risk behaviors of cooperative business can be deeply explored.
[0121] The first level of association is created by searching for contracts with the same names of Party A and Party B, and then further associations are established based on the similarities of contract names, subject matter, and delivery addresses. Next, these related contracts are analyzed in depth, and more potential clues to compliance risks of cooperative businesses are found by creating a second level of association. This process is cyclical until the search process no longer generates new related contracts.
[0122] Ultimately, by comprehensively analyzing these data and information and using the contract base model, it is possible to determine whether there is improper business dealings between specific interested parties. This way of thinking based on the Agent thinking chain, which uses a variety of tools and methods, not only improves the accuracy of identifying compliance risks in cooperative business, but also provides a systematic and efficient solution for contract auditing.
[0123] For example, the following is an example of a prompt. As shown in the following table, the prompt example of Siweilian's compliance risk assessment for cooperative business:
[0124]
[0125]
[0126] In the technical solution of this embodiment, the thinking chain can effectively ask questions to the big model, and use various tools and models to complete complex contract audit tasks, so as to determine whether there are compliance risks in the cooperative business. This method not only improves the accuracy and efficiency of the audit, but also helps to reveal potential risks and problems and find more clues to business scenarios.
[0127] Based on any one of the first to third embodiments of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the above embodiments can refer to the above introduction, and will not be repeated later. Fig. 9 , before step S10, further comprising:
[0128] Step S50, acquiring contract domain data and general domain data;
[0129] Step S60, pre-training is performed based on the contract domain data and the general domain data to obtain the contract base large language model.
[0130] It should be noted that when pre-training the base model, the ratio of data preparation is crucial to the performance and generalization ability of the model. In order to ensure that the model performs well in a specific contract field and also has the ability to process general field data, the balance of vertical field data, related field data and general field data is considered.
[0131] Obtain all contract data from the database, including data in vertical fields. For example, prepare about 2 million pieces of data. The contract data includes various types of contract texts, such as sales contracts, service contracts, lease contracts, etc., as well as contract samples covering different industries and fields. This ensures that the model can deeply understand the structure, terms, and legal terms of the contract text.
[0132] Obtain data in other contract fields, such as 4 million pieces of data, including legal documents, agreements, regulations, etc. related to contracts. These data can help the model learn the legal logic and principles behind the contract text, thereby improving the accuracy and reliability of the model in understanding and generating contract text.
[0133] Obtaining general domain data, such as 10 million pieces, covering a wide range of topics and fields such as news, scientific articles, and literary works can help the model learn a wider range of language knowledge and contextual information, and improve its performance in handling non-contract related tasks.
[0134] Prepare code data, including collecting a large number of SQL query statements, including select (SELECT), insert (INSERT), update (UPDATE) and delete (DELETE) operations, as well as more complex queries, such as the use of joins (JOIN) and subqueries (Subquery). Prepare examples of the Cypher query language, which should cover basic operations of graph databases, such as the creation, query and deletion of nodes and relationships, as well as complex graph traversal and pattern matching. Create or collect pseudocode samples, which describe the logic and steps for solving specific programming problems, help the model understand the logical structure behind the code, etc. In actual operation, adjustments need to be made based on the results of model training.
[0135] The contract data is preprocessed according to the above contract preprocessing module, and then the data set is divided into a training set, a validation set and a test set according to a preset ratio, and the preset ratio = 7:1:2.
[0136] Select a large base model. In deep learning, the number of model parameters is usually proportional to its capabilities. The Qwen-72B model has 72 billion parameters, which makes it a very powerful language model. More parameters mean that the model can capture more subtle language features and more complex language structures.
[0137] As the number of model parameters increases, the model's ability to understand and generate language will improve, a phenomenon known as capability emergence. Due to its huge number of parameters, the Qwen-72B model has demonstrated excellent performance in a variety of natural language processing tasks such as text classification, information extraction, and text generation.
[0138] In order to use a large model to reason about the chain of thought to obtain clues, the reasoning performance of the model is positively correlated with the number of model parameters. The larger the number of model parameters, the stronger the model reasoning ability and the more accurate the results. Optionally, a model with the same number of parameters as qwen72B is the Llama2-70B model developed by Meta, which can also be used in the contract field. At the same time, chatglm3, baichuan2, YuLan-Chat65B and other open source large models with hundreds of billions of parameters can also be fine-tuned and used in the contract field.
[0139] Fine-tune the model using LORA (Low-Rank Adaptation). LORA is a technique for efficient adjustment on large pre-trained models, which enables efficient parameter updates by introducing low-rank matrices in specific parts of the model. This approach can fine-tune the model to adapt to specific tasks without significantly increasing the number of parameters and computational cost.
[0140] When fine-tuning Qwen-72B, selected parts of the model are fine-tuned using LoRa technology, adding additional low-rank matrices to the original layers, which are updated during training while the original pre-trained parameters remain unchanged.
[0141] During the fine-tuning process, it is necessary to monitor the performance indicators of the model in real time, such as accuracy, loss function value, F1 score, etc. The following are several directions that can be considered for optimization: Learning rate, the learning rate can be adjusted according to the performance of the model on the validation set. If the performance improvement is not obvious, you can try to lower the learning rate. If the performance is overfitting, you can try to increase the learning rate. Regularization, in order to prevent overfitting, you can use regularization techniques such as weight decay and Dropout during fine-tuning. Early stopping strategy, if the performance of the model on the validation set has not improved significantly over a period of time, you can use an early stopping strategy to terminate training to prevent overfitting. Hyperparameter optimization, you can use grid search, random search and other methods to find the best hyperparameter combination.
[0142] During the training phase, 8 GPUs with video memory are used for training. Int4 quantization and vllm acceleration can be considered. Several TB of high-quality storage space is used to store raw data, model weights, and temporary files during training. 256GB of system memory is used to support data processing and model operation, as well as other network resources and software dependencies that may be required.
[0143] After the above steps, a large base model specifically for the contract field is obtained. Use indicators such as accuracy, recall, and F1 score to evaluate the performance of the fine-tuned model. Based on the evaluation results, further optimize the model, including adjusting the model structure, re-fine-tuning, or using more data. Deploy the final large base model for the contract field to the production environment to ensure that the model can run stably and provide services.
[0144] In the technical solution of this embodiment, a contract base large language model is obtained through training, and the contract base large language model is used to conduct a comprehensive analysis of the key information extracted from the thinking chain to obtain the final compliance risk judgment result of the cooperative business.
[0145] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the contract risk identification method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0146] This application also provides a contract risk identification device, please refer to Fig.10 , the contract risk identification device comprises:
[0147] Construction module 10, used to construct a contract knowledge graph of cooperative business in the contract data;
[0148] An extraction module 20, for extracting key information of the contract data based on the pre-trained contract base model, according to the thought chain and the contract knowledge graph;
[0149] A determination module 30, configured to construct a prompt word according to the thought chain and the key information;
[0150] The identification module 40 is used to ask questions to the contract base big model based on the prompt words, and obtain the compliance risk results of the cooperative business of the contract data output by the contract base big model based on the prompt words.
[0151] Optionally, the step of constructing a contract knowledge graph of cooperative business compliance risks includes:
[0152] Based on the pre-trained contract base large language model, extract the entities, entity attributes and relationships of the contract data in the preset database;
[0153] The contract knowledge graph is constructed based on the entities, entity attributes and relationships of the contract data.
[0154] Optionally, before the step of extracting entities, entity attributes and relationships of contract data based on the pre-trained contract base large language model, the step further includes:
[0155] Acquire original contract data, and divide the original contract data into document segments;
[0156] Creating an index for each of the document fragments;
[0157] The document fragment and the index are used as contract data and stored in a preset database.
[0158] Optionally, the step of extracting key information of the contract data based on the pre-trained contract base large model according to the thought chain and the contract knowledge graph includes:
[0159] Based on the pre-trained contract base model, the contractual relationship between contract data is extracted according to the thought chain of different scenarios and the contract knowledge graph;
[0160] Based on the contract association relationship, key information of the contract data is determined.
[0161] Optionally, the step of constructing prompt words according to the thought chain and the key information further includes:
[0162] Calling an enterprise query tool to query the enterprise relationship corresponding to the contract data;
[0163] The prompt words are constructed according to the enterprise relationship, the thought chain and the key information.
[0164] Optionally, before the step of constructing a contract knowledge graph of cooperative business compliance risks, the step further includes:
[0165] Obtain contract domain data and general domain data;
[0166] Pre-training is performed based on the contract domain data and the general domain data to obtain the contract base large language model.
[0167] The contract risk identification device provided by the present application adopts the contract risk identification method in the above embodiment, which can solve the technical problem of low accuracy of the risk identification result of the contract. Compared with the prior art, the beneficial effects of the contract risk identification device provided by the present application are the same as the beneficial effects of the contract risk identification method provided by the above embodiment, and the other technical features in the contract risk identification device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0168] The present application provides a contract risk identification device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the contract risk identification method in the above-mentioned embodiment one.
[0169] Reference below Fig.11, which shows a schematic diagram of the structure of a contract risk identification device suitable for implementing the embodiment of the present application. The contract risk identification device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.11 The contract risk identification device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0170] like Fig.11 As shown, the contract risk identification device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the contract risk identification device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the contract risk identification device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a contract risk identification device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.
[0171] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0172] The contract risk identification device provided by the present application adopts the contract risk identification method in the above embodiment, which can solve the technical problem of low accuracy of the risk identification result of the contract. Compared with the prior art, the beneficial effects of the contract risk identification device provided by the present application are the same as the beneficial effects of the contract risk identification method provided by the above embodiment, and the other technical features in the contract risk identification device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0173] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0174] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0175] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the contract risk identification method in the above-mentioned embodiment.
[0176] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0177] The above-mentioned computer-readable storage medium may be included in the contract risk identification device; or it may exist independently without being assembled into the contract risk identification device.
[0178] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the contract risk identification device, the contract risk identification device: realizes the structuring of contract data by establishing a contract knowledge graph, calls the contract knowledge graph based on the pre-trained contract base big model, and outputs compliance risk results based on prompt words, and by constructing prompt words, uses the contract base big model to identify compliance risk results in structured contract data, thereby improving the accuracy of compliance risk result identification.
[0179] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0180] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0181] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0182] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned contract risk identification method, and can solve the technical problem of low accuracy of the contract risk identification result. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the contract risk identification method provided in the above-mentioned embodiment, and will not be repeated here.
[0183] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned contract risk identification method when executed by a processor.
[0184] The computer program product provided by this application can solve the technical problem of low accuracy of the risk identification results of the contract. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the contract risk identification method provided by the above embodiment, which will not be repeated here.
[0185] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for identifying contract risks, characterized in that: The method comprises: Construct a contract knowledge graph of cooperative business in contract data; Based on the pre-trained contract base model, key information of the contract data is extracted according to the thought chain and the contract knowledge graph; Constructing prompt words according to the thought chain and the key information; Based on the prompt words, questions are asked to the contract base big model to obtain the compliance risk results of the cooperative business of the contract data output by the contract base big model based on the prompt words.
2. The method according to claim 1, characterized in that The steps of constructing the contract knowledge graph of cooperative business compliance risks include: Based on the pre-trained contract base large language model, extract the entities, entity attributes and relationships of the contract data in the preset database; The contract knowledge graph is constructed based on the entities, entity attributes and relationships of the contract data.
3. The method according to claim 2, characterized in that Before the step of extracting entities, entity attributes and relationships of contract data based on the pre-trained contract base large language model, the following steps are also included: Acquire original contract data, and divide the original contract data into document segments; Creating an index for each of the document fragments; The document fragment and the index are used as contract data and stored in a preset database.
4. The method according to claim 1, characterized in that The steps of extracting key information of the contract data based on the pre-trained contract base model according to the thought chain and the contract knowledge graph include: Based on the pre-trained contract base model, the contractual relationship between contract data is extracted according to the thought chain of different scenarios and the contract knowledge graph; Based on the contract association relationship, key information of the contract data is determined.
5. The method according to claim 1, characterized in that The step of constructing prompt words according to the thought chain and the key information also includes: Calling an enterprise query tool to query the enterprise relationship corresponding to the contract data; The prompt words are constructed according to the enterprise relationship, the thought chain and the key information.
6. The method according to claim 1, characterized in that Before the step of constructing the contract knowledge graph of the compliance risk of the cooperative business, it also includes: Obtain contract domain data and general domain data; Pre-training is performed based on the contract domain data and the general domain data to obtain the contract base large language model.
7. A contract risk identification device, characterized in that: The device comprises: A construction module is used to construct a contract knowledge graph of cooperative business in contract data; An extraction module, for extracting key information of the contract data based on the pre-trained contract base model, according to the thought chain and the contract knowledge graph; A determination module, used for constructing prompt words according to the thought chain and the key information; The identification module is used to ask questions to the contract base model based on the prompt words, and obtain the compliance risk results of the cooperative business of the contract data output by the contract base model based on the prompt words.
8. A contract risk identification device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the contract risk identification method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the contract risk identification method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the contract risk identification method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Method and device for extracting geological prospecting knowledge triad by using cue word engineering
CN120087465A
Method and device for extracting geological prospecting knowledge triples using prompt word engineering
CN120087465B
Contract risk intelligent identification method and system
CN120542439A
Contract risk early warning method, device and equipment based on knowledge graph
CN120563280A
Contract information extraction method and device, equipment and medium
CN120849530A
