A method, system, device and storage medium for predicting admissibility of defense opinions

Through the neural network model that combines attention mechanism and reinforcement learning, the semantic relationship between defense opinions and case facts is established, and relevant text segments are screened. This solves the problem of predicting the admissibility of defense opinions in intelligent justice and achieves high-accuracy prediction effects. .

CN114781388BActive Publication Date: 2024-10-01XIDIAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210096959.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-26
Publication Date
2024-10-01
Estimated Expiration
2042-01-26

AI Technical Summary

Technical Problem

In the field of smart justice, existing technologies fail to effectively consider and predict the admissibility of defense opinions. Especially in criminal defense, the semantic relationship between defense opinions and case facts is not fully utilized, resulting in the inability to accurately predict whether the defense opinions will be admissible. will be adopted.

Method used

An attention mechanism is used to establish the semantic relationship between defense opinions and case facts, and reinforcement learning is combined to screen case fact text segments related to defense opinions, and the admissibility of defense opinions is predicted through a neural network model.

Benefits of technology

It achieves high-accuracy prediction of the admissibility of defense opinions, fills the gap in the field of intelligent justice, and improves the transparency and prediction effect of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114781388B_ABST
    Figure CN114781388B_ABST
Patent Text Reader

Abstract

The present invention proposes a method, system, device and storage medium for predicting the admissibility of a defense opinion, including: using an attention mechanism to establish a semantic relationship between a defense opinion and case facts; using reinforcement learning to screen case fact text segments related to the defense opinion; and using the screened case fact text segments related to the defense opinion to predict the admissibility of the defense opinion. The method, system, device and storage medium can accurately predict the admissibility of a defense opinion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of intelligent justice and relates to a method, system, device and storage medium for predicting the admissibility of defense opinions. Background Art

[0002] "Smart Justice" is a very practical research field, and its main research purpose is to assist judicial decision-making and provide help to judicial practitioners and case participants. Defense is a very important part of judicial decisions, especially criminal defense.

[0003] However, in the current "intelligent justice" research, such as crime prediction, legal question answering and similar case query, defense opinions are not used as reference factors. For example, the patent of the auxiliary sentencing method for theft based on deep learning designs a series of features for theft cases, extracts the features and then predicts the sentencing of theft through deep learning, but does not consider the impact of defense opinions. In addition, the patent of the visualization analysis method based on multi-dimensional linkage also studies the judgment. It extracts the subject in the judgment to visualize the relationship between the subjects, and automatically divides the judgment into five parts: document header, document tail, comprehensive evaluation, accusation content, evidence confirmation and defense opinions. Although this patent takes defense opinions into consideration, it only superficially separates the defense opinions and does not further study the admissibility of defense opinions and their impact on the judgment results. Based on the above reasons, we proposed the topic of defense opinion admissibility prediction and proposed a corresponding research plan to fill the gap in the field of "intelligent justice".

[0004] The question we raise can be described as: given the facts of a case, predict whether the corresponding defense opinion will be accepted. This is because the case facts in the judgment will describe the important course of the case, the identity of the defendant, and his confession. From these descriptions, we can find out the details related to the defense opinion and make a judgment. Figure 1 As shown, in this case, the defense lawyer put forward two defense opinions. One of them was that "the defendant surrendered himself", but the case facts stated that "the defendant was arrested on March 4", which did not show any surrender circumstances, which was contrary to the defense opinion and therefore could not be accepted; while the second defense opinion stated that "the defendant confessed truthfully and the arson did not cause major losses", which was consistent with the description of the case.

[0005] The admissibility of defense opinions task is very similar to the natural language reasoning task in the field of natural language processing. Given two paragraphs of text, the system needs to determine whether the relationship between the two paragraphs is supportive or opposed. Therefore, here we consider using the attention mechanism commonly used in natural language reasoning to model the semantic relationship between case facts and defense opinions, so as to make predictions.

[0006] However, we found that the most important difference between the task of predicting the admissibility of defense opinions and the task of natural language reasoning is that the premise text given by the task of natural language reasoning is very short, only a few sentences. Of course, in the existing natural language processing tasks, there are also some studies involving the processing of long texts, such as "ReinforcedRanker-Reader forOpen-DomainQuestion Answering", which uses the policy gradient method to extract long texts, but the network structure, application field and method are different from the prediction of the admissibility of defense opinions. Through studying the data set, we found that the length of the case facts is basically more than 600 words, and only a limited number of sentences in the case facts are related to the defense opinions. Therefore, we consider extracting the text related to the defense opinions in the case facts first, and then predicting whether the defense opinions will be adopted through these extracted text segments. Combining the above key points, we propose a neural network model that combines attention mechanism and reinforcement learning to predict the admissibility of defense opinions, and can achieve a high accuracy rate. Summary of the invention

[0007] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and to provide a method, system, device and storage medium for predicting the admissibility of a defense opinion, which can accurately predict the admissibility of a defense opinion.

[0008] In order to achieve the above object, the present invention adopts the following technical scheme:

[0009] The method for predicting the admissibility of defense opinions described in the present invention includes:

[0010] Use the attention mechanism to establish the semantic relationship between defense opinions and case facts;

[0011] Use reinforcement learning to screen case fact text segments relevant to defense opinions;

[0012] The admissibility of the defense opinion is predicted using the screened case fact text segments related to the defense opinion.

[0013] The specific process of using the attention mechanism to establish the semantic relationship between the defense opinion and the case facts is as follows:

[0014] The words in the defense opinions and case facts are mapped into numerical representations through word embedding technology;

[0015] Obtain the contextual representation of each word in the case facts and defense opinions;

[0016] Calculate the correlation between each word between the case facts and the defense opinion;

[0017] Obtain word representations of case facts based on defense opinion perceptions;

[0018] Obtain a defense opinion based on a perception of the facts of the case;

[0019] The final representation of the case facts is encoded by using the defense opinion representation based on case fact perception and the case fact word representation based on defense opinion perception.

[0020] The specific operation of using reinforcement learning to screen the case fact text segments related to the defense opinion is:

[0021] Divide the case facts into text segments;

[0022] Compute a semantic representation for each text segment;

[0023] Calculate the relevance of each text segment;

[0024] Filtering text segments using reinforcement learning strategies;

[0025] The specific process of using the screened case fact text segments related to the defense opinion to predict the admissibility of the defense opinion is as follows:

[0026] Concatenate the representations of the text segments selected by the reinforcement learning strategy in a sequential order to form a text segment representation;

[0027] Get the contextual representation of the filtered text segment

[0028] Obtain the semantic association of the filtered text segments through the self-attention mechanism;

[0029] The admissibility of defense opinions is predicted based on text segment representation, contextual representation of text segments, and semantic associations of text segments.

[0030] The reward function of reinforcement learning in screening case fact text segments related to defense opinions using reinforcement learning is:

[0031]

[0032] in, is the result predicted by the model, and y is the label.

[0033] The defense opinion admissibility prediction system of the present invention comprises:

[0034] Establish a module for establishing the semantic relationship between defense opinions and case facts using an attention mechanism;

[0035] A screening module for screening case fact text segments related to defense opinions using reinforcement learning;

[0036] The prediction module is used to predict the admissibility of the defense opinion by using the screened case fact text segments related to the defense opinion.

[0037] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for predicting the admissibility of defense opinions when executing the computer program.

[0038] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for predicting the admissibility of defense opinions.

[0039] The present invention has the following beneficial effects:

[0040] During specific operation, the method, system, device and storage medium for predicting the admissibility of defense opinions described in the present invention adopt an attention mechanism to establish a semantic relationship between defense opinions and case facts, and then use reinforcement learning to screen case fact text segments related to defense opinions to improve the transparency of the model. The screened case fact text segments related to the defense opinions are then used to predict the admissibility of the defense opinions. It should be noted that the present invention combines reinforcement learning with an attention mechanism to achieve high-accuracy prediction of the admissibility of defense opinions while improving the transparency of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

[0042] Figure 1 is a flow chart of the present invention;

[0043] Figure 2 It is a schematic diagram of the structure of the present invention. DETAILED DESCRIPTION

[0044] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0045] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0046] Embodiment 1

[0047] The method for predicting the admissibility of defense opinions described in the present invention comprises the following steps:

[0048] 1) Use the attention mechanism to establish the semantic relationship between defense opinions and case facts;

[0049] The specific process of step 1) is:

[0050] 11) Represent the words in the case facts x and the defense opinion q after Chinese word segmentation into computable data representations X, Q, where the number of words in the case facts is m and the number of words in the defense opinion is n, using onehot encoding or distributed encoding, such as word2vec, ELMo, BERT, etc.;

[0051] 12) Using long short-term memory networks to obtain contextual encoding of case facts and defense opinions and

[0052]

[0053]

[0054] 13) Calculate the correlation a of each word between the case facts and the defense opinion ij :

[0055]

[0056] 14) Obtain word representation of case facts based on defense opinion perception;

[0057] Specifically, based on the similarity of each word, the attention distribution of all words in the defense opinion for any word in the case facts is calculated as follows:

[0058] λ i =softmax(ai: )

[0059] The representation of case facts with defense opinion awareness is calculated as:

[0060]

[0061] 15) Obtain defense opinions based on the facts of the case;

[0062] Specifically, consider the i-th word in each case fact, and the highest attention that can be given to all words in the defense opinion, that is:

[0063] v i =max(a i: )

[0064] Normalize the highest attention of each word of the case facts and all words of the defense opinions to get the final weight v:

[0065] v = softmax(v)

[0066] The obtained attention and the contextual representation of the case facts are multiplied and accumulated to obtain the defense opinion representation vector based on the case facts. Right now:

[0067]

[0068] 16) The case facts representation M that obtains the semantic relationship between the defense opinion and the case facts i .

[0069]

[0070] The case facts that encode the semantic relationship between the two text segments as a whole are denoted as M.

[0071] 2) Use the policy gradient algorithm of reinforcement learning to screen out the text segments related to the defense opinions in the case facts;

[0072] 21) Divide the case facts into text segments;

[0073] Specifically, M is divided into natural sentences or text segments of equal length, and s text segments are obtained. l k The length of each text segment.

[0074] 22) Calculate the semantic representation of each text segment after segmentation.

[0075] Specifically, the segmented text segments are represented by M kInput into BiLSTM, concatenate its last forward state and last backward state to obtain the semantic representation z of each text segment k .

[0076]

[0077]

[0078]

[0079] 23) Design a network to calculate the relevance of each text segment to the defense opinion.

[0080] e k =Tanh(W c z k +b c )

[0081] e=[e1,…,e s ]

[0082]

[0083] 24) Using reinforcement learning strategies to screen texts;

[0084] Specifically, the policy gradient algorithm in reinforcement learning is used to screen the text. In the problem of predicting the admissibility of defense opinions, the agent in reinforcement learning is the model designed for the present invention; the action that the agent needs to take is to select the text segment related to the defense opinion. The environment of reinforcement learning is the correlation between each text segment and the defense opinion. In reinforcement learning, when the game requires the agent to walk a certain path to reach the end, the point on the path walked by the agent is called the state of the agent; in the task of predicting the admissibility of defense opinions, the model selects the text segment and then predicts the admissibility, and there are no other steps in between, so the present invention does not forcibly define the state of the model. In addition, the policy gradient algorithm does not require the calculation of the value of the action, but only needs to simulate the calculation of the probability of the action being selected. Therefore, the present invention does not set the action value, but only calculates the probability of the text segment being selected. The probability φ of the relevant text segment being selected in the case facts is simulated and calculated by a neural network, where the strategy in reinforcement learning is:

[0085]

[0086] Among them, π refers to the reinforcement learning strategy, which is based on the parameter θ in the neural network r and the environment state e to select the text segment r, that is, the probability of the case fact text segment being selected is obtained by using the neural network During training and inference, the probability of using text segments Select this paragraph, when the probability of text segment r The higher the probability, the greater the probability of being selected.

[0087] The present invention selects the number of text segments as ss, and tests the different effects of selecting one or more text segments by changing the value of ss. In addition, in the present invention, the policy gradient of reinforcement learning mainly calculates the probability of all text segments being selected. The present invention needs to design a reward function obtained after selecting a text segment r, and approximate the derivation according to the REINFORCE algorithm. The specific derivation algorithm derivation and reward function are discussed in the training part.

[0088] 3) Use the screened text segments to make an admissibility prediction;

[0089] 31) Connect the text segment representations selected by reinforcement learning in sequence to form a text segment representation M g .

[0090] M g =[M1,…,M ss ]

[0091] 32) Obtain the contextual representation of the filtered text segment. The representation of the obtained text segment is still calculated from the attention mechanism in the first part, and has not been obtained through the BiLSTM in the second part of reinforcement learning. The concatenated text segment representation Mg is first input into a BiLSTM network, and its forward and backward last states are concatenated to form a text segment semantic representation, and the obtained

[0092] 33) The semantic associations between the filtered text segments are obtained through the self-attention mechanism.

[0093] At this time, only the semantic representation of a single text segment is obtained, but when predicting the adoption results, these text segments need to be viewed as a whole. Therefore, it is necessary to obtain the association between the selected text segments. The present invention selects a self-attention mechanism to calculate the semantic representation after the text segments are associated, wherein the selected attention calculation method is a triangular attention calculation method. It is just that the attention calculation between the defense opinion and the case facts is transformed into the attention calculation between the selected text segment matrix and itself. In addition, when i=j, the correlation should be set to -∞.

[0094] Suppose the semantic representation of the i-th text segment obtained at this time is l i represents the number of words in the i-th text segment. Therefore, the representation of all the filtered text segments is

[0095] 34) Use the encoded representation of the semantic relationship between the defense opinions and the related text segments to predict admissibility.

[0096]

[0097]

[0098]

[0099]

[0100] Finally, the admissibility label is predicted through a linear layer and a normalization function.

[0101]

[0102] It should be noted that the labels of "adopt" or "not adopt" in the data set are processed into two-dimensional vectors, that is, [1,0] represents adoption and [0,1] represents non-adoption. The output dimension is also 2-dimensional. Therefore, we only need to judge the prediction result Whether the prediction is accurate can be determined by whether the subscript of the maximum value of is consistent with the subscript of the maximum value of the label; when the subscripts of the maximum values ​​of the two are consistent, the prediction is correct; otherwise, the prediction is wrong.

[0103] It should be noted that the present invention uses cross entropy and back propagation for model training.

[0104]

[0105] In the reinforcement learning stage, the present invention adopts policy gradient for training, and the reward function in the training process is:

[0106]

[0107] The objective function is:

[0108]

[0109] Therefore, the overall objective function is:

[0110]

[0111] Embodiment 2

[0112] The defense opinion admissibility prediction system of the present invention comprises:

[0113] Establish a module for establishing the semantic relationship between defense opinions and case facts using an attention mechanism;

[0114] A screening module for screening case fact text segments related to defense opinions using reinforcement learning;

[0115] The prediction module is used to predict the admissibility of the defense opinion by using the screened case fact text segments related to the defense opinion.

[0116] Embodiment 3

[0117] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method for predicting the admissibility of defense opinions are implemented. The memory may include a memory, such as a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk memory, etc. The processor, the network interface, and the memory are interconnected through an internal bus. The internal bus may be an industrial standard architecture bus, a peripheral component interconnection standard bus, an extended industrial standard structure bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory is used to store programs. Specifically, the program may include a program code, and the program code includes computer operation instructions. The memory may include a memory and a non-volatile memory, and provide instructions and data to the processor.

[0118] Embodiment 4

[0119] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the defense opinion admissibility prediction method are implemented. Specifically, the computer-readable storage medium includes, but is not limited to, volatile memory and / or non-volatile memory. The volatile memory may include random access memory (RAM) and / or cache memory, etc. The non-volatile memory may include read-only memory (ROM), hard disk, flash memory, optical disk, magnetic disk, etc.

[0120] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0121] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0122] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0123] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for predicting the admissibility of a defense opinion, characterized in that: include: Use the attention mechanism to establish the semantic relationship between defense opinions and case facts; Use reinforcement learning to screen case fact text segments relevant to defense opinions; The admissibility of the defense opinion is predicted by using the selected case fact text segments related to the defense opinion; The specific process of using the attention mechanism to establish the semantic relationship between the defense opinion and the case facts is as follows: The words in the defense opinions and case facts are mapped into numerical representations through word embedding technology; Obtain the contextual representation of each word in the case facts and defense opinions; Calculate the correlation between each word between the case facts and the defense opinion; Obtain word representations of case facts based on defense opinion perceptions; Obtain a defense opinion based on a perception of the facts of the case; The final representation of the case facts is encoded by using the defense opinion representation based on the perception of the case facts and the word representation of the case facts based on the perception of the defense opinion; The specific process of using the screened case fact text segments related to the defense opinion to predict the admissibility of the defense opinion is as follows: Concatenate the representations of the text segments selected by the reinforcement learning strategy in a sequential order to form a text segment representation; Get the contextual representation of the filtered text segment; Obtain the semantic association of the filtered text segments through the self-attention mechanism; Predict the admissibility of defense opinions based on text segment representation, text segment context representation, and text segment semantic association; The reward function of reinforcement learning in screening case fact text segments related to defense opinions using reinforcement learning is: in, is the result predicted by the model, and y is the label.

2. The method for predicting the admissibility of defense opinions according to claim 1, characterized in that: The specific operation of using reinforcement learning to screen the case fact text segments related to the defense opinion is: Divide the case facts into text segments; Compute a semantic representation for each text segment; Calculate the relevance of each text segment; Filtering text segments using reinforcement learning strategies.

3. A defense opinion admissibility prediction system, characterized in that: include: Establish a module for establishing the semantic relationship between defense opinions and case facts using an attention mechanism; A screening module for screening case fact text segments related to defense opinions using reinforcement learning; A prediction module, used to predict the admissibility of the defense opinion using the screened case fact text segments related to the defense opinion; The specific process of using the attention mechanism to establish the semantic relationship between the defense opinion and the case facts is as follows: The words in the defense opinions and case facts are mapped into numerical representations through word embedding technology; Obtain the contextual representation of each word in the case facts and defense opinions; Calculate the correlation between each word between the case facts and the defense opinion; Obtain word representations of case facts based on defense opinion perceptions; Obtain a defense opinion based on a perception of the facts of the case; The final representation of the case facts is encoded by using the defense opinion representation based on the perception of the case facts and the word representation of the case facts based on the perception of the defense opinion; The specific process of using the screened case fact text segments related to the defense opinion to predict the admissibility of the defense opinion is as follows: Concatenate the representations of the text segments selected by the reinforcement learning strategy in a sequential order to form a text segment representation; Get the contextual representation of the filtered text segment; Obtain the semantic association of the filtered text segments through the self-attention mechanism; Predict the admissibility of defense opinions based on text segment representation, text segment context representation, and text segment semantic association; The reward function of reinforcement learning in screening case fact text segments related to defense opinions using reinforcement learning is: in, is the result predicted by the model, and y is the label.

4. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for predicting the admissibility of defense opinions as described in any one of claims 1 to 2 are implemented.

5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for predicting the admissibility of defense opinions as described in any one of claims 1 to 2 are implemented.