Legal element extraction method and apparatus
By constructing a causal legal element extraction model, explicitly stated legal elements are extracted cyclically, and implicit elements are identified through causal reasoning. This solves the problem of low accuracy in legal text analysis in existing technologies and achieves highly accurate legal element extraction.
Patent Information
- Application Number
- CN202210716031.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-23
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2042-06-23
AI Technical Summary
In existing technologies, legal text understanding models cannot accurately extract legal elements, especially implicit legal elements, resulting in extremely low accuracy in case content analysis.
A causal association-based legal element extraction model (CLEE) is constructed. It extracts explicitly stated legal elements through cyclical extraction and obtains implicit legal elements through causal reasoning. The multi-inference element extraction module (MINE) is used to learn the interrelationships between legal elements and combines descriptive embedding and label embedding for reasoning.
It improves the accuracy of legal element extraction, effectively identifies explicit and implicit legal elements, and enhances the accuracy of legal text analysis.
Smart Images

Figure CN115034199B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of big data, and particularly relates to a legal element extraction method and device. BACKGROUND
[0002] Language is the natural carrier of law. The combination of natural language processing (NLP) and judicial analysis is an important way for artificial intelligence to be applied in the legal field. At present, the application of NLP in the legal field is gradually developing from the initial classification algorithm-based civil case classification to case matching, intelligent consultation and other application scenarios based on legal document understanding. Unlike the reading comprehension of ordinary language texts, the formation of legal logic is not based on the surface meaning of words, but is a definition formed by abstracting behaviors or states in the objective world, and each legal term hides different legal elements such as legal relationship, subject, object, right, obligation and the like. However, the current analysis and reasoning of legal rules are still in the stage of formal logic, and the conclusions of traditional natural language classification models cannot complete the understanding of legal language, and the evaluation rules obtained by relying solely on a large amount of data training cannot reflect the connotation of legal relationship, so that the accuracy of case content analysis is extremely low.
[0003] At present, there is a lack of a high-accuracy legal element extraction scheme. SUMMARY
[0004] The present application provides a legal element extraction method for realizing legal element extraction, including explicitly stated legal elements and implicitly stated legal elements obtained through causal reasoning, and the method has high accuracy. The method comprises the following steps:
[0005] Constructing a legal consultation data set of a target field;
[0006] Dividing the legal consultation data set according to consultation intentions to obtain data sets corresponding to multiple consultation intentions;
[0007] Determining legal entities in each data set corresponding to a consultation intention;
[0008] Dividing each data set corresponding to a consultation intention into multiple fact description sets according to the legal entities;
[0009] For each fact description set, a legal element extraction model based on causal correlation is used to extract legal elements from the fact description set and determine the polarity of the extracted legal elements; wherein the legal element extraction model based on causal correlation can extract explicitly stated legal elements and implicitly stated legal elements through causal reasoning through circulation.
[0010] The embodiment of the present application provides a legal element extraction device, which is used for realizing legal element extraction, including explicit legal elements and implicit legal elements obtained through causal reasoning, and has high accuracy. The device comprises:
[0011] A consultation dataset construction module is configured to construct a legal consultation dataset of a target field.
[0012] A dataset division module is configured to divide the legal consultation dataset according to consultation intentions, to obtain datasets corresponding to multiple consultation intentions.
[0013] A legal entity determination module is configured to determine legal entities in each dataset corresponding to a consultation intention.
[0014] A fact description set division module is configured to divide each dataset corresponding to a consultation intention into multiple fact description sets according to the legal entities.
[0015] A legal element extraction module is configured to extract legal elements from each fact description set and determine the polarity of the extracted legal elements, by using a legal element extraction model based on causal correlation. The legal element extraction model based on causal correlation can extract explicit legal elements and implicit legal elements obtained through causal reasoning through circulation.
[0016] The embodiment of the present application also provides a computer device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the legal element extraction method is realized.
[0017] The embodiment of the present application also provides a computer readable storage medium, which stores a computer program. When the processor executes the computer program, the legal element extraction method is realized.
[0018] The embodiment of the present application also provides a computer program product, which comprises a computer program. When the processor executes the computer program, the legal element extraction method is realized.
[0019] In the embodiment of the present application, a legal consultation dataset of a target field is constructed; the legal consultation dataset is divided according to consultation intentions to obtain a plurality of datasets corresponding to the consultation intentions; for each dataset corresponding to a consultation intention, a legal entity in the dataset is determined; each dataset corresponding to a consultation intention is divided into a plurality of fact description sets according to the legal entity; for each fact description set, a legal element extraction model based on causal correlation is used to extract legal elements from the fact description set and determine the polarity of the extracted legal elements; wherein the legal element extraction model based on causal correlation can extract explicitly stated legal elements and implicitly stated legal elements obtained through causal reasoning through a loop. Compared with the technical solution in the prior art that can only extract explicitly stated legal elements, through the use of the legal element extraction model based on causal correlation for each fact description set, legal elements are extracted from the fact description set and the polarity of the extracted legal elements is determined; wherein the legal element extraction model based on causal correlation can extract explicitly stated legal elements and implicitly stated legal elements obtained through causal reasoning through a loop, thereby extracting legal elements with high accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort. In the drawings:
[0021] Figure 1 Examples of legal element extraction in legal text;
[0022] Figure 2 Flowchart of the legal element extraction method in the embodiment of the present application;
[0023] Figure 3 Schematic diagram of dataset classification in the embodiment of the present application;
[0024] Figure 4 Principle of class loop processing of CLEE model in the embodiment of the present application;
[0025] Figure 5 Structure schematic diagram of CLEE model in the embodiment of the present application;
[0026] Figures 6-8 Comparison of reasoning performance of CLEE in different loop numbers in the embodiment of the present application;
[0027] Figure 9 Schematic diagram of legal element extraction device in the embodiment of the present application;
[0028] Figure 10 Fig. 1 is a schematic diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the embodiments of the present application are further described in detail below with reference to the drawings. Herein, the schematic embodiments of the present application and the descriptions thereof are used to explain the present application, but are not as limitations to the present application.
[0030] In the description of the present specification, "comprise", "include", "have", "contain" and the like are all open terms, i.e. meaning containing but not limited to. The description referring to the terms "one embodiment", "one specific embodiment", "some embodiments", "for example" and the like means that the specific features, structures or characteristics described in connection with the embodiment or example are contained in at least one embodiment or example of the present application. In the present specification, the schematic description of the above terms does not necessarily mean the same embodiment or example. Moreover, the specific features, structures or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. The order of steps involved in the embodiments is used to illustrate the embodiments of the present application, and the order of steps is not limited, and can be adjusted as needed.
[0031] The inventor found that, from the perspective of natural language understanding, the understanding process of legal text is to extract key legal elements from the understanding of legal text, then take the legal elements as nodes in the knowledge graph, and further judge the causal relationship between the nodes through legal logic to draw conclusions. Among them, the extraction of legal elements (legal element extraction, LEE) is the basis for completing the understanding of legal language. Figure 1 For the extraction of legal elements in legal text, the extraction of legal elements includes two aspects of work: one is to extract the legal elements involved in the given fact description, and the other is to judge the positive and negative polarity of the elements. This task is very similar in form to aspect-based sentiment analysis (aspect-based sentiment analysis, ABSA), but existing ABSA task methods are difficult to get good results in legal element extraction. Through experiments, it is summarized that there are two important challenges in the application of ABSA in LEE:
[0032] Challenge 1: Lack of training data based on legal relationship annotation for intelligent consulting scenarios. In order to accurately extract legal elements, a large number of professional legal element annotation databases are needed to support. The legal element annotation of the case should include three aspects: 1) the legal elements mentioned in the text; 2) the potential legal element information that needs to be inferred; 3) social influence elements (such as regional customs). However, due to the lack of interdisciplinary personnel and immature technical conditions, there is currently no large-scale legal data annotation organized for element extraction.
[0033] Challenge 2: Ignoring potential legal element information. As discussed in challenge 1) 2) and 3), there is no explicit text representation in the text, and the machine cannot directly identify it. To extract such elements, the model needs to have the ability to infer based on prior knowledge. Traditional ABSA only considers the elements that appear explicitly in the description without reasoning and implication, so it will lead to the neglect of a large amount of hidden information in the extraction process of legal elements.
[0034] The inventors believe that in order to solve challenge 1, a brand new legal consultation dataset (marriage civil legal consultation dataset, CLC-marriage) can be established. A large amount of case data is obtained for model training, and professional legal element annotation is attached. In order to ensure the universality of the annotation and the effectiveness of the subsequent training, the element annotation rules based on legal relationship are established to more comprehensively reflect the legal logical relationship.
[0035] In order to solve challenge 2, a causal-based legal element extraction (CLEE) model is proposed for LEE task. The core idea of CLEE is to learn the mutual relationship between legal elements, first extract the elements that are explicitly expressed, and then extract the implicit elements through causal reasoning. It should be pointed out that the mutual relationship between elements is not isolated, but is related to each other under different description characteristics. For this purpose, a multiple inference element extraction (MINE) module is created, which learns the mutual relationship between elements in an end-to-end manner. The reasoning process is realized in a circular manner. This module learns the mutual relationship between legal elements based on description embedding and existing elements. The label of the predicted legal element in the current cycle becomes the existing element in the next cycle, and the label of the predicted legal element in the last cycle becomes the final result.
[0036] Figure 2 For the flowchart of the legal element extraction method in the embodiment of the application, as shown in Figure 2 The method comprises the following steps:
[0037] Step 201, constructing a legal consultation dataset of a target field;
[0038] Step 202, dividing the legal consultation dataset according to consultation intentions to obtain a plurality of datasets corresponding to the consultation intentions;
[0039] Step 203, determining legal entities in each dataset corresponding to the consultation intentions;
[0040] Step 204, dividing each dataset corresponding to the consultation intentions into a plurality of fact description sets according to the legal entities;
[0041] Step 205, for each fact description set, extracting legal elements from the fact description set and determining the polarity of the extracted legal elements by using a legal element extraction model based on causal association; wherein the legal element extraction model based on causal association can extract explicitly stated legal elements and implicitly stated legal elements obtained through causal reasoning through a loop.
[0042] In the embodiment of the application, compared with the technical solution in the prior art that can only extract explicitly stated legal elements, legal elements are extracted from each fact description set and the polarity of the extracted legal elements is determined by using a legal element extraction model based on causal association; wherein the legal element extraction model based on causal association can extract explicitly stated legal elements and implicitly stated legal elements obtained through causal reasoning through a loop, so that legal elements with high accuracy are extracted.
[0043] In step 201, a legal consultation dataset of a target field is constructed;
[0044] From the perspective of legal case analysis, the key judgment points of different cases are different. For example, labor dispute cases emphasize labor contract relationships, and marriage and family cases emphasize personal relationships and common property of husband and wife. Since the judgment basis of different cases is greatly different and the coincidence probability is low, it is necessary to collect consultation data according to the case, and extract legal elements of each case from the corresponding legal provisions and judicial interpretations.
[0045] Based on this, in the embodiment of the application, the legal consultation dataset is obtained from a plurality of data sources of professional websites that provide legal consultation and assistance, and is classified by machine classification and manual screening according to the case. In the embodiment of the application, the target field is the civil field, the consultation intention is the marriage and family intention, and the cases of other fields are also applicable to the application.
[0046] In an embodiment, the legal consultation dataset of the target field is constructed, including:
[0047] Obtaining legal consultation data of a plurality of data sources;
[0048] According to the case of the target field, the legal consultation data set of the target field is screened from the legal consultation data of multiple data sources.
[0049] Figure 3 The schematic diagram of the data set classification in the embodiment of the application corresponds to steps 202-204.
[0050] In step 202, the legal consultation data set is divided according to the consultation intention, and a plurality of data sets corresponding to the consultation intention are obtained, for example, Figure 3 In the embodiment, the marriage and family intention is obtained from the legal consultation data set of the civil field. It should be noted that the consultation intention can be further subdivided, for example Figure 3 In the embodiment, the marriage and family intention can be summarized as marriage problems and non-marriage problems. The marriage problems can be further divided into marriage relationship problems, child relationship problems, property division problems, divorce progress problems, etc.; the non-marriage problems can be divided into engagement gift problems, legal age of marriage problems, bigamy problems, cohabitation problems, etc. Through subdivision and filtering of low-frequency consultation intentions, nine main marriage and family legal intentions are obtained, which can be used as an analysis guide for subsequent legal element confirmation and annotation.
[0051] In step 203, for each data set corresponding to the consultation intention, the legal entity in the data set is determined, and in an embodiment, the legal entity includes a legal subject and a legal object. For example, Figure 3 For example, the legal entities of marriage and family cases can be divided into legal objects and legal subjects, the legal subjects can be subdivided into the male party, the female party, the male party's parents, the female party's parents, the child, the legal person institution, etc., and the legal objects can be divided into houses (real estate), movables, stock rights and options, etc. The above entities are the subjects and objects of the relative legal relationship.
[0052] In step 204, each data set corresponding to the consultation intention is divided into a plurality of fact description sets according to the legal entity; each fact description set has a plurality of fact descriptions, for example, "My father-in-law and mother-in-law bought a house for us with full payment, and the name on the house property certificate is my father-in-law and mother-in-law. Does this house belong to us?" This is a fact description.
[0053] In step 205, for each fact description set, a legal element extraction model based on causal association is used to extract legal elements from the fact description set and determine the polarity of the extracted legal elements; wherein the legal element extraction model based on causal association can extract explicit legal elements and implicit legal elements obtained through causal reasoning through circulation.
[0054] In an embodiment, for each fact description set, a legal element extraction model based on causal relationship is adopted to extract legal elements from the fact description set, including:
[0055] According to the consulting intention and the legal entity involved in each fact description set, a legal element set corresponding to each fact description set is queried, the legal element set being a set of all legal elements predefined for the consulting intention and the legal entity;
[0056] For each fact description set, a legal element extraction model based on causal relationship is adopted to obtain labels of each legal fact in the fact description set based on the fact description set and the legal element set corresponding to the fact description set;
[0057] According to the labels of each legal fact in the fact description set, the extracted legal facts and the polarity of each legal fact are determined.
[0058] In the above embodiment, for example, Figure 3 the rightmost side is the legal element set queried according to the consulting intention and the legal entity, in this set, the social factor should also be considered. For example, in the fact description "My father-in-law and mother-in-law bought a house for us in full, and the name on the house property certificate is my father-in-law and mother-in-law. Does this house belong to us?", if the traditional ABSA aspect extraction method is used, only 4 elements mentioned in the fact description can be obtained: house (property), husband's parents (investor), full payment (investment situation), husband's parents (property ownership). In the embodiment of the present application, there are as many as 15 legal elements, and subsequent logical judgment only needs to be performed on these 15 legal elements to determine which of the 15 legal elements is included in each fact description and to determine the polarity.
[0059] In an embodiment, the label of the legal fact includes positive polarity, negative polarity and no polarity, the positive polarity indicates that the legal element exists and the polarity is positive, the negative polarity indicates that the legal element exists and the polarity is negative, and the no polarity indicates that the element does not exist.
[0060] In an embodiment, for each fact description set, a legal element extraction model based on causal relationship is adopted to obtain labels of each legal fact in the fact description set based on the fact description set and the legal element set corresponding to the fact description set, including:
[0061] Each fact description data in the fact description set is represented by token, and each fact description set corresponds to a token sequence;
[0062] Each legal element in the legal element set corresponding to the fact description set is represented by token, and each legal element set corresponds to a token sequence;
[0063] concatenate the token sequence corresponding to the fact description set and the token sequence corresponding to the legal element set;
[0064] input the concatenated token sequence into the legal element extraction model based on causal correlation to obtain the label of each legal fact in the fact description set.
[0065] In the above embodiment, the legal element set A = {a1,..., aM} contains M legal elements, corresponding to a token sequence, and each sequence includes M tokens. The fact description set S = [w1,..., wN] corresponds to a token sequence, and each sequence includes N tokens. The task of LEE is to extract the legal elements mentioned in the fact description and determine the polarity y = {Positive, Negative, None} related to the legal element a M . N . i . i It should be noted that not all element terms are directly described in the event description, and some elements need to be extracted by reasoning.
[0066] In an embodiment, the legal element extraction model based on causal correlation includes a description encoder and a class loop multiple inference element extraction module, wherein,
[0067] The description encoder is used to input the fact description set and the legal element set corresponding to the fact description set, and output a description embedding.
[0068] The class loop multiple inference element extraction module is used to input the description embedding, and through multiple loops, the label of the legal fact is output. Each loop uses the label output in the last loop until the loop termination condition is reached, and the label of each legal fact in the final fact description set is output.
[0069] Specifically, the CLEE model uses a class loop multiple inference element extraction (MINE) module to iteratively infer implied elements. Figure 4 The principle of the class loop processing of the CLEE in the embodiment of the application is shown in Figure 4 The CLEE model consists of a description encoder (DE) and a MINE module. Figure 4 In the formula, S is a fact description set, and L is a predicted output, i.e., a predicted label, i.e., a label of a legal fact. As can be seen, in a non-initial loop, the MINE module inputs the predicted label of the last time.
[0070] In an embodiment, the described encoder is a BERT-based encoder. The input of the DE is the concatenation of the token sequence corresponding to the set of fact descriptions and the token sequence corresponding to the set of legal elements, that is, the DE combines the fact descriptions with the legal elements to help learn more about the description embeddings related to the relevant parts of the legal elements. The output of the DE is the description embedding E = [e1,..., en], where e N+M ] is a vector embedding. i
[0071] Figure 5 is a structural diagram of the CLEE model in an embodiment of the present application. In an embodiment, the class cycle multi-reasoning element extraction module includes a self-attention layer, a pooling layer, a first fully connected layer, and a second fully connected layer, wherein,
[0072] The self-attention layer is configured to input the description embedding E in the initial cycle and input the vector sum of the label embedding LE and the self-attention embedding IA of the last cycle in the non-initial cycle, and output the self-attention embedding IA.
[0073] The pooling layer is configured to input the self-attention embedding IA and output the pooling embedding IL.
[0074] The first fully connected layer is configured to input the pooling embedding IL and output the label L.
[0075] The second fully connected layer is configured to input the label L and output the label embedding LE.
[0076] Wherein, the MINE predicts L as a root class problem, and each layer in the class cycle multi-reasoning element extraction module has a softmax layer. L is a matrix with a size of (3, M), where 3 is the number of polarities (positive polarity, negative polarity, and no polarity), and M is the number of legal elements. The working principle of the CLEE model can be simply described as:
[0077] IA = SelfAttention (IE) (1)
[0078] IL = Pooling (IA) (2)
[0079] L = FC (IL) (3)
[0080] It should be noted that in the non-initial cycle, the predicted label L needs to be included in the description embedding IE. The label L is sent to the label embedding layer constructed by the second fully connected layer. In this layer, the label embedding LE is realized by converting the label prediction dimension from M to the element number N+M. Then, the input IE of the next cycle is the vector sum between LE and IA. In this way, IE retains the predicted label of the previous cycle, and enhances the prediction of L through cycle reasoning.
[0081] In an embodiment, the cycle termination condition is reaching a preset cycle number.
[0082] In addition, the CLEE model is obtained by training, and the parameters in the DE and MINE modules are obtained by training. During training, the average error of cross entropy between the predicted label and the standard label is calculated each cycle, and the cycle is terminated when a preset threshold is met.
[0083] The calculation formula of the average error is as follows:
[0084]
[0085] wherein K is the total number of cycles, is the i-th predicted label value of L in the K-th cycle, Y i is the i-th standard label reference true value, and the standard label is the labeled label in the training set data.
[0086] A specific embodiment is given below to verify the method of the application.
[0087] First, the data set is introduced.
[0088] Taking the civil field as an example, the embodiment of the application constructs a CLC-marriage data set, taking the marriage family cases therein as an example, containing 29 legal entities and 51 labels for determining the polarity of legal elements. The CLC-marriage data set contains 20,000 marriage family consultation case annotation samples, and the statistical analysis is shown in Table 1. Unlike the MPQA news data set and the NAACL07 restaurant data set, the case elements of the CLC-marriage data set are not independent. The multi-aspect correlation information contained between the legal elements can be used to reflect the polarity of different elements in the marriage relationship, and can also provide more context logic information.
[0089] Table 1
[0090] Units (pcs)
[0091]
[0092]
[0093] The implementation details of CLEE model are introduced next, and then the evaluation results of CLEE are given from three aspects: (1) evaluating the importance of label embedding for legal element reasoning. The ablation study shows that label embedding can significantly improve the accuracy of legal elements by 5.6 times; (2) evaluating the effectiveness of MINE module. The causal learning comparison shows that legal elements and polarity can be corrected through cyclic reasoning, and achieve the best performance at the 12th cycle; (3) evaluating the overall performance of CLEE model using four different methods. The results show that the proposed CLEE model can improve the performance of all indicators in LEE task and the performance of polarity accuracy by 22%. In ABSA task, CLEE model also achieves comparable performance, which shows that the proposed method has good generalization.
[0094] (1) Comparison settings
[0095] The DE uses the pre-trained model based on Chinese BERT for fine-tuning. In the experiment, the number of self-attention heads is 12, the hidden layer size is 768, and the total number of parameters of the pre-trained model is 110M. The length of the word list (from "BERT-base-Chinese") is 21128. The last hidden state of BERT is used for word representation, which is fine-tuned on the LEE task. The batch size in training is 5 and the batch size in testing is 8. The DE is trained using the Adam optimizer with the default configuration. The learning rate in the encoder without BERT is 10 -5 , and the learning rate in the encoder based on BERT is 10 -7 . In the MINE module, the hidden size of the self-attention layer is 768, the first token corresponding to the hidden state is taken in the pooling layer, the output size of the first fully connected layer is the product of the polarity size and the number of legal elements, and the output size of the second fully connected layer is the same as the output size of the self-attention layer.
[0096] Datasets: The ability of CLEE was evaluated on three datasets, CLC-marriage and two benchmark datasets (laptop domain and restaurant dataset) in SemEval2014 Task 4, respectively. CLC-marriage contains 20,000 Chinese samples, of which 13,000 samples are used for the training set, 2,000 samples are used for the validation set, and 5,000 samples are used for the test set. Each sample contains multiple legal element terms, and each legal element has a corresponding polarity. The total number of elements in the element set is 51. By giving the fact description and the full set of legal elements, it is necessary to first detect the cited fact description and the legal elements that can be inferred from the fact description, and then determine the positive and negative polarity of each legal element. In order to evaluate the generalization ability of CLEE, comparative experiments were also conducted on two benchmark datasets. Each example sentence of the dataset is marked with element terms and their related polarity.
[0097] Method comparison: The most relevant methods in recent years were selected for comparison.
[0098] • BERT-pair-NLI method, which is used to solve the ABSA problem through natural language inference technology. Based on this idea, the method proposes two algorithms, BERT-pair-NLI-B and BERT-pair-NLI-M. The difference between the two is the use of different forms of auxiliary sentences. The auxiliary sentence form of BERT-pair-NLI-B is “aspect term-polarity”, and the auxiliary sentence form of BERT-pair-NLI-M is “aspect term”.
[0099] • LCF-BERT-CDW method, which is used to extract syntactic information in sentences. Considering that the description in CLC-marriage is Chinese, Glyce is used to present the dependency tree in this method.
[0100] • CE-TABSA method, which is used to improve aspect embedding to improve the accuracy of the ABSA problem.
[0101] The training of all models is carried out under full supervision.
[0102] Indicators: Micro-F1 and overall accuracy are used to evaluate model performance, and legal element precision and polarity precision are also reported respectively. Legal element precision is defined as the percentage of correct legal elements predicted by the CLEE model among all legal elements cited in the fact description, and polarity precision is defined as the percentage of correct polarity predicted by the CLEE model.
[0103] (2) Ablation experiment
[0104] To enhance the causal relation learning ability of CLEE, two key information, descriptive embedding and label embedding, are introduced in the MINE algorithm. Next, this embodiment evaluates the importance of these two key information for causal relation learning through ablation experiments. As shown in Table 2, when there is no LE and IA embedding, the performance of CLEE is poor. After adding LE or IA, the overall accuracy is improved by 31.43% and 37%, respectively. Especially in the comparison of polarity accuracy, LE can achieve a 5.6-fold performance improvement. Compared with the results of IA, LE can obtain more significant effect, which proves that the inclusion of predicted labels can improve the ability of causal relation learning. Benefiting from LE and IA, CLEE can obtain the best overall accuracy result.
[0105] Table 2
[0106]
[0107]
[0108] (3) Causal Inference Learning
[0109] Figures 6-8 To compare the inference performance of CLEE in different cycle numbers in the embodiment of the application, Figure 6 To compare the inference performance of CLEE in different cycle numbers for the CLC-marriage data set tested in the embodiment of the application, Figure 7 To compare the inference performance of CLEE in different cycle numbers for the Laptop data set tested in the embodiment of the application,
[0110] Figure 8 To compare the inference performance of CLEE in different cycle numbers for the Rest data set tested in the embodiment of the application, from Figure 6 It can be seen that the performance of CLEE is continuously improved in the cycle process. In the 12th cycle, the CLEE model obtains the best performance. This proves that the CLEE model with the MINE module plays an important role in causal learning. When the cycle number is 5, the polarity accuracy reaches a relatively good performance. It shows that the model obtains the basic polarity analysis ability in the first 5 cycles. After the 5th cycle, the element accuracy is greatly improved, because the improvement of polarity accuracy affects the inference of potential elements. After the polarity accuracy is guaranteed, the accuracy of the elements is also guaranteed. At the same time, it also proves that the MINE module can provide better results by including the prediction of the previous cycle.
[0111] In other data sets without causal inference, Figure 7 Laptop and Figure 8The accuracy scores of the CLEE model in different numbers of cycles are relatively stable, which shows that the MINE module has good generalization ability in both causal and non-causal data.
[0112] The following embodiments will be analyzed in detail based on the examples shown in Figure 3 Table 3 shows the prediction of five legal elements in different rounds of reasoning cycles (only five legal elements are taken as examples, but the total number of legal elements extracted based on the fact description is much more than five). Among the given five legal elements, the ground truth label indicates that four legal elements can be extracted from the description. However, only the legal element of “husband's parents pay for the house” is explicitly stated in the fact description, and other legal elements should be inferred. Through deeper reasoning cycles, more accurate reasoning can be achieved. In the first few cycles, the CLEE model can identify the legal element “joint down payment”. Using these predictions, the legal elements “wife's down payment” and “wife has no fixed income” can be inferred. After enough cycles, all correct legal elements and corresponding polarities can be predicted.
[0113] Table 3
[0114]
[0115]
[0116] (4) Overall performance
[0117] As shown in Table 4, the overall performance of the CLEE model and other methods trained on three data sets is compared. It can be seen that the method of the present application obtains the best results on all indicators in CLC-marriage. For traditional, non-causal ABSA data sets (such as Laptop and Restaurant), comparative results are also obtained. These results show that the CLEE model performs better in data requiring causal reasoning and has good generalization ability in non-causal scenarios.
[0118] The method based on BERT-pair-NLI-M performs well in element accuracy, but still has a large gap in polarity accuracy compared with the CLEE model. This shows that it is relatively difficult to determine the polarity from the description without using cycle reasoning in CLC-marriage. Compared with other methods, the CLEE model improves the polarity accuracy by 22%. This proves that the MINE module can better handle causal learning, and the CLEE model can also solve the LEE task.
[0119] Table 4
[0120]
[0121]
[0122] In summary, in the method provided in the embodiment of the application, a legal consultation data set of a target field is constructed; the legal consultation data set is divided according to consultation intentions to obtain data sets corresponding to multiple consultation intentions; for each data set corresponding to a consultation intention, legal entities in the data set are determined; each data set corresponding to a consultation intention is divided into multiple fact description sets according to the legal entities; for each fact description set, a legal element extraction model based on causal correlation is used to extract legal elements from the fact description set and determine the polarity of the extracted legal elements; wherein the legal element extraction model based on causal correlation can extract explicitly stated legal elements and implicitly stated legal elements obtained through causal reasoning through a loop. Compared with the technical solution in the prior art that can only extract explicitly stated legal elements, through the use of the legal element extraction model based on causal correlation for each fact description set, legal elements are extracted from the fact description set and the polarity of the extracted legal elements is determined; wherein the legal element extraction model based on causal correlation can extract explicitly stated legal elements and implicitly stated legal elements obtained through causal reasoning through a loop, so that high-accuracy legal elements are extracted. The process of obtaining implicitly stated legal elements through causal reasoning needs to be logically reasoned and judged through legal knowledge. The legal element extraction model based on causal correlation can extract elements and their mutual relationships in data through the way of cyclic causal reasoning to extract potential legal elements.
[0123] The embodiment of the application also provides a legal element extraction device, which has a principle similar to the legal element extraction method, and will not be described here.
[0124] Figure 9 The schematic diagram of the legal element extraction device in the embodiment of the application includes:
[0125] The consultation data set construction module 901 is used to construct a legal consultation data set of a target field;
[0126] The data set division module 902 is used to divide the legal consultation data set according to consultation intentions to obtain data sets corresponding to multiple consultation intentions;
[0127] The legal entity determination module 903 is used to determine legal entities in each data set corresponding to a consultation intention;
[0128] The fact description set division module 904 is used to divide each data set corresponding to a consultation intention into multiple fact description sets according to the legal entities;
[0129] The legal element extraction module 905 is configured to extract legal elements and determine the polarity of the extracted legal elements from each fact description set by using a legal element extraction model based on causal connection.
[0130] In an embodiment, the legal element extraction module is specifically configured to:
[0131] According to the consulting intention and the legal entity involved in each fact description set, query the legal element set corresponding to each fact description set, wherein the legal element set is a set of all legal elements predefined for the consulting intention and the legal entity;
[0132] For each fact description set, a legal element extraction model based on causal connection is used to obtain the label of each legal fact in the fact description set based on the fact description set and the legal element set corresponding to the fact description set;
[0133] According to the label of each legal fact in the fact description set, determine the extracted legal fact and the polarity of each legal fact.
[0134] In an embodiment, the label of the legal fact includes positive polarity, negative polarity and no polarity, the positive polarity indicates that the legal element exists and the polarity is positive, the negative polarity indicates that the legal element exists and the polarity is negative, and the no polarity indicates that the element does not exist.
[0135] In an embodiment, the legal element extraction module is specifically configured to:
[0136] Each fact description data in the fact description set is represented by a token, and each fact description set corresponds to a token sequence;
[0137] Each legal element in the legal element set corresponding to the fact description set is represented by a token, and each legal element set corresponds to a token sequence;
[0138] The token sequence corresponding to the fact description set and the token sequence corresponding to the legal element set are concatenated;
[0139] The concatenated token sequence is input into the legal element extraction model based on causal connection to obtain the label of each legal fact in the fact description set.
[0140] In an embodiment, the legal element extraction model based on causal connection includes a description encoder and a cyclic multi-reasoning element extraction module, wherein,
[0141] The encoder is used for inputting a fact description set and a legal element set corresponding to the fact description set, and outputting a description embedding;
[0142] The class loop multiple reasoning element extraction module is used for inputting the description embedding and outputting a label of a legal fact through multiple loops, wherein a label output in a previous loop is used in each loop until a loop termination condition is reached, and a label of each legal fact in the final fact description set is output.
[0143] In an embodiment, the class loop multiple reasoning element extraction module comprises a self-attention layer, a pooling layer, a first fully connected layer and a second fully connected layer, wherein,
[0144] The self-attention layer is used for inputting the description embedding in an initial loop and inputting a vector sum of a label embedding and a self-attention embedding in a non-initial loop, and outputting a self-attention embedding;
[0145] The pooling layer is used for inputting the self-attention embedding and outputting a pooling embedding;
[0146] The first fully connected layer is used for inputting the pooling embedding and outputting a label;
[0147] The second fully connected layer is used for inputting the label and outputting a label embedding.
[0148] In summary, in the device provided in the embodiment of the present application, a legal consultation dataset of a target field is constructed; the legal consultation dataset is divided according to consultation intents to obtain a plurality of datasets corresponding to the consultation intents; for each dataset corresponding to a consultation intent, a legal entity in the dataset is determined; each dataset corresponding to a consultation intent is divided into a plurality of fact description sets according to the legal entity; for each fact description set, a legal element extraction model based on causal association is used to extract a legal element from the fact description set and determine a polarity of the extracted legal element; wherein the legal element extraction model based on causal association can extract an explicitly stated legal element and an implicitly stated legal element through causal reasoning through a loop. Compared with the technical solution in the prior art that can only extract an explicitly stated legal element, through the legal element extraction model based on causal association, a legal element is extracted from each fact description set and the polarity of the extracted legal element is determined; wherein the legal element extraction model based on causal association can extract an explicitly stated legal element and an implicitly stated legal element through a loop, thereby extracting a legal element with high accuracy. The process of obtaining an implicitly stated legal element through causal reasoning needs to be logically reasoned and judged through legal knowledge. The legal element extraction model based on causal association can extract elements and their mutual relationships in data through the way of cyclic causal reasoning to extract potential legal elements.
[0149] The embodiment of the present application further provides a computer device, Figure 10 As a schematic diagram of the computer device in the embodiment of the present application, the computer device 1000 comprises a memory 1010, a processor 1020, and a computer program 1030 stored in the memory 1010 and capable of running on the processor 1020, and the processor 1020 implements the legal element extraction method described above when executing the computer program 1030.
[0150] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the legal element extraction method described above.
[0151] The embodiment of the present application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the legal element extraction method described above.
[0152] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.
[0153] The present application is described with reference to flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices produce a device implemented in the flowcharts and / or block diagrams. Figure 1 The function specified in one flow or multiple flows and / or blocks Figure 1 The function specified in one flow or multiple flows and / or blocks
[0154] These computer program instructions can also be stored in a computer readable storage medium capable of guiding the computer or other programmable data processing devices to work in a specific manner, so that the instructions stored in the computer readable storage medium produce a product comprising instruction devices, which implement the flowcharts and / or block diagrams. Figure 1 The function specified in one flow or multiple flows and / or blocks Figure 1 The function specified in one flow or multiple flows and / or blocks
[0155] These computer program instructions can also be loaded into a computer or other programmable data processing devices, so that a series of operational steps are performed on the computer or other programmable data processing devices to generate a computer implemented process, so that the instructions executed on the computer or other programmable data processing devices provide a process for implementing the flowchart Figure 1 one flow or multiple flows and / or the functions specified in the block Figure 1 one flow or multiple flows and / or the functions specified in the block
[0156] The above described specific embodiments, the purpose, technical solutions and beneficial effects of the present application are further described in detail, it should be understood that the above described is only a specific embodiment of the present application, and is not used to limit the protection scope of the present application, any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A legal element extraction method characterized by, The method comprises the following steps: constructing a legal consultation dataset of a target field; dividing the legal consultation dataset according to consultation intents to obtain a plurality of datasets corresponding to the consultation intents; determining, for each dataset corresponding to a consultation intent, legal entities in the dataset; dividing, according to the legal entities, each dataset corresponding to a consultation intent into a plurality of fact description sets; querying, according to a consultation intent and a legal entity involved in each fact description set, a legal element full set corresponding to the fact description set, the legal element full set being a set of all legal elements predefined for the consultation intent and the legal entity; obtaining, for each fact description set, a label of each legal fact in the fact description set by using a legal element extraction model based on causal correlation, based on the fact description set and the legal element full set corresponding to the fact description set, and determining the extracted legal elements and the polarity of each legal element according to the label of each legal fact in the fact description set, wherein the legal element extraction model based on causal correlation can extract explicitly stated legal elements and implicitly stated legal elements through causal reasoning by circulation.
2. The method of claim 1, wherein, The label of the legal fact includes positive polarity, negative polarity and no polarity of the legal element in the legal fact, the positive polarity indicates that the legal element exists and the polarity is positive, the negative polarity indicates that the legal element exists and the polarity is negative, and the no polarity indicates that the element does not exist.
3. The method of claim 1, wherein, For each fact description set, a label of each legal fact in the fact description set is obtained by using a legal element extraction model based on causal correlation, based on the fact description set and the legal element full set corresponding to the fact description set, which comprises the following steps: each legal fact in the fact description set is represented by a token, and each fact description set corresponds to a token sequence; each legal element in the legal element full set corresponding to the fact description set is represented by a token, and each legal element full set corresponds to a token sequence; the token sequence corresponding to the fact description set and the token sequence corresponding to the legal element full set are concatenated; the concatenated token sequence is input into the legal element extraction model based on causal correlation to obtain the label of each legal fact in the fact description set.
4. The method of claim 1, wherein, The legal element extraction model based on causal correlation comprises a description encoder and a class loop multiple reasoning element extraction module, wherein the description encoder is used to input the fact description set and the legal element full set corresponding to the fact description set, and output a description embedding; the class loop multiple reasoning element extraction module is used to input the description embedding, and output the label of the legal fact through multiple loops, wherein the label output in the last loop is used in each loop until a loop termination condition is reached, and the final label of each legal fact in the fact description set is output.
5. The legal element extraction method of claim 4, wherein, The class loop multiple reasoning element extraction module comprises a self-attention layer, a pooling layer, a first full connection layer and a second full connection layer, wherein the self-attention layer is used to input the description embedding in the initial loop and input the vector sum of the label embedding and the self-attention embedding of the last loop in the non-initial loop, and output a self-attention embedding; the pooling layer is used to input the self-attention embedding and output a pooling embedding; A first fully connected layer for inputting the pooled embedding and outputting the label; A second fully connected layer for inputting the label and outputting the label embedding.
6. A legal element extraction apparatus characterized by comprising: The method comprises the following steps: The consultation dataset construction module is configured to construct a legal consultation dataset of a target field; The dataset division module is configured to divide the legal consultation dataset according to consultation intents, and obtain datasets corresponding to multiple consultation intents; The legal entity determination module is configured to determine legal entities in each dataset corresponding to a consultation intent; The fact description set division module is configured to divide each dataset corresponding to a consultation intent into multiple fact description sets according to the legal entities; The legal element extraction module is configured to query a legal element universal set corresponding to each fact description set according to a consultation intent and legal entities involved in the fact description set, wherein the legal element universal set is a set of all legal elements defined in advance for the consultation intent and the legal entities; For each fact description set, a legal element extraction model based on causal association is adopted to obtain labels of each legal fact in the fact description set based on the fact description set and the legal element universal set corresponding to the fact description set, and determine the extracted legal elements and the polarity of each legal element according to the labels of each legal fact in the fact description set, wherein the legal element extraction model based on causal association can extract legal elements expressed explicitly and legal elements implied through causal reasoning through circulation.
7. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to realize the method of any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the method of any one of claims 1 to 5.
9. A computer program product, characterised in that, The computer program product comprises a computer program, and the computer program is executed by the processor to realize the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Legal opinion consulting database and construction method thereof
CN108920706A
Legal opinion generation system and production method
CN109002431A