Case recommendation method and system based on legal review opinions
Patent Information
- Application Number
- CN202311280640.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-07
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-10-07
AI Technical Summary
[0004]然而在实现本申请的过程中发明人发现,现有技术的法律案件推荐,或采用案件基本信息(结构化)或者案由(非结构化)作为输入源,均未考虑到法务人员给出的审查意见的重要性,例如在处理合同送审稿等法律事务时,一般使用合同正文或者摘要进行相似性推荐,往往忽略了法律审查意见,而事实上法律审查意见是经过法务人员确认的准确意见,完全可以作为相似性推荐的重要依据
[0021]本申请实施例通过对案件库中收集的每个法律案件,提取法律审查意见,并拆分成独立意见,对每条独立意见分别提取语义特征,将所有独立意见的语义特征构建的特征集合,使用基于密度的DBSCAN聚类算法进行类簇处理,得出相近的审查意见类簇;然后根据类簇结果将案件库中的每个案件构造成固定格式向量,并将所述向量作为该案件的表征向量;在进行案件检索时,根据待检索案件表征成的相应向量检索案件库,得到按照向量相近程度由高到低依次推荐的案件列表,从而实现了将法律审查意见作为重要依据的案件推荐。
Smart Images

Figure CN117408842B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information processing technology, specifically to a case recommendation method and system based on legal review opinions. Background Technology
[0002] As society becomes increasingly information-based, more legal cases are entering the digital age. Simultaneously, the artificial intelligence industry is developing rapidly. Using AI-powered legal services to handle legal cases can improve the efficiency of legal personnel and promote the intelligentization of legal affairs.
[0003] Currently, there are many auxiliary tools on the market for recommending legal cases. For example, patent CN111144068A (Patent Name: A Method and Device for Recommending Similar Arbitration Cases) presents a basic case recommendation approach: first, the case information is vectorized; second, the similarity between this vector and other vectorized cases in the database is calculated; finally, cases that meet the preset conditions are extracted and recommended. This patent transforms the recommendation problem into a search problem, which is a commonly used approach. Patent CN111797221A (Patent Name: A Method and Device for Recommending Similar Cases) proposes to divide case information into structured and unstructured information, combine and vectorize them, and then recommend similar cases through a cause-of-fact prediction model. Patent CN107818138B (Patent Name: A Method and System for Recommending Legal Regulations for Cases) also uses structured and unstructured information vectorization as input, and obtains recommended legal regulations through a crime type prediction model and a similar case calculation model.
[0004] However, in the process of realizing this application, the inventors discovered that the existing legal case recommendations, whether using basic case information (structured) or cause of action (unstructured) as input sources, do not take into account the importance of the review opinions given by legal professionals. For example, when dealing with legal matters such as contract drafts, the main text or summary of the contract is generally used for similarity recommendations, often ignoring legal review opinions. In fact, legal review opinions are accurate opinions confirmed by legal professionals and can serve as an important basis for similarity recommendations. Summary of the Invention
[0005] The purpose of this application is to propose a method and system for case recommendation based on legal review opinions.
[0006] Based on the first aspect of this application, a case recommendation method based on legal review opinions is proposed, comprising the following steps:
[0007] S1, extract the legal review opinions for each case in the case database, and use the set rules to break them down into independent opinions;
[0008] S2, extract semantic features for each independent opinion, and store the semantic features as the representation vector of the independent opinion in the case database;
[0009] S3, construct a feature set based on the semantic features of all independent opinions, and perform clustering on the feature set using the density-based DBSCAN clustering algorithm;
[0010] S4. For each case in the case database, the legal review opinion is broken down into individual opinions, which are then categorized and counted according to the clustering results. A fixed-format vector is constructed, and the vector is stored in the case database as the representation vector of the case.
[0011] S5. Based on the representation vector of the case to be retrieved, retrieve the representation vectors of all cases in the case database, and recommend cases in descending order of vector similarity based on the retrieval results.
[0012] According to a second aspect of this application, a case recommendation system based on legal review opinions is proposed, the system comprising:
[0013] The opinion splitting unit is used to extract the legal review opinions for each case in the case database and split them into independent opinions using set rules.
[0014] The semantic feature extraction unit is used to extract semantic features for each independent opinion and store the semantic features as the representation vector of the independent opinion in the case database.
[0015] The cluster processing unit is used to construct a feature set based on the semantic features of all independent opinions, and to perform cluster processing on the feature set using the density-based DBSCAN clustering algorithm;
[0016] The vector representation unit is used to classify and count each independent opinion of the legal review opinion of each case in the case database according to the clustering results, construct a fixed-format vector, and store the vector as the representation vector of the case in the case database.
[0017] The case recommendation unit is used to retrieve the representation vectors of all cases in the case database based on the representation vector of the case to be retrieved, and recommend cases in descending order of the similarity of the vectors.
[0018] According to a third aspect of this application, a computer-readable storage medium is proposed, the computer-readable storage medium storing one or more programs that, when the programs are executed, control the device on which the computer-readable storage medium is located to perform the aforementioned case recommendation method based on legal review opinions.
[0019] According to a fourth aspect of this application, an electronic device is proposed, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the aforementioned case recommendation method based on legal review opinions.
[0020] The technical solution of this application embodiment can achieve the following beneficial effects:
[0021] This application embodiment extracts legal review opinions from each legal case collected in the case database, breaks them down into independent opinions, extracts semantic features from each independent opinion, constructs a feature set from the semantic features of all independent opinions, and uses a density-based DBSCAN clustering algorithm to perform clustering, resulting in clusters of similar review opinions. Then, based on the clustering results, each case in the case database is constructed into a fixed-format vector, and the vector is used as the representation vector of the case. When performing case retrieval, the case database is searched according to the corresponding vector representing the case to be retrieved, resulting in a list of cases recommended in descending order of vector similarity, thereby realizing case recommendation based on legal review opinions as an important basis. Attached Figure Description
[0022] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0023] Figure 1 A flowchart illustrating a case recommendation method based on legal review opinions proposed in an embodiment of this application is shown.
[0024] Figure 2 This paper illustrates a flowchart of the adaptive acquisition of epsilon parameters during the DBSCAN clustering process proposed in an embodiment of this application.
[0025] Figure 3 A data distance distribution map is shown in an embodiment of this application;
[0026] Figure 4 The following diagram illustrates the intra-cluster distance distribution in an embodiment of this application;
[0027] Figure 5 A flowchart illustrating the progressive cluster update strategy proposed in an embodiment of this application is shown.
[0028] Figure 6 A schematic diagram of the structure of a case recommendation system based on legal review opinions proposed in an embodiment of this application is shown;
[0029] Figure 7 A schematic diagram of the structure of an electronic device according to an embodiment of this application is shown. Detailed Implementation
[0030] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0032] As described in the background section, current legal case recommendations are mostly based on basic case information (structured) or cause of action (unstructured), failing to consider the importance of review opinions. In fact, legal review opinions are accurate opinions confirmed by legal professionals and can serve as a crucial basis for similarity recommendations. This application addresses this technological gap by proposing a case recommendation method, apparatus, storage medium, and electronic device based on legal review opinions.
[0033] Example 1
[0034] According to the first aspect of this application, embodiments of this application propose a case recommendation method based on legal review opinions, referring to... Figure 1 The flowchart shown includes steps S1 to S5:
[0035] S1: Extract the legal review opinions for each case in the case database and use the set rules to break them down into independent opinions.
[0036] In legal matters, submitting contract cases for review is a very common occurrence. Legal professionals typically review the basic information and the main text of the submitted contract (as an attachment) to formulate a legal review opinion. These opinions, confirmed by legal professionals, are accurate and play a crucial role in the submission of contract cases for review. For example, a legal review opinion might look like this:
[0037] I. Regarding the Investment Contract: The text states "in accordance with the Contract Law of the People's Republic of China". Since the Contract Law has expired, please amend it to the Civil Code.
[0038] II. Regarding the Trustee Agreement: 1. Article 3.6 does not specify the annual interest rate for the investment funds; it is recommended to clarify and complete this information before signing. 2. Article 4.4.3 stipulates that the trustee, for the benefit of the beneficiary, may agree to waive some requirements or postpone the fulfillment of one or more preconditions stipulated in the Investment Agreement, provided that it does not violate relevant laws and regulations. The trustee shall not be liable for any losses incurred due to delays or cessation of fund transfer instructions to the financing entity's dedicated account as a result. 3. Article 23.3.1 stipulates that if the trustee violates the legal documents of the investment plan, resulting in debts to third parties or losses suffered by the trustee, the trustee shall bear the loss to its own assets.
[0039] III. Regarding the Custody Agreement: Article 7.3 stipulates that the custodian shall bear the liability for compensation for actual losses caused to the parties involved in the investment plan due to the custodian's fault. Please consider whether the actual losses mentioned here can cover the foreseeable losses stipulated in Article 584 of the Civil Code. If not, it is recommended to amend the agreement.
[0040] Each point in this review opinion has a different meaning, therefore it is necessary to break down the overall review opinion. Dividing the legal review opinion for each case into multiple independent opinions can avoid semantic confusion.
[0041] Given the diversity of examination comments, splitting the data based on periods or paragraphs is clearly inappropriate. This application uses statistical rules to analyze hundreds of thousands of comments, achieving a 98% accuracy rate in data splitting. The specific rules are as follows:
[0042] A) Keyword selection: Select two types of keywords. The first type of keywords is 1234567890, and the second type of keywords is one two three four five six seven eight nine ten.
[0043] B) Verify the validity of key characters: If the character preceding the extracted key character contains special characters such as a newline, period, semicolon, or colon, and the character following the extracted key character contains special characters such as a decimal point, comma, colon, or space, then the key character is considered valid; otherwise, the key character is invalid.
[0044] C) Preserve the continuity of key characters: If a key character is encountered, record the starting position and continue until a non-key character is encountered. Extract this segment of characters as a whole key character, such as key characters 12, 13, etc.
[0045] D) Two-type keyword matching and merging strategy: Considering that the content of the second type of keyword often contains the first type of keyword, the content of the second type of keyword is extracted and merged with the nearest first type of keyword. The merging principle is that if the length of the content of the second type of keyword is less than a set number of characters (e.g., 10 characters, which can be adjusted), it is merged with the content of the next first type of keyword. For example, the statement "II. Regarding the Civil Code, Article 1. xx is inconsistent with the content xx." satisfies the two-type keyword matching and merging strategy.
[0046] E) Reduce error rate: Considering that the content of each independent opinion is generally not short, the split results should be set to meet the minimum character length requirement, which is 4 by default. The parameter can be adjusted according to the actual opinions.
[0047] Using the above rules, the aforementioned legal review opinion can be broken down into the following five independent opinions:
[0048] I. Regarding the Investment Contract: The text states "in accordance with the Contract Law of the People's Republic of China". Since the Contract Law has expired, please amend it to the Civil Code.
[0049] II. Regarding the Trustee Agreement: 1. Article 3.6 does not specify the annual interest rate of the investment funds. It is recommended to clarify and fill it in completely before signing.
[0050] 2. Article 4.4.3 stipulates that, for the benefit of the beneficiary, the trustee may agree to waive some requirements or postpone the fulfillment of one or more preconditions stipulated in the Investment Contract, provided that it does not violate relevant laws and regulations. The trustee shall not be liable for any losses in investment income resulting from any delay or cessation in issuing fund transfer instructions to the designated account of the financing entity as a result.
[0051] 3. Article 23.3.1 stipulates that if the trustee violates the provisions of the investment plan's legal documents, resulting in debts owed to third parties or losses suffered by the trustee, the trustee shall bear the liability with its own assets.
[0052] III. Regarding the Custody Agreement: Article 7.3 stipulates that the custodian shall bear the liability for compensation for actual losses caused to the parties involved in the investment plan due to the custodian's fault. Please consider whether the actual losses mentioned here can cover the foreseeable losses stipulated in Article 584 of the Civil Code. If not, it is recommended to amend the agreement.
[0053] S2, extract semantic features for each independent opinion, and store the semantic features as the representation vector of the independent opinion in the case database.
[0054] There are many ways to extract semantic features from independent opinions. For example, TF-IDF can be used to generate the feature representation of the sentence, or pre-trained models such as BERT can be used to obtain semantic representation. This application also uses a pre-trained model that currently performs well.
[0055] Considering that the individual opinions may still be quite long, this application uses the LongFormer pre-trained model for semantic feature extraction. That is, for each input individual opinion x, the corresponding semantic feature f(x) can be obtained after feature extraction by the pre-trained model, and its feature dimension is 768.
[0056] S3. Construct a feature set based on the semantic features of all independent opinions, and perform clustering on the feature set using the density-based DBSCAN clustering algorithm.
[0057] This step is the clustering model generation process, which clusters the independent opinions obtained from the splitting into clusters, and then makes case recommendations based on the information of these clusters.
[0058] Because independent opinions vary widely, the number of cluster centers cannot be determined. Therefore, the k-means algorithm (which requires pre-setting the number of cluster centers) is not considered. Instead, the density-based DBSCAN algorithm is used. The advantage of this algorithm is that it eliminates the need to specify the number of cluster centers, but it does require specifying two crucial parameters: minPts and epsilon. MinPts represents the minimum number of data points in a cluster; this application sets this parameter to an empirical value, such as 10. Epsilon is used to determine the maximum distance between two points to determine if they belong to the same cluster. This application adaptively obtains this parameter statistically, specifically through a coarse-to-fine hierarchical clustering approach to obtain an appropriate value for this parameter.
[0059] Step S3 specifically involves:
[0060] Construct a feature set F(X) = {f(x1), ..., f(x2)}, where the semantic features of all independent opinions are used to construct the feature set F(X) = {f(x1), ..., f(x3)}. N )}, where f(x) i (x) indicates an independent opinion i The semantic features, where N represents the total number of independent opinions;
[0061] The feature set was clustered using the density-based DBSCAN clustering algorithm. In the DBSCAN clustering algorithm, the minPts parameter was set to an empirical value, and the epsilon parameter was adaptively obtained statistically. The acquisition process is described in [link to documentation]. Figure 2 As shown, the process includes the following steps S31 to S35:
[0062] S31, calculate the distance between every two feature vectors in the feature set to obtain the data distance distribution of all data points.
[0063] This application uses Euclidean distance as the distance metric between two feature vectors, i.e.
[0064]
[0065] After calculating the distance between two features, the distance distribution of all data points can be obtained. Let's assume we have obtained the following... Figure 3 The data distance distribution map shown.
[0066] S32, based on the data distance distribution, adaptively select the initial value of the epsilon parameter and perform the first DBSCAN clustering.
[0067] according to Figure 3 The distance statistics distribution plot can be used to adaptively select a relatively lenient value as the initial distance parameter, for example, d = 10. This value is then used as the epsilon parameter in DBSCAN clustering for the first clustering.
[0068] S33, perform DBSCAN clustering to obtain several clusters.
[0069] S34. Calculate the distance within each cluster to obtain the intra-cluster distance distribution of all clusters.
[0070] S35, the process value of the epsilon parameter is adaptively selected based on the distance distribution within the cluster.
[0071] Assuming that the previous step yielded... Figure 4 The distance distribution within the cluster shown can be used to obtain a more accurate epsilon parameter. For example, in this step, we adaptively take d=8 as the process value of the epsilon parameter.
[0072] S36, return to step S33 and loop until the change in the epsilon parameter is less than the set change threshold (e.g., 0.1) or the set maximum number of iterations (e.g., 6 times) is reached, then stop the iteration process.
[0073] In step S3, the value selected after stopping the iteration is taken as the final value of the epsilon parameter, and the clustering result after stopping the iteration is taken as the final clustering result.
[0074] S4. For each case in the case database, the legal review opinion is broken down into individual opinions, which are then categorized and counted according to the clustering results. These opinions are then constructed into a fixed-format vector, and the vector is stored in the case database as the representation vector of the case.
[0075] Step S4 specifically includes:
[0076] Assume the number of cluster centers obtained from the clustering results is C, and the total number of cluster categories is c1, c2, ..., cC;
[0077] For each case k in the case database, its legal review opinion is broken down into individual opinions, each belonging to one of the various clusters c1, c2, ..., cC. The number of opinions in each cluster is counted, thus constructing a fixed-format vector of total length C, with the vector format f. k ={n c1 ,n c2 ,...,n cC}, where n ci This represents the number of independent opinions in case k that belong to class ci, where 1 ≤ i ≤ C;
[0078] Using the f k As the representation vector of case k, and the f k The corresponding case k is stored in the case database.
[0079] S5. Based on the representation vector of the case to be retrieved, retrieve the representation vectors of all cases in the case database, and recommend cases in descending order of vector similarity based on the retrieval results.
[0080] It is generally believed that similar combinations of independent opinions tend to recommend similar cases. Taking advantage of this characteristic, this application uses combinations of independent opinions as the basis for recommending similar cases. Therefore, during case retrieval, the combinations of independent opinions to be retrieved are represented as corresponding vectors, and cosine similarity is used as a metric to perform feature vector matching retrieval in the case database, prioritizing cases with high vector matching degrees for recommendation.
[0081] In summary, the solution of this application embodiment extracts legal review opinions from each legal case collected in the case database, breaks them down into independent opinions, extracts semantic features from each independent opinion, constructs a feature set from the semantic features of all independent opinions, and uses the density-based DBSCAN clustering algorithm to perform clustering processing to obtain clusters of similar review opinions. Then, based on the clustering results, each case in the case database is constructed into a fixed-format vector, and the vector is used as the representation vector of the case. When performing case retrieval, the case database is retrieved based on the corresponding vector represented by the case to be retrieved, and a list of cases recommended in descending order of vector similarity is obtained, thereby realizing case recommendation based on legal review opinions as an important basis.
[0082] In actual production processes, new legal cases are continuously added to the case database. As the number of independent opinions obtained from the decomposition increases, the cluster processing results of these independent opinions also need to be continuously updated. To address this, this application proposes a progressive cluster update strategy. Corresponding to this update strategy, the method of this application further includes the following steps: for newly added cases in the case database, use the newly added independent opinions obtained from their decomposition to progressively update the cluster results.
[0083] See Figure 5 As shown, the progressive cluster update strategy proposed in this application includes both short-cycle and long-cycle updates. Specifically, it includes the following steps:
[0084] S51, For each newly added independent opinion, its representation vector is f(x) m Add it to the new data set.
[0085] S52, calculate the f(x) m The distance between f(x) and the center of each cluster is used to obtain its nearest neighbor cluster C and the distance between f(x) and each cluster center. m The distance between the cluster C and the group C.
[0086] S53, determine whether the newly added independent opinion is noise data based on the distance, specifically whether the distance is higher than a set distance threshold, for example, d=8. If yes, proceed to step S54; otherwise, enter the update cycle and proceed to step S55.
[0087] S54, the newly added independent opinions are labeled as noisy data, and their representation vector is f(x) m )Put it into the noisy data set.
[0088] 1) Update cycle:
[0089] S55, assign a cluster label C to the newly added independent opinions, and assign its representation vector f(x) m Add it to the waiting queue of tag C;
[0090] S56, determine whether the waiting queue is full, specifically whether the length of the waiting queue has reached a set length threshold, such as 10. If not, proceed to step S57; if yes, proceed to step S58.
[0091] S57, the f(x) m Add it to the waiting queue of label C;
[0092] S58, perform average pooling on all representation vectors in the queue to obtain the pooled vector f(x). avg Clear the queue and use the pooled vector f(x) avg Update cluster C.
[0093] The update method uses a moving average, specifically the formula f(x) c )=(1-ε)f(x c )+εf(x avg ), update the center vector of cluster C, where f(x) c ) is the center vector of cluster C, and ε is the weight adjustment parameter, for example, ε is set to 0.02.
[0094] This storage queue pooling + moving average update method ensures that new data can influence the clusters while maintaining the central position of the original clusters, preventing them from being excessively affected by new noisy data.
[0095] 2) Update cycle:
[0096] Because the small update cycles dynamically change the cluster centers but the number of cluster centers remains unchanged, and there may be some noisy data that cannot be classified, the incremental cluster update strategy of this application also includes the following steps for updating the large cycle:
[0097] S591, determine whether the newly added data set has reached the specified quantity, specifically whether the amount of data in the newly added data set has reached the first set ratio value α of the total amount of original independent opinions N, for example, α = 0.5, then proceed to step S50;
[0098] S592, determine whether the noise data set has reached a specified quantity, specifically whether the amount of data in the noise data set has reached the second set ratio value β of the original total number of independent opinions N, for example, β = 0.05, then proceed to step S50;
[0099] S50 will re-cluster the newly added independent opinions together with the existing independent opinions in the case database, update the original cluster results, and complete the cluster "shuffling" operation of the entire data.
[0100] It should be noted that steps S591 and S592 above are not sequential and can be performed separately. Both steps can be performed periodically or irregularly. The re-clustering method in step S50 is the same as the cluster processing process in step S3 above.
[0101] Thus, this application, through a progressive cluster update strategy with varying timeframes, fully considers and solves the data increment problem in real-world systems.
[0102] Example 2
[0103] The above-described Example 1 uses legal review opinions as an important basis for case recommendation, while Example 2 uses legal review opinions as an important basis for review opinion recommendation. The specific implementation process is as follows:
[0104] Based on the representation vector of the review opinion to be retrieved, calculate the distance between the representation vector and the center of each cluster, and find the nearest neighboring clusters of 1 to n, where n≥2;
[0105] Searches are performed sequentially within the 1 to n clusters, and the search results are reviewed and recommended in descending order of vector similarity.
[0106] The input data source for this application is legal review opinions, so the easiest thing to do is to recommend these opinions. The usual practice is to treat this recommendation as a retrieval task, searching the entire opinion database for the most similar opinions. However, the total number of opinions can be hundreds of thousands or even millions, making a full data retrieval extremely time-consuming. To address this problem of high time consumption and low efficiency, Embodiment 2 of this application employs a two-step retrieval method. The first step is to perform a cluster search, finding 1 to n clusters (e.g., 3) that are most similar to the representation vector of the review opinion to be retrieved. The second step is to sequentially search within these 1 to n clusters, recommending review opinions based on the search results in descending order of vector similarity. This two-step retrieval method reduces the total amount of data retrieved and improves retrieval efficiency.
[0107] When recommending examination opinions, this application embodiment can also perform high-frequency recommendations. High-frequency recommendations refer to whether a certain examination opinion exists in other cases and how frequently it appears. Combining the two-step retrieval process for recommending examination opinions described above, for the nearest neighbor clusters found to the examination opinion to be retrieved, it is determined whether the similarity between the examination opinion to be retrieved and the nearest neighbor cluster meets the minimum similarity condition, such as the distance between the two being less than 7. If it meets the condition, the total number of data points in the cluster and the proportion of that number relative to the total number are displayed, showing the frequency.
[0108] As can be seen, in terms of recommendation methods, this application embodiment can not only recommend cases, but also recommend examination opinions, high-frequency recommendations, and other forms.
[0109] Example 3
[0110] According to the second aspect of this application, such as Figure 6 As shown in the embodiment of this application, a case recommendation system based on legal review opinions is proposed, including the following units:
[0111] Opinion splitting unit 61 is used to extract legal review opinions for each case in the case database and split them into independent opinions using set rules;
[0112] The semantic feature extraction unit 62 is used to extract semantic features for each independent opinion and store the semantic features as the representation vector of the independent opinion in the case database.
[0113] The cluster processing unit 63 is used to construct a feature set based on the semantic features of all independent opinions, and to perform cluster processing on the feature set using the density-based DBSCAN clustering algorithm;
[0114] The vector representation unit 64 is used to classify and count each independent opinion of the legal review opinion of each case in the case database according to the cluster results, construct a fixed format vector, and store the vector as the representation vector of the case in the case database.
[0115] The case recommendation unit 65 is used to retrieve the representation vectors of all cases in the case database based on the representation vector of the case to be retrieved, and recommend cases in descending order of the similarity of the vectors according to the retrieval results.
[0116] See Figure 6 Preferably, the system in this application embodiment further includes:
[0117] The cluster update unit 68 is used to progressively update the cluster results for newly added cases in the case database using the newly added independent opinions obtained from their splitting.
[0118] More preferably, the system in this embodiment of the application further includes:
[0119] The opinion recommendation unit 66 is used to calculate the distance between the representation vector of the review opinion to be retrieved and the center of each cluster, find the nearest 1 to n clusters, n≥2; and perform a search in the 1 to n clusters in turn, and recommend the review opinions in order of the similarity of the vectors from high to low.
[0120] The high-frequency recommendation unit 67 is used to determine whether the similarity between the review opinion to be retrieved and the nearest neighbor cluster meets the minimum similarity condition. If it does, it will return the total number of data points in the cluster and the proportion of the number to the total number, and display the frequency.
[0121] From a system design perspective, the above units can be roughly categorized into three modules: a front-end preprocessing module, a middle-layer model generation module, and a back-end recommendation module. See also... Figure 6 The system comprises the following modules: Opinion Segmentation Unit 61, which belongs to the preprocessing module, splits legal review opinions into independent opinions to avoid semantic confusion; Semantic Feature Extraction Unit 62, Cluster Processing Unit 63, Vector Representation Unit 64, and Cluster Update Unit 68, which belong to the model generation module, obtain similar review opinion models based on the semantic features of legal review opinions through clustering, including adaptive parameter adjustment and incremental data processing; and Case Recommendation Unit 65, Opinion Recommendation Unit 66, and High-Frequency Recommendation Unit 67, which belong to the recommendation module, make different forms of recommendations based on model cluster information and the characteristics of legal review opinions.
[0122] Figure 6 The implementation process and principle description of each unit in the device can be found in the foregoing method embodiments, and will not be repeated here. It should also be noted that the names of the units or modules described in the embodiments of this application do not necessarily constitute a limitation on the unit or module itself under certain circumstances.
[0123] Example 4
[0124] According to a third aspect of this application, embodiments of this application provide a computer-readable storage medium storing one or more programs that, when the programs are executed, control the device where the computer-readable storage medium is located to perform the case recommendation method based on legal review opinions of this application.
[0125] The computer-readable storage medium of this application embodiment can be any tangible medium containing a stored program, or it can be a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Furthermore, the computer-readable storage medium of this application embodiment can be located in any computer terminal within a group of computer terminals in a computer network, or in any communication device within a group of communication devices.
[0126] Example 5
[0127] According to a fourth aspect of this application, embodiments of this application provide an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the case recommendation method based on legal review opinions of this application.
[0128] The following is for reference. Figure 7 The diagram illustrates a structural schematic of an electronic device suitable for implementing the embodiments of this application. The electronic devices in the embodiments of this application may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 7 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0129] like Figure 7 As shown, an electronic device may include a processing unit (such as a central processing unit, graphics processing unit, etc.) that can perform various appropriate actions and processes based on a program stored in read-only memory (ROM) or a program loaded from a storage device into random access memory (RAM). The RAM also stores various programs and data required for the operation of the electronic device. The processing unit, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0130] Typically, the following systems can be connected to the I / O interface: input devices including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices including, for example, magnetic tapes, hard disks, etc.; and communication devices. Communication devices allow electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although electronic devices with various systems are shown in the figures, it should be understood that it is not required to implement or possess all the systems shown. More or fewer systems may be implemented alternatively.
[0131] Specifically, according to embodiments of this application, the processes described in the flowcharts above can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, it performs the functions defined in the methods of embodiments of this application.
[0132] Finally, it should be noted that:
[0133] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. In the above embodiments of this application, the descriptions of each embodiment have their own emphasis; parts not described in detail in a certain embodiment can be referred to in the relevant descriptions of other embodiments. The embodiments of this application can be implemented using hardware, software, firmware, or a combination thereof.
[0134] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The system embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, units, or modules, and may be electrical or other forms.
[0135] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0136] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods, systems, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0137] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Moreover, if the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0138] The above description is merely a preferred embodiment of this application. It should be noted that various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of this application should be included within the scope of the claims of this application.
Claims
1. A case recommendation method based on legal review opinions, characterized in that, Includes the following steps: S1, extract the legal review opinions for each case in the case database, and use the set rules to break them down into independent opinions; S2, extract semantic features for each independent opinion, and store the semantic features as the representation vector of the independent opinion in the case database; S3, construct a feature set based on the semantic features of all independent opinions, and perform clustering on the feature set using the density-based DBSCAN clustering algorithm; S4. For each case in the case database, the legal review opinion is broken down into individual opinions, which are then categorized and counted according to the clustering results. A fixed-format vector is constructed, and the vector is stored in the case database as the representation vector of the case. S5. Based on the representation vector of the case to be retrieved, retrieve the representation vectors of all cases in the case database, and recommend cases in descending order of the similarity of the vectors according to the retrieval results. Step S3 specifically includes: Construct a feature set from the semantic features of all independent opinions; The feature set is clustered using the density-based DBSCAN clustering algorithm, where the minPts parameter in the DBSCAN clustering algorithm is set to an empirical value, and the epsilon parameter is adaptively obtained using a statistical method. The acquisition process includes the following steps S31 to S36: S31, calculate the distance between every two feature vectors in the feature set to obtain the data distance distribution of all data points; S32, Adaptively select the initial value of the epsilon parameter based on the data distance distribution; S33, perform DBSCAN clustering to obtain several clusters; S34, calculate the distance within each cluster to obtain the intra-cluster distance distribution of all clusters; S35, adaptively select the process value of the epsilon parameter according to the distance distribution within the cluster; S36, return to step S33 and loop until the change in the epsilon parameter is less than the set change threshold or the set maximum number of iterations is reached, then stop the iteration process. The value selected after stopping the iteration is taken as the final value of the epsilon parameter, and the clustering result after stopping the iteration is taken as the final clustering result; Step S4 specifically includes: Assume the number of cluster centers obtained from the clustering results is C, and the total number of cluster categories is c1, c2, ..., cC; For each case k in the case database, each independent opinion in its legal review opinion is assigned to one of the following clusters: c1, c2, ..., cC. The number of opinions in each cluster is counted, thus constructing a fixed-format vector of total length C. The vector format is fk = {nc1, nc2, ..., ncC}, where nci represents the number of independent opinions in case k belonging to the ci-th cluster, 1 ≤ i ≤ C. The fk is used as the representation vector of case k, and the case k corresponding to the fk is stored in the case database.
2. The method according to claim 1, characterized in that, The method further includes: for newly added cases in the case database, using the newly added independent opinions obtained from their decomposition, progressively updating the cluster results; this step includes: For each new independent opinion, its representation vector f(x) m ) is added to the new data set, the f(x) m Let represent the representation vector of the m-th independent opinion; Calculate the f(x) m The distance between f(x) and the center of each cluster is used to obtain the nearest neighbor cluster and the value of f(x). m The distance between the cluster and the group; Based on the distance, determine whether the newly added independent opinion is noise data. If so, mark the newly added independent opinion as noise data and add its representation vector f(xm) to the noise data set; otherwise, label the newly added independent opinion with a cluster and add the f(xm) to the noise data set. m Add it to the tag's waiting queue; When the length of the tag waiting queue reaches a set threshold, average pooling is performed on all vectors in the queue to obtain the pooled vector f(x). avg Clear the queue; The formula f(xc) = (1-ε)f(xc) + εf(x) is used. avg ), using the pooled vector f(x) avg Update the center of the cluster, where f(xc) is the center vector of the cluster and ε is the weight adjustment parameter.
3. The method according to claim 2, characterized in that, The step of progressively updating the cluster results using the newly added independent opinions obtained from the splitting of newly added cases in the case database further includes: When the amount of data in the newly added data set reaches a first predetermined proportion of the total amount of original independent opinions, or when the amount of data in the noisy data set reaches a second predetermined proportion of the total amount of original independent opinions, the newly added independent opinions and the original independent opinions in the case database will be re-clustered together to update the original cluster results.
4. The method according to claim 3, characterized in that, The method further includes: Based on the representation vector of the review opinion to be retrieved, calculate its distance to the center of each cluster, and find the nearest neighboring clusters of 1 to n, where n≥2; Searches are performed sequentially within the 1 to n clusters, and the search results are reviewed and recommended in descending order of vector similarity.
5. The method according to claim 4, characterized in that, The method further includes: For the nearest neighbor cluster found to the review opinion to be retrieved, it is determined whether the similarity between the review opinion to be retrieved and the nearest neighbor cluster meets the minimum similarity condition. If it does, the total number of data points in the cluster and the proportion of the number to the total number are fed back and displayed in terms of frequency.
6. A case recommendation system based on legal review opinions, characterized in that, The system includes: The opinion splitting unit is used to extract the legal review opinions for each case in the case database and split them into independent opinions using set rules. The semantic feature extraction unit is used to extract semantic features for each independent opinion and store the semantic features as the representation vector of the independent opinion in the case database. The cluster processing unit is used to construct a feature set based on the semantic features of all independent opinions, and to perform cluster processing on the feature set using the density-based DBSCAN clustering algorithm; The vector representation unit is used to classify and count each independent opinion of the legal review opinion of each case in the case database according to the clustering results, construct a fixed-format vector, and store the vector as the representation vector of the case in the case database. The case recommendation unit is used to retrieve the representation vectors of all cases in the case database based on the representation vector of the case to be retrieved, and recommend cases in descending order of the similarity of the vectors according to the retrieval results. The cluster processing unit is further configured to: Construct a feature set from the semantic features of all independent opinions; The feature set is clustered using the density-based DBSCAN clustering algorithm, where the minPts parameter in the DBSCAN clustering algorithm is set to an empirical value, and the epsilon parameter is adaptively obtained using a statistical method. The acquisition process includes: Calculate the distance between every two feature vectors in the feature set to obtain the data distance distribution of all data points; The initial value of the epsilon parameter is adaptively selected based on the data distance distribution; Perform DBSCAN clustering to obtain several clusters; Calculate the distance within each cluster separately to obtain the intra-cluster distance distribution for all clusters; The process value of the epsilon parameter is adaptively selected based on the distance distribution within the cluster. The process continues in a loop until the change in the epsilon parameter is less than the set change threshold or the set maximum number of iterations is reached, at which point the iteration process stops. The value selected after stopping the iteration is taken as the final value of the epsilon parameter, and the clustering result after stopping the iteration is taken as the final clustering result; The vector representation unit is also used for: Assume the number of cluster centers obtained from the clustering results is C, and the total number of cluster categories is c1, c2, ..., cC; For each case k in the case database, each independent opinion in its legal review opinion is assigned to one of the following clusters: c1, c2, ..., cC. The number of opinions in each cluster is counted, thus constructing a fixed-format vector of total length C. The vector format is fk = {nc1, nc2, ..., ncC}, where nci represents the number of independent opinions in case k belonging to the ci-th cluster, 1 ≤ i ≤ C. The fk is used as the representation vector of case k, and the case k corresponding to the fk is stored in the case database.
7. The system according to claim 6, characterized in that, The system also includes: The cluster update unit is used to progressively update the cluster results for new cases in the case database using the newly added independent opinions obtained from their decomposition.
8. The system according to claim 7, characterized in that, The system also includes: The opinion recommendation unit is used to calculate the distance between the representation vector of the review opinion to be retrieved and the center of each cluster, find the nearest 1 to n clusters (n≥2), and then search within the 1 to n clusters in turn, and recommend the review opinions in order of the similarity of the vectors from high to low. The high-frequency recommendation unit is used to determine whether the similarity between the review opinion to be retrieved and the nearest neighbor cluster meets the minimum similarity condition. If it does, it will return the total number of data points in the cluster and the proportion of the number to the total number, and display the frequency.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs that, when the programs are executed, control the device on which the computer-readable storage medium is located to perform the case recommendation method based on legal review opinions as described in any one of claims 1 to 5.
10. An electronic device, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed, enable the at least one processor to perform the case recommendation method based on legal review opinions as described in any one of claims 1 to 5.
Citation Information
Patent Citations
A method and system for recommending legal provisions for cases
CN107818138B
Similar case recommendation method and device
CN111797221A
Similar arbitration case recommendation method and device
CN111144068A
Clustering analysis-based case series-parallel method
CN115905526A