Legal provision matching method and device, equipment and storage medium

By building a legal text structure tree and optimizing the matching results using a large language model, the problem that existing legal and regulatory search systems are difficult to achieve accurate legal matching is solved, and the search efficiency and matching accuracy are improved.

CN119513287AInactive Publication Date: 2025-02-25ASPIRE INFORMATION TECH BEIJING

Patent Information

Application Number
CN202411658933.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-02-25
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing legal and regulatory search system is based on title or full text search, making it difficult to achieve accurate legal matching for specific cases.

Method used

By constructing a legal text structure tree, searching the scope of legal matching step by step, and determining multiple target matching laws based on the similarity between the article data and legal text, finally optimizing the matching results through a large language model.

Benefits of technology

It improves the search efficiency of legal texts, realizes accurate legal matching of specific cases, and enhances the interpretability and accuracy of matching results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513287A_ABST
    Figure CN119513287A_ABST
Patent Text Reader

Abstract

The invention discloses a legal provision matching method and device, equipment and a storage medium. The legal provision matching method comprises the steps of obtaining a plurality of item data of each item classification under a target project contract; based on a target project contract, performing step-by-step retrieval on the legal text structure tree to obtain a law article matching range; based on the similarity between each piece of objective data and each legal provision in the legal provision matching range, determining a plurality of target matching legal provisions of each piece of objective data; and optimizing a plurality of target matching legal provisions of each piece of pursuit data under each piece of pursuit classification to obtain a legal provision matching result. According to the method, step-by-step retrieval is carried out by utilizing the pre-constructed legal text structure tree, so that the retrieval efficiency of the legal text is improved, the similarity between the law article data and the legal provisions is compared, the preliminary matching result is obtained, multiple target matching law articles subjected to preliminary matching are audited and optimized, and the accuracy of legal provision matching is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a legal clause matching method, device, equipment and storage medium. Background Art

[0002] With the continuous development of natural language technology, especially the development of pre-trained language models in recent years, the application of natural language processing technology in the legal field has made great progress. For example, it is used for case classification and regulation matching. These mainly determine the case or regulation corresponding to the pending case based on the keywords in the pending case and the regulations.

[0003] However, providing legal advice through simple keyword matching queries is not flexible and requires a lot of work. For example, when searching for applicable laws for a specific case, it is often necessary to search for relevant laws and regulations. However, the regulatory search systems currently on the market are still based on title or full-text searches, and cannot achieve accurate searches for applicable laws for specific cases. Summary of the invention

[0004] Based on this, it is necessary to provide a legal clause matching method, device, equipment and storage medium to address the above technical issues, so as to solve at least one of the above technical issues.

[0005] The present invention provides a legal clause matching method, comprising:

[0006] Obtaining multiple clause data of each clause classification under the target project contract;

[0007] For any category:

[0008] Based on the target project contract, a pre-constructed legal text structure tree is searched level by level to obtain a legal article matching range, wherein the legal text structure tree is constructed by disassembling the legal text content level by level;

[0009] Determine multiple target matching legal provisions for each of the article data based on the similarity between each of the article data and each legal provision within the legal provision matching range;

[0010] The multiple target matching laws of each purpose data under each purpose classification are optimized to obtain the legal provisions matching results.

[0011] Optionally, according to a legal provision matching method provided by the present invention, the determining of multiple target matching legal provisions for each of the provision data based on the similarity between each of the provision data and each legal provision within the legal provision matching range includes:

[0012] For each of the above mentioned data:

[0013] Based on the legal provisions of the article data and the matching range of the legal provisions, extract the text feature vector of the article data and the legal feature vector of each legal provision;

[0014] Calculating the similarity between the text feature vector and each of the legal provision feature vectors respectively;

[0015] The similarities are sorted, and based on the similarity sorting results, a plurality of target matching legal provisions of the provision data are screened out from the legal provisions.

[0016] Optionally, according to a legal provision matching method provided by the present invention, the optimization of multiple target matching legal provisions of each subject data under each subject classification to obtain a legal provision matching result includes:

[0017] For each category:

[0018] Input each item data under the item classification and multiple target matching laws of each item data into a preset large language model to obtain the detection result output by the large prediction model;

[0019] According to the detection result, each of the target matching legal provisions is filtered to obtain the legal provision matching result.

[0020] Optionally, according to a legal provision matching method provided by the present invention, filtering each of the target matching legal provisions according to the detection result to obtain the legal provision matching result includes:

[0021] According to the detection result, multiple candidate laws are selected from the multiple target matching laws;

[0022] The occurrence frequency of each of the candidate legal provisions is determined, so as to screen a preset number of candidate legal provisions as the legal provision matching results according to the occurrence frequency.

[0023] Optionally, according to a legal text matching method provided by the present invention, the legal text structure tree is constructed based on the following steps:

[0024] Obtain legal text content;

[0025] According to the preset rule for dividing the legal article nodes into different levels, the legal text content is disassembled level by level to obtain the level attribute information of each node, wherein the level attribute information includes the legal text of the current node, the node level and the level attribute information of the next node;

[0026] Based on each of the hierarchical attribute information, the legal text structure tree is constructed.

[0027] Optionally, according to a legal text matching method provided by the present invention, the step of obtaining the legal text content includes:

[0028] Access to original legal data;

[0029] The original legal data is preprocessed, and the legal text content is extracted based on the preprocessed legal data.

[0030] Optionally, according to a legal clause matching method provided by the present invention, the step of obtaining a plurality of clause data of each clause classification under the target project contract includes:

[0031] Determining a contract classification label of the target project contract;

[0032] Based on the contract classification label, determine all clause classifications corresponding to the target project contract;

[0033] A plurality of item data of each item classification is determined to cluster the item data of each item classification, and a plurality of item data of each item classification is screened according to the clustering result.

[0034] The present invention also provides a legal clause matching device, comprising:

[0035] An acquisition module is used to acquire a number of clause data of each clause classification under the target project contract;

[0036] For any category:

[0037] A search module is used to search the pre-constructed legal text structure tree level by level based on the target project contract to obtain a matching range of legal provisions, wherein the legal text structure tree is constructed by disassembling the legal text content level by level;

[0038] A determination module, for determining a plurality of target matching legal provisions for each of the said article data based on the similarity between each of the said article data and each legal provision in the said legal provision matching range;

[0039] The optimization module is used to optimize multiple target matching laws for each purpose data under each purpose classification to obtain legal provisions matching results.

[0040] The present invention also provides a computer device, comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor implements the above-mentioned legal provision matching method when executing the computer-readable instructions.

[0041] The present invention also provides one or more readable storage media storing computer-readable instructions, which implement the above-mentioned legal clause matching method when executed by a processor.

[0042] The above-mentioned legal clause matching method, device, equipment and storage medium include: obtaining a number of clause data of each clause classification under the target project contract; based on the target project contract, searching step by step in the pre-constructed legal text structure tree to obtain the legal clause matching range, wherein the legal text structure tree is constructed by disassembling the legal text content step by step; based on the similarity between each of the clause data and each legal clause in the legal clause matching range, determining multiple target matching legal clauses for each of the clause data; optimizing the multiple target matching legal clauses for each of the clause data under each clause classification to obtain the legal clause matching result. The present invention forms a hierarchical legal text structure tree by disassembling the legal text step by step, which can improve the retrieval efficiency of the legal text, enable the user to quickly locate the required information, and then compare the similarity between the clause text vector and the legal clause text vector, effectively measure the semantic proximity between the two texts, obtain multiple target matching legal clauses that are initially matched, and finally conduct refined review and matching on the multiple target matching legal clauses that are initially matched, so as to improve the accuracy of legal clause matching. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0044] Figure 1 is a flow chart of a legal clause matching method in one embodiment of the present invention;

[0045] Figure 2 is a structural diagram of providing level attribute information according to an embodiment of the present invention;

[0046] Figure 3 It is a flowchart of performing preliminary matching of legal clauses according to similarity according to an embodiment of the present invention;

[0047] Figure 4 This is an effect diagram of legal clause matching provided by an embodiment of the present invention;

[0048] Figure 5 is a structural schematic diagram of a legal clause matching device in one embodiment of the present invention;

[0049] Figure 6 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0051] The terms used in one or more embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present invention. The singular forms of "a", "said" and "the" used in one or more embodiments of the present invention are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present invention refers to and includes any or all possible combinations of one or more associated listed items.

[0052] In one embodiment, specifically, Figure 1 As shown, Figure 1 1 is a flow chart of a legal clause matching method in an embodiment of the present invention. The present invention provides a legal clause matching method, comprising the following steps:

[0053] Step S11, obtaining a number of clause data of each clause classification under the target project contract;

[0054] Specifically, a contract classification table is pre-set, and then based on the contract classification table, the contract classification label corresponding to the target project contract is determined; according to the retrieved contract classification label, all the clause classifications under the contract classification can be found in the preset clause table, and then a series of tasks of "contract classification-clause of the classification-clause corresponding to the legal clause" are completed. Furthermore, the clause table does not contain the detailed clauses corresponding to the clause, and only establishes an association with the legal clause through the clause name, which has low accuracy and interpretability. Therefore, the embodiment of the present invention also provides a clause data comparison table, and then according to the clause data comparison table, the correspondence between the clause classification and the contract clause is completed to obtain multiple clause data of each clause classification.

[0055] Furthermore, in order to ensure the diversity of the article data and more comprehensively complete the correspondence between the article and the legal provisions, similar data in the article data needs to be eliminated during data processing. In addition, the article data also needs to be balanced, for example, the article data of each article classification is clustered, and according to the clustering results, a number of article data of each article classification is screened to ensure the diversity of the data.

[0056] Step S12, based on the target project contract, perform a level-by-level search in the pre-constructed legal text structure tree to obtain a matching scope of legal provisions;

[0057] It should be noted that the legal text structure tree is constructed by disassembling the legal text content level by level. The specific construction process of the legal text structure tree is specifically described in the following embodiments and will not be repeated here. Specifically, based on the target project contract, the content of the legal text structure tree is detected level by level through keyword search, which can greatly improve the search efficiency. Optionally, the search starts from a high-level node. If a keyword is retrieved, all branches under the node are used as the scope of the legal article matching to obtain the legal article matching scope. For example, the legal article keywords for leasing and intellectual property contracts are determined as follows: Leasing: lease, contract. Intellectual property: patents, software copyrights, trademarks, etc.

[0058] Step S13, determining multiple target matching legal provisions for each of the article data based on the similarity between each of the article data and the legal provisions in the legal provision matching range;

[0059] Specifically, the following steps are performed for each of the aforementioned article data: extracting the text feature vector of the article data, and extracting the legal article feature vector corresponding to each legal article. Optionally, the M3E model is used to extract the vector representation of the legal article and the article data, wherein the M3E model is a Chinese embedding model that integrates multiple NLP tasks. Then, the similarity between the text feature vector and each of the aforementioned legal article feature vectors is calculated respectively, for example, the similarity is calculated according to the cosine similarity formula. Furthermore, legal articles whose similarity is lower than a preset similarity threshold are filtered out; in addition, the various similarities can be sorted, and based on the similarity sorting results, multiple legal articles with higher similarity are selected as target matching articles.

[0060] Step S14, optimizing multiple target matching laws for each subject data under each subject classification to obtain legal text matching results.

[0061] In this embodiment, a preset large language model is also used to perform secondary review and optimization on the initially matched target matching legal provisions to ensure that the recommended legal clauses are highly relevant to the contract clause labels, thereby improving the accuracy of legal clause matching.

[0062] Specifically, for each article classification: based on each article data under the article classification and multiple target matching laws of each article data, query information in a preset data format is generated. For example, the query information is: based on the legal text: "Article 543 [Agreement to Change Contract] The parties can change the contract by mutual agreement". Set up a contract clause: "The parties can negotiate to change or terminate this contract". Use the large language model to detect the query information in the preset data format to obtain the detection result. Therefore, according to the detection result, it is determined whether the article data matches the target matching law. In order to analyze the relationship between legal concepts and enhance the interpretability of the matching results, in one embodiment, a thinking chain derivation method is introduced to increase the interpretability of the generation of the large language model, wherein the thinking chain derivation method (Think Chain) is a technology for improving the interpretability of natural language processing models; when solving problems or making inferences, each thinking step is gradually expanded and explained. When analyzing the relationship between legal concepts, the model not only gives the final matching result, but also gradually shows how to analyze the relationship between concepts through different reasoning steps, so that users can understand how the model draws conclusions.

[0063] It can be understood that the test results output by the large language model include an analysis part and a conclusion part. Using the above example, the analysis part is: the contract clause is consistent with the legal content of Article 543 of the Civil Code of the People's Republic of China, which clarifies the principle that the modification or termination of the contract requires the consensus of both parties; the conclusion part in the test result is: yes. At this time, it is proved that the clause data matches the target matching legal clause. Optionally, the large language model in the embodiment is set to the Qwen2-72B model.

[0064] Furthermore, in each target matching legal provision, multiple candidate legal provisions with successful matching results are selected. In one embodiment, multiple candidate legal provisions are directly used as legal provision matching results. Since the number of multiple candidate legal provisions for each purpose classification may be large, in another embodiment, the occurrence frequency of each candidate legal provision is counted, so as to screen a preset number of candidate legal provisions as the legal provision matching results according to the occurrence frequency.

[0065] The embodiment of the present invention, through the above scheme, includes: obtaining a number of clause data of each clause classification under the target project contract; based on the target project contract, performing a step-by-step search in the pre-constructed legal text structure tree to obtain the legal clause matching range, wherein the legal text structure tree is constructed by step-by-step decomposition of the legal text content; based on the similarity between each of the clause data and each legal provision in the legal clause matching range, determining multiple target matching legal provisions for each of the clause data; optimizing multiple target matching legal provisions for each of the clause data under each clause classification to obtain legal clause matching results. It is realized that by step-by-step decomposition of the legal text, a hierarchical legal text structure tree is formed, which can improve the retrieval efficiency of the legal text, enable users to quickly locate the required information, and then compare the similarity between the clause text vector and the legal clause text vector, effectively measure the semantic proximity between the two texts, obtain multiple target matching legal provisions that are initially matched, and finally conduct refined review and matching on the multiple target matching legal provisions that are initially matched, so as to improve the accuracy of legal clause matching.

[0066] In one embodiment of the present invention, the legal text structure tree is constructed based on the following steps:

[0067] Obtain the content of the legal text; according to the preset legal article node level division rules, disassemble the legal text content level by level to obtain the level attribute information of each node, wherein the level attribute information includes the legal text of the current node, the node level and the level attribute information of the next node; based on each level attribute information, construct the legal text structure tree.

[0068] It should be noted that, summarizing the rules of legal writing, legal texts are mainly divided into five levels, namely, volume, sub-volume, chapter, section, and article. Among them, there are legal texts in the form of numbers plus a colon (for example: one,) as legal article titles. In this embodiment, the number plus a colon and the section are classified as the same level. In one embodiment, the legal article node level division rules are as shown in Table 1, wherein the disassembled legal clause paragraphs have clear node levels, and the smaller the level number, the higher the node level.

[0069] Node Level Node Description Example 1 Part [ ] Part I 2 Part [ ] Part I 3 Chapter 【】 Chapter 1 4 Section [ ] / [ ], Section 1 / I. 5 Article [ ] Article 1

[0070] In addition, it should be noted that different business scenarios use different legal content scopes. For example, for the legal article matching of lease and intellectual property contracts, the selected legal scopes are:

[0071] (1) Lease: The Contract Chapter and Judicial Interpretations of the Contract Chapter of the Civil Code of the People's Republic of China;

[0072] (2) Intellectual property: Copyright Law, Patent Law, Trademark Law, Regulations for the Implementation of the Trademark Law, Patent Implementation Rules, Regulations for the Implementation of the Copyright Law, Regulations on the Protection of Computer Software, and Part I of the Contract Chapter of the Civil Code.

[0073] Specifically, the original legal data is obtained. Optionally, the original legal data is stored in the Elasticsearch library, and the format of HTML encapsulated in JSON is used to pre-process the original legal data. For example, the content of the legal text may be too broad and not fully applicable to specific article matching tasks. For example, although the inheritance chapter of the Civil Code contains legal provisions related to inheritance, not all content is directly related to lease or intellectual property contracts. Therefore, it is necessary to perform redundancy operations on the legal text content. In addition, the legal text downloaded by the Elasticsearch library is in HTML format. In addition to the legal provisions to be matched, there are redundant HTML tags and attributes. HTML tags (such as, The structured symbols (such as class, id, etc.) and attributes (such as text, etc.) are not always crucial to the semantic analysis and clause matching of legal texts. These structured symbols may increase the complexity of the data. Therefore, the legal text content is extracted from the original legal data. Understandably, the Elasticsearch library exports data in JSON format, and filters out the "title" and "fulltext" fields, namely the legal title and legal text. The legal text here is in HTML format, and further text content parsing is required. When parsing the text content, the Xpath method under etree is used. To ensure the correct parsing of line breaks, the line breaks in HTML need to be Change it to "\n" in String to get the legal text content.

[0074] Furthermore, according to the preset legal article node level division rules, the legal text content is disassembled level by level to obtain the level attribute information of each node, wherein the level attribute information includes the legal text of the current node, the node level and the level attribute information of the next node, etc. Figure 2 , Figure 2 This is a structural diagram of hierarchical attribute information provided by an embodiment of the present invention, wherein the "deep" field is the node level of the current node; the "index" field is the index of the current node, which is composed of the legal name and the node index at each level; the "desc" field is the legal provision-related content of the current node; the "children" field is the hierarchical attribute information of the next-level node of the current node, and the hierarchical attribute information of the next-level node has the same structure as the current hierarchical node. Each of the hierarchical attribute information is analyzed level by level until there is no branch that needs to be further split, and the legal text structure tree is constructed.

[0075] The embodiment of the present invention realizes the step-by-step decomposition of the legal text content through the preset node level rules through the above scheme, forming a legal text structure tree with clear hierarchy and logic. It is thus possible to gradually search in the legal text structure tree, improve the search efficiency of the legal text, enable users to quickly locate the required information, and save a lot of query time.

[0076] In one embodiment of the present invention, based on the similarity between each of the article data and each legal provision in the legal provision matching range, multiple target matching legal provisions for each of the article data are determined, including:

[0077] For each of the said article data: based on the various legal provisions within the matching range between the said article data and the said legal provisions, the text feature vector of the said article data and the legal provision feature vector of each of the said legal provisions are extracted; the similarity between the said text feature vector and each of the said legal provision feature vectors is calculated respectively; the said similarities are sorted, so as to screen out multiple target matching legal provisions of the said article data in each of the said legal provisions according to the similarity sorting results.

[0078] Specifically, refer to Figure 3 , Figure 3 The flowchart of performing preliminary matching of legal provisions according to similarity is provided in one embodiment of the present invention. For each of the said legal provisions data, the following steps are performed: based on the said legal provisions data, a text feature vector of the said legal provisions data is extracted; based on each legal provision in the said legal provision matching range, a legal provision feature vector of each said legal provision is extracted. Furthermore, the similarity between the said text feature vector and each of the said legal provision feature vectors is calculated respectively. For example, the similarity between the feature vectors is calculated using the cosine similarity, and the calculation formula is as follows:

[0079]

[0080] Among them, score lm represents the similarity between the text feature vector of the i-th clause data and the legal feature vector of the j-th legal provision; textVec represents the text feature vector of the clause data in the contract. lawVec represents the legal feature vector of the legal provision.

[0081] Furthermore, the legal provisions whose similarity is lower than a preset similarity threshold are filtered out. The preset similarity threshold can be set according to the actual situation, for example, it is set to 0.86; then the similarities are sorted, and according to the similarity sorting result, multiple legal provisions with higher similarity are selected from the legal provisions, for example, 5 legal provisions with higher similarity are selected, so as to obtain multiple target matching legal provisions of the provision data, which can be referred to Figure 4 , Figure 4 This is an effect diagram of legal clause matching provided by an embodiment of the present invention.

[0082] Through the above scheme, the embodiment of the present invention realizes the use of a model to vectorize the article data text and the legal text text, and compares the similarity between the text feature vector of the article data and the legal feature vector of the legal text, effectively measuring the semantic proximity between the two texts, and providing an efficient screening mechanism for preliminary matching.

[0083] In one embodiment of the present invention, multiple target matching laws of each subject data under each subject classification are optimized to obtain legal provisions matching results, including:

[0084] For each article classification: each article data under the article classification and multiple target matching laws of each article data are input into the preset large language model to obtain the detection result output by the large prediction model; according to the detection result, each target matching law is filtered to obtain the legal text matching result.

[0085] It should be noted that the prompts standard data format is pre-set. prompts stipulates that the output results include two parts: analysis and conclusion. Analysis is to improve the accuracy of judgment through the way of thinking chain, and the conclusion is the matching result verified by the large language model. The conclusion includes two forms: "yes" and "no". For example, the Qwen2-72B model is selected, and the matching effect corresponding to multiple target matching laws is obtained by calling the large language model to judge the preliminary match, and the laws that cannot be correctly matched are filtered out, and finally a relatively accurate matching effect of the purpose and law is obtained.

[0086] Specifically, for each purpose classification: based on each purpose data under the purpose classification and multiple target matching laws of each purpose data, input them into the preset large language model to obtain the detection result output by the large prediction model. For example, based on each purpose data and multiple target matching laws of each purpose data, query information in a preset data format is generated. For example, the query information is: based on the legal text: "Article 543 [Agreement to Change Contract] The parties may change the contract by mutual agreement." Establish a contract clause: "The parties may negotiate to change or terminate this contract." Use the large language model to detect the query information in the preset data format to obtain the detection result. Continuing with the above example, the analysis in the detection result is: the contract clause is consistent with the legal content of Article 543 of the Civil Code of the People's Republic of China, which clarifies the principle that the change or termination of the contract requires the consensus of both parties. The conclusion of the test results is: Yes; it proves that the article data matches the target matching article. The preliminary matching results are verified by imitating the way legal experts analyze cases, and the relationship between legal concepts, the application of legal principles and the impact of case precedents are further analyzed to enhance the interpretability of the matching results.

[0087] Furthermore, in each target matching legal provision, multiple candidate legal provisions with successful matching results are selected. In one embodiment, multiple candidate legal provisions are directly used as legal provision matching results. In another embodiment, the occurrence frequency of each candidate legal provision is counted, so as to screen a preset number of candidate legal provisions as the legal provision matching results according to the occurrence frequency, for example, the three candidate legal provisions with the highest occurrence frequency are selected as the legal provision matching results.

[0088] The embodiment of the present invention uses the above scheme to first roughly match the purpose of the clauses with the legal provisions. After quickly screening out potentially relevant legal provisions, a large language model is used to finely match the roughly matched legal provisions, thereby improving the accuracy of legal provision matching and reducing the consumption of computing resources.

[0089] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0090] In one embodiment, a legal clause matching device is provided, which corresponds one-to-one to the legal clause matching method in the above embodiment. Figure 5 As shown, Figure 5 1 is a schematic diagram of a structure of a legal text matching device in one embodiment of the present invention, the legal text matching device comprising:

[0091] An acquisition module 21 is used to acquire a plurality of clause data of each clause classification under the target project contract;

[0092] A search module 22 is used to search the pre-constructed legal text structure tree level by level based on the target project contract to obtain a matching range of legal provisions, wherein the legal text structure tree is constructed by disassembling the legal text content level by level;

[0093] A determination module 23, configured to determine a plurality of target matching legal provisions for each of the said article data based on the similarity between each of the said article data and each legal provision in the said legal provision matching range;

[0094] The optimization module 24 is used to optimize multiple target matching laws for each data item under each item classification to obtain legal article matching results.

[0095] The determination module 23 is also used for:

[0096] For each of the above mentioned data:

[0097] Based on the legal provisions of the article data and the matching range of the legal provisions, extract the text feature vector of the article data and the legal feature vector of each legal provision;

[0098] Calculating the similarity between the text feature vector and each of the legal provision feature vectors respectively;

[0099] The similarities are sorted, and based on the similarity sorting results, a plurality of target matching legal provisions of the provision data are screened out from the legal provisions.

[0100] The optimization module 24 is also used to:

[0101] For each category:

[0102] Input each item data under the item classification and multiple target matching laws of each item data into a preset large language model to obtain the detection result output by the large prediction model;

[0103] According to the detection result, each of the target matching legal provisions is filtered to obtain the legal provision matching result.

[0104] The optimization module 24 is also used to:

[0105] According to the detection result, multiple candidate laws are selected from the multiple target matching laws;

[0106] The occurrence frequency of each of the candidate legal provisions is determined, so as to screen a preset number of candidate legal provisions as the legal provision matching results according to the occurrence frequency.

[0107] The legal provisions matching device includes:

[0108] Obtain legal text content;

[0109] According to the preset rule for dividing the legal article nodes into different levels, the legal text content is disassembled level by level to obtain the level attribute information of each node, wherein the level attribute information includes the legal text of the current node, the node level and the level attribute information of the next node;

[0110] Based on each of the hierarchical attribute information, the legal text structure tree is constructed.

[0111] The legal provisions matching device includes:

[0112] Access to original legal data;

[0113] The original legal data is preprocessed, and the legal text content is extracted based on the preprocessed legal data.

[0114] The acquisition module 21 is also used for:

[0115] Determining a contract classification label of the target project contract;

[0116] Based on the contract classification label, determine all clause classifications corresponding to the target project contract;

[0117] A plurality of item data of each item classification is determined to cluster the item data of each item classification, and a plurality of item data of each item classification is screened according to the clustering result.

[0118] For the specific definition of the legal text matching device, please refer to the definition of the legal text matching method above, which will not be repeated here. Each module in the above-mentioned legal text matching device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0119] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, Figure 6 : is a schematic diagram of a computer device in an embodiment of the present invention. The computer device includes a processor, a memory, a network interface and a database connected by a device bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium and an internal memory. The readable storage medium stores an operating device, a computer-readable instruction and a database. The internal memory provides an environment for the operation of the operating device and the computer-readable instructions in the readable storage medium. The database of the computer device is used to store data involved in the legal text matching method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer-readable instruction is executed by the processor, a legal text matching method is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.

[0120] In one embodiment, a computer device is provided. The computer device may be a terminal device, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, and a network interface connected through a device bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium. The readable storage medium stores computer-readable instructions. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer-readable instructions are executed by the processor, a legal provision matching method is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.

[0121] In one embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, and when the processor executes the computer-readable instructions, the steps of the legal provision matching method described above are implemented.

[0122] In one embodiment, a readable storage medium is provided, the readable storage medium stores computer-readable instructions, and the computer-readable instructions are executed by the processor to implement the steps of the above-mentioned legal provisions matching method. A person of ordinary skill in the art can understand that the implementation of all or part of the process in the above-mentioned embodiment method can be completed by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer-readable instructions are executed, they may include the process of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0123] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0124] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A legal text matching method, characterized in that: include: Obtaining multiple clause data of each clause classification under the target project contract; Based on the target project contract, a pre-constructed legal text structure tree is searched level by level to obtain a legal article matching range, wherein the legal text structure tree is constructed by disassembling the legal text content level by level; Determine multiple target matching legal provisions for each of the article data based on the similarity between each of the article data and each legal provision within the legal provision matching range; The multiple target matching laws of each purpose data under each purpose classification are optimized to obtain the legal provisions matching results.

2. The legal clause matching method according to claim 1, characterized in that: The determining of a plurality of target matching legal provisions for each of the article data based on the similarity between each of the article data and each legal provision within the legal provision matching range includes: For each of the above mentioned data: Based on the legal provisions of the article data and the matching range of the legal provisions, extract the text feature vector of the article data and the legal feature vector of each legal provision; Calculating the similarity between the text feature vector and each of the legal provision feature vectors respectively; The similarities are sorted, and based on the similarity sorting results, a plurality of target matching legal provisions of the provision data are screened out from the legal provisions.

3. The legal clause matching method according to claim 1, characterized in that: The optimization of multiple target matching laws for each purpose data under each purpose classification to obtain legal provisions matching results includes: For each category: Input each item data under the item classification and multiple target matching laws of each item data into a preset large language model to obtain the detection result output by the large prediction model; According to the detection result, each of the target matching legal provisions is filtered to obtain the legal provision matching result.

4. The legal clause matching method according to claim 3, characterized in that: According to the detection result, filtering each of the target matching laws to obtain the legal provisions matching result includes: According to the detection result, multiple candidate laws are selected from the multiple target matching laws; The occurrence frequency of each of the candidate legal provisions is determined, so as to screen a preset number of candidate legal provisions as the legal provision matching results according to the occurrence frequency.

5. The legal clause matching method according to claim 1, characterized in that: The legal text structure tree is constructed based on the following steps: Obtain legal text content; According to the preset legal article node level division rules, the legal text content is disassembled level by level to obtain the level attribute information of each node, wherein the level attribute information includes the legal text of the current node, the node level and the level attribute information of the next node; Based on each of the hierarchical attribute information, the legal text structure tree is constructed.

6. The legal clause matching method according to claim 5, characterized in that: The obtaining of legal text content includes: Access to original legal data; The original legal data is preprocessed, and the legal text content is extracted based on the preprocessed legal data.

7. The legal clause matching method according to claim 1, characterized in that: The obtaining of several clause data of each clause classification under the target project contract includes: Determining a contract classification label of the target project contract; Based on the contract classification label, determine all clause classifications corresponding to the target project contract; A plurality of item data of each item classification is determined to cluster the item data of each item classification, and a plurality of item data of each item classification is screened according to the clustering result.

8. A legal clause matching device, characterized in that: include: An acquisition module is used to acquire a number of clause data of each clause classification under the target project contract; A search module is used to search the pre-constructed legal text structure tree level by level based on the target project contract to obtain a matching range of legal provisions, wherein the legal text structure tree is constructed by disassembling the legal text content level by level; A determination module, for determining a plurality of target matching legal provisions for each of the said article data based on the similarity between each of the said article data and each legal provision in the said legal provision matching range; The optimization module is used to optimize multiple target matching laws for each purpose data under each purpose classification to obtain legal provisions matching results.

9. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executed on the processor, characterized in that: When the processor executes the computer-readable instructions, the legal text matching method as described in any one of claims 1 to 7 is implemented.

10. A readable storage medium having computer readable instructions stored thereon, characterized in that: When the computer-readable instructions are executed by a processor, the legal clause matching method as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Document title tree construction method and device, electronic equipment and storage medium

    CN111460083A

  • Legal provision citation information extraction system

    CN112069307A

  • Contract review method and device, electronic equipment and storage medium

    CN117909499A

  • Case auxiliary information prompting method, device, storage medium and server

    WO2021042560A1

Cited By

  • Intelligent procurement system review method and system and electronic equipment

    CN121835928A