Methods, systems, and storage media for retrieving similar cases

By using K-BERT and TF-IDF models combined with knowledge graphs in the judicial document retrieval system, the problem of low efficiency in similar case retrieval in existing technologies has been solved, achieving more efficient and accurate matching of similar cases and improving the case-handling efficiency of judicial departments.

CN115293145BActive Publication Date: 2025-11-14ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210749683.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-29
Publication Date
2025-11-14
Estimated Expiration
2042-06-29

AI Technical Summary

Technical Problem

Existing judicial document retrieval systems cannot effectively integrate general knowledge, legal knowledge, and the relationship between judgments, resulting in low efficiency in retrieving similar cases and potentially increasing the probability of judicial misconduct.

Method used

A single-tower or dual-tower K-BERT model is used in conjunction with TF-IDF and an empirical feature extraction model. A knowledge graph is constructed to represent the relationship between legal provisions and judgments. By integrating textual, empirical, and knowledge graph features, similar cases can be retrieved.

Benefits of technology

It has improved the accuracy and efficiency of similar case searches, reduced the probability of judicial accidents, and enhanced the case-handling capabilities of judicial departments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115293145B_ABST
    Figure CN115293145B_ABST
Patent Text Reader

Abstract

This specification provides an embodiment of a method for retrieving similar cases, the method comprising: receiving a similar case query request for a case to be queried; extracting textual features and empirical features of the case to be queried and historical judgment cases, respectively, and extracting knowledge graph features of the historical judgment cases, at least in part based on the similar case query request; fusing the textual features, empirical features, and knowledge graph features; and retrieving and outputting similar cases in the historical judgment cases based on the fused features. Numerous other aspects are also provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of natural language processing, and more specifically to methods, systems, and storage media for similar case retrieval. Background Technology

[0002] Judicial cases occur daily across the country, resulting in a massive accumulation of historical cases in judicial document databases. Public security, procuratorial, and judicial departments often need to utilize similar cases from these historical records to assist in current case handling. Without effective historical case retrieval, these departments must rely on their own experience, leading to higher difficulty, greater time and effort, and potentially increasing the probability of judicial misconduct. A convenient and efficient similar case retrieval (also known as case matching) system can retrieve similar cases from publicly available judicial document and case databases by inputting a description of the suspect's alleged involvement, using machine learning. This significantly improves the efficiency of case handling by relevant departments and reduces the occurrence of judicial misconduct.

[0003] Conventional text matching models only calculate the similarity between search results and judgment documents based on surface character information, lacking general knowledge, legal knowledge, and modeling of the relationship between judgments. To better adapt to the judicial field and better serve supervision, this paper provides a method, system, and storage medium for similar case retrieval that integrates general knowledge, legal knowledge, and historical judgment knowledge. Summary of the Invention

[0004] The following provides a brief overview of one or more aspects to offer a basic understanding of them. This overview is not an exhaustive summary of all conceived aspects, nor is it intended to identify the key or decisive elements of all aspects, nor to define the scope of any or all aspects. Its sole purpose is to present some concepts of one or more aspects in a simplified form as a prelude to the more detailed descriptions that follow.

[0005] To address the aforementioned problems, one or more embodiments of this specification achieve their objectives through the following technical solutions.

[0006] In one aspect, a method for retrieving similar cases is provided, the method comprising: receiving a similar case query request for a case to be queried; extracting, at least in part, first text features and first empirical features of the case to be queried, and second text features and second empirical features of historical judgment cases, based on the similar case query request; fusing the first text features, the second text features, the first empirical features, the second empirical features, and pre-extracted knowledge graph features of the historical judgment cases; and retrieving and outputting similar cases in the historical judgment cases, at least in part, based on the fused features.

[0007] Preferably, extracting the first text features and the second text features includes: using a single-tower K-BERT text feature extraction model to extract the first text features and the second text features, wherein the single-tower K-BERT text feature extraction model is pre-trained using a general knowledge graph.

[0008] Preferably, extracting the first text features and the second text features includes: extracting the first text features of the query case using the User tower of the dual-tower K-BERT text feature extraction model; extracting the second text features of the historical judgment cases using the Item tower of the dual-tower K-BERT text feature extraction model, wherein the dual-tower K-BERT model is pre-trained using a general knowledge graph.

[0009] Preferably, extracting the first experience feature and the second experience feature includes: extracting the first experience feature and the second experience feature using an experience feature extraction model, wherein the experience feature extraction model is pre-trained at least in part based on a group of experience vocabularies generated through human experience.

[0010] Preferably, extracting the first experience feature and the second experience feature includes: generating an experience vocabulary group based at least in part on human experience; using TF-IDF to extract a first shallow vocabulary feature of the case to be queried and a second shallow vocabulary feature of the historical judgment cases; using an experience feature extraction model to extract the corresponding experience vector of the case to be queried, and concatenating it with the first shallow vocabulary feature to obtain the first experience feature, wherein the experience feature extraction model is pre-trained based at least in part on the experience vocabulary group generated by human experience; and using the experience feature extraction model to extract the corresponding experience vector of the historical judgment cases, and concatenating it with the first shallow vocabulary feature to obtain the second experience feature.

[0011] Preferably, the vocabulary group of experience is preconfigurable and includes one or more of the following: whether it includes a guarantor, the number of guarantors, whether it includes collateral, the number of collateral, whether the plaintiff is a company, the number of plaintiffs, whether the defendant is a company, the number of defendants, whether there is a loan relationship, whether it includes interest, the relationship between the plaintiff and the defendant, and death status.

[0012] Preferably, extracting the knowledge graph features of the historical judgment cases includes: constructing a legal knowledge graph based at least partially on legal provisions; constructing a historical judgment relationship knowledge graph based at least partially on the historical judgment cases; and performing graph reasoning based at least partially on the legal knowledge graph and the historical judgment relationship knowledge graph to output the corresponding node vectors of the historical judgment cases as the knowledge graph features.

[0013] Preferably, constructing the historical judgment relationship knowledge graph includes: extracting specified fields from the historical judgment cases; and using the specified fields to construct a historical judgment relationship graph for the relationships between the historical judgment cases.

[0014] Preferably, the fusion includes: performing feature concatenation, information fusion, and feature dimensionality reduction on the first text feature, the second text feature, the first experience feature, the second experience feature, and the knowledge graph feature.

[0015] Preferably, retrieving and outputting the similar cases includes: inputting the fused features into a classifier to obtain the similarity between the query case and the historical judgment cases; and outputting historical judgment cases whose similarity is greater than a specified threshold as retrieved similar cases.

[0016] Preferably, retrieving and outputting the similar cases further includes: automatically extracting case judgments of one or more similar cases; or grouping and displaying one or more similar cases with the same or similar key information.

[0017] On the other hand, a system for retrieving similar cases is provided, the system comprising an interaction module for receiving a similar case query request for a case to be queried; a feature extraction module for extracting, at least in part, a first text feature and a first empirical feature of the case to be queried, and a second text feature and a second empirical feature of historical judgment cases, based on the similar case query request; a feature fusion module for fusing the first text feature, the second text feature, the first empirical feature, the second empirical feature, and pre-extracted knowledge graph features of the historical judgment cases; and a similar case output module for retrieving and outputting similar cases in the historical judgment cases, at least in part, based on the fused features.

[0018] In another aspect, a non-transient computer-readable storage medium is provided that stores instructions, which, when executed by a computer, cause the computer to perform any of the methods described above.

[0019] This summary is provided to introduce some concepts in a simplified form, which will be further described in the detailed description below. This summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter. Other aspects, features, and / or advantages of the embodiments will be set forth in part in the description which follows, and will be apparent in part from the description, or may be learned by practice of this specification. Attached Figure Description

[0020] To gain a more detailed understanding of the manner in which the features described above are employed, reference can be made to various embodiments for a more specific description of the content briefly outlined above, some of which are illustrated in the accompanying drawings. However, it should be noted that the drawings illustrate only certain typical aspects of this specification and should not be considered as limiting its scope, as the description may allow for other equivalent aspects. Similar reference numerals are consistently used in the drawings. It should be noted that the described drawings are schematic and non-limiting. Some components in the drawings may be enlarged and are not drawn to scale for illustrative purposes.

[0021] Figure 1 An example of a text retrieval model was explained.

[0022] Figure 2 Examples of models for implementing similar case retrieval according to embodiments of this specification have been explained.

[0023] Figure 3A and 3B Examples of models supporting text feature extractors for implementing similar case retrieval, according to embodiments of this specification, are explained.

[0024] Figure 4 An example of a knowledge graph built for a knowledge graph feature extractor used to implement similar case retrieval, according to embodiments of this specification, is explained.

[0025] Figure 5 A block diagram illustrating a method for implementing similar case retrieval according to embodiments of this specification is provided.

[0026] Figure 6 A block diagram illustrating a system for implementing similar case retrieval according to embodiments of this specification is provided.

[0027] Figure 7 A block diagram illustrating an apparatus for implementing similar case retrieval according to embodiments of this specification is provided. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this specification clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the exemplary embodiments described. However, it will be apparent to those skilled in the art that the described embodiments can be practiced without some or all of these specific details. In other exemplary embodiments, well-known structures or processing steps have not been described in detail to avoid unnecessarily obscuring the concepts of this specification.

[0029] In this specification, unless otherwise stated, the term "A or B" as used herein refers to "A and B" and "A or B", and does not imply that A and B are exclusive.

[0030] Figure 1 This paper explains an example of text retrieval model 100. In text retrieval algorithms, the BERT (Bidirectional Encoder Representations from Transformers) algorithm and its variants are the main approaches. The text retrieval model presented in this paper can also be called a text matching deep learning model, and its architecture mainly falls into two categories: Representation-Based models and Interaction-Based models.

[0031] Figure 1 This is a schematic diagram of a Representation-Based dual-tower model, which utilizes bidirectional encoders such as DSSM (Deep Structured Semantic Models) and SNRM. The Representation-Based dual-tower model encodes and maps queries and documents to the same semantic vector space, and scores the degree of matching between queries and documents by constructing a matching function. It can compute the representation vectors of all documents offline and compute the representation vector of queries online for matching. On the other hand, the Interaction-Based single-tower model (not shown) can utilize cross-encoders such as DSSM, KNRM, and ConvKNRM; the global interaction model in the Interaction-Based model can universally utilize cross-encoders such as BERT. In the Interaction-Based model, queries and documents are interactively computed during encoding, enabling finer-grained matching and effectively improving matching results. In addition, there are late-interaction models, such as the proposed ColBERT (Contextualized Late Interaction over BERT), which uses BERT to independently encode queries and documents, employing a cost-effective yet powerful interaction step to model their fine-grained similarity. By delaying and preserving this fine-grained interaction, ColBERT can leverage BERT's expressive power while obtaining pre-computed document representations offline, thereby significantly accelerating query processing.

[0032] However, the maximum text length threshold that the aforementioned models (such as BERT) can handle is 512 characters, while the average length of judgment documents based on the LeCaRD dataset (A Legal Case Retrieval Dataset for Chinese Law System) is as high as 12,497 characters. To address this issue, a common practice is to extract the portion of the judgment document from which the prosecution accused the defendant, discarding the rest. This leads to the following problems:

[0033] It is necessary to understand the content of legal documents in conjunction with legal knowledge. For example:

[0034] Case 1: "The defendant Chen XX had a grudge against the victim WangXX. On DD / MM / YYYY, when Wang XX was on his way home from work, Chen XX together with another defendant Li XX beat Wang XX, causing Wang XX to be second-levelslightly injured...."

[0035] The descriptions of "beat Wang XX" and "second-level slightly injured" as factors of judicial concern were extracted from the judgment document, while other relevant content was not included with the aforementioned factors of judicial concern as a basis for judging similar cases, resulting in information loss.

[0036] It is necessary to model the relationships between the judgments. For example:

[0037] The documents pointing to the first instance, second instance, and final instance of the same case; the relationship between multiple offenses committed by the same defendant and the corresponding documents, thus losing useful information.

[0038] General knowledge is required. For example:

[0039] Case 2: "Defendant M sold a packet of red powder weighing a grams and a packet of white crystals weighing b grams to N for RMB X. Upon testing, methamphetamine was detected in both the red powder and the white crystals. Subsequently, the police went to a nearby barbecue restaurant to arrest Defendant M. Defendant M refused to cooperate, slashed auxiliary police officer L with a knife, and then fled."

[0040] The prosecution's description of the defendant's conduct may not directly include terms like "prohibited drugs" or common names of drugs familiar to the public, thus making it impossible to link the aforementioned conduct to drug-related cases.

[0041] Therefore, in order to better adapt to the judicial field and better serve supervision, this article provides a similar case retrieval method and process that integrates general knowledge, legal knowledge and historical judgment knowledge, so as to retrieve similar cases in the case set more quickly and accurately, as described below.

[0042] Figure 2 An example of a model 200 for implementing similar case retrieval according to an embodiment of this specification has been explained.

[0043] like Figure 2 As shown, text feature extractor 215, experience feature extractor 220, and knowledge graph feature extractor 225 can be used to extract features from the query 205 and historical judgment cases 210 during the similar case retrieval process from different perspectives. These features are then concatenated, fused, and dimensionality reduced, and finally fed into a classifier to output a predicted probability score (e.g., similarity), thereby retrieving similar cases. It should be understood that the historical judgment cases 210 may come from a similar case retrieval dataset, the knowledge graph feature extractor 225 may represent an offline computing module, and the remaining parts may represent an online real-time computing module. It should be understood that although the embodiments of this specification use three feature extractors, similar case retrieval can be achieved by using only one or any combination of two of these feature extractors without departing from the scope of the embodiments of this specification.

[0044] First, the model 200 needs to input the case to be queried (e.g., a case that has been filed, a case under investigation, etc.) and a related behavioral description query 205 for the case to be queried, and then generate a similar case query request based on the description. For example, you can input the full description of the case 2 above or just the key information.

[0045] Furthermore, based on the similar case query request, the input text feature extractor 215, the experience feature extractor 220, and the knowledge graph feature extractor 225 can be used to obtain the experience features, text features, and knowledge graph features of the query 205 and the historical judgment case 210, respectively.

[0046] In the embodiments of this application specification, the input text feature extractor 215 can be used to extract the text features of the input query 205 and the historical judgment case 210, respectively. In the embodiments of this application specification, a knowledge graph (KG) is applied to BERT to create a K-BERT model, thereby replacing the BERT model commonly used in judicial document scenario retrieval, so as to integrate general knowledge in the process of similar behavior determination. The text feature extractor 215 will be described in further detail below with reference to FIG3. For example, in the text feature extractor 215, feature word vectors can be extracted from the case description of query 205 and the historical judgment case 210, respectively, to obtain the vector representation of each word in the case description of query 205 and the historical judgment case 210, wherein the word sequence corresponding to each case description is defined as x. input ={x1, x2, ..., x n}, x n Let A represent the nth word; after passing through the text feature extractor, its corresponding word vector output is A. ouput = [A1, A2, ..., A n ], where A represents the vector representation of each case description. n This represents the word vector of the nth word in the case description, where n represents the total number of words in the case description.

[0047] In the embodiments of this application specification, an empirical feature extractor 220 can be used to extract empirical features from the input query 205 and historical judgment cases 210. On one hand, in the embodiments of this application specification, TF-IDF (Term Frequency-Inverse Document Frequency) can optionally be used to extract shallow lexical features from the query and historical judgment cases based on shallow vocabulary. TF-IDF can assess the importance of a word to a document in a corpus. The importance of a word increases proportionally to the number of times it appears in the document, but decreases inversely proportionally to its frequency of appearance in the corpus. Using TF-IDF to statistically analyze data can yield a large amount of shallow information. For example, shallow information in judgment cases does not require calculation or reasoning; it is sufficient to identify key words, such as numbers, colors, and keywords, from each sentence in the judgment case. For the first sentence in Case 2, "Defendant M sold a package of red powder weighing a grams and a package of white crystals weighing b grams to N for RMB X," the simplest and easiest information to obtain is the numbers: a grams and b grams. Key words that need to be emphasized include red powder, white crystals, and selling. In this way, we can obtain the shallow lexical features of query 205 and the shallow lexical features of historical judgment cases.

[0048] On the other hand, in the embodiments of this application specification, experiential features are extracted for query 205 and historical judgment cases 210 based on the human experience of judicial practitioners to incorporate their experience. The experiential features to be extracted are configurable and can be a group of experiential features including one or more of the following: whether a guarantor is included, the number of guarantors, whether collateral is included, the number of collateral, whether the plaintiff is a company, the number of plaintiffs, whether the defendant is a company, the number of defendants, whether a loan relationship exists, whether interest is included, the relationship between the plaintiff and defendant, and death status. An experiential feature extractor is used to extract feature vectors for the query case and historical judgment cases. For example, each dimension of this feature vector is a scalar (numerical value) derived from textual statistical results from a specific business perspective. Specifically, when the feature vector of a case input to the feature extractor is [1, 1, 0, 0, 1, 2, 0, 0, 0, 0, 2, 0], it indicates that the case: includes a guarantor; the number of guarantors is 1; does not include collateral; the amount of collateral is 0; the plaintiff belongs to a company; the number of plaintiffs is 2; the defendant does not belong to a company; the number of defendants is 0; there is no loan relationship; no interest is included; the plaintiff and defendant are friends; there are no deaths. These empirical features can be obtained based on the vocabulary statistics in the above empirical feature group and are used as a supplement to the features extracted by the text feature extractor and the KG feature extractor. In the embodiments of this application specification, the empirical feature vector obtained based on the empirical feature group can be used as empirical features, or the above two aspects can be combined, using the empirical feature vector concatenated with shallow vocabulary features to obtain the empirical features of the case to be queried and the empirical features of historical judgment cases. It should be understood that empirical features can be obtained in a different way than described above, and the specific details will not be repeated here.

[0049] In the embodiments of this application, the knowledge graph feature extractor 225 can be pre-trained offline and used to extract knowledge graph features of historical judgment cases offline in advance. For example, a knowledge graph can be constructed using historical judgment cases and their related nodes, and then the knowledge graph can be trained to obtain the vectors corresponding to the nodes of the historical judgment cases as feature vectors. The knowledge graph feature extractor 225 will be discussed further with reference to... Figure 4 The following is a more detailed description.

[0050] Furthermore, the textual and empirical features of query 205, as well as the textual, empirical, and knowledge graph features of historical judgment cases 210, can be fused. For example, these features are input into the feature concatenation module 230 and merged into a high-dimensional vector through feature vector concatenation. For example, these features can be directly concatenated as vectors. Further, the concatenated features are input into the deep neural network (DNN) module 235 to complete the cross-interaction between features, perform information fusion, and subsequently reduce the feature dimensionality. The information in each part of the concatenated features is isolated, and the total feature dimensionality is relatively high, requiring the use of the DNN module 235 for information fusion and feature dimensionality reduction. For example, information fusion can handle incomplete, inconsistent, conflicting, or misaligned raw data to obtain reliable, valuable, and accurate information. Feature dimensionality reduction can retain important features and remove redundant features, thereby reducing the dimensionality of data features, where the importance of a feature depends on how much information the feature can express about the dataset.

[0051] Finally, a classifier is used to output a final probability score based on the fused features. For example, the feature input output from the DNN module 235 can be normalized using a Softmax classifier, transforming all output values ​​into probabilities between 0 and 1, with all probability values ​​summing to 1. This converts the semantic similarity between query 205 and historical judgment case 210 into a posterior probability of relevance. In this embodiment, only historical judgment cases with posterior probabilities greater than a specified threshold can be output and displayed, or only the top K (K being the threshold number of cases) historical judgment cases can be output and displayed. In this embodiment, key information from one or more similar cases can be automatically extracted and output to the user. For example, case name, defendant, plaintiff, case judgment, etc., can be displayed for quick browsing. Preferably, one or more related candidates (e.g., the same defendant, the same plaintiff, etc.) can be grouped together for output and display.

[0052] Figure 3A and 3B Examples of text feature extractors 305 and 310, which support similar case retrieval according to embodiments of this specification, are explained respectively.

[0053] In the embodiments of this specification, the text feature extractor uses a knowledge graph-based language representation model (K-BERT) to replace the commonly used BERT, injecting triples from the legal document scenario as domain knowledge into the text to integrate general knowledge during the similarity behavior determination process. Specifically, the K-BERT model mainly includes four modules: a knowledge layer, an embedding layer, a seeing layer, and a mask-transformer encoder. For the K-BERT model used in this application, the knowledge layer first injects relevant triples from the knowledge graph into the input case description, transforming the original case sentence description into a knowledge-rich sentence tree. The sentence tree is then simultaneously fed into the embedding layer and the seeing layer, subsequently converting it into an embedding representation and a seeing matrix.

[0054] In the embodiments of this application specification, the general knowledge-related triples can be, but are not limited to:

[0055] (Methamphetamine, ingredient, prohibited drug)

[0056] (Crystals, appearance, prohibited drugs)

[0057] (Powder, appearance, prohibited drugs)

[0058] For example, knowledge graphs can be used to augment the input sentence x in the knowledge layer of the K-BERT model. input ={x0, x1, ... x i , ..., x n} (where x i (For the i-th word / character), and finally obtain the knowledge-integrated sentence x. knowledeg ={x0, x1, ... xi{(r i0 x i0 ), ..., (r ik x ik )},…,x n}, where x ik Indicates with x i The k-th connected entity (i.e., the entity in the knowledge graph connected to entity x) i The node connected to the k-th node), and r ik Represents entity x ik With entity x i The relationships between nodes (i.e., nodes x in the knowledge graph) i With node x ik(The edges between them). For example, by incorporating the triples of the aforementioned general knowledge, the description in Case 2, "Methamphetamine was detected in both the aforementioned red powder and white crystals," is transformed into "Methamphetamine was detected in both the aforementioned red powder and white crystals (appearance, prohibited drug) (component, prohibited drug)," and processed by subsequent modules of the K-BERT model. Thus, "metamphetamine," "crystals," etc., in the description can be identified as "prohibited drugs" by the text feature extractor. It should be understood that different methods can be used to expand sentences using knowledge graphs to obtain knowledge-integrated sentences; the specific details of this will not be elaborated here.

[0059] In actual use, different measures can be taken according to the response time requirements. Figure 3A The single-tower K-BERT text feature extraction model 305 or Figure 3B The dual-tower K-BERT text feature extraction model 355 is used in this study. The single-tower K-BERT text feature extraction model 305 can compute the representation vector of the interaction between query 310 (e.g., the case to be queried, such as the description of Case 2 above) and historical judgment case 315 online, achieving finer-grained matching and effectively improving the matching effect. For example, a general knowledge graph can be used to pre-train the single-tower K-BERT text feature extraction model 305, while simultaneously inputting both query case 310 and historical judgment case 315 to extract the text features of the input query case and the text features of the historical judgment case. Specifically, in the case of Case 2, by extracting the feature "prohibited drugs" from query 310, cases containing the feature "prohibited drugs" can be matched in historical judgment case 315.

[0060] The dual-tower K-BERT text feature extraction model 355 can compute the representation vectors of historical judgment cases 365 offline, while only the representation vector of query 360 (e.g., the case to be queried) needs to be computed online. This results in lower computational cost and faster execution speed. For example, a general knowledge graph can be used to pre-train the dual-tower K-BERT text feature extraction model 355. The User tower of the model can be used to extract the first text features of query 360, and the Item tower can be used to extract the second text features of historical judgment cases. The first and second text features are then concatenated. Specifically, in case 2, the features "prohibited drugs" from query 310 and historical judgment case 315 can be extracted and output for subsequent module processing (e.g., classification, labeling, etc.). It should be understood that different methods can be used to obtain text features, the specific details of which will not be elaborated here.

[0061] Figure 4An example of a knowledge graph 400 built for a knowledge graph feature extractor for implementing similar case retrieval, according to an embodiment of this specification, is explained.

[0062] The retrieval of judicial documents from historical judgment cases focuses on criminal elements. Therefore, in the embodiments of this specification, the behaviors and relevant legal provisions existing in the judicial documents of historical case databases are linked to integrate legal knowledge to extract knowledge graph features from the judicial documents of historical judgment cases. For example, in order to extract criminal elements in a targeted manner, legal provision knowledge can be integrated to construct a legal provision knowledge graph based on legal provision knowledge. Figure 4 As shown on the right, a legal provision diagram can be constructed based on the "Criminal Law of the People's Republic of China (2020 Revised Edition)". The triplets in the legal provision diagram can include, but are not limited to:

[0063] (The crime of provoking trouble, possible conduct: assaulting others)

[0064] (The crime of provoking trouble, a necessary act, disrupting public order)

[0065] (Illegal detention, possible conduct, assault)

[0066] (Illegal detention, a necessary act, depriving another person of their personal freedom)

[0067] Meanwhile, the relationships between judicial documents have potential implications for retrieving similar cases. Therefore, in the embodiments of this specification, historical judgment knowledge (e.g., judicial documents of historical judgment cases) can be structured to construct a historical judgment knowledge graph, further exploring the relationships between historical judgment cases involved in the judicial documents. For example, specific fields of historical judgment cases (e.g., including defendant, court of judgment, first instance, second instance, etc.) can be extracted, and these specified fields can be used to construct a historical judgment relationship graph. Additionally or alternatively, the number of legal provisions cited in the judicial documents (and the included clauses), the penalties involved (and the charges), the companies involved, the defense law firms, the factors of the crime, the court of judgment, the defendant, the prosecutor, the presiding judge, etc., can also be extracted to construct a historical judgment knowledge graph. Figure 4 As shown on the left, the triples in the historical decision knowledge graph can include, but are not limited to:

[0068] (Case 1, Second Instance, Case 2)

[0069] (Case 2, Final Appeal, Case 3)

[0070] (Case 1, Defendant: Zhang San)

[0071] (Case 4, Defendant: Zhang San)

[0072] After constructing the legal provisions knowledge graph and the historical judgment knowledge graph, the Trans algorithm (e.g., TransH, TransR, TranD, etc.) can be used to perform graph reasoning based on the legal provisions knowledge graph and the historical judgment knowledge graph to learn graph representations, and the corresponding nodes of the judicial documents are used as feature outputs.

[0073] The Trans algorithm maps entities and relations in a knowledge graph to a vector space, while capturing the implicit associations between entities and relations. During the learning of vector representations, it automatically extracts features needed for reasoning, enabling automatic computation of knowledge graph reasoning using the pre-defined feature representations in the vector space. More details about the Trans algorithm, a knowledge graph feature extractor, can be found in the paper "ASurvey on Knowledge Graphs: Representation, Acquisition and Application" by Shaoxiong Ji et al. This paper is cited in its entirety here, and further details about knowledge graph feature extractors will not be described in detail here.

[0074] Specifically, refer to Figure 4 For Case 1, its corresponding nodes (Case 1, second instance, Case 2), (Case 1, court, Changning District People's Court), (Case 1, defendant, Zhang 3), (Case 1, conduct, deprivation of personal freedom), etc., can be output as knowledge graph features. It should be understood that knowledge graph features of all historical judgment cases in the similar case retrieval dataset can be extracted offline in advance. It should be understood that different methods than those described above can be used to obtain knowledge graph features; the specific details will not be elaborated here.

[0075] Figure 5 A block diagram illustrating a method 500 for implementing similar case retrieval according to an embodiment of this specification is provided.

[0076] Method 500 may include: receiving a similar case query request for the case to be queried in operation 510. This operation may be similar to that described in [reference 1] Figure 2 As described in Figure 3, the first step is to input a description of the relevant behavior in the case to be queried. Preferably, the entire description of case 2 above or only key information can be entered. Preferably, operation 510 can be specifically implemented by the interaction module 605, as described in more detail below.

[0077] Method 500 may further include: in operation 520, at least in part based on the similar case query request, extracting first text features and first empirical features of the case to be queried, and second text features and second empirical features of historical judgment cases. This operation may be similar to that described in [see...] Figures 2 to 4 As described herein, a single-tower K-BERT text feature extraction model pre-trained using a general knowledge graph can extract the first text features and the second text features. Alternatively, a dual-tower K-BERT text feature extraction model pre-trained using a general knowledge graph can be used to extract the first text features of the query case using the User tower; and the dual-tower K-BERT text feature extraction model can be used to extract the second text features of the historical judgment cases using the Item tower. Preferably, an experience feature extraction model pre-trained using experience vocabulary generated from human experience can also be used to extract the first experience features and the second experience features. Preferably, a legal knowledge graph and a historical judgment relationship knowledge graph can be constructed; and graph reasoning can be performed based on the legal knowledge graph and the historical judgment relationship knowledge graph to output the corresponding node vectors of the historical judgment cases as the knowledge graph features. Preferably, operation 520 can be specifically implemented by the feature extraction module 610, as described in more detail below.

[0078] Method 500 may further include: in operation 530, fusing the first text features, the second text features, the first empirical features, the second empirical features, and pre-extracted knowledge graph features of the historical judgment cases. This operation may be similar to that described in [see...] Figure 2 The process described herein can involve performing feature concatenation, information fusion, and feature dimensionality reduction on the first text feature, the second text feature, the first experience feature, the second experience feature, and the knowledge graph feature. Preferably, a DNN can be used to perform information fusion and feature dimensionality reduction on the concatenated feature set. Preferably, operation 530 can be specifically implemented by the feature fusion module 615, as described in more detail below.

[0079] Method 500 may further include: retrieving and outputting similar cases from the historical judgment cases in operation 540, at least in part, based on the fused features. This operation may be similar to that described in [see also...] Figure 2 As described, a Softmax classifier can be used to normalize the semantic similarity between the query and historical judgment cases, converting it into a posterior probability of relevance, and only outputting probabilities higher than a threshold. Preferably, the fused features can be input into a classifier to obtain the similarity between the query case and the historical judgment cases; and historical judgment cases with similarity greater than a specified threshold can be output as retrieved similar cases. Preferably, the judgments of one or more similar cases can be automatically extracted; or one or more similar cases with the same or similar key information can be grouped and displayed. Preferably, operation 540 can be specifically implemented by the similar case output module 620, as described in more detail below.

[0080] Figure 6 A block diagram illustrating a system 600 for implementing similar case retrieval according to an embodiment of this specification is provided.

[0081] like Figure 6 As shown, system 600 may include: an interaction module 605, configured to receive a similar case query request for the case to be queried. The operation implemented by interaction module 605 can be similar to that described in [reference]. Figure 2 As described, first, input a description of the relevant behavior in the case to be queried. Preferably, you can input the entire description of case 2 above or just the key information.

[0082] System 500 may further include: a feature extraction module 610, configured to extract, at least in part, first textual features and first empirical features of the case to be queried, and second textual features and second empirical features of historical judgment cases, based on the similar case query request. The operation implemented by feature extraction module 615 may be similar to that described in [reference]. Figures 2 to 4 As described, a single-tower K-BERT text feature extraction model pre-trained using a general knowledge graph can extract the first text features and the second text features. Alternatively, a dual-tower K-BERT text feature extraction model pre-trained using a general knowledge graph can be used to extract the first text features of the query case using the User tower; and the dual-tower K-BERT text feature extraction model can be used to extract the second text features of the historical judgment cases using the Item tower. Preferably, an experience feature extraction model pre-trained using experience vocabulary generated from human experience can also be used to extract the first experience features and the second experience features. Preferably, a legal provision knowledge graph and a historical judgment relationship knowledge graph can be constructed; and graph reasoning can be performed based on the legal provision knowledge graph and the historical judgment relationship knowledge graph to output the corresponding node vectors of the historical judgment cases as the knowledge graph features.

[0083] System 600 may further include: a feature fusion module 620, configured to fuse the first text features, the second text features, the first empirical features, the second empirical features, and pre-extracted knowledge graph features of the historical judgment cases. The operation implemented by the feature fusion module 620 can be similar to that described in [reference]. Figure 2 As described herein, feature concatenation, information fusion, and feature dimensionality reduction can be further performed on the first text feature, the second text feature, the first experience feature, the second experience feature, and the knowledge graph feature.

[0084] System 600 may further include: a similar case output module 625, configured to retrieve and output similar cases from the historical judgment cases, at least in part based on the fused features. The operation of the similar case output module 625 may be similar to that described in [reference needed]. Figure 2 As described, a Softmax classifier is used to normalize the semantic similarity between the query and historical judgment cases, converting it into a posterior probability of relevance, and only outputting probabilities higher than a threshold. Preferably, the fused features can be input into the classifier to obtain the similarity between the query case and the historical judgment cases; and historical judgment cases with similarity greater than a specified threshold can be output as retrieved similar cases. Preferably, the judgments of one or more similar cases can be automatically extracted; or one or more similar cases with the same or similar key information can be grouped and displayed.

[0085] For specific details on the operation of each of the above modules, please refer to the method description above. It should be understood that some optional operations can be performed by the above modules, or by additional modules.

[0086] Figure 7 A block diagram illustrating an apparatus 700 for implementing similar case retrieval according to an embodiment of this specification is provided.

[0087] The device may include a processor 710 and a memory 715, the processor being configured to perform any of the methods described above, such as those shown in the accompanying figures. The memory may store, for example, acquired articles, information associated with products or services, data that may be generated during processing, and necessary algorithms, etc.

[0088] The device may include a network connectivity element 725, such as a network connectivity device that can connect to other devices via a wired or wireless connection. The wireless connection may be, for example, a WiFi connection, a Bluetooth connection, or a 3G / 4G / 5G network connection. For instance, the system can connect to a database via the network connectivity element to retrieve historical judgment cases. It can also receive user input from other devices or transmit data to other devices for display via the network connectivity element.

[0089] The device may also optionally include other peripheral components 720, such as input devices (e.g., keyboard, mouse) and output devices (e.g., display). For example, in a user input-based method, the user can perform input operations via the input device. Corresponding information can also be output to the user via the output device.

[0090] Each of these modules can communicate with each other directly or indirectly, for example, via one or more buses (e.g., bus 705).

[0091] Furthermore, embodiments of this specification also disclose a computer-readable storage medium including computer-executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the methods of the embodiments described herein.

[0092] Furthermore, embodiments of this specification also disclose an apparatus including a processor and a memory storing computer-executable instructions that, when executed by the processor, cause the processor to perform the methods of the embodiments described herein.

[0093] Furthermore, embodiments of this specification also disclose a similar case retrieval system, which includes means for implementing the methods of the various embodiments described herein. In one aspect, the system includes: means for receiving a similar case query request for a case to be queried; means for extracting, at least in part, first textual features and first empirical features of the case to be queried, and second textual features and second empirical features of historical judgment cases, based on the similar case query request; means for fusing the first textual features, the second textual features, the first empirical features, the second empirical features, and pre-extracted knowledge graph features of the historical judgment cases; and means for retrieving and outputting similar cases in the historical judgment cases, at least in part, based on the fused features.

[0094] The above describes the method, system, and storage medium for similar case retrieval according to this specification. Compared with existing technologies, the method in this specification has at least the following advantages: It comprehensively models legal provisions and judgment cases, constructs a legal knowledge graph for learning legal document features, incorporates legal information to obtain better feature vector representation, and improves model performance; it extracts fields from massive judicial documents and establishes relationships between judgment documents based on this, constructs a historical judgment graph, and uses it to learn historical case document features, further enhancing feature vector representation capabilities; it applies K-BERT to judicial scenarios, combines it with a general knowledge graph, learns Query and Document features, solves the problem of poor performance of the BERT model in judicial document scenarios, and thus solves the problems of heterogeneous embedding space and the introduction of knowledge noise; it mines shallow information based on both business experience and TF-IDF, absorbs the human experience of judicial practitioners, and obtains a large amount of shallow information by combining lexical statistics, improving the retrieval efficiency and performance of similar case retrieval scenarios.

[0095] Throughout this specification, reference has been made to "embodiments," meaning that a particular described feature, structure, or characteristic is included in at least one embodiment. Therefore, the use of these phrases may refer to more than one embodiment. Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0096] The various steps and modules of the methods and apparatus described above can be implemented in hardware, software, or a combination thereof. If implemented in hardware, the various illustrative steps, modules, and circuits described herein can be implemented or executed using a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic components, hardware components, or any combination thereof. A general-purpose processor can be a processor, microprocessor, controller, microcontroller, or state machine, etc. If implemented in software, the various illustrative steps and modules described herein can be stored as one or more instructions or codes on a computer-readable medium or transmitted. Software modules implementing the various operations of this specification can reside in storage media such as RAM, flash memory, ROM, EPROM, EEPROM, registers, hard disks, removable disks, CD-ROMs, cloud storage, etc. The storage medium can be coupled to a processor so that the processor can read and write information from / to the storage medium and execute the corresponding program modules to implement the various steps of this specification. Furthermore, software-based embodiments can be uploaded, downloaded, or remotely accessed through appropriate communication means. Suitable means of communication include, for example, the Internet, the World Wide Web, intranets, software applications, cables (including fiber optic cables), magnetic communication, electromagnetic communication (including RF microwave and infrared communication), electronic communication, or other such means of communication.

[0097] It is understood that the methods according to one or more embodiments of this specification can be implemented in software, firmware, or a combination thereof.

[0098] It should be understood that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments. In particular, for the apparatus and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments.

[0099] It should be understood that the foregoing description describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0100] It should be understood that the use of a singular form to describe an element or to show only one element in the accompanying drawings does not imply that the number of such element is limited to one. Furthermore, modules or elements described or shown as separate herein may be combined into a single module or element, and modules or elements described or shown as single herein may be broken down into multiple modules or elements.

[0101] It should also be understood that the terminology and expressions used herein are for descriptive purposes only, and one or more embodiments described herein should not be limited to these terms and expressions. The use of these terms and expressions does not exclude any illustrative and descriptive equivalent features (or parts thereof), and it should be recognized that various modifications that may exist should also be included within the scope of the claims. Other modifications, variations, and substitutions may also exist. Accordingly, the claims should be considered to cover all such equivalents.

[0102] Similarly, it should be noted that although specific embodiments have been described with reference to the present invention, those skilled in the art should recognize that the above embodiments are merely illustrative of one or more embodiments of this specification. Various equivalent changes or substitutions can be made without departing from the spirit of the embodiments of this specification. Therefore, any changes or modifications to the above embodiments within the scope of the essential spirit of this specification will fall within the scope of the claims of this specification.

Claims

1. A method for retrieving similar cases, the method comprising: Receive similar case search requests for the case to be searched; Based at least in part on the similar case query request, a first text feature and a first experience feature of the case to be queried, as well as a second text feature and a second experience feature of historical judgment cases, are extracted, wherein the first experience feature and the second experience feature are extracted using an experience feature extraction model, and the experience feature extraction model is pre-trained based at least in part on an experience vocabulary group generated through human experience; Extracting knowledge graph features from the historical judgment cases, wherein extracting the knowledge graph features includes: constructing a legal provision knowledge graph based at least in part on legal provision knowledge, constructing a historical judgment relationship knowledge graph based at least in part on the historical judgment cases, and performing graph reasoning based at least in part on the legal provision knowledge graph and the historical judgment relationship knowledge graph, so as to output the corresponding node vector of the historical judgment cases as the knowledge graph features; The first text feature, the second text feature, the first experience feature, the second experience feature, and the knowledge graph feature are integrated; and Similar cases in the historical judgment cases are retrieved and output, at least in part, based on the fused features.

2. The method of claim 1, wherein extracting the first text feature and the second text feature comprises: The first text features and the second text features are extracted using a single-tower K-BERT text feature extraction model, and The single-tower K-BERT text feature extraction model mentioned therein is pre-trained using a general knowledge graph.

3. The method of claim 1, wherein extracting the first text feature and the second text feature comprises: The User Tower of the dual-tower K-BERT text feature extraction model is used to extract the first text features of the case to be queried; The second text features of the historical judgment cases are extracted using the Item Tower of the dual-tower K-BERT text feature extraction model, and... The dual-tower K-BERT model mentioned above is pre-trained using a general knowledge graph.

4. The method as described in claim 1, wherein extracting the first empirical feature and the second empirical feature comprises: The vocabulary of experience is generated at least in part based on human experience. The first shallow lexical features of the case to be queried and the second shallow lexical features of the historical judgment cases are extracted using TF-IDF. The empirical feature extraction model is used to extract the corresponding empirical vector of the query case, and this vector is concatenated with the first shallow lexical features to form the first empirical feature, wherein the empirical feature extraction model is pre-trained at least in part based on an empirical vocabulary group generated through human experience; and The empirical feature extraction model is used to extract the corresponding empirical vectors of the historical judgment cases, and these vectors are concatenated with the first shallow lexical features to form the second empirical feature.

5. The method of claim 4, wherein the experiential vocabulary is preconfigurable and includes one or more of the following: Does it include guarantors, the number of guarantors, does it include collateral, the number of collateral, whether the plaintiff is a company, the number of plaintiffs, whether the defendant is a company, the number of defendants, whether there is a loan relationship, whether interest is included, the relationship between the plaintiff and the defendant, and any death details.

6. The method of claim 1, wherein constructing the historical judgment relationship knowledge graph comprises: Extract specified fields from the historical judgment cases; as well as Construct a historical judgment relationship graph using the specified fields to identify the relationships between the historical judgment cases.

7. The method of claim 1, wherein the fusion comprises: Perform feature concatenation, information fusion, and feature dimensionality reduction on the first text feature, the second text feature, the first experience feature, the second experience feature, and the knowledge graph feature.

8. The method of claim 1, wherein retrieving and outputting the similar cases comprises: The fused features are input into a classifier to obtain the similarity between the query case and the historical judgment cases; as well as Output historical judgment cases whose similarity is greater than a specified threshold as retrieved similar cases.

9. The method of claim 8, wherein retrieving and outputting the similar cases further comprises: Automatically extract case judgments from one or more similar cases; or Grouping displays one or more similar cases with the same or similar key information.

10. A system for retrieving similar cases, the system comprising: The interaction module is configured to receive similar case query requests for the case to be queried; A feature extraction module is configured to extract, at least in part, the first text features and first empirical features of the case to be queried, as well as the second text features and second empirical features of historical judgment cases and knowledge graph features, based on the similar case query request. The first empirical features and second empirical features are extracted using an empirical feature extraction model, which is pre-trained at least in part based on an empirical vocabulary generated through human experience. Extracting the knowledge graph features includes: constructing a legal knowledge graph at least in part based on legal provisions, constructing a historical judgment relationship knowledge graph at least in part based on the historical judgment cases, and performing graph reasoning at least in part based on the legal knowledge graph and the historical judgment relationship knowledge graph to output the corresponding node vectors of the historical judgment cases as the knowledge graph features. A feature fusion module is configured to fuse the first text features, the second text features, the first experience features, the second experience features, and the knowledge graph features; and A similar case output module is configured to retrieve and output similar cases from the historical judgment cases, at least in part based on the fused features.

11. A non-transient computer-readable storage medium storing instructions, which, when executed by a computer, cause the computer to perform the method as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Knowledge graph-based case retrieval method, device and equipment, and storage medium

    CN111241241A

  • Event reasoning method and device

    CN114357197A