A case-based recommendation method based on deep understanding

By employing a deep understanding-based case recommendation method, and utilizing the Legal-BERT encoder and legal provision graph database for semantic and structural feature extraction, this approach addresses the issues of low recognition accuracy and insufficient identification of legal terminology boundaries in existing case recommendation systems for long legal texts, achieving more efficient and accurate case recommendation.

CN120492612BActive Publication Date: 2025-11-04XIANGTAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510906740.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-02
Publication Date
2025-11-04
Estimated Expiration
2045-07-02

AI Technical Summary

Technical Problem

Existing case recommendation systems suffer from low accuracy in identifying similar legal texts and insufficient ability to accurately identify the semantic boundaries of legal terms, making it difficult to accurately distinguish between similar legal concepts and capture the systematic connections between legal provisions.

Method used

This approach employs a deep understanding-based case recommendation method, which includes semantic extraction, structural extraction, and case retrieval steps. It utilizes a Legal-BERT encoder for semantic feature extraction, constructs a legal provision graph database for entity-element matching, and recommends cases through dynamic fusion and similarity calculation, while also incorporating user feedback for optimization.

Benefits of technology

It improves the accuracy and practicality of similar case recommendations, reduces discrepancies in judgments, enhances the understanding of legal texts and the ability to model logical structures, and achieves efficient identification and recommendation of long legal texts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120492612B_ABST
    Figure CN120492612B_ABST
Patent Text Reader

Abstract

The application discloses a case recommendation method based on deep understanding, comprising the following steps: semantic extraction, preprocessing of case text, and semantic feature extraction of the preprocessed case text through an encoder; the semantic feature extraction comprises initial charge prediction and legal entity identification; structure extraction, conversion of nonlinear legal provisions, judicial interpretations and adjudication rules into a statute atlas database and analysis of requirements, entity-requirement matching of the legal entity identification result with the requirements; case retrieval, dynamic fusion of the initial charge prediction result with the entity-requirement matching result, obtaining of a case feature fusion vector, similarity calculation according to the case feature fusion vector, and case recommendation. The application solves the technical problems of low recognition accuracy in long legal texts and insufficient accurate semantic boundary recognition of legal terms in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, and particularly relates to a case recommendation method based on deep understanding. BACKGROUND

[0002] At present, with the rapid development of big data, artificial intelligence and information technology, legal artificial intelligence is also undergoing a profound change. At present, the application of large natural language processing models has significantly deepened the understanding of legal texts. However, the accuracy of the case recommendation system related technology processed by the large natural language model has not reached its potential application value. Under the existing technology, it is expected to further improve the accuracy and practicality of case recommendation. It is not difficult to know that the recommended cases must be "fast", so that the efficiency is continuously improved, the workload of case analysis is reduced, and the judges and mediators can quickly make decisions; at the same time, the recommended cases must be "accurate", so as to minimize the differences in the judgments of similar cases, and provide key technical support for various judicial platforms. However, the speed and accuracy of the current case recommendation are hindered by factors such as the length and professionalism of legal documents, which limits the auxiliary role of legal judgment prediction or judicial mediation.

[0003] In the face of the above challenges of case recommendation in the field of legal artificial intelligence, researchers have proposed many different solutions, mainly including keyword-based case retrieval, label-based case retrieval and basic natural language processing text recommendation algorithms. Most of the existing methods focus on calculating the similarity between two texts. Unlike the basic word frequency statistical method, scholars try to extract features from legal documents or improve them by converting documents into embeddings using the vector space model, and then evaluate the similarity between the extracted features or embeddings. These methods are very effective, but they only compare the extracted features without combining full-text information or capturing context and self-features. Therefore, some scholars have proposed a context-aware similar case recommendation model, which significantly improves the extraction of text features compared to traditional methods. However, there is still considerable room for improvement in terms of accuracy and applicability to long legal texts. In addition, existing research uses natural language processing techniques to make case recommendations to improve their quality. However, most existing methods lack detailed understanding of legal professional terms, the relationship between legal provisions, legal reasoning logic and other content, so it is difficult to extract key information hidden in documents, and there is naturally a lack of accurate semantic boundary recognition of legal terms, difficulty in capturing systematic relationships between legal provisions, and lack of explicit modeling of judicial reasoning logic. This makes it difficult to accurately distinguish between similar legal concepts, insufficient modeling of the logical structure unique to legal texts, and ineffective integration of the legal professional knowledge system. Therefore, it is urgent to propose a case recommendation method based on deep understanding to solve the technical problems of low recognition accuracy in long legal texts and insufficient accurate semantic boundary recognition of legal terms. SUMMARY

[0004] The main purpose of the present application is to propose a case recommendation method based on deep understanding, aiming to solve the technical problems of low recognition accuracy in long legal texts and insufficient accurate semantic boundary recognition of legal terms in existing methods.

[0005] To achieve the above purpose, the present application provides a case recommendation method based on deep understanding, wherein the case recommendation method based on deep understanding comprises the following steps:

[0006] S1, semantic extraction, preprocessing the case text, and extracting semantic features from the preprocessed case text through an encoder; the semantic feature extraction includes initial charge prediction and legal entity recognition;

[0007] S2, structure extraction, converting nonlinear legal provisions, judicial interpretations and adjudication rules into a statute graph database and performing requirement analysis, and performing entity-requirement matching between the legal entity recognition result and the requirements;

[0008] S3, case retrieval, dynamically fusing the initial crime name prediction result with the entity-requirement matching result to obtain a case feature fusion vector, performing similarity calculation according to the case feature fusion vector, and performing case recommendation.

[0009] In one preferred scheme, the step S1 pre-processes the case text, specifically:

[0010] The unstructured case text is mapped to a unified legal element node, and a semantic association network of the term case is constructed through legal concept embedding, supporting cross-law system term alignment;

[0011] The case text is divided into word pieces through WordPiece segmentation, and structured marks are injected into the word pieces.

[0012] In one preferred scheme, the Legal-BERT encoder is used to extract semantic features of the pre-processed case text in S1.

[0013] In one preferred scheme, the Legal-BERT encoder includes a 24-layer Transformer encoder, and the Transformer encoder includes a multi-head attention mechanism and a feedforward neural network.

[0014] In one preferred scheme, the step S1 extracts semantic features of the pre-processed case text through the encoder, specifically:

[0015] The correlation weight between each word in the input sequence is calculated to form a global semantic dependency graph;

[0016] The encoder is used to calculate multiple groups of attention in parallel to obtain semantic associations in different dimensions, and the attention output is nonlinearly transformed to output the initial crime name prediction and legal entity recognition result of the case text.

[0017] In one preferred scheme, the correlation weight between each word in the input sequence is calculated to form a global semantic dependency graph, specifically:

[0018]

[0019] Wherein, is the input embedding layer parameter of the Legal-BERT encoder, is a digital ID sequence, is a trainable weight matrix of the digital ID sequence, is a position encoding, is a trainable weight matrix of the position encoding, is a paragraph encoding, is a trainable weight matrix of the paragraph encoding.

[0020] One preferred embodiment involves parallel computation of multiple attention sets by the encoder to obtain semantic associations in different dimensions, and then performing a nonlinear transformation on the attention output, specifically:

[0021] Multiple sets of attention are computed in parallel through multi-head self-attention to obtain semantic associations in different dimensions, and residual connections and normalization are performed.

[0022] Each of the aforementioned self-attentions is:

[0023]

[0024] in, For the first Self-attention For the Transformer encoder Layer Level output, The first A self-attention query, key, and value;

[0025] The residual connection and normalization process are as follows:

[0026]

[0027] in, For the first The intermediate output of the layer, For layer normalization, This is the output matrix of the multi-head self-attention mechanism;

[0028] The attention output is nonlinearly transformed by a feedforward neural network, and then subjected to quadratic residual and layer normalization processing.

[0029] The output of the feedforward neural network is:

[0030]

[0031] in, This is the output of the feedforward neural network. For activation function, These are the weights of the first layer of the feedforward neural network. This is the bias of the first layer of the feedforward neural network. These are the weights of the second layer of the feedforward neural network. This is the bias of the second layer of the feedforward neural network;

[0032] The secondary residual and layer normalization processing are as follows:

[0033]

[0034] in, The step S3 dynamically fuses the preliminary charge prediction result and the entity-element matching result to obtain a case feature fusion vector.

[0035] In one preferred solution, the step S3 dynamically fuses the preliminary charge prediction result and the entity-element matching result to obtain a case feature fusion vector, specifically as follows.

[0036] The dynamic fusion is as follows.

[0037]

[0038] wherein, is a comprehensive score of the charge, is a semantic weight, is an initial charge prediction result, is a confidence degree of the charge and the first entity-element matching;

[0039] The case feature fusion vector is as follows.

[0040]

[0041] wherein, is a case feature fusion vector, is a string concatenation function, is a structure matching score of the charge. In one preferred solution, the step S3 performs similarity calculation according to the case feature fusion vector and performs case recommendation, specifically as follows.

[0042] The similarity calculation according to the case feature fusion vector is specifically as follows.

[0043]

[0044]

[0045] wherein, is a comprehensive similarity between the query case and the historical case, i.e., a comprehensive similarity between the case text and the historical case, is a feature fusion vector of the query case, is a feature fusion vector of the historical case, and are charge semantic sub-vectors in and respectively, is an entity-element matching score, is a matching threshold;

[0046] The case recommendation is specifically as follows.​​​​​

[0047]

[0048] wherein, is the top case output, is the ranking weight, is the comprehensive score of the case .

[0049] In one of the preferred solutions, after the step S3, the method further comprises the following steps:

[0050] The cases retrieved and recommended by the case-based retrieval are subjected to user feedback processing, and the dynamic fusion is adjusted and the case-based retrieval strategy is updated according to the result of the user feedback processing.

[0051] In the above technical solution of the present application, the case-based recommendation method based on deep understanding comprises the following steps: semantic extraction, pre-processing of the case text, and semantic feature extraction of the pre-processed case text by an encoder; the semantic feature extraction comprises initial charge prediction and legal entity recognition; structure extraction, conversion of non-linear legal provisions, judicial interpretations and adjudication rules into a statute graph database and analysis of the requirements, entity-requirement matching of the legal entity recognition result with the requirements; case-based retrieval, dynamic fusion of the initial charge prediction result with the entity-requirement matching result to obtain a case feature fusion vector, similarity calculation according to the case feature fusion vector, and case-based recommendation. The present application solves the technical problems of low recognition accuracy in long legal texts and insufficient accurate semantic boundary recognition of legal terms in the prior art. BRIEF DESCRIPTION OF DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained according to the structures shown in these drawings without creative labor for those skilled in the art.

[0053] Figure 1 FIG. 1 is a first schematic diagram of a case-based recommendation method based on deep understanding according to an embodiment of the present application;

[0054] Figure 2 FIG. 2 is a second schematic diagram of a case-based recommendation method based on deep understanding according to an embodiment of the present application;

[0055] Figure 3 FIG. 3 is a third schematic diagram of a case-based recommendation method based on deep understanding according to an embodiment of the present application;

[0056] Figure 4 FIG. 4 is a fourth schematic diagram of a case recommendation method based on deep understanding according to an embodiment of the present application.

[0057] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

[0058] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0059] In addition, the descriptions such as "first", "second" and the like in the present application are only for the purpose of description, and cannot be understood as indicating or implying the relative importance of the indicated technical features or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features.

[0060] In addition, the technical solutions of the various embodiments of the present application can be combined with each other, but it must be based on the fact that a person of ordinary skill in the art can realize it. When the combination of technical solutions appears to be contradictory or unachievable, it should be considered that the combination of technical solutions does not exist and is not within the protection scope required by the present application.

[0061] Referring to Figures 1-4 According to an aspect of the present application, a case recommendation method based on deep understanding is provided, comprising the following steps:

[0062] S1, semantic extraction, preprocessing the case text, and extracting semantic features of the preprocessed case text through an encoder; the semantic feature extraction includes initial charge prediction and legal entity recognition;

[0063] S2, structure extraction, converting the nonlinear legal provisions, judicial interpretations and adjudication rules into a legal article map database and performing requirement analysis, and performing entity-requirement matching between the legal entity recognition result and the requirements;

[0064] S3, case retrieval, dynamically fusing the initial charge prediction result and the entity-requirement matching result to obtain a case feature fusion vector, performing similarity calculation according to the case feature fusion vector, and performing case recommendation.

[0065] Specifically, in the present embodiment, the step S1 preprocesses the case text, specifically:

[0066] The unstructured case text is mapped to a uniform legal element node, and a semantic association network of the term piece is constructed through legal concept embedding, supporting cross-law system term alignment; different expressions of legal concepts are mapped to a uniform legal element node through legal term standardization, eliminating the ambiguity of text expression, specifically:

[0067]

[0068] Among them, is the standardized case text, is the original case text, is the legal phrase dictionary; through legal concept embedding, a semantic association network between terms is constructed to support cross-law system term alignment; through WordPiece segmentation, the case text is divided into word pieces to prepare for the input of the subsequent encoder, and through WordPiece segmentation, a field adaptive table can be constructed, special marks are injected, and over-disassembly and over-merging are avoided. And inject structured markers into word pieces, add structured markers, and use a dynamic marker expansion mechanism based on active learning and a hierarchical marker system, specifically inject 、 structured markers into the word pieces to provide explicit hints for subsequent semantic encoding and enhance the understanding of the unique semantics and logic of legal text. The markers mainly include element boundaries, legal references, evidence types and logical relationships; the vocabulary in the case text is divided into smaller semantic units, which improves the model's processing ability for long sentences while maintaining semantic integrity;

[0069] The case text is segmented, specifically:

[0070]

[0071] Among them, is the word piece;

[0072] Structured markers are injected into the word pieces, specifically:

[0073]

[0074] Among them, is the word piece after injecting structured markers, is the label of the classification task, is the case fact description text, is the marker separating sentences, is the legal text;

[0075] After injecting structured markers into the word pieces, it further includes: converting the structured marker word piece into an encoder input; specifically:

[0076]

[0077]

[0078]

[0079] wherein, is a numerical ID sequence, is a legal field glossary, is a location code, is a length, is a paragraph code, is a length of a fact description, is a length of a legal citation, is an invalid .

[0080] Specifically, in the present embodiment, the pre-processed case text is subjected to semantic feature extraction by a Legal-BERT encoder in the step S1; the Legal-BERT encoder comprises a 24-layer Transformer encoder, adopts a hierarchical attention mechanism, perceives character-level encoding through a bottom-layer encoder, eliminates the ambiguity of legal terms, understands paragraph-level encoding through a middle-layer encoder, reasons across-paragraph requirements, masters logic encoding between paragraphs and paragraph structures through a high-layer encoder, abstracts and induces legal logic, and is nested from shallow to deep to promote the understanding of legal language, and further embeds a global attention mechanism to understand long-distance dependency relationships of legal texts, so that the global attention mechanism and the hierarchical attention mechanism are combined to better mine the deep understanding of legal documents; the Transformer encoder comprises a multi-head attention mechanism and a feedforward neural network.

[0081] Specifically, in the present embodiment, the pre-processed case text is subjected to semantic feature extraction by an encoder in the step S1, specifically:

[0082] The correlation weights between the words in the input sequence are calculated to form a global semantic dependency graph; that is, the discrete legal text words are converted into continuous vector representations through word embedding; specifically:

[0083]

[0084] wherein, is an input embedding layer parameter of the Legal-BERT encoder, which belongs to the conventional design of the Transformer model in natural language processing, is only used in the forward propagation process of the Legal-BERT encoder, and outputs the semantic features of the case text (such as charge prediction and entity recognition), and does not directly participate in the construction of the legal citation graph, is a numerical ID sequence, a trainable weight matrix for the digital ID sequence, a position encoding, a trainable weight matrix for the position encoding, a passage encoding, a trainable weight matrix for the passage encoding;

[0085] a plurality of groups of attentions are calculated in parallel by the encoder to obtain semantic associations of different dimensions, and a nonlinear transformation is performed on the attention output to output the initial charge prediction and legal entity recognition result of the case text; specifically:

[0086] a plurality of groups of attentions are calculated in parallel by the encoder to obtain semantic associations of different dimensions, and a nonlinear transformation is performed on the attention output to output the initial charge prediction and legal entity recognition result of the case text; specifically:

[0087]

[0088] wherein, is the output matrix of the multi-head self-attention in the i-th Transformer layer, is the i-th self-attention, is the output projection matrix; Each of the self-attentions is:

[0089]

[0090]

[0091] wherein, is the i-th self-attention, is the i-th self-attention, is the i-th self-attention, is the i-th self-attention, is the i-th self-attention, is the i-th self-attention, is the i-th self-attention,

[0092] The residual connection and normalization processing is:

[0093]

[0094]

[0095] wherein, is the i-th self-attention, is the i-th self-attention, is the i-th self-attention, ​​is an output matrix of multi-head self-attention, are learnable scaling parameters and offset parameters, respectively, is a mean of the input, is a variance of the input;

[0096] performing a nonlinear transformation on the attention output by a feedforward neural network, and performing a secondary residual and layer normalization processing; an output of the feedforward neural network is:

[0097]

[0098] wherein, is an output of the feedforward neural network, is an activation function, is a first layer weight of the feedforward neural network, is a first layer bias of the feedforward neural network, is a second layer weight of the feedforward neural network, is a second layer bias of the feedforward neural network;

[0099] the secondary residual and layer normalization processing is:

[0100]

[0101] wherein, is an output of the first stage of the Transformer encoder;

[0102] The combination of word embedding and single-layer Transformer, that is, first encoding the legal term prior knowledge through word embedding, and then modeling the logical relationship between legal elements through Transformer.

[0103] Specifically, in the present embodiment, the 24-layer stacked Transformer is to refine the deep semantic representation of the legal text layer by layer. The bottom layer encoder is a 1-6 layer Transformer used to capture word or phrase level features, the middle layer encoder is a 7-18 layer used to understand the logic between sentences, and the high layer encoder is a 19-24 layer Transformer used to build global case understanding; specifically:

[0104]

[0105] wherein, is an output of the 24-layer stacked Transformer, is a processing result of the first layer Transformer encoder on the input embedding E.

[0106] ​Specifically, in the embodiment, the legal entity recognition complete Token output is:

[0107]

[0108] wherein, is the result of legal entity recognition, is a conditional random field, is a linear projection layer output, is the output of the layer of the Transformer encoder;

[0109] The result of the initial charge prediction of the case text is:

[0110]

[0111] wherein, is the initial charge prediction output, is a charge classification weight matrix, is a bias term, is a charge set.

[0112] Specifically, in the embodiment, the structure extraction is structure feature extraction, which converts non-linear legal provisions, judicial interpretations and adjudication rules into calculable logical maps through structured prior knowledge in the legal field, forming a collaborative cognitive system with semantic extraction; the legal graph database is deeply deconstructed, and legal-related methods are used to extract component element nodes, logical relationships between component elements and cross-article citing rules; after the semantic channel completes the legal entity recognition, the structure channel starts a multi-level matching engine, including surface matching, logical verification and conflict detection; the real-time evolution of the article relationship graph has the ability of self-correction and counterfactual reasoning; the coordination of structure recognition and semantic recognition two channels enables the system to identify the matching degree of the component elements of the crime and the legal entity in the article, and also to mine the deep semantics in the case text, providing a basis for subsequent case retrieval.

[0113] Specifically, in the embodiment, a legal article graph is constructed, wherein the legal article graph is:

[0114]

[0115] wherein, is the legal article graph, is a legal provision node, is a logical edge between legal provisions;

[0116] The component element set of the provision is:

[0117]

[0118] in, For the clauses The set of elements, To parse the clauses The requirements;

[0119] Construct a legal provision relationship diagram; let the extended legal provision diagram be:

[0120]

[0121] in, To expand the legal provisions diagram, The union of all elements. , This refers to the dependencies between components; the dependencies between components are as follows:

[0122]

[0123] in, For the first One requirement, For the first One requirement;

[0124] This can be viewed as a heterogeneous graph, where dependency information between components is propagated through a graph neural network, specifically:

[0125]

[0126] in, For the requirements In the Layer representation, For activation function,

[0127] For the first The layer-specific learnable weight matrix For the requirements In the Layer representation;

[0128] Entity-element matching; from a result perspective, the result of legal entity identification can be represented as:

[0129]

[0130] in, The result of legal entity identification For the identified legal entities, The type label corresponding to the identified legal entity, The total number of legal entity and type label pairs identified from the case text;

[0131] The matching score matrix is:

[0132]

[0133] Wherein, is the matching score matrix, is the type label Partial matching requirements The matching score matrix takes a constant of 0 to 1;

[0134] The overall requirement satisfaction vector; the degree vector is:

[0135]

[0136] Wherein, is the degree vector, and the highest matching score of each requirement is finally obtained.

[0137] Specifically, in this embodiment, the step S3 is a reinforcement learning feedback loop, which realizes the cognitive transition from static recommendation to dynamic adaptation through continuous learning. This mechanism converts the implicit experience in judicial practice into a fine-tunable signal of model parameters, forming a closed-loop learning system of recommendation-feedback-optimization. The technical framework and legal value are embodied in the following dimensions: judicial quantification device of feedback signal, dynamic optimization of strategy network, and continuous sedimentation of judicial cognition. Among them, the judicial quantification design of feedback signal is to convert user behavior in legal scenarios into structured rewards, with the functions of explicit feedback, implicit feedback and compliance verification. The dynamic optimization of strategy network refers to the parameter update of the feedback signal driven fusion device and the retrieval strategy. The continuous sedimentation of parameter cognition refers to enhancing entity recognition, reconstructing feature space, and expanding structure channel. In general, the reinforcement learning feedback loop steps the data law, and realizes cognitive evolution in the interaction of human legal community.

[0138] Specifically, in this embodiment, the step S3 dynamically fuses the preliminary charge prediction result and the entity-requirement matching result to obtain a case feature fusion vector, which is specifically:

[0139] The preliminary charge prediction result and the entity-requirement matching result are dynamically fused through the dynamic fusion device; that is, the semantic features and the structural features are high-order fused to form a unified representation, realizing the collaborative calculation of the formal logic and the essence of the legal text, breaking through the limitation of the separation of semantics and knowledge in traditional legal text processing, and constructing a composite feature space conforming to the judicial cognitive law;

[0140] The dynamic fusion is:

[0141]

[0142] Wherein, a comprehensive score of the charge, a semantic weight, an initial charge prediction result, a comprehensive score of the charge, a confidence of the charge and the first entity-ingredient match, a comprehensive score of the charge, a subset of the charge set; The case feature fusion vector is:

[0143]

[0144]

[0145] wherein, a case feature fusion vector, a string concatenation function, a structure matching score of the charge. Specifically, in the present embodiment, the step S3 performs similarity calculation according to the case feature fusion vector, and performs case recommendation, specifically:

[0146] According to the case feature fusion vector, case retrieval and similarity calculation are performed; specifically:

[0147] Case retrieval is realized through a case retrieval engine, and through multi-dimensional similarity calculation, precise association of the pending case and the historical judgment case is realized, intelligent auxiliary support of similar cases is provided for the user, that is, the legal principles of case retrieval are converted into a calculable algorithm model; the case retrieval engine is:

[0148]

[0149]

[0150] wherein, a case retrieval engine, a graph index, Top-K most similar cases;

[0151] The similarity is:

[0152]

[0153] wherein, a comprehensive similarity between the query case and the historical case, that is, a comprehensive similarity between the case text and the historical case, a feature fusion vector of the query case, a feature fusion vector of the historical case, and and ​​​The semantic subvector of the crime in the text Entity-component matching score, The matching threshold;

[0154] The recommended case studies are as follows:

[0155]

[0156] in, Recommended for similar cases One case output, For sorting weights, For example The overall score.

[0157] Specifically, in this embodiment, after step S3, the method further includes:

[0158] User feedback is processed on the cases retrieved and recommended based on the case retrieval results, and the dynamic fusion is adjusted and the case retrieval strategy is updated based on the results of the user feedback processing.

[0159] The user feedback processing captures users' decision-making preferences and corrective behaviors in a structured manner, transforming users' professional judgments into machine-understandable optimization information to achieve continuous optimization of legal case recommendations; specifically:

[0160]

[0161] in, Provide feedback on the processing results to users. The overall optimization cycle for similar case recommendations. For the current time step, For the first Each time step for The reward obtained at any time is, that is, Instant rewards earned at any time As a discount factor, for The reward obtained at any time is, that is, Instant rewards earned at any time The regularization coefficient is . For policy entropy;

[0162] Based on the results of the user feedback processing, immediate and cumulative rewards are obtained through a reward calculator; a multi-dimensional reward function design ensures that the decision-making behavior of case retrieval and recommendation remains dynamically consistent with the requirements of relevant departments; the immediate reward is:

[0163]

[0164] in, for an instant reward;

[0165] the accumulated reward is:

[0166]

[0167] wherein, is the accumulated reward, is an instant reward obtained at the moment;

[0168] the policy network is updated, the input of the policy network depends on the user feedback signal, that is, the instant reward , reflecting the user's revision or adoption behavior on the recommendation result, and the current policy state, the recommendation probability distribution generated by the feature fusion vector and the similarity calculation, the updated policy network can optimize the retrieval strategy, adjust the ranking weight of the case retrieval engine, such as HNSW search, so that the future recommendation is more in line with the user's preference, and adjust the dynamic fusion parameter, which may be back propagated to and other weights, to achieve end-to-end optimization; specifically:

[0169]

[0170] wherein, is the objective function of policy optimization, is the expectation for all samples, is the policy network, is the selected action, is the state, is the old policy, is the advantage function, is the clipping threshold, is to limit to ;

[0171] update the case retrieval strategy, the core of updating the case retrieval strategy is to integrate the user feedback into the retrieval model through the reinforcement learning closed loop, specifically:

[0172]

[0173] output new parameters, specifically:

[0174]

[0175] wherein, is the parameter of the policy network, is the learning rate, is the gradient of the parameter of the policy network, is the action probability output by the policy network.

[0176] Specifically, in the present embodiment, the present application adopts the design idea of semantic channel and structural channel, extracts the semantic features of the case text and the structural features of the legal provisions respectively, not only realizes the conversion of the legal original case text into computer recognizable language and the in-depth understanding of the text meaning, but also ensures the rigor, system and explainability of reasoning by combining with the legal provisions, realizes the high coordination of the semantic channel and the structural channel, and after the fusion of the features of the two channels, the similar cases are retrieved and recommended, the user can feed back in real time according to the relevant cases, the parameters are updated by using the method of reinforcement learning, the training time of the model is reduced and the accuracy is improved, the present application solves the problems of the lack of representativeness of long legal text in case recommendation, the low accuracy, the lack of accurate semantic boundary recognition of legal terms, the difficulty in capturing the systematic correlation between legal provisions and the lack of explicit modeling of judicial reasoning logic.

[0177] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structural transformation made by using the content of the present application specification and drawings, or direct / indirect application in other related technical fields is included in the patent protection scope of the present application.

Claims

1. A deep understanding-based case recommendation method, characterized by, The method comprises the following steps: S1, semantic extraction, preprocessing the case text, and extracting semantic features of the preprocessed case text through an encoder; the semantic feature extraction includes initial charge prediction and legal entity recognition; S2, structure extraction, converting non-linear legal provisions, judicial interpretations and adjudication rules into a legal provision graph database and performing requirement analysis, and performing entity-requirement matching of the legal entity recognition results and the requirements; S3, case search, dynamically fusing the initial charge prediction results and the entity-requirement matching results to obtain a case feature fusion vector, calculating the similarity according to the case feature fusion vector, and recommending similar cases; the step S3 dynamically fuses the initial charge prediction results and the entity-requirement matching results to obtain a case feature fusion vector, specifically: The dynamic fusion is: ; wherein, is the composite score for the charge , is the semantic weight, is the initial charge prediction result, is the composite score for the charge , is the confidence of the entity-requirement match.

2. The method of claim 1, wherein, The step S1 preprocesses the case text, specifically: Map the unstructured case text to a unified legal element node, and construct a semantic association network between terms by legal concept embedding to support cross-law system term alignment; Divide the case text into word pieces through WordPiece segmentation, and inject structured marks in the word pieces.

3. The method of claim 1 or 2, wherein, The semantic feature of the preprocessed case text is extracted through a Legal-BERT encoder in S1.

4. The method of claim 3, wherein, The Legal-BERT encoder includes a 24-layer Transformer encoder, and the Transformer encoder includes a multi-head attention mechanism and a feedforward neural network.

5. The method of claim 4, wherein, The semantic feature of the preprocessed case text is extracted through an encoder in step S1, specifically: Calculate the correlation weight between each word in the input sequence to form a global semantic dependency graph; Parallelly calculate multiple groups of attention through the encoder, obtain semantic associations of different dimensions, and perform nonlinear transformation on the attention output to output the initial charge prediction and legal entity recognition results of the case text.

6. The method of claim 5, wherein, The correlation weight between each word in the input sequence is calculated to form a global semantic dependency graph, specifically: ; wherein, is an input embedding layer parameter for the Legal-BERT encoder, is a sequence of numerical IDs, is a trainable weight matrix for the sequence of numerical IDs, is a position encoding, is a trainable weight matrix for the position encoding, is a section encoding, is a trainable weight matrix for the section encoding.

7. The method of claim 5, wherein, The multiple groups of attention are parallelly calculated through the encoder to obtain semantic associations of different dimensions, and the attention output is nonlinearly transformed, specifically: Parallelly calculate multiple groups of attention through multi-head self-attention to obtain semantic associations of different dimensions, and perform residual connection and normalization processing; Each self-attention is: ; wherein, is the th self-attention, is the output of the th stage of the Transformer encoder, th layer, is the query, key and value of the th self-attention, respectively; The residual connection and normalization processing are: ; wherein, is the first is the intermediate output of the layer, is the layer normalization, is the output matrix of the multi-head self-attention mechanism; The attention output is nonlinearly transformed through a feedforward neural network, and secondary residual and layer normalization processing are performed; The output of the feedforward neural network is: ; wherein, is an output of the feedforward neural network, is an activation function, is a first layer weight of the feedforward neural network, is a first layer bias of the feedforward neural network, is a second layer weight of the feedforward neural network, is a second layer bias of the feedforward neural network; The secondary residual and layer normalization processing are: ; wherein, is the output of the Transformer encoder first layer. stage.

8. The deep understanding based case recommendation method according to any one of claims 1-2, characterized in that, After step S3, it further includes: User feedback processing is performed on the case searched and recommended, and the dynamic fusion is adjusted and the case search strategy is updated according to the user feedback processing result.

Citation Information

Patent Citations

  • Class case recommendation method and device based on legal element hierarchical network and text features

    CN117149999A

  • Intelligent legal text analysis method based on legal concept pedigree

    CN119990290A