Legal text similarity threshold adjustment method, device and electronic device

By calculating the similarity matrix of legal text and training the legal clause recognition model, the problem of low efficiency in adjusting the legal text similarity threshold in the existing technology is solved, and efficient legal text similarity threshold adjustment and recognition accuracy are achieved.

CN112580323BActive Publication Date: 2024-10-22PINGAN INT SMART CITY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011534012.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-22
Publication Date
2024-10-22
Estimated Expiration
2040-12-22

AI Technical Summary

Technical Problem

The existing technology requires a large amount of manual annotation and optimization when determining the legal text similarity threshold, resulting in high labor costs and low adjustment efficiency. It cannot effectively reduce manual annotation and improve the adjustment efficiency of the legal text similarity threshold.

Method used

Calculate the similarity matrix through a small amount of legal texts carrying annotation information to determine the initial similarity threshold, and train the legal clause recognition model through a small amount of annotation information to obtain the second similarity threshold, and regularly optimize the similarity threshold to ensure Recognition accuracy, reducing manual annotation and improving adjustment efficiency.

Benefits of technology

It achieves the reduction of manual annotation, improves the adjustment efficiency of the legal text similarity threshold, and ensures the recognition accuracy and efficiency of the legal clause recognition model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112580323B_ABST
    Figure CN112580323B_ABST
Patent Text Reader

Abstract

The present invention relates to data processing, and discloses a method for adjusting a similarity threshold of legal texts, comprising: collecting a first number of first legal texts carrying first annotation information, and determining a first similarity threshold corresponding to each legal clause based on the first legal text; collecting a second number of second legal texts carrying second annotation information, and training a legal clause recognition model based on the first similarity threshold to obtain a second similarity threshold corresponding to each legal clause; obtaining a recognition result of a third legal text by the legal clause recognition model based on the second similarity threshold at preset intervals, and determining a third similarity threshold corresponding to each legal clause based on the recognition result. The present invention also provides a legal text similarity threshold adjustment device and electronic device. The present invention can reduce manual annotation and improve the adjustment efficiency of the legal text similarity threshold.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to data processing of big data, and in particular to a method, device and electronic device for adjusting a similarity threshold of legal texts. Background Art

[0002] With the advancement of science and technology, artificial intelligence has developed rapidly, and legal-related industries have also gradually introduced artificial intelligence. For example, when reviewing a contract text, the contract text is disassembled through a model, and the similarity between the disassembled text and the pre-annotated legal clause samples is calculated. When the calculated similarity exceeds the similarity threshold, the legal clause can be located. The similarity threshold plays a key role in the location of the legal clause. However, how to determine the appropriate legal text similarity threshold?

[0003] At present, when determining the similarity threshold of legal texts, different similarity thresholds need to be trained for different clauses. Usually, a large amount of sampling and annotation work is required in the early stage to determine the initial similarity threshold of the legal text; in the actual application process, the similarity threshold needs to be continuously optimized to ensure the recognition accuracy of legal clauses. At this time, the texts during the operation period need to be manually combed and annotated to determine the appropriate similarity threshold. This method makes the labor cost high and the adjustment efficiency of the legal text similarity threshold is low. Therefore, a legal text similarity threshold adjustment method is urgently needed to reduce manual annotation and improve the adjustment efficiency of the legal text similarity threshold. Summary of the invention

[0004] In view of the above, it is necessary to provide a legal text similarity threshold adjustment method, aiming to reduce manual annotation and improve the adjustment efficiency of the legal text similarity threshold.

[0005] The method for adjusting the legal text similarity threshold provided by the present invention comprises:

[0006] Responding to a legal text similarity threshold adjustment request issued by a user based on a client, parsing the request, and obtaining multiple legal clauses carried in the request;

[0007] Collecting a first number of first legal texts carrying first annotation information, and determining a first similarity threshold corresponding to each of the plurality of legal clauses based on the first legal texts;

[0008] Collecting a second number of second legal texts carrying second annotation information, training a legal clause recognition model based on the first similarity threshold, and obtaining a second similarity threshold corresponding to each legal clause;

[0009] At preset time intervals, the recognition result of the legal clause recognition model on the third legal text based on the second similarity threshold is obtained, and the third similarity threshold corresponding to each legal clause is determined based on the recognition result.

[0010] Optionally, determining a first similarity threshold corresponding to each of the plurality of legal clauses based on the first legal text includes:

[0011] Obtaining a first subtext corresponding to the first annotation information in the first legal text;

[0012] Grouping the first subtexts based on the first annotation information to obtain a subtext group corresponding to each legal clause in the plurality of legal clauses;

[0013] Calculating a first similarity value between each subtext and other subtexts in the subtext group corresponding to each legal clause to obtain a similarity matrix corresponding to each legal clause;

[0014] The set of maximum values ​​of each row in the similarity matrix corresponding to each legal clause is used as the set of similarity values ​​corresponding to each legal clause;

[0015] The smallest similarity value in the similarity set corresponding to each legal clause is used as the first similarity threshold corresponding to each legal clause.

[0016] Optionally, the training of the legal clause recognition model based on the first similarity threshold to obtain the second similarity threshold corresponding to each legal clause includes:

[0017] Writing the second legal text into a sample pool, extracting a first proportion of samples from the sample pool as training samples, extracting a second proportion of samples as test samples, taking the set of the training samples and the test samples as a sample set, and cyclically extracting to obtain multiple sample sets;

[0018] The clause recognition result of each test sample in each sample set is determined based on the first similarity threshold, and the second similarity threshold corresponding to each legal clause is determined according to the clause recognition result.

[0019] Optionally, determining the clause recognition result of each test sample in each sample set based on the first similarity threshold includes:

[0020] Obtaining the second subtext corresponding to the second annotation information of each training sample in each sample set, to obtain the second subtext set corresponding to each sample set;

[0021] Inputting each test sample in each sample set into the text decomposition area of ​​the legal clause recognition model to obtain a plurality of third subtexts corresponding to each test sample in each sample set;

[0022] Calculating a second similarity value between each third subtext in a plurality of third subtexts corresponding to each test sample in each sample set and each second subtext in the second subtext set, and taking the second subtext corresponding to the largest second similarity value as the initial legal clause corresponding to each third subtext;

[0023] When the maximum second similarity value is greater than the first similarity threshold corresponding to the initial legal clause, the initial legal clause is used as the predicted legal clause corresponding to each third subtext, and the maximum second similarity value is used as the third similarity value corresponding to each third subtext;

[0024] The clause recognition result of the test sample corresponding to each third sub-text is determined according to the second annotation information corresponding to each third sub-text and the predicted legal clause.

[0025] Optionally, determining the second similarity threshold corresponding to each legal clause according to the clause recognition result includes:

[0026] The set of third subtexts with the same predicted legal clauses is taken as the third subtext set, and the third subtext set corresponding to each legal clause is obtained;

[0027] Marking the third subtexts corresponding to each legal clause in the third subtext set with a correct clause recognition result as a first mark, and marking the third subtexts corresponding to the third subtext set with an incorrect clause recognition result as a second mark;

[0028] The third subtexts in the third subtext set corresponding to each legal clause are sorted in descending order according to the third similarity values, and the second similarity threshold corresponding to each legal clause is determined based on the first mark, the second mark and the sorted queue.

[0029] Optionally, determining the second similarity threshold corresponding to each legal clause based on the first mark, the second mark and the sorted queue includes:

[0030] Determine whether the third subtexts corresponding to the first markers in the sorted queue corresponding to each legal clause are all arranged before the third subtexts corresponding to the second markers;

[0031] When the judgment result is yes, the middle numerical interval between the third similarity value of the third subtext corresponding to the last first mark in the sorted queue corresponding to each legal clause and the third similarity value of the third subtext corresponding to the first second mark is used as the threshold adjustment interval corresponding to each legal clause;

[0032] A value is randomly selected from the threshold adjustment interval as the second similarity threshold corresponding to each legal clause.

[0033] Optionally, after determining whether all the third subtexts corresponding to the first mark in the sorted queue corresponding to each legal clause are arranged before the third subtexts corresponding to the second mark, the method further includes:

[0034] If the judgment result is no, the third subtext marked as the second mark is added to the sample pool as a negative sample of each legal clause, and the third similarity values ​​of the negative samples corresponding to each legal clause are compared, and the largest third similarity value is used as the negative sample threshold corresponding to each legal clause;

[0035] Re-extract sample sets from the sample pool, and input the training samples and test samples in each sample set into the clause recognition model for training and testing respectively; if the fourth similarity value between a designated test sample and a negative sample is greater than the negative sample threshold, the designated test sample is marked as a second mark and written into the sample pool, and sample sets are continuously extracted to train the legal clause recognition model until the threshold adjustment interval is determined.

[0036] Optionally, the recognition result includes clause identification information corresponding to the third legal text and an approval result fed back by the user based on the clause identification information, and determining the third similarity threshold corresponding to each legal clause based on the recognition result includes:

[0037] Determining the recognition accuracy of each legal clause by the clause recognition model based on the clause recognition information and the approval results;

[0038] If the recognition accuracy corresponding to a certain designated legal clause is lower than the accuracy threshold, the clause identification information corresponding to the third proportion of the third legal texts whose approval result corresponding to the designated legal clause is passed is used as the third annotation information of the third legal text;

[0039] The third legal text carrying the third annotation information is written into the sample pool, and the sample sets are re-extracted. Each sample set is input into the legal clause recognition model for training until a new threshold adjustment interval is determined, and any value in the new threshold adjustment interval is taken as the third similarity threshold corresponding to the specified legal clause.

[0040] In order to solve the above problem, the present invention also provides a device for adjusting the similarity threshold of legal texts, the device comprising:

[0041] A request module, used to respond to a legal text similarity threshold adjustment request issued by a user based on a client, parse the request, and obtain multiple legal clauses carried in the request;

[0042] A first collection module, configured to collect a first number of first legal texts carrying first annotation information, and determine a first similarity threshold corresponding to each of the plurality of legal clauses based on the first legal texts;

[0043] A second collection module is used to collect a second number of second legal texts carrying second annotation information, and train a legal clause recognition model based on the first similarity threshold to obtain a second similarity threshold corresponding to each legal clause;

[0044] The determination module is used to obtain the recognition result of the third legal text by the legal clause recognition model based on the second similarity threshold at preset time intervals, and determine the third similarity threshold corresponding to each legal clause based on the recognition result.

[0045] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:

[0046] at least one processor; and,

[0047] a memory communicatively connected to the at least one processor; wherein,

[0048] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the above-mentioned legal text similarity threshold adjustment method.

[0049] Compared with the prior art, the present invention first calculates the similarity matrix corresponding to each legal clause through a relatively small amount of the first legal text carrying the first annotation information, and determines the first similarity threshold corresponding to each legal clause according to the similarity matrix. This step ensures that the first similarity threshold will not be too low (to prevent similar legal clauses from being mistakenly identified as correct legal clauses), and at the same time ensures that most legal texts can be correctly identified by the legal clause recognition model; then, the legal clause recognition model is trained through a small amount of the second legal text carrying the second annotation information to obtain the second similarity threshold corresponding to each legal clause. Based on the second similarity threshold, the legal clause recognition model can correctly identify the legal clauses of all samples in the sample pool; finally, at preset intervals, the similarity threshold is regularly optimized according to the recognition result of the legal clause recognition model within the preset time period to ensure the recognition accuracy of the legal clause recognition model, and at the same time improve the adjustment efficiency of the similarity threshold. Therefore, the present invention reduces manual annotation and improves the adjustment efficiency of the legal text similarity threshold. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1A schematic diagram of a flow chart of a method for adjusting a legal text similarity threshold provided by an embodiment of the present invention;

[0051] Figure 2 A schematic diagram of a module of a device for adjusting a legal text similarity threshold provided by an embodiment of the present invention;

[0052] Figure 3 A schematic diagram of the structure of an electronic device for implementing a method for adjusting a legal text similarity threshold provided by an embodiment of the present invention;

[0053] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0055] It should be noted that the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0056] The present invention provides a method for adjusting the similarity threshold of legal texts. Figure 1 FIG. 1 is a flow chart of a method for adjusting a legal text similarity threshold provided by an embodiment of the present invention. The method can be executed by an electronic device, and the electronic device can be implemented by software and / or hardware.

[0057] In this embodiment, the method for adjusting the legal text similarity threshold includes:

[0058] S1, responding to a legal text similarity threshold adjustment request issued by a user based on a client, parsing the request, and obtaining multiple legal clauses carried in the request;

[0059] S2. Collect a first number of first legal texts carrying first annotation information, and determine a first similarity threshold corresponding to each of the multiple legal clauses based on the first legal texts.

[0060] The purpose of the present invention is to determine a suitable legal text similarity threshold through a smaller number of annotated samples. Therefore, the first number in the present invention is relatively small. In this embodiment, the first number is 5 and the legal text is a contract text.

[0061] Determining the first similarity threshold corresponding to each of the plurality of legal clauses based on the first legal text includes:

[0062] A1. Obtain a first subtext corresponding to the first annotation information in the first legal text;

[0063] Assume that the first annotation information of the five contract texts are:

[0064] In Contract 1, paragraph 2 is marked as Legal Clause 1, paragraph 4 is marked as Legal Clause 2, and paragraph 5 is marked as Legal Clause 4;

[0065] In Contract 2, paragraph 3 is marked as Legal Clause 1, paragraph 5 is marked as Legal Clause 3, and paragraph 7 is marked as Legal Clause 5;

[0066] Paragraph 5 of Contract 3 is marked with Legal Clause 2;

[0067] Paragraph 3 of Contract 4 is marked as Legal Clause 3, Paragraph 5 is marked as Legal Clause 1, and Paragraph 8 is marked as Legal Clause 2;

[0068] Paragraph 1 of Contract 5 is marked as Legal Clause 2, paragraph 4 is marked as Legal Clause 3, paragraph 6 is marked as Legal Clause 1, and paragraph 9 is marked as Legal Clause 5.

[0069] If the legal text similarity threshold adjustment request sent by the user only includes legal clause 1, legal clause 2, and legal clause 3, only the sub-text marked as legal clause 1, legal clause 2, and legal clause 3 in each contract text is obtained.

[0070] A2. Grouping the first subtexts based on the first annotation information to obtain a subtext group corresponding to each legal clause in the plurality of legal clauses;

[0071] The subtext marked as Legal Clause 1 includes: Paragraph 2 of Contract 1, Paragraph 3 of Contract 2, Paragraph 5 of Contract 4, and Paragraph 6 of Contract 5. The subtext group corresponding to Legal Clause 1 includes Paragraph 2 of Contract 1, Paragraph 3 of Contract 2, Paragraph 5 of Contract 4, and Paragraph 6 of Contract 5.

[0072] A3, calculating a first similarity value between each subtext and other subtexts in the subtext group corresponding to each legal clause, and obtaining a similarity matrix corresponding to each legal clause;

[0073] Taking legal clause 1 as an example, assuming that the calculation results of the first similarity between the first subtext (i.e., paragraph 2 of contract 1) and other subtexts in the subtext group corresponding to legal clause 1 are as follows:

[0074] The first similarity value between paragraph 2 of contract 1 and paragraph 3 of contract 2 is 0.91;

[0075] The first similarity value between paragraph 2 of contract 1 and paragraph 5 of contract 4 is 0.88;

[0076] The first similarity value between paragraph 2 of contract 1 and paragraph 6 of contract 5 is 0.94;

[0077] By analogy, the first similarity value between each subtext and other subtexts in the subtext group corresponding to legal clause 1 can be calculated, and the similarity matrix corresponding to legal clause 1 can be obtained. Assume that the similarity matrix corresponding to legal clause 1 is:

[0078]

[0079] Among them, Y1 is the similarity matrix corresponding to legal clause 1. The first row in the similarity matrix is ​​the similarity value between the first sub-text (i.e., paragraph 1 of Contract 1) and other sub-texts, and the second row is the similarity value between the second sub-text (i.e., paragraph 3 of Contract 2) and other sub-texts.

[0080] A4. Taking the set of maximum values ​​of each row in the similarity matrix corresponding to each legal clause as the set of similarity values ​​corresponding to each legal clause;

[0081] A5. Taking the smallest similarity value in the similarity set corresponding to each legal clause as the first similarity threshold corresponding to each legal clause.

[0082] Therefore, the similarity set corresponding to Legal Clause 1 is: {0.94, 0.92, 0.93, 0.95}, where 0.92 is the first similarity threshold of Legal Clause 1.

[0083] The method for determining the first similarity threshold in this step ensures that the first similarity threshold will not be too low (to prevent similar legal terms from being mistakenly identified as correct legal terms), while also ensuring that most contract texts can be correctly identified by the legal terms recognition model.

[0084] S3: Collect a second number of second legal texts carrying second annotation information, and train a legal clause recognition model based on the first similarity threshold to obtain a second similarity threshold corresponding to each legal clause;

[0085] In this step, the legal clause recognition model is trained through the second legal text and the first similarity threshold is adjusted, with the aim of making the recognition accuracy of the legal clause recognition model higher.

[0086] In this embodiment, the legal clause recognition model is a deep neural network model, which is used to decompose the input legal text, calculate the similarity between the decomposed text and the pre-labeled legal clause samples, and when the calculated similarity value is greater than a preset threshold, output the legal clause corresponding to the legal text.

[0087] The training of the legal clause recognition model based on the first similarity threshold to obtain the second similarity threshold corresponding to each legal clause includes:

[0088] B1. Write the second legal text into a sample pool, extract a first proportion of samples from the sample pool as training samples, extract a second proportion of samples as test samples, and use the set of training samples and test samples as a sample set, and extract in a loop to obtain multiple sample sets;

[0089] This embodiment is described by taking the second quantity of 10 as an example. There are 10 second legal texts in the sample pool. Eight legal texts are used as training samples, and the other two legal texts are used as test samples. After cyclic extraction, 45 sample sets can be obtained.

[0090] B2. Determine a clause recognition result of each test sample in each sample set based on the first similarity threshold, and determine a second similarity threshold corresponding to each legal clause according to the clause recognition result.

[0091] In this embodiment, determining the clause recognition result of each test sample in each sample set based on the first similarity threshold includes:

[0092] C1. Obtain the second subtext corresponding to the second annotation information of each training sample in each sample set, and obtain the second subtext set corresponding to each sample set;

[0093] C2. Input each test sample in each sample set into the text decomposition area of ​​the legal clause recognition model to obtain a plurality of third subtexts corresponding to each test sample in each sample set;

[0094] In this embodiment, the text type of each legal clause in the request is adjusted according to the legal text similarity threshold to determine the splitting method of each test sample. For example, if the text type of each legal clause in the request is a paragraph, each test sample is split into paragraphs; if the text type of each legal clause in the request is a sentence, each test sample is split into sentences.

[0095] C3, calculating the second similarity value between each third subtext in the plurality of third subtexts corresponding to each test sample in each sample set and each second subtext in the second subtext set, and taking the second subtext corresponding to the largest second similarity value as the initial legal clause corresponding to each third subtext;

[0096] C4. When the maximum second similarity value is greater than the first similarity threshold corresponding to the initial legal clause, use the initial legal clause as the predicted legal clause corresponding to each third subtext, and use the maximum second similarity value as the third similarity value corresponding to each third subtext;

[0097] C5. Determine the clause recognition result of the test sample corresponding to each third sub-text according to the second annotation information corresponding to each third sub-text and the predicted legal clause.

[0098] If the legal terms marked in the second marking information are the same as the predicted legal terms, the terms recognition result is correct; if the legal terms marked in the second marking information are different from the predicted legal terms, the terms recognition result is incorrect.

[0099] In this embodiment, determining the second similarity threshold corresponding to each legal clause according to the clause recognition result includes:

[0100] D1. The set of third subtexts with the same predicted legal clauses is taken as the third subtext set, and the third subtext set corresponding to each legal clause is obtained;

[0101] D2, marking the third sub-texts corresponding to each legal clause in the third sub-text set with a correct clause recognition result as a first mark, and marking the third sub-texts corresponding to the third sub-text set with an incorrect clause recognition result as a second mark;

[0102] In this embodiment, the first mark is 1 and the second mark is 0.

[0103] D3. Sort the third subtexts in the third subtext set corresponding to each legal clause in descending order of the third similarity values, and determine the second similarity threshold corresponding to each legal clause based on the first mark, the second mark and the sorted queue.

[0104] The determining of the second similarity threshold corresponding to each legal clause based on the first mark, the second mark and the sorted queue includes:

[0105] E1. Determine whether the third subtexts corresponding to the first mark in the sorted queue corresponding to each legal clause are all arranged before the third subtexts corresponding to the second mark;

[0106] E2. When the judgment result is yes, the middle value interval between the third similarity value of the third subtext corresponding to the last first mark in the sorted queue corresponding to each legal clause and the third similarity value of the third subtext corresponding to the first second mark is used as the threshold adjustment interval corresponding to each legal clause;

[0107] E3. Randomly select a value from the threshold adjustment interval as the second similarity threshold corresponding to each legal clause.

[0108] The purpose of this step is to make the third similarity values ​​of the third sub-text marked as 1 all greater than the second similarity threshold, and the third similarity values ​​of the third sub-text marked as 0 all less than the second similarity threshold. At this time, the clause recognition model can correctly identify the legal clauses of all samples in the sample pool.

[0109] In this embodiment, after determining whether the third subtexts corresponding to the first mark in the sorted queue corresponding to each legal clause are all arranged before the third subtexts corresponding to the second mark, the method further includes:

[0110] F1. If the judgment result is no, the third subtext marked as the second mark is added to the sample pool as a negative sample of each legal clause, and the third similarity values ​​of the negative samples corresponding to each legal clause are compared, and the largest third similarity value is used as the negative sample threshold corresponding to each legal clause;

[0111] F2. Re-extract sample sets from the sample pool, and input the training samples and test samples in each sample set into the clause recognition model for training and testing respectively. If the fourth similarity value between a designated test sample and a negative sample is greater than the negative sample threshold, the designated test sample is marked as a second tag and written into the sample pool, and the sample sets are continuously extracted to train the legal clause recognition model until the threshold adjustment interval is determined.

[0112] S4. At preset time intervals, obtain the recognition result of the legal clause recognition model on the third legal text based on the second similarity threshold, and determine the third similarity threshold corresponding to each legal clause based on the recognition result.

[0113] This step is used to regularly optimize the similarity threshold of the legal terms recognition model after it is put into production and operation.

[0114] In this embodiment, the recognition result includes the clause identification information corresponding to the third legal text and the approval result fed back by the user based on the clause identification information, and the third similarity threshold corresponding to each legal clause is determined based on the recognition result, including:

[0115] G1. Determine the recognition accuracy of each legal clause by the clause recognition model based on the clause recognition information and approval results;

[0116] If the approval result is passed, it is considered that the clause identification information identified by the legal clause identification model for the third legal text is accurate. If the approval result is failed, it is considered that the clause identification information identified by the legal clause identification model is wrong. The recognition accuracy of the legal clause identification model for each legal clause can be determined based on the approval result.

[0117] G2. If the recognition accuracy corresponding to a certain designated legal clause is lower than the accuracy threshold, the clause identification information corresponding to the third proportion of the third legal text with the approval result corresponding to the designated legal clause being passed is used as the third annotation information of the third legal text;

[0118] G3. Write the third legal text carrying the third annotation information into the sample pool, re-extract the sample set, input each sample set into the legal clause recognition model for training until a new threshold adjustment interval is determined, and randomly select a value from the new threshold adjustment interval as the third similarity threshold corresponding to the specified legal clause.

[0119] It can be seen from the above embodiments that the method for adjusting the similarity threshold of legal texts proposed by the present invention, first, calculates the similarity matrix corresponding to each legal clause through a small amount of first legal texts carrying first annotation information, and determines the first similarity threshold corresponding to each legal clause according to the similarity matrix. This step ensures that the first similarity threshold will not be too low (to prevent similar legal clauses from being mistakenly identified as correct legal clauses), and at the same time ensures that most legal texts can be correctly identified by the legal clause recognition model; then, the legal clause recognition model is trained through a small amount of second legal texts carrying second annotation information to obtain the second similarity threshold corresponding to each legal clause, and based on the second similarity threshold, the legal clause recognition model can correctly identify the legal clauses of all samples in the sample pool; finally, at preset intervals, the similarity threshold is regularly optimized according to the recognition result of the legal clause recognition model within the preset time period to ensure the recognition accuracy of the legal clause recognition model, and at the same time improve the adjustment efficiency of the similarity threshold. Therefore, the present invention reduces manual annotation and improves the adjustment efficiency of the legal text similarity threshold.

[0120] like Figure 2 , which is a module schematic diagram of a legal text similarity threshold adjustment device provided in one embodiment of the present invention.

[0121] The legal text similarity threshold adjustment device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the legal text similarity threshold adjustment device 100 can include a request module 110, a first acquisition module 120, a second acquisition module 130 and a determination module 140. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.

[0122] In this embodiment, the functions of each module / unit are as follows:

[0123] The request module 110 is used to respond to the legal text similarity threshold adjustment request issued by the user based on the client, parse the request, and obtain multiple legal clauses carried in the request;

[0124] The first collection module 120 is used to collect a first number of first legal texts carrying first annotation information, and determine a first similarity threshold corresponding to each of the multiple legal clauses based on the first legal texts.

[0125] The purpose of the present invention is to determine a suitable legal text similarity threshold through a smaller number of annotated samples. Therefore, the first number in the present invention is relatively small. In this embodiment, the first number is 5 and the legal text is a contract text.

[0126] Determining the first similarity threshold corresponding to each of the plurality of legal clauses based on the first legal text includes:

[0127] A1. Obtain a first subtext corresponding to the first annotation information in the first legal text;

[0128] Assume that the first annotation information of the five contract texts are:

[0129] In Contract 1, paragraph 2 is marked as Legal Clause 1, paragraph 4 is marked as Legal Clause 2, and paragraph 5 is marked as Legal Clause 4;

[0130] In Contract 2, paragraph 3 is marked as Legal Clause 1, paragraph 5 is marked as Legal Clause 3, and paragraph 7 is marked as Legal Clause 5;

[0131] Paragraph 5 of Contract 3 is marked with Legal Clause 2;

[0132] Paragraph 3 of Contract 4 is marked as Legal Clause 3, Paragraph 5 is marked as Legal Clause 1, and Paragraph 8 is marked as Legal Clause 2;

[0133] Paragraph 1 of Contract 5 is marked as Legal Clause 2, paragraph 4 is marked as Legal Clause 3, paragraph 6 is marked as Legal Clause 1, and paragraph 9 is marked as Legal Clause 5.

[0134] If the legal text similarity threshold adjustment request issued by the user only includes the identifiers of Legal Clause 1, Legal Clause 2, and Legal Clause 3, only the sub-texts marked as Legal Clause 1, Legal Clause 2, and Legal Clause 3 in each contract text are obtained.

[0135] A2. Grouping the first subtexts based on the first annotation information to obtain a subtext group corresponding to each legal clause in the plurality of legal clauses;

[0136] The subtext marked as Legal Clause 1 includes: Paragraph 2 of Contract 1, Paragraph 3 of Contract 2, Paragraph 5 of Contract 4, and Paragraph 6 of Contract 5. The subtext group corresponding to Legal Clause 1 includes Paragraph 2 of Contract 1, Paragraph 3 of Contract 2, Paragraph 5 of Contract 4, and Paragraph 6 of Contract 5.

[0137] A3, calculating a first similarity value between each subtext and other subtexts in the subtext group corresponding to each legal clause, and obtaining a similarity matrix corresponding to each legal clause;

[0138] Taking legal clause 1 as an example, assuming that the calculation results of the first similarity between the first subtext (i.e., paragraph 2 of contract 1) and other subtexts in the subtext group corresponding to legal clause 1 are as follows:

[0139] The first similarity value between paragraph 2 of contract 1 and paragraph 3 of contract 2 is 0.91;

[0140] The first similarity value between paragraph 2 of contract 1 and paragraph 5 of contract 4 is 0.88;

[0141] The first similarity value between paragraph 2 of contract 1 and paragraph 6 of contract 5 is 0.94;

[0142] By analogy, the first similarity value between each subtext and other subtexts in the subtext group corresponding to legal clause 1 can be calculated, and the similarity matrix corresponding to legal clause 1 can be obtained. Assume that the similarity matrix corresponding to legal clause 1 is:

[0143]

[0144] Among them, Y1 is the similarity matrix corresponding to legal clause 1. The first row in the similarity matrix is ​​the similarity value between the first sub-text (i.e., paragraph 1 of Contract 1) and other sub-texts, and the second row is the similarity value between the second sub-text (i.e., paragraph 3 of Contract 2) and other sub-texts.

[0145] A4. Taking the set of maximum values ​​of each row in the similarity matrix corresponding to each legal clause as the set of similarity values ​​corresponding to each legal clause;

[0146] A5. Taking the smallest similarity value in the similarity set corresponding to each legal clause as the first similarity threshold corresponding to each legal clause.

[0147] Therefore, the similarity set corresponding to Legal Clause 1 is: {0.94, 0.92, 0.93, 0.95}, where 0.92 is the first similarity threshold of Legal Clause 1.

[0148] The method for determining the first similarity threshold in this step ensures that the first similarity threshold will not be too low (to prevent similar legal clauses from being mistakenly identified as correct legal clauses), while also ensuring that most contract texts can be correctly identified by the legal clause recognition model.

[0149] A second collection module 130 is used to collect a second number of second legal texts carrying second annotation information, and train a legal clause recognition model based on the first similarity threshold to obtain a second similarity threshold corresponding to each legal clause;

[0150] In this step, the legal clause recognition model is trained through the second legal text and the first similarity threshold is adjusted, with the aim of making the recognition accuracy of the legal clause recognition model higher.

[0151] In this embodiment, the legal clause recognition model is a deep neural network model, which is used to decompose the input legal text, calculate the similarity between the decomposed text and the pre-labeled legal clause samples, and when the calculated similarity value is greater than a preset threshold, output the legal clause corresponding to the legal text.

[0152] The training of the legal clause recognition model based on the first similarity threshold to obtain the second similarity threshold corresponding to each legal clause includes:

[0153] B1. Write the second legal text into a sample pool, extract a first proportion of samples from the sample pool as training samples, extract a second proportion of samples as test samples, and use the set of training samples and test samples as a sample set, and extract in a loop to obtain multiple sample sets;

[0154] This embodiment is described by taking the second quantity of 10 as an example. There are 10 second legal texts in the sample pool. Eight legal texts are used as training samples, and the other two legal texts are used as test samples. After cyclic extraction, 45 sample sets can be obtained.

[0155] B2. Determine a clause recognition result of each test sample in each sample set based on the first similarity threshold, and determine a second similarity threshold corresponding to each legal clause according to the clause recognition result.

[0156] In this embodiment, determining the clause recognition result of each test sample in each sample set based on the first similarity threshold includes:

[0157] C1. Obtain the second subtext corresponding to the second annotation information of each training sample in each sample set, and obtain the second subtext set corresponding to each sample set;

[0158] C2. Input each test sample in each sample set into the text decomposition area of ​​the legal clause recognition model to obtain a plurality of third subtexts corresponding to each test sample in each sample set;

[0159] In this embodiment, the text type of each legal clause in the request is adjusted according to the legal text similarity threshold to determine the splitting method of each test sample. For example, if the text type of each legal clause in the request is a paragraph, each test sample is split into paragraphs; if the text type of each legal clause in the request is a sentence, each test sample is split into sentences.

[0160] C3, calculating the second similarity value between each third subtext in the plurality of third subtexts corresponding to each test sample in each sample set and each second subtext in the second subtext set, and taking the second subtext corresponding to the largest second similarity value as the initial legal clause corresponding to each third subtext;

[0161] C4. When the maximum second similarity value is greater than the first similarity threshold corresponding to the initial legal clause, use the initial legal clause as the predicted legal clause corresponding to each third subtext, and use the maximum second similarity value as the third similarity value corresponding to each third subtext;

[0162] C5. Determine the clause recognition result of the test sample corresponding to each third sub-text according to the second annotation information corresponding to each third sub-text and the predicted legal clause.

[0163] If the legal terms marked in the second marking information are the same as the predicted legal terms, the terms recognition result is correct; if the legal terms marked in the second marking information are different from the predicted legal terms, the terms recognition result is incorrect.

[0164] In this embodiment, determining the second similarity threshold corresponding to each legal clause according to the clause recognition result includes:

[0165] D1. The set of third subtexts with the same predicted legal clauses is taken as the third subtext set, and the third subtext set corresponding to each legal clause is obtained;

[0166] D2, marking the third sub-texts corresponding to each legal clause in the third sub-text set with a correct clause recognition result as a first mark, and marking the third sub-texts corresponding to the third sub-text set with an incorrect clause recognition result as a second mark;

[0167] In this embodiment, the first mark is 1 and the second mark is 0.

[0168] D3. Sort the third subtexts in the third subtext set corresponding to each legal clause in descending order of the third similarity values, and determine the second similarity threshold corresponding to each legal clause based on the first mark, the second mark and the sorted queue.

[0169] The determining of the second similarity threshold corresponding to each legal clause based on the first mark, the second mark and the sorted queue includes:

[0170] E1. Determine whether the third subtexts corresponding to the first mark in the sorted queue corresponding to each legal clause are all arranged before the third subtexts corresponding to the second mark;

[0171] E2. When the judgment result is yes, the middle value interval between the third similarity value of the third subtext corresponding to the last first mark in the sorted queue corresponding to each legal clause and the third similarity value of the third subtext corresponding to the first second mark is used as the threshold adjustment interval corresponding to each legal clause;

[0172] E3. Randomly select a value from the threshold adjustment interval as the second similarity threshold corresponding to each legal clause.

[0173] The purpose of this step is to make the third similarity values ​​of the third sub-text marked as 1 all greater than the second similarity threshold, and the third similarity values ​​of the third sub-text marked as 0 all less than the second similarity threshold. At this time, the clause recognition model can correctly identify the legal clauses of all samples in the sample pool.

[0174] In this embodiment, after determining whether the third subtexts corresponding to the first mark in the sorted queue corresponding to each legal clause are all arranged before the third subtexts corresponding to the second mark, the second acquisition module 130 is further used to:

[0175] F1. If the judgment result is no, the third subtext marked as the second mark is added to the sample pool as a negative sample of each legal clause, and the third similarity values ​​of the negative samples corresponding to each legal clause are compared, and the largest third similarity value is used as the negative sample threshold corresponding to each legal clause;

[0176] F2. Re-extract sample sets from the sample pool, and input the training samples and test samples in each sample set into the clause recognition model for training and testing respectively. If the fourth similarity value between a designated test sample and a negative sample is greater than the negative sample threshold, the designated test sample is marked as a second tag and written into the sample pool, and the sample sets are continuously extracted to train the legal clause recognition model until the threshold adjustment interval is determined.

[0177] The determination module 140 is used to obtain the recognition result of the third legal text by the legal clause recognition model based on the second similarity threshold at preset time intervals, and determine the third similarity threshold corresponding to each legal clause based on the recognition result.

[0178] This step is used to regularly optimize the similarity threshold of the legal terms recognition model after it is put into production and operation.

[0179] In this embodiment, the recognition result includes the clause identification information corresponding to the third legal text and the approval result fed back by the user based on the clause identification information, and the third similarity threshold corresponding to each legal clause is determined based on the recognition result, including:

[0180] G1. Determine the recognition accuracy of each legal clause by the clause recognition model based on the clause recognition information and approval results;

[0181] If the approval result is passed, it is considered that the clause identification information identified by the legal clause identification model for the third legal text is accurate. If the approval result is failed, it is considered that the clause identification information identified by the legal clause identification model is wrong. The recognition accuracy of the legal clause identification model for each legal clause can be determined based on the approval result.

[0182] G2. If the recognition accuracy corresponding to a certain designated legal clause is lower than the accuracy threshold, the clause identification information corresponding to the third proportion of the third legal text with the approval result corresponding to the designated legal clause being passed is used as the third annotation information of the third legal text;

[0183] G3. Write the third legal text carrying the third annotation information into the sample pool, re-extract the sample set, input each sample set into the legal clause recognition model for training until a new threshold adjustment interval is determined, and randomly select a value from the new threshold adjustment interval as the third similarity threshold corresponding to the specified legal clause.

[0184] like Figure 3 , which is a schematic diagram of the structure of an electronic device for implementing a method for adjusting a legal text similarity threshold value provided by an embodiment of the present invention.

[0185] The electronic device 1 is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions. The electronic device 1 can be a computer, a single network server, a server group consisting of multiple network servers, or a cloud based on cloud computing consisting of a large number of hosts or network servers, wherein cloud computing is a type of distributed computing, a super virtual computer composed of a group of loosely coupled computer sets.

[0186] In this embodiment, the electronic device 1 includes, but is not limited to, a memory 11, a processor 12, and a network interface 13, which can be interconnected and communicated via a system bus. The memory 11 stores a legal text similarity threshold adjustment program 10, and the legal text similarity threshold adjustment program 10 can be executed by the processor 12. Figure 3 Only the electronic device 1 having the components 11-13 and the legal text similarity threshold adjustment program 10 is shown. It can be understood by those skilled in the art that Figure 3 The structure shown does not constitute a limitation on the electronic device 1 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0187] The memory 11 includes a memory and at least one type of readable storage medium. The memory provides a cache for the operation of the electronic device 1; the readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the readable storage medium may be an internal storage unit of the electronic device 1, such as a hard disk of the electronic device 1; in other embodiments, the non-volatile storage medium may also be an external storage device of the electronic device 1, such as a plug-in hard disk equipped on the electronic device 1, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. In this embodiment, the readable storage medium of the memory 11 is generally used to store an operating system and various application software installed on the electronic device 1, such as storing the code of the legal text similarity threshold adjustment program 10 in an embodiment of the present invention. In addition, the memory 11 can also be used to temporarily store various types of data that have been output or are to be output.

[0188] In some embodiments, the processor 12 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 12 is generally used to control the overall operation of the electronic device 1, such as performing control and processing related to data interaction or communication with other devices. In this embodiment, the processor 12 is used to run the program code stored in the memory 11 or process data, such as running the legal text similarity threshold adjustment program 10.

[0189] The network interface 13 may include a wireless network interface or a wired network interface, and the network interface 13 is used to establish a communication connection between the electronic device 1 and a client (not shown in the figure).

[0190] Optionally, the electronic device 1 may further include a user interface, which may include a display (Display), an input unit such as a keyboard (Keyboard), and the optional user interface may also include a standard wired interface and a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.

[0191] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0192] The legal text similarity threshold adjustment program 10 stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 12, it can achieve:

[0193] Responding to a legal text similarity threshold adjustment request issued by a user based on a client, parsing the request, and obtaining multiple legal clauses carried in the request;

[0194] Collecting a first number of first legal texts carrying first annotation information, and determining a first similarity threshold corresponding to each of the plurality of legal clauses based on the first legal texts;

[0195] Collecting a second number of second legal texts carrying second annotation information, training a legal clause recognition model based on the first similarity threshold, and obtaining a second similarity threshold corresponding to each legal clause;

[0196] At preset time intervals, the recognition result of the legal clause recognition model on the third legal text based on the second similarity threshold is obtained, and the third similarity threshold corresponding to each legal clause is determined based on the recognition result.

[0197] Specifically, the specific implementation method of the processor 12 for the above instructions can refer to Figure 1 The description of the relevant steps in the corresponding embodiment is not repeated here. It should be emphasized that in order to further ensure the privacy and security of the first, second and third legal texts, the first, second and third legal texts can also be stored in a node of a blockchain.

[0198] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0199] The computer-readable storage medium stores a legal text similarity threshold adjustment program 10, which can be executed by one or more processors. The specific implementation of the computer-readable storage medium of the present invention is basically the same as the above-mentioned legal text similarity threshold adjustment method embodiments, and will not be repeated here.

[0200] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0201] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0202] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0203] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0204] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0205] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0206] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The second and other words are used to indicate names, but not to indicate any particular order.

[0207] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A method for adjusting the similarity threshold of legal texts, characterized in that: The method comprises: Responding to a legal text similarity threshold adjustment request issued by a user based on a client, parsing the request, and obtaining multiple legal clauses carried in the request; Collecting a first number of first legal texts carrying first annotation information, and determining a first similarity threshold corresponding to each of the plurality of legal clauses based on the first legal texts; Collecting a second number of second legal texts carrying second annotation information, training a legal clause recognition model based on the first similarity threshold, and obtaining a second similarity threshold corresponding to each legal clause; At preset intervals, obtaining a recognition result of the legal clause recognition model on the third legal text based on the second similarity threshold, and determining a third similarity threshold corresponding to each legal clause based on the recognition result; Wherein, the determining of the first similarity threshold corresponding to each of the plurality of legal clauses based on the first legal text includes: obtaining a first subtext corresponding to the first annotation information in the first legal text; grouping the first subtext based on the first annotation information to obtain a subtext group corresponding to each of the plurality of legal clauses; calculating a first similarity value between each subtext and other subtexts in the subtext group corresponding to each legal clause to obtain a similarity matrix corresponding to each legal clause; taking the set of maximum values ​​of each row in the similarity matrix corresponding to each legal clause as the set of similarity values ​​corresponding to each legal clause; taking the minimum similarity value in the similarity set corresponding to each legal clause as the first similarity threshold corresponding to each legal clause; The training of the legal clause recognition model based on the first similarity threshold to obtain the second similarity threshold corresponding to each legal clause includes: writing the second legal text into a sample pool, extracting a first proportion of samples from the sample pool as training samples, extracting a second proportion of samples as test samples, taking the set of training samples and test samples as a sample set, and cyclically extracting to obtain multiple sample sets; determining a clause recognition result of each test sample in each sample set based on the first similarity threshold, and determining the second similarity threshold corresponding to each legal clause according to the clause recognition result.

2. The method for adjusting the legal text similarity threshold according to claim 1, characterized in that: The determining of the clause recognition result of each test sample in each sample set based on the first similarity threshold comprises: Obtaining the second subtext corresponding to the second annotation information of each training sample in each sample set, to obtain the second subtext set corresponding to each sample set; Inputting each test sample in each sample set into the text decomposition area of ​​the legal clause recognition model to obtain a plurality of third subtexts corresponding to each test sample in each sample set; Calculating a second similarity value between each third subtext in a plurality of third subtexts corresponding to each test sample in each sample set and each second subtext in the second subtext set, and taking the second subtext corresponding to the largest second similarity value as the initial legal clause corresponding to each third subtext; When the maximum second similarity value is greater than the first similarity threshold corresponding to the initial legal clause, the initial legal clause is used as the predicted legal clause corresponding to each third subtext, and the maximum second similarity value is used as the third similarity value corresponding to each third subtext; The clause recognition result of the test sample corresponding to each third sub-text is determined according to the second annotation information corresponding to each third sub-text and the predicted legal clause.

3. The method for adjusting the legal text similarity threshold according to claim 2, characterized in that: Determining the second similarity threshold corresponding to each legal clause according to the clause recognition result includes: The set of third subtexts with the same predicted legal clauses is taken as the third subtext set, and the third subtext set corresponding to each legal clause is obtained; Marking the third subtexts corresponding to each legal clause in the third subtext set with a correct clause recognition result as a first mark, and marking the third subtexts corresponding to the third subtext set with an incorrect clause recognition result as a second mark; The third subtexts in the third subtext set corresponding to each legal clause are sorted in descending order according to the third similarity values, and the second similarity threshold corresponding to each legal clause is determined based on the first mark, the second mark and the sorted queue.

4. The method for adjusting the legal text similarity threshold according to claim 3, characterized in that: The determining of the second similarity threshold corresponding to each legal clause based on the first mark, the second mark and the sorted queue includes: Determine whether the third subtexts corresponding to the first markers in the sorted queue corresponding to each legal clause are all arranged before the third subtexts corresponding to the second markers; When the judgment result is yes, the middle numerical interval between the third similarity value of the third subtext corresponding to the last first mark in the sorted queue corresponding to each legal clause and the third similarity value of the third subtext corresponding to the first second mark is used as the threshold adjustment interval corresponding to each legal clause; A value is randomly selected from the threshold adjustment interval as the second similarity threshold corresponding to each legal clause.

5. The method for adjusting the legal text similarity threshold according to claim 4, characterized in that: After determining whether the third subtexts corresponding to the first mark in the sorted queue corresponding to each legal clause are all arranged before the third subtexts corresponding to the second mark, the method further includes: If the judgment result is no, the third subtext marked as the second mark is added to the sample pool as a negative sample of each legal clause, and the third similarity values ​​of the negative samples corresponding to each legal clause are compared, and the largest third similarity value is used as the negative sample threshold corresponding to each legal clause; Re-extract sample sets from the sample pool, and input the training samples and test samples in each sample set into the clause recognition model for training and testing respectively; if the fourth similarity value between a designated test sample and a negative sample is greater than the negative sample threshold, the designated test sample is marked as a second mark and written into the sample pool, and sample sets are continuously extracted to train the legal clause recognition model until the threshold adjustment interval is determined.

6. The method for adjusting the legal text similarity threshold according to claim 4, characterized in that: The recognition result includes the clause identification information corresponding to the third legal text and the approval result fed back by the user based on the clause identification information, and the third similarity threshold corresponding to each legal clause is determined based on the recognition result, including: Determining the recognition accuracy of each legal clause by the clause recognition model based on the clause recognition information and the approval results; If the recognition accuracy corresponding to a certain designated legal clause is lower than the accuracy threshold, the clause identification information corresponding to the third proportion of the third legal texts whose approval result corresponding to the designated legal clause is passed is used as the third annotation information of the third legal text; The third legal text carrying the third annotation information is written into the sample pool, and the sample sets are re-extracted. Each sample set is input into the legal clause recognition model for training until a new threshold adjustment interval is determined, and any value in the new threshold adjustment interval is taken as the third similarity threshold corresponding to the specified legal clause.

7. A device for adjusting a similarity threshold of a legal text, used to implement the method for adjusting a similarity threshold of a legal text as claimed in any one of claims 1 to 6, characterized in that: The device comprises: A request module, used to respond to a legal text similarity threshold adjustment request issued by a user based on a client, parse the request, and obtain multiple legal clauses carried in the request; A first collection module, configured to collect a first number of first legal texts carrying first annotation information, and determine a first similarity threshold corresponding to each of the plurality of legal clauses based on the first legal texts; A second collection module is used to collect a second number of second legal texts carrying second annotation information, and train a legal clause recognition model based on the first similarity threshold to obtain a second similarity threshold corresponding to each legal clause; The determination module is used to obtain the recognition result of the third legal text by the legal clause recognition model based on the second similarity threshold at preset time intervals, and determine the third similarity threshold corresponding to each legal clause based on the recognition result.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the legal text similarity threshold adjustment method according to any one of claims 1 to 6.