A construction method of a causal representation learning framework for judicial case matching
By decomposing the mediating and direct effects of legal provisions using a causal representation learning framework, this approach addresses the problem of ineffective utilization of legal provisions in existing technologies, thereby improving the accuracy and effectiveness of legal case matching.
Patent Information
- Application Number
- CN202310463448.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-26
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2043-04-26
AI Technical Summary
Existing legal case matching methods fail to effectively utilize the important role of legal provisions in matching similar cases, resulting in poor matching results.
A causal representation learning framework based on instrumental variable regression is adopted. By processing the variable decomposition module, the mediating and direct effects of legal provisions are decomposed from legal cases. Embedding vectors are generated using a pre-trained language model and then recombined by attention weights to generate the final matching score.
It improves the accuracy and effectiveness of legal case matching, reasonably incorporates legal provisions into the matching process, and enhances the model's ability to recognize matching signals.
Smart Images

Figure CN116561252B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and particularly relates to a construction method of a cause-and-effect representation learning framework for judicial case matching. BACKGROUND
[0002] Legal case matching plays an important role in intelligent legal systems. For example, in legal case retrieval, a matching model helps the system determine the relevance between a query case and candidate cases. Traditionally, this task is formalized as matching two long text documents at the semantic level. Some general document matching models have been used to solve this problem, including heuristic methods, network-based methods, and text-based methods. Although the above solutions are effective, there is still room for improvement. There is a significant problem in treating legal cases as general long text documents, that is: legal cases often cite some legal provisions (legal provisions are the basis of statutes or written laws, usually enacted by judicial authorities (such as the Criminal Law of the People's Republic of China)). These legal provisions are selected by judges from legal documents (such as the Criminal Law of the People's Republic of China) and provide important knowledge for the background and judgment of legal cases. Existing research shows that legal provisions are beneficial to many legal-related tasks. Generally, key elements and key circumstances provide important signals for the matching of two legal cases. Key elements are highly abstract texts written according to certain legal provisions. On the other hand, key circumstances are detailed fact descriptions, which are usually very different between cases. They have no direct relationship with any legal provisions. Therefore, legal provisions can help the matching model to identify and decompose these key information.
[0003] Legal case matching can be solved by manual knowledge engineering (KE). These methods include Boolean search techniques and manual classification. With the development of natural language processing (NLP), deep learning has been applied to realize semantic-level matching of legal cases. These studies can be divided into network-based and text-based methods. Network-based methods are for common law, using citations of different cases to construct a precedent citation network (PCNet). For example, using Jaccard similarity based on PCNet to infer the similarity of matching legal cases; using Node2vec to map the nodes of the graph to a vector space, and then calculating the cosine similarity of legal cases.
[0004] In recent years, text-based methods have been used to calculate the semantic similarity between legal cases. For example, using BERT to capture semantic relationships at the paragraph level, and then inferring the relevance between two cases by aggregating paragraph-level interactions; a pre-training language model based on Longformer to obtain a better representation of long legal documents; a three-stage interpretable legal case matching model, etc.
[0005] There is a significant problem that the existing method only regards legal cases as general long text documents, that is, legal cases usually cite some legal provisions (legal provisions are the basis of regulations or written laws, usually issued by judicial organs (such as the Criminal Law of the People's Republic of China)). These legal provisions are selected by judges from legal documents (such as the Criminal Law of the People's Republic of China) and provide important knowledge for the background and judgment of legal cases, but the existing method does not consider the important role of legal provisions in case matching. SUMMARY
[0006] To this end, the present application first proposes a construction method of a causal representation learning framework for judicial case matching, adopts a causal representation learning framework based on instrumental variable regression, first passes through a variable decomposition module, adopts two treatment reconstruction modules with the same architecture to process source cases and target cases , respectively outputs reconstructed embedding vectors and , generates the direct causal effect of legal provisions on legal cases, respectively obtains the fitted part and the residual part, then adopts the treatment reconstruction module, recombines the fitted part and the residual part through attention weight, finally through the downstream application module, represents each input document as a vector, and predicts the matching score according to the representation. The matching score can be used to guide the case retrieval system to sort related documents.
[0007] The specific method of outputting the reconstructed embedding vectors and is: first, use a pre-trained language model (BERT) to encode the text to obtain legal provision embeddings and , and legal case embeddings and , which are all vectors with a length of . Considering that instrumental variables need to have an impact on treatment variables, and mediate the impact on output results through treatment variables, define the instrumental variables as and , and the input legal cases and are two treatment variables in the causal graph, respectively represented as their embeddings and , decompose through the instrumental variables to obtain the fitted part and the residual part ,
[0008] The fitted part can be calculated as follows:
[0009] wherein the vector space of legal texts is mapped to the vector space of legal texts, input is a linear combination of:
[0010] wherein:
[0011]
[0012] f attn s ( a , b )= v T tanh( W [ a ; b ])
[0013] and are learnable parameters, representing the mediating effect variable of legal texts and legal texts,
[0014] The fitted part is obtained, and the residual part is calculated: wherein represents the direct causal effect of legal texts on legal cases.
[0015] wherein the fitted part is calculated in the following way:
[0016] wherein the vector space of legal texts is mapped to the vector space of legal texts, input is a linear combination of:
[0017] wherein:
[0018]
[0019] f attn T ( a , b )= v T tanh( W [ a ; b ])
[0020] with are learnable parameters, represents the mediating effect variable between legal provisions and legal texts,
[0021] The fitted part is obtained After that, the residual part is calculated : where represents the direct causal effect of legal provisions on legal cases.
[0022] The implementation of the processing variable reconstruction module is as follows: for the source case and the target case, the fitted part and the residual part are combined to obtain new processing variables: , .
[0023] where α s ∈[0,1] represents the weight of : α s = σ f weight s ([ e ( X ); e ̃ ( X )])
[0024] α T ∈[0,1] represents the weight of : α T = σ f weight T ([ e ( Y ); e ̃ ( Y )])
[0025] with denotes the real value of the fitted and residual parts as input and output by using a two-layer MLP, denotes the sigmoid function.
[0026] The implementation of the downstream application module is as follows: given a pair of judicial cases , two processing variable reconstruction modules output reconstructed vectors and , and the matching score between is obtained:
[0027]
[0028] where Any matching model can be used.
[0029] The technical effect to be achieved by the present application is that:
[0030] The present application proposes a novel model-independent causal learning framework to introduce legal texts into the process of legal case matching in a reasonable way. By using regression methods, the legal texts are treated as instrumental variables and the legal cases are treated as treated variables, so that the mediation effect and the direct effect are decomposed from the legal cases. BRIEF DESCRIPTION OF DRAWINGS
[0031] Figure 1 is a causal diagram of original case matching;
[0032] Figure 2 Tool variable decoupling case matching causal diagram;
[0033] Figure 3 is the overall framework of the Law-Match model;
[0034] Figure 4 Experimental results on ELAM, LeCaRD, and eCAIL data. DETAILED DESCRIPTION
[0035] The following is a preferred embodiment of the present application and further describes the technical solutions of the present application in conjunction with the drawings, but the present application is not limited to this embodiment.
[0036] The present application proposes a construction method of a causal representation learning framework for judicial case matching.
[0037] First, define the construction of the causal diagram, and use a multivariate causal diagram to formalize legal case matching. According to the diagram shown in Figure 1 、 2 Two input legal cases and are two treated variables in the causal diagram, respectively represented as their embeddings and . The outcome variable is the matching label. Because the prediction is based on the matching signal between and , there is an association between and (path ) and .
[0038] According to observations, key components in legal cases are usually highly relevant to cited legal provisions, while key circumstances are not. Causally, matching labels are determined along two paths, including the mediating effect of legal provisions and the direct effect of key circumstances. More specifically, the mediating effect of key components leads to the influence of legal provisions on matching labels, while key circumstances have a direct impact on matching labels. Therefore, and The association between them is a mixture of two different types of causal paths, i.e., the law-related association caused by mediating effects and the law-unrelated association caused by direct effects.
[0039] A causal representation learning framework based on instrumental variable regression is then constructed:
[0040] As shown on the left side, Figure 3 Law-Match adopts two treatment reconstruction modules to process source cases and target cases , outputting reconstructed embedding vectors and respectively. The two modules share the same network architecture but have different parameters. can be obtained by first regressing on instrumental variables (IVs) and , obtaining the fitted part and the residual part. We call this stage treatment variable decomposition. Then, the two parts will be recombined together through attention weights, called treatment variable reconstruction.
[0041] For the construction of the treatment variable decomposition module: we use as the instrumental variable to decompose , obtaining the fitted part ( ) and the residual part ( ). Specifically, ( ) can be calculated as follows:
[0042]
[0043]
[0044] where maps the vector space of legal provisions to the vector space of legal provisions, and the input ( ) is Linear combination:
[0045]
[0046]
[0047] in:
[0048]
[0049] f attn s ( a , b )= v T tanh( W [ a ; b ])
[0050]
[0051] f attn T ( a , b )= v T tanh( W [ a ; b ])
[0052] in and These are learnable parameters. ( () represents the mediating effect variable between legal provisions and legal texts.
[0053] get ( After that, we can obtain it through the following methods. ( ):
[0054]
[0055]
[0056] ( ) represents the direct causal effect of legal provisions on legal cases.
[0057] For the process of the treatment variable reconstruction module: the combination of the fitting part and the residual part gets the new treatment variable: , .
[0058] where α s ∈[0,1] represent the weights of : α s = σ f weight s ([ e ( X ); e ̃ ( X )])
[0059] α T ∈[0,1] represent the weights of : α T = σ f weight T ([ e ( Y ); e ̃ ( Y )])
[0060] and denote the real value of the two-layer MLP that takes the fitting and residual parts as input and output, denotes the sigmoid function.
[0061] For the construction of the downstream application module: many case matching models have similar structures, which we call the base model. The base model represents each input document as a vector and predicts the matching score according to the representation. Law-Match is a model-agnostic framework that is implemented on existing document matching models, which achieve matching by providing the reconstructed treatment to the matching model.
[0062] Specifically, given a pair of judicial cases , two treatment variable reconstruction modules output the reconstructed vectors and respectively. Finally we can get the matching score between :
[0063]
[0064] where can be any matching model, such as sentence-BERT, Lawformer, Bert-PLI, IOT-Match, etc.
[0065] The dataset of the model uses ELAM, eCAIL and LeCaRD three datasets.
[0066] ELAM is an explainable legal case matching dataset. It contains 1250 source legal cases, each related to four target cases. The label of each case pair is matched (2), partially matched (1) or not matched (0).
[0067] eCAIL is an extension of CAIL (Challenge on Legal Artificial Intelligence) 2021 dataset. In CAIL data, each legal case is associated with a label about private lending. Following the practice in [9], we constructed 1875 source cases, each related to four target cases. According to the number of overlapping labels, each legal case pair is assigned a matching label (matched if overlap > 10; not matched if < 1; otherwise partially matched).
[0068] LeCaRD is a legal case retrieval dataset, containing 107 source (query) cases and 43,000 target cases. All criminal cases are published by the Supreme People's Court of China. For each query, 30 target cases are manually labeled, each assigned a 4-level relevance (match) label.
[0069] For evaluation metrics, accuracy, macro precision, macro recall, and macro F1 are used to measure the accuracy of matching.
Claims
1. A method for constructing a causal representation learning framework for judicial case matching, characterized in that: Adopting the causal representation learning framework based on instrumental variable regression, firstly, through the processing variable decomposition module, two same-architecture treatment reconstruction modules are used to process the source case X and the target case Y respectively, and the reconstructed embedding vectors e re (X) and e re (Y) are output respectively, to generate the direct causal effect of the legal provisions on the legal cases, and the fitting part and the residual part are obtained respectively, then the processing variable reconstruction module is used to recombine the fitting part and the residual part through the attention weight, finally, through the downstream application module, each input document is represented as a vector, and the matching score is predicted according to the representation, and the matching score is used to guide the sorting of the relevant documents by the case retrieval system; the output reconstructed embedding vector e re (X) and e re The specific method of (Y) is: first, encode the text using a pre-trained language model to obtain legal provision embedding e(L X ) and e(L Y ), and legal case embedding e(X) and e(Y), all of which are vectors of length n, define instrumental variables e(L X ) and e(L Y ), and the input legal cases X and Y are two treatment variables in the causal graph, respectively represented as their embeddings e(X) and e(Y), decompose e(X) and e(Y) through the instrumental variables to obtain the fitted part and the residual part where the fitted portion The calculation is made by: wherein mapping the vector space of legal texts to the vector space of legal texts, input c s (L X , L Y ) is a linear combination of e(L X ) and e(L Y ): c s (L X , L Y ) = w s · e(L X ) + (1 - w s ) · e(L Y ) wherein: with are learnable parameters, represent the mediating effect variable of legal provisions and legal texts, obtaining a fitted portion After, calculating a residual portion wherein represents the direct causal effect of the legal provision on the legal case; where the fitted portion The calculation is made by: wherein mapping the vector space of legal texts to the vector space of legal texts, input c T (L X , L Y ) is a linear combination of e(L X ) and e(L Y ): c T (L X , L Y ) = w T · e(L Y ) + (1 - w T ) · e(L X ) wherein: with are learnable parameters, represent the mediating effect variable of legal provisions and legal texts, obtaining a fitted portion After, calculating a residual portion wherein represents the direct causal effect of the legal provision on the legal case.
2. The method of claim 1, wherein the method further comprises: The implementation mode of the processing variable reconstruction module is that for the source case and the target case, the fitting part and the residual part are combined to obtain new processing variables: , wherein represent the weight of: representative weight: with denotes the real value of the fitted and residual part as input and output using a two-layer MLP, denotes the sigmoid function.
3. The method of claim 1, wherein: The implementation mode of the downstream application module is that, given a pair of judicial cases (X, Y), the two processing variable reconstruction modules respectively output the reconstructed vectors e re (X) and e re (Y), to obtain the matching score between X and Y: where f pred may be any matching model.
Citation Information
Patent Citations
Competitive risk survival analysis method based on causal inference
CN114418420A
Domain generalization image recognition method based on causal decoupling generation model
CN114863213A