A disciplinary inspection case trial AI assistance method and system based on a large language model

By using an AI-assisted system based on a large language model and leveraging dynamic knowledge graphs and attention mechanisms, the problems of low efficiency and insufficient accuracy in case handling have been solved, achieving efficient and secure intelligent decision support for case handling.

CN120804342BActive Publication Date: 2025-12-05中国建设基础设施有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511278102.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-09
Publication Date
2025-12-05
Estimated Expiration
2045-09-09

AI Technical Summary

Technical Problem

When determining the nature of a case and making a judgment, the judges need to manually consult a large number of legal provisions, which is inefficient and prone to errors. Existing legal retrieval systems cannot be dynamically updated, complex cases are difficult to reason about, and the lack of an intelligent case database makes it difficult to match similar cases.

Method used

An AI-assisted system based on a large language model is adopted. By matching case element vectors with dynamic knowledge graphs, legal clauses and historical case vectors are generated. Structural and contextual features are extracted using a three-channel coding layer. The probability of application of legal clauses is calculated by combining an attention mechanism, and an encrypted report is generated and stored in the blockchain.

Benefits of technology

It has automated and intelligentized case handling, improved the accuracy and efficiency of decision-making, ensured security, shortened processing time, and reduced human error.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120804342B_ABST
    Figure CN120804342B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on big language model's discipline inspection and supervision case trial AI auxiliary method and system. Including: determine the case element vector of the discipline inspection and supervision case trial AI auxiliary system to be determined;Several candidate legal provisions and historical cases matched by case element vector based on dynamic knowledge graph are respectively generated legal provision vector and historical case vector;The three-channel coding layer of big language model extracts the dynamic knowledge graph structure features corresponding to legal provision vector through legal channel, obtains the context features corresponding to case element vector through case element channel, carries out attention pooling operation to historical case vector through case channel, and generates semantic features;Weighted vector superimposed with attention weight is input into fully connected layer to determine the legal provision application probability corresponding to weighted vector;Output layer determines the second output vector representing applicable legal provisions based on legal provision application probability.The application makes the decision auxiliary conclusion more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of artificial intelligence, in particular to a case handling AI auxiliary method and system for discipline inspection and supervision based on a large language model. BACKGROUND

[0002] When a case handling personnel qualitatively and determines a case of discipline inspection and supervision, a large number of legal provisions need to be manually consulted, which is low in efficiency and prone to deviation. The existing legal retrieval system usually only supports keyword matching and cannot dynamically update the revised legal provisions. When the input keyword is inconsistent with the legal retrieval system, the case handling personnel often cannot find the applicable legal provisions. In particular, the reasoning of complex cases is difficult and tests the experience of the case handling personnel. When similar cases are queried in combination with the case library, the existing technology lacks an intelligent case library, and the matching of similar cases is difficult. SUMMARY

[0003] Therefore, the present application provides a case handling AI auxiliary method and system for discipline inspection and supervision based on a large language model, which can solve the above technical problems.

[0004] In order to solve the above technical problems, the present application is implemented as follows.

[0005] A case handling AI auxiliary method for discipline inspection and supervision based on a large language model, comprising:

[0006] Step S1: determining a case element vector of a case handling AI auxiliary system for discipline inspection and supervision; matching the case element vector with a dynamic knowledge graph to determine a plurality of candidate legal provisions and historical cases; the dynamic knowledge graph is a knowledge graph that is updated in real time according to current laws and regulations and integrates historical cases; generating a legal provision vector and a historical case vector based on the plurality of matched candidate legal provisions and historical cases; embedding the legal provision vector, the case element vector and the historical case vector into a first output vector;

[0007] Step S2: inputting the first output vector into a large language model that has been trained; the three-channel encoding layer of the large language model extracts the dynamic knowledge graph structure features corresponding to the legal provision vector through the legal channel, obtains the context features corresponding to the case element vector through the case element channel, and performs attention pooling operation on the historical case vector through the case channel to generate semantic features; the cross-channel attention layer calculates the attention weights between the dynamic knowledge graph structure features, the context features and the semantic features respectively; inputting the weighted vector superimposed with the attention weights into the full connection layer to determine the legal provision application probability corresponding to the weighted vector; the output layer determines a second output vector representing the applicable legal provisions based on the legal provision application probability.

[0008] Preferably, the method further comprises step S3: generating applicable legal provisions corresponding to the second output vector, generating an encrypted report, and storing the encrypted report into the blockchain as encrypted data.

[0009] Preferably, the step S1 of determining the case element vector of the case to be handled by the discipline inspection and supervision case handling AI auxiliary system comprises:

[0010] Step S11: generating a text vector of a case text corresponding to the case to be handled by the discipline inspection and supervision case handling AI auxiliary system through BERT encoding of the case text, and taking the text vector as an input vector;

[0011] Step S12: aggregating neighborhood node information of the input vector by a graph neural network to generate a case element vector corresponding to the input vector, and the aggregation formula is:

[0012]

[0013] wherein, l is the number of training times, u is a neighbor node of v, and v is a node in the graph neural network, is a neighbor node set composed of neighbor nodes of node v, is a training parameter at the l th training, is a hidden state of node u at the l th training, is a hidden state of node v at the l +1th training, is a nonlinear activation function.

[0014] Preferably, the step S1 of generating a legal provision vector and a historical case vector based on the matched several candidate legal provisions and historical cases comprises:

[0015] Step S13: mapping candidate legal provision texts to a relationship space using a TranSR model to generate a legal provision vector, and the mapping formula is:

[0016]

[0017] wherein, is an initial provision feature vector, is a relationship projection matrix, is a bias term, is a legal provision vector;

[0018] Step S14: generating a historical case vector corresponding to a historical case using a SiameseNetwork, and the loss function of the SiameseNetwork is:

[0019]

[0020] wherein, is a loss function of SiameseNetwork, margin is a preset interval threshold, , are the i-th historical case vector and the j-th historical case vector, respectively.

[0021] Preferably, the step S1 of generating the legal clause vector and the historical case vector based on the matched several candidate legal clauses and historical cases, respectively, comprises:

[0022] Step S13: using the TranSR model to map the candidate legal clause text to the relationship space to generate the legal clause vector, and the mapping formula is:

[0023]

[0024] wherein, is an initial clause feature vector, is a relationship projection matrix, is a bias term, is a legal clause vector;

[0025] Step S14: using the SiameseNetwork to generate the historical case vector corresponding to the historical case, and the loss function of SiameseNetwork is:

[0026]

[0027] wherein, is a loss function of SiameseNetwork, margin is a preset interval threshold, , are the i-th historical case vector and the j-th historical case vector, respectively.

[0028] An AI auxiliary system for handling a discipline inspection and supervision case based on a large language model, comprising:

[0029] An initialization module is configured to determine a case element vector of the AI auxiliary system for handling the discipline inspection and supervision case; match the case element vector with a dynamic knowledge graph to determine several candidate legal clauses and historical cases; the dynamic knowledge graph is a knowledge graph that is updated in real time according to current laws and regulations and integrates historical cases; generate a legal clause vector and a historical case vector based on the matched several candidate legal clauses and historical cases, respectively; and embed the legal clause vector, the case element vector and the historical case vector into a first output vector;

[0030] The matching module is configured to input the first output vector into the trained large language model, the three-channel encoding layer of the large language model extracts dynamic knowledge graph structure features corresponding to the legal clause vector through the legal channel, obtains context features corresponding to the case element vector through the case element channel, and performs attention pooling operation on the historical case vector through the case channel to generate semantic features; the cross-channel attention layer calculates the attention weights between the dynamic knowledge graph structure features, the context features and the semantic features in pairs respectively; the weighted vector superimposed with the attention weights is input into the full connection layer to determine the legal clause application probability corresponding to the weighted vector; and the output layer determines the second output vector representing the applied legal clause based on the legal clause application probability.

[0031] The application provides a computer readable storage medium, wherein the storage medium stores a plurality of instructions; the plurality of instructions are used for loading and executing the method as described above by a processor.

[0032] The application provides an electronic device, characterized in that the electronic device comprises:

[0033] A processor is configured to execute a plurality of instructions.

[0034] A memory is configured to store the plurality of instructions.

[0035] The plurality of instructions are used for storing in the memory and loading and executing the method as described above by the processor.

[0036] Advantages:

[0037] (1) The application is an intelligent discipline inspection case trial AI auxiliary system method based on a large language model (LLM). Through natural language processing (NLP), knowledge graph (KG) and deep learning technology, automatic legal matching, historical case comparison and decision assistance of the case are realized.

[0038] (2) The application constructs a dynamic knowledge graph and a multi-dimensional analysis model, fully combines the characteristics of text matching, and makes the decision assistance conclusion more accurate.

[0039] (3) The application uses hardware-level security technology to improve security. BRIEF DESCRIPTION OF DRAWINGS

[0040] Figure 1 It is a flowchart of the application based on a large language model of a discipline inspection case trial AI auxiliary system method.

[0041] Figure 2 It is a structure diagram of the application based on a large language model of a discipline inspection case trial AI auxiliary system device. DETAILED DESCRIPTION

[0042] The application will be described in detail below with reference to the accompanying drawings and examples.

[0043] As shown in Figure 1 The application proposes a disciplinary inspection case trial AI auxiliary system method based on a large language model, which comprises the following steps:

[0044] Step S1: determining the case element vector of the case of the disciplinary inspection case trial AI auxiliary system; matching the case element vector with a dynamic knowledge graph to determine a plurality of candidate legal provisions and historical cases; the dynamic knowledge graph is a knowledge graph that is updated in real time according to current laws and regulations and integrates historical cases; generating a legal provision vector and a historical case vector based on the plurality of matched candidate legal provisions and historical cases; embedding the legal provision vector, the case element vector and the historical case vector into a first output vector;

[0045] Step S2: inputting the first output vector into a large language model that has been trained; the three-channel encoding layer of the large language model extracts the dynamic knowledge graph structure features corresponding to the legal provision vector through the legal channel, obtains the context features corresponding to the case element vector through the case element channel, and performs attention pooling operation on the historical case vector through the case channel to generate semantic features; the cross-channel attention layer calculates the attention weights between the dynamic knowledge graph structure features, the context features and the semantic features respectively; inputting the weighted vector superimposed with the attention weights into the full connection layer to determine the legal provision application probability corresponding to the weighted vector; the output layer determines the second output vector representing the applicable legal provision based on the legal provision application probability.

[0046] Further, the method further comprises step S3: generating the applicable legal provision corresponding to the second output vector, generating an encrypted report, and storing the encrypted report as encrypted data into a blockchain.

[0047] The large language model comprises an input layer, a three-channel encoding layer, a cross-channel attention layer, a full connection layer and an output layer connected in sequence.

[0048] The application realizes the disciplinary inspection case trial AI auxiliary system through three stages. Firstly, legal provisions are obtained, a dynamic knowledge graph with time limit labels is constructed, the time limit labels are used to represent the effective time of the legal provisions, and the dynamic knowledge graph is updated according to the update of the legal provisions; based on the dynamic knowledge graph and the case element vector of the disciplinary inspection case trial AI auxiliary system, the first output vector is determined; then, the trained large language model is used to associate the case of the disciplinary inspection case trial AI auxiliary system with the applicable legal provision by combining the attention mechanism; finally, the encrypted report is generated according to the applicable legal provision, the encrypted report is stored as encrypted data into a blockchain, and the whole process is realized by chain storage.

[0049] In the application, the case text corresponding to the case of the AI auxiliary system for handling the case of discipline inspection and supervision is encoded by BERT to generate a 768-dimensional text vector.

[0050] The step S1 determines the case element vector of the AI auxiliary system for handling the case of discipline inspection and supervision, including:

[0051] Step S11: The case text corresponding to the case of the AI auxiliary system for handling the case of discipline inspection and supervision is encoded by BERT to generate a text vector, and the text vector is used as an input vector;

[0052] Step S12: The graph neural network aggregates the neighborhood node information of the input vector to generate a case element vector corresponding to the input vector, and the aggregation formula is:

[0053]

[0054] Among them, l is the training frequency, u is the neighbor node of node v, v is the node in the graph neural network, is a neighbor node set composed of the neighbor nodes of node v, is the training parameter at the l th training, is the hidden state of node u at the l th training, is the hidden state of node v at the l +1th training, is a nonlinear activation function.

[0055] In the application, the case element vector of the case of the AI auxiliary system for handling the case of discipline inspection and supervision is generated by fusing Word2Vec and graph neural network, and the case element vector can represent the correlation of subject, behavior and consequence.

[0056] The step S1 generates a legal clause vector and a historical case vector based on the matched several candidate legal clauses and historical cases, including:

[0057] Step S13: Using the TranSR model, the candidate legal clause text is mapped to the relationship space to generate a legal clause vector, and the mapping formula is:

[0058]

[0059] Among them, is an initial clause feature vector, is a relationship projection matrix, is a bias term, is a legal clause vector;

[0060] Step S14: generate a historical case vector corresponding to the historical case using a Siamese Network, and a loss function of the Siamese Network is:

[0061]

[0062] wherein, is a loss function of the Siamese Network, and margin is a preset interval threshold, , and are the i th historical case vector and the j th historical case vector, respectively.

[0063] In the application, the TransR model is used to retain the semantic and relationship characteristics of the candidate legal provisions; the Siamese Network is used to calculate the case similarity, and the historical case vector is a semantic matching vector.

[0064] In the application, the dynamic knowledge graph is a knowledge graph that is updated in real time according to current laws and regulations and is provided with a time limit label, for example, current laws and regulations are acquired at a fixed time every day, revised provisions and newly added provisions are detected, a text fingerprint is calculated based on SimHash, if the difference between the text and the legal regulation text stored in the local database exceeds a threshold, the process of updating the dynamic knowledge graph is triggered, so that the dynamic knowledge graph is reconstructed. When a node and an edge are added in the dynamic knowledge graph, transactional writing is used to ensure data consistency; for invalid provisions, the provisions are marked as 'invalidated' and no longer participate in matching.

[0065] The step S2, wherein:

[0066] The legal channel extracts the dynamic knowledge graph structure features corresponding to the legal provision vector through a graph attention network; the fact channel encodes the case element vector through BERT-wwm to generate the context features corresponding to the case element vector; and the case channel performs attention pooling operation on the historical case vector to generate semantic features, and the attention pooling formula is: αi C i wherein, αi is the attention weight of the i th historical case vector.

[0067] The cross-channel attention layer calculates the attention weights between the dynamic knowledge graph structure features, the context features and the semantic features in pairs, and the formula is:

[0068]

[0069] wherein, The attention weight between the two features to be calculated for the attention weight of the dynamic knowledge graph structure feature, the context feature and the semantic feature is a Softmax function, The vector dimension of the two features to be calculated for the attention weight, , One of the two features to be calculated for the attention weight.

[0070] The weighted vector calculation formula is wherein, is , The weighted vector superimposed with the attention weight.

[0071] The loss function of the large language model is:

[0072]

[0073] wherein, , , , respectively are weights, is a cross-entropy loss function, is a legal logic loss function, is a semantic loss function, is a time limit loss function;

[0074]

[0075] wherein, is a cross-entropy loss function in the art, KL is a divergence function, is a prediction probability distribution of the large model on the applicability of the legal provisions vector, is a difference operation, is an ideal distribution about the applicability of legal provisions generated according to expert knowledge, F is the context feature corresponding to the case element vector, C is the historical case vector, is the cosine similarity between F and C; ReLu is a ReLu function, is the effective time of the legal provisions, is the time of the case to be disciplined and supervised by the case trial AI auxiliary system.

[0076] In the present application, the alignment of the context feature corresponding to the case element vector and the historical case vector is constrained by the cosine similarity, and the approximation of is constrained by the KL divergence , so as to avoid generating conclusions that violate legal rules.

[0077] In step S1, when determining the case element vector of the case to be tried by the discipline inspection and supervision case trial AI auxiliary system, the case description to be tried by the discipline inspection and supervision case trial AI auxiliary system is replaced by synonyms, reorganized in a sentence form, etc., so that the extracted case element vector is more accurate and the generalization is improved. Adversarial samples can also be generated for training to enhance the robustness of the large model. The present application adopts distributed training, and the initial value of the learning rate is 3e5. The learning rate is adjusted using the cosine annealing strategy.

[0078] The present application adopts the encryption storage mode, divides the case data of the discipline inspection and supervision case trial AI auxiliary system into 128KB fragments, encrypts each fragment using the SM4 algorithm, generates a key by a security chip, attaches an HMACSHA256 signature to each encrypted fragment of data to prevent tampering. Rotate the key regularly and destroy the old key. Build a hardware isolation mode, divide the memory into a secure area and a non-secure area, configure the inference process of the large model and the report generation in the non-secure area, and store various data in the secure area. The operation log is stored in the blockchain in real time. A user is authenticated in a way that supports fingerprint and digital master book dual-factor authentication. When the user starts the operation, load the trusted computing firmware to ensure security and confidentiality. For example, using the ArmTrustZone technology, the secure area and the non-secure area are divided, and the key call is only executed in the secure area. The operation log information such as timestamp, user ID and operation type is calculated by the SHA3 algorithm to obtain the log hash value, and then the smart contract is called to write to the blockchain.

[0079] Further, the present application outputs a weighted vector to visually display the association path of the legal provisions and the case to be tried by the discipline inspection and supervision case trial AI auxiliary system.

[0080] The test results of the present application are as follows.

[0081] Accuracy: In 1000 test cases, the qualitative accuracy rate is 92.7%;

[0082] Efficiency: The average processing time is shortened from 8 hours to 3 minutes;

[0083] Security: The encryption storage cracking cost is more than 10^20 operations.

[0084] As shown in Figure 2 The present application also provides a discipline inspection and supervision case trial AI auxiliary system device based on a large language model, which comprises:

[0085] The initialization module is configured to determine a case element vector of an AI auxiliary system for trial of a case to be supervised and investigated; match the case element vector with a dynamic knowledge graph to determine a plurality of candidate legal provisions and historical cases; the dynamic knowledge graph is a knowledge graph that is updated in real time according to current laws and regulations and integrates historical cases; generate a legal provision vector and a historical case vector based on the plurality of matched candidate legal provisions and historical cases, respectively; and embed the legal provision vector, the case element vector and the historical case vector into a first output vector;

[0086] The matching module is configured to input the first output vector into a trained large language model, a three-channel encoding layer of the large language model extracts dynamic knowledge graph structure features corresponding to the legal provision vector through a legal channel, obtains context features corresponding to the case element vector through a case element channel, and performs attention pooling operation on the historical case vector through a case channel to generate semantic features; a cross-channel attention layer calculates attention weights between the dynamic knowledge graph structure features, the context features and the semantic features two by two; a fully connected layer is inputted with the weighted vector superimposed with the attention weights to determine a legal provision application probability corresponding to the weighted vector; and an output layer determines a second output vector representing an applicable legal provision based on the legal provision application probability.

[0087] The specific embodiments described above only describe the design principles of the present application, and the shapes and names of the components in the description can be different and are not limited. Therefore, those skilled in the art of the present application can modify or equivalently replace the technical solutions described in the foregoing embodiments; and these modifications and replacements do not deviate from the purpose and technical solutions of the present application, and should all belong to the protection scope of the present application.

Claims

1. A method for AI assistance in handling cases of discipline inspection and supervision based on a large language model, characterized in that, Comprise: Step S1: determine the trial case element vector of the case to be disciplined and supervised; match the case element vector with the dynamic knowledge graph to determine a plurality of candidate legal provisions and historical cases; the dynamic knowledge graph is a knowledge graph that is updated in real time according to the current laws and regulations and integrates historical cases; generate a legal provision vector and a historical case vector based on the matched plurality of candidate legal provisions and historical cases respectively; embed the legal provision vector, the case element vector and the historical case vector into a first output vector; Step S2: input the first output vector into the trained large language model, and the three-channel coding layer of the large language model extracts the dynamic knowledge graph structure features corresponding to the legal provision vector through the legal channel, obtains the context features corresponding to the case element vector through the case element channel, and performs attention pooling operation on the historical case vector through the case channel to generate semantic features; The cross-channel attention layer calculates the attention weights between the dynamic knowledge graph structure features, the context features and the semantic features respectively; input the weighted vector superimposed with the attention weights into the full connection layer to determine the legal provision application probability corresponding to the weighted vector; the output layer determines a second output vector representing the applicable legal provision based on the legal provision application probability.

2. The method of claim 1, wherein, The method further comprises step S3: generating an applicable legal provision corresponding to the second output vector, generating an encrypted report, and storing the encrypted report as encrypted data in a blockchain.

3. The method of any one of claims 1-2, wherein, The step S1, determining the trial case element vector of the case to be disciplined and supervised, comprises: Step S11: generate a text vector from the BERT encoding of the case text corresponding to the case to be disciplined and supervised, and use the text vector as an input vector; Step S12: the graph neural network aggregates neighborhood node information of the input vector to generate a case element vector corresponding to the input vector, and the aggregation formula is: wherein, l is the number of training times, u is a neighbor node of node v, v is a node in the graph neural network, is a neighbor node set consisting of neighbor nodes of node v, is the training parameter at the l training time, is the hidden state of node u at the l training time, is the hidden state of node v at the l +1 training time, is a nonlinear activation function.

4. The method of claim 3, wherein, The step S1, based on the matched plurality of candidate legal provisions and historical cases, respectively generates a legal provision vector and a historical case vector, comprising: Step S13: use the TranSR model to map the candidate legal provision text to the relationship space to generate a legal provision vector, and the mapping formula is: wherein, is an initial clause feature vector, is a relation projection matrix, is a bias term, is a legal clause vector; Step S14: use SiameseNetwork to generate a historical case vector corresponding to the historical case, and the loss function of SiameseNetwork is: wherein, is a loss function of Siamese Network, margin is a preset interval threshold, , are the i-th historical case vector and the j-th historical case vector, respectively.

5. The method of claim 4, wherein, The loss function of the large language model is: wherein, , , , are weights, respectively, is a cross-entropy loss function, is a legal logic loss function, is a semantic loss function, is an age loss function; wherein KL is a divergence function, is a predicted probability distribution of the applicability of the legal provision vector by the large model, is a difference operation, is an ideal distribution about the applicability of the legal provision generated according to expert knowledge, F is a context feature corresponding to a case element vector, and C is a historical case vector, is a cosine similarity between F and C; ReLu is a ReLu function, is an effective time of the legal provision, is a time of a case of an AI-assisted system for trial of a case to be disciplined and supervised.

6. A discipline inspection case trial AI assistance system based on a large language model, characterized by, Comprise: Initialization module: configured to determine the case element vector of the trial AI auxiliary system of the case to be disciplined and supervised; match the case element vector with the dynamic knowledge graph to determine a plurality of candidate legal provisions and historical cases; the dynamic knowledge graph is a knowledge graph that is updated in real time according to the current laws and regulations and integrates historical cases; generate a legal provision vector and a historical case vector based on the matched plurality of candidate legal provisions and historical cases respectively; embed the legal provision vector, the case element vector and the historical case vector into a first output vector; The matching module is configured to input the first output vector into the trained large language model, and the three-channel encoding layer of the large language model extracts dynamic knowledge graph structure features corresponding to the legal clause vector through the legal channel, acquires context features corresponding to the case element vector through the case element channel, and performs attention pooling operation on the historical case vector through the case channel to generate semantic features. The cross-channel attention layer calculates attention weights between the dynamic knowledge graph structure features, the context features and the semantic features respectively; the weighted vector superimposed with the attention weights is input into the full connection layer to determine the legal clause application probability corresponding to the weighted vector; and the output layer determines the second output vector representing the applied legal clause based on the legal clause application probability.

7. A computer readable storage medium characterized in that, The storage medium stores a plurality of instructions; the plurality of instructions are used to be loaded and executed by the processor to implement the method in any one of claims 1-5.

8. An electronic device, comprising: The electronic device comprises: a processor configured to execute a plurality of instructions; a memory configured to store the plurality of instructions; wherein the plurality of instructions are used to be stored in the memory and loaded and executed by the processor to implement the method in any one of claims 1-5.

Citation Information

Patent Citations

  • Legal provision recommendation method and device and storage medium

    CN110569350A

  • Method and system for recommending criminal legal instrument related laws

    CN111460817A