A method and device for identifying case causes based on structural characteristics of legal documents
By combining the structural characteristics of legal documents and artificial intelligence technology, the UIE model and twin network similarity matching methods are used to identify causes of action in legal documents, solving the problem of low recognition accuracy in the existing technology and achieving efficient and accurate causes of action. identification, significantly reducing manual inspection workload.
Patent Information
- Application Number
- CN202311418562.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-30
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2043-10-30
AI Technical Summary
It is difficult for the existing technology to effectively identify the cause of action information in legal documents, especially when there are differences in writing standards in different provinces, differences in writing structures of different case types, and manual writing errors, resulting in low recognition accuracy.
An identification method based on the structural characteristics of legal documents is used, combined with artificial intelligence technology, to identify the cause of action through automatic annotation of training samples, UIE model naming entity recognition, extraction methods of different case structure designs, and twin network calculation similarity methods. Specific steps include determining the case type, preparing a standard cause of action library, paragraph division, UIE model training, weighted probability calculation and twin network similarity matching.
It greatly improves the accuracy of cause of action identification, reduces the workload of manual verification, can process tens of millions of documents in the company, corrects nearly one million cause of action names, and significantly improves the verification speed and accuracy.
Smart Images

Figure CN117350294B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a method for judging a case cause by utilizing artificial intelligence technology in combination with the structural characteristics of a legal document. Background Art
[0002] Legal documents, as common unstructured data in a society ruled by law, often contain a huge amount of information. Case information, as an important basis for judicial organs to hear cases, is crucial in similar case retrieval. Due to differences in writing standards in different provinces, differences in writing structures for different case types, and the fact that a case involves multiple cases and errors in manual writing, it is not easy to identify the case in legal documents.
[0003] At present, the common case cause identification methods are based on the matching of the entire case cause text. These methods are difficult to solve the above-mentioned problems such as differences in document standards, misspellings and omissions, and are very easy to make mistakes based on other irrelevant information, and have a low accuracy rate. Summary of the invention
[0004] In view of this, the present invention provides a method and device for identifying case causes based on the structural characteristics of legal documents, which identifies case causes by combining artificial intelligence technology with the structural characteristics of documents. This includes designing an automatic annotation training sample method based on the characteristics of the document structure, a named body recognition method based on the UIE model, designing different extraction methods based on different case structural characteristics, and a case cause recommendation method based on twin network calculation of similarity, etc. The specific process steps of the present invention are shown in the figure below. Figure 1 shown.
[0005] A method and device for identifying a case cause based on the structural characteristics of a legal document, comprising the following steps:
[0006] Step (1): First, determine the supported case types and document types to facilitate the construction of training samples. Currently, the supported case types include "civil", "criminal", "execution", "administrative", and "compensation". The document types supported by each case type include "judgment", "ruling", "notice", "mediation", and "decision".
[0007] Step (2): Prepare the above five types of standard case libraries: "civil", "criminal", "execution", "administrative", and "compensation". The format of the standard case library is as follows. The case names in the standard case library are all in string format, which is convenient for subsequent full case regular matching and similarity calculation when recommending the final case.
[0008]
[0009]
[0010] Step (3): Prepare corresponding document data based on the above document type and case type, and complete the paragraph division based on the paragraph regular expression and text order. The main paragraphs used here are the title paragraph, the trial process paragraph, and the court's opinion paragraph.
[0011] Step (4): Based on the characteristics of the documents, it is found that the case name will appear in the title section and the trial process section in civil, criminal, execution, administrative, and compensation cases. Among them, the case name in criminal cases will also appear in the "This Court's Opinion" section. Based on the above characteristics, the names in the above case database are combined into regular expressions, and the case names are matched in the title section and the trial process section respectively using the full case rule matching method. The case names with exactly the same names extracted from the title section and the trial process section are considered to be correct case names, and then a sample set is obtained, which contains paragraph text and case name information.
[0012] Step (5): Calculate the position of the case name in the title section and the trial process section in the above sample set to obtain the subscript position of each case name in the relevant paragraph. Then obtain a training sample set U that conforms to the UIE model training set format. Each training sample in the set includes a paragraph text, case name, and subscript position information of a case.
[0013] Step (6): The training set U is brought into the UIE model for training. Here, the benchmark model is uie-base, the BCE-loss loss function is used, the learning rate is set to 0.001, the batch_size is set to 4, and the rounds are set to 20 rounds. The training of the UIE model is completed based on the training method of the above parameters, thereby obtaining the named entity recognition model AY_MODEL. Extracting the case name based on the AY_MODEL model can solve some "omissions" and "wrong writing" situations, such as "civilian borrowing disputes" and "dangerous driving".
[0014] Step (7): Since the paragraph precision of the case name in different case types is different, different case name extraction methods are designed based on different case types. For the set of pending documents in civil, execution, compensation, and administrative cases, the case name is first extracted from the title segment and the trial process segment based on the AY_MODEL model. If the case name extracted from the title segment and the trial process segment is the same, the extracted case name is stored in the candidate case name set.
[0015] Step (8): If there is inconsistency, and at least one paragraph extracts the case name, the weighted probability will be calculated based on the weights of different paragraphs, and the one with the highest weighted probability will be selected to be added to the set of candidate case names. If no case name is extracted from either paragraph, the set of candidate case names is considered to be empty.
[0016] Step (9): For the set of documents to be processed in criminal cases, first extract the case names from the title section, the trial process section, and the court's opinion section based on the AY_MODEL model. If the case names extracted from the three sections are the same, then store the extracted case names in the candidate case name set.
[0017] Step (10): If there is inconsistency, obtain a set of alternative case names according to the algorithm of step (8).
[0018] Step (11): If the set of candidate case names is empty, the case name of the current case is output as "unidentified". If there is a value in the set of candidate case names, the case name similarity matching module is entered.
[0019] Step (12): If the elements in the set of alternative case names can be completely matched in the standard case library, the alternative case names are taken as the extracted true case names.
[0020] Step (13): If a perfect match is not possible, the similarity between the elements in the alternative case name set and the case name that is most similar to it in the case name library is calculated through the twin network model.
[0021] Step (14): If the similarity is greater than the set threshold, the case name of the current case document is output, otherwise it is output as unrecognized.
[0022] Compared with the prior art, the present invention has the following beneficial effects:
[0023] The present invention is a method for identifying the cause of action by combining artificial intelligence technology with the characteristics of the document structure. The method mainly uses the document structure automatic annotation training set, the UIE-based named body recognition method, the weighted logical judgment method based on different document structures, and the similarity calculation scheme based on the twin network. It solves the problems of inconsistent cause of action names in different paragraphs and incorrectly written cause of action names. The method completes the cause of action verification of tens of millions of documents in the company, greatly reduces the workload of manual inspection, and greatly improves the verification speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A flowchart of the specific implementation steps.
[0025] Figure 2 This is the structural diagram of the twin network. DETAILED DESCRIPTION
[0026] To further illustrate the technical solution of the present invention, the above steps are described in detail below through drawings and specific examples, but the embodiments are not intended to limit the present invention:
[0027] (1) Prepare a standard case database for civil, criminal, administrative, enforcement, and compensation cases. Generate a regular expression to match the case name based on the case database. For example, a case matching rule such as "divorce dispute|private loan dispute|labor dispute|..."
[0028] (2) Prepare a collection of 20,000 documents covering civil, criminal, administrative, enforcement, and compensation cases and judgments, rulings, mediations, decisions, and notices. Use paragraph regular expressions to divide paragraphs, and then obtain a title set bt = {b1, b2…b 20000}、The set of trial paragraphs sljg={s1,s2…s 20000}. The paragraph regular expression is shown in the following table:
[0029]
[0030]
[0031] (3) Based on the rules generated in step (1), the title set bt = {b1, b2…b 20000} and the set of trial paragraphs sljg = {s1, s2…s 20000}. The n samples with the same case names extracted from the two sets are selected as the sample set M = {m1,m2…m n}.
[0032] (4) Calculate the start and end subscripts of each case name element according to the position of each case name element in the set M in the paragraph, and set the SCHEM required by UIE. Here, SCHEM is set to "case name", and then it can be combined into a data format that can be directly trained by the UIE model. The data format is as follows
[0033]
[0034] (5) Based on the process of step (4), we obtain the training sample U = {u1,u2…u n}, UIE training is started based on the U training set. After multiple trainings, it is found that the best model is obtained when the above samples are divided into a training set and a test set with a ratio of 8:2, the learning rate is set to 0.001, the batch_size is set to 4, and the rounds are set to 20.
[0035] (6) After the above training, the best model AY_MODEL is obtained. In a part of the new data set, the results predicted by AY_MODEL are compared with the results of the full case rule matching. It is found that the UIE model can predict typos, misspellings, and missing characters.
[0036] (7) Input a document data from a document dataset to be processed. First, divide it into paragraphs to obtain the title paragraph, the trial process paragraph, and the court's opinion paragraph. Then, determine the case type based on the information in the title paragraph.
[0037] (8) Based on the advice of professional legal personnel, the importance of the case titles in different paragraphs of different case types is weighted. In civil, administrative, compensation, and enforcement cases, the weight of the title paragraph is 0.45, and the weight of the trial process is 0.55. In criminal cases, the weight of the title paragraph is 0.45, and the weight of the trial process is 0.5. The weight of the court's opinion paragraph is 0.55.
[0038] (9) If the case type is civil, administrative, compensation, or enforcement, AY_MODEL is used to extract the case name from the title segment and the trial process segment. If the case name is not extracted from both segments, the candidate case name set returns empty. If the case name is not extracted from any segment but is extracted from another segment, all the case names extracted from the segment are added to the candidate case name set.
[0039] (10) If the case names are extracted from both paragraphs but are inconsistent, based on the characteristics of the UIE model, while extracting the case name entity, the probability of the entity will be predicted based on the information of the start and end boundaries of the predicted entity and the softmax function, which are P 标题_u and P 审理经过_u , and then calculate P based on the weights 标题 =0.45*P 标题_u and P 审理经过 =0.55*P 审理经过_u . Add the case names extracted from the paragraphs with large probability values to the set of candidate case names.
[0040] (11) If the case type is a criminal case, use AY_MODEL to extract the case name from the title, trial process, and this court's opinion. If the case name is not extracted from any of the three paragraphs, the set of candidate case names returns empty. If the case name is not extracted from any two paragraphs but is extracted from the other paragraph, all the case names in the paragraph are added to the set of candidate case names. If the case name is extracted from all three paragraphs, or if the case name is extracted from any two paragraphs, then calculate P 标题 =0.45*P 标题_u , P 审理经过 =0.50*P 审理经过_u and P 本院认为 =0.55*P 本院认为_u , then the paragraph with the correct case name is selected according to the weighted value of the probability, and the case name extracted from the paragraph with a large probability value is added to the case name alternative set.
[0041] (12) If the case name candidate set is empty, then output "unrecognized". If the case name candidate set is not empty, then enter the case name similarity calculation module.
[0042] (13) The elements in the candidate case name set are matched with the standard case library for similarity. If the element can be completely matched in the case library, the "case name" is output. If it cannot be completely matched, the twin network is entered to calculate the similarity. The twin network structure is as follows: Figure 2 shown.
[0043] (14) The sample elements in the alternative case name set and the sample elements in the standard case name library are simultaneously input into the pre-trained model BERT to obtain word vectors.
[0044] (15) Next, the transformed vector is passed through the pooling layer for feature extraction and compression, and then the two compressed vectors are concatenated and combined. Finally, the cosine similarity formula is used to calculate the similarity. The calculation formula of the cosine similarity is as follows:
[0045]
[0046] If the calculated similarity is greater than the set threshold, the case name is output, otherwise it is output as unrecognized.
[0047] The above-designed process can solve the problem of inconsistent case causes extracted from different paragraphs, the situation where there are multiple case causes in one case, the situation where there are mistakes or omissions, etc. This greatly improves the accuracy of case cause recognition.
[0048] The present invention has currently completed the updating of case titles in tens of millions of legal documents within the company, and has corrected nearly one million document case titles in total, greatly saving labor costs.
[0049] The embodiments described above are only specific ways of presenting the present invention. Any technical solutions that can be easily obtained by simply changing or equivalently replacing the above embodiments belong to the protection scope of the present invention.
Claims
1. A method for identifying case causes based on the structural characteristics of legal documents, the steps of which include: 1) According to the determined supported case types and document types, multiple cases of each case type are obtained, wherein the cases include document data of each document type; and the case cause extraction segments of each document data are obtained, including the title segment, the trial process segment, and the court's opinion segment; 2) For each case type, combining the standard case cause information in the legal standard database corresponding to the case type and the case cause structure information of each case of the case type, a standard case cause database of the case type is constructed; 3) constructing a training sample set based on the standard case cause library of each case type and combining the paragraph characteristics of the case document data of the case type with each other in a mutually verified manner, wherein each sample in the training sample set includes the case cause and the case cause extraction segment of a case; 4) Calculate the position of the case name of each sample in the case extraction segment to obtain a training sample set U in the training set format that conforms to the UIE model. Each training sample in the training sample set U includes the case extraction segment, the case name, and the subscript position information of the case name in the case extraction segment; 5) Using the training sample set U to train the UIE model, a named entity recognition model AY_MODEL is obtained; 6) Input the document data of a case A in the pending document data set into the named entity recognition model AY_MODEL to obtain the alternative case cause set of case A; perform similarity matching on the elements in the alternative case cause set of case A and the elements in the standard case cause library corresponding to the case type of case A; if a completely matched element is found, it is output as the case cause name of case A; otherwise, a twin network is used to calculate the similarity between the elements in the alternative case cause set of case A and the elements in the standard case cause library corresponding to the case type of case A, and the case cause name of case A is output according to the similarity calculation result; wherein the steps for obtaining the alternative case cause set of case A are as follows: 61) For the pending document set in civil, execution, compensation, and administrative cases, the case cause name is first extracted from the title segment and the trial process segment respectively based on the named entity recognition model AY_MODEL; if the case cause name extracted from the title segment and the trial process segment is consistent, the extracted case cause name is stored in the alternative case cause name set; 62) If they are inconsistent, and the case name is extracted from at least one paragraph, the weighted probability is calculated according to the weights of different paragraphs, and the case name extracted from the paragraph with high weighted probability is selected to be added to the set of alternative case names. If the case name is not extracted from the two paragraphs, the set of alternative case names is considered to be empty; 63) For the set of documents to be processed in criminal cases, the case name is first extracted from the title paragraph, the trial process paragraph and the court's opinion paragraph based on the named body recognition model AY_MODEL; if the case names extracted from the three paragraphs are consistent, the extracted case names are stored in the set of alternative case names. If they are inconsistent, and the case name is extracted from at least one paragraph, the weighted probability is calculated according to the weights of different paragraphs, and the case name extracted from the paragraph with high weighted probability is selected to be added to the set of alternative case names. If the case name is not extracted from the three paragraphs, the set of alternative case names is considered to be empty.
2. The method according to claim 1, characterized in that The case types include civil, criminal, execution, administrative, and compensation, and the case document data for each case type includes judgments, rulings, notices, mediation documents, and decisions.
3. The method according to claim 1, characterized in that A standard library is constructed based on the legal information of national standards and the document information of a large number of real cases, and rules are generated based on the standard library. Combined with the characteristics of the document structure, a large amount of correct sample data is automatically generated to obtain the training sample set.
4. The method according to claim 1, characterized in that: If the case name is extracted but not consistent, according to P i =λ i *P 案由提取段i The weighted probability P of the case name extracted from the case extraction segment i by the named entity recognition model AY_MODEL is calculated i ;P 案由提取段i is the predicted probability corresponding to the case name extracted from the case extraction segment i by the named entity recognition model AY_MODEL, λ i is the weight of extracting segment i from the case.
5. The method according to claim 1, characterized in that The twin network uses the cosine similarity calculation formula to calculate the similarity between the elements in the alternative case name set of case A and the elements in the standard case library corresponding to the case type of case A.
6. A case identification device based on the structural characteristics of legal documents, characterized in that: It includes a standard case library construction module, a training sample set U generation module, a model training module and a case name recognition module; The standard case cause library construction module is used to obtain multiple cases of each case type according to the determined supported case types and document types, wherein the cases include document data of each document type; obtain the case cause extraction segment of each document data, including the title segment, the trial process segment, and the court's opinion segment; for each case type, combine the standard case cause information in the legal standard library corresponding to the case type and the case cause structure information of each case of the case type to construct a standard case cause library of the case type; The training sample set U generation module is used to automatically construct a training sample set based on the standard case cause library of each case type and the paragraph structure characteristics of the case document data of the case type, wherein each sample in the training sample set includes a case cause and a case cause extraction segment of a case; Calculate the position of the case name of each sample in the case extraction segment to obtain a training sample set U in the training set format that conforms to the UIE model, where each training sample in the training sample set U includes the case extraction segment, the case name, and the subscript position information of the case name in the case extraction segment; The model training module is used to train the UIE model using the training sample set U to obtain a named entity recognition model AY_MODEL; The case name recognition module is used to input the document data of a case A in the document data set to be processed into the named entity recognition model AY_MODEL to obtain the alternative case name set of case A; perform similarity matching on the elements in the alternative case name set of case A and the elements in the standard case name library corresponding to the case type of case A; if a completely matched element is found, it is output as the case name of case A; otherwise, a twin network is used to calculate the similarity between the elements in the alternative case name set of case A and the elements in the standard case name library corresponding to the case type of case A, and the case name of case A is output according to the similarity calculation result; wherein the steps for obtaining the alternative case name set of case A are as follows: 61) For the document set to be processed in civil, execution, compensation, and administrative cases, the case name is first extracted from the title segment and the trial process segment respectively based on the named entity recognition model AY_MODEL; if the case name extracted from the title segment and the trial process segment is consistent, the extracted case name is stored in the alternative case name set; 62) If they are inconsistent, and the case name is extracted from at least one paragraph, the weighted probability is calculated according to the weights of different paragraphs, and the case name extracted from the paragraph with high weighted probability is selected to be added to the set of alternative case names. If the case name is not extracted from the two paragraphs, the set of alternative case names is considered to be empty; 63) For the set of documents to be processed in criminal cases, the case name is first extracted from the title paragraph, the trial process paragraph and the court's opinion paragraph based on the named body recognition model AY_MODEL; if the case names extracted from the three paragraphs are consistent, the extracted case names are stored in the set of alternative case names. If they are inconsistent, and the case name is extracted from at least one paragraph, the weighted probability is calculated according to the weights of different paragraphs, and the case name extracted from the paragraph with high weighted probability is selected to be added to the set of alternative case names. If the case name is not extracted from the three paragraphs, the set of alternative case names is considered to be empty.
7. A server, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing each step in the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Extraction method based on 12345 hotspots
CN115345252A
Case quality control map establishment method and device, case document quality inspection method and device and storage medium
CN115982388A
Literature analysis system and method based on general information extraction
CN116562280A
Information extraction and semantic matching system and method based on deep learning method
CN116611447A
Method and System for Intent Classification
US20200065384A1
