Method, device and storage medium for extracting event causal relationships based on background knowledge
By screening event neighbor nodes in judicial case text and encoding background knowledge, combining pre-trained language models and neural networks to extract event causal relationships in judicial cases, the problem of implicit causal relationship extraction in the existing technology is solved, and fast and accurate causal relationship recognition is achieved.
Patent Information
- Application Number
- CN202310259295.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-16
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-03-16
AI Technical Summary
The prior art is difficult to effectively extract implicit event causal relationships in judicial case texts, especially in the absence of explicit causal conjunctions, which leads to poor model recognition effect.
By constructing a stop word list and word segmentation tool in the judicial field, screening event-related neighbor nodes, combining knowledge graph coding background knowledge representation, fusing word vectors of pre-trained language models, using two-way long and short-term memory neural networks and conditional random field models, assigning causal semantic role tags to words in sentences, realizing the extraction of event causality.
In the absence of explicit causal conjunctions, it is possible to quickly discover the causal relationship of implicit events in the text, simplify the content of legal texts, and provide convenience for the judicial industry.
Smart Images

Figure CN116341519B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of natural language processing and deep learning technology, and in particular to a method for extracting causal relationships between judicial case events based on event background knowledge. Background Art
[0002] With the rapid development of artificial intelligence (AI) technology, it is being applied in an increasing number of fields and scenarios, and smart law has become a hot research topic. A judicial case text often contains numerous causal relationships between events. Extracting causal relationships between events not only simplifies complex legal texts by leveraging these causal relationships, but also helps relevant personnel make informed decisions about key case information based on these causal relationships, leading to a better understanding of the case's development.
[0003] Currently, methods for extracting causal relationships between events can be roughly divided into pattern matching-based methods and machine learning-based methods. Pattern matching-based methods analyze and summarize text to construct common syntactic templates to extract causal relationships between events. Although these methods have achieved good results in tasks targeting specific fields, the syntactic templates constructed by these methods cannot cover all possible syntactic structures and are difficult to generalize to other fields, resulting in low applicability. Although machine learning-based methods have achieved relatively good results, these methods often only perform well in identifying explicit event causal relationships. When the text lacks words such as "because" and "result" that indicate causal relationships, it is difficult for the model to infer the implicit event causal relationships between events based on background knowledge between the events, as humans do. Summary of the Invention
[0004] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a method for extracting causal relationships of judicial case events based on event background knowledge.
[0005] The purpose of the present invention can be achieved by the following technical solutions:
[0006] As a first aspect of the present invention, a method for extracting event causal relationships based on background knowledge is provided, which specifically includes the following steps:
[0007] Input a sentence, preprocess the sentence, and obtain the words representing the event in the sentence;
[0008] Filter the neighboring knowledge nodes associated with the event in the knowledge graph and retain the neighboring nodes related to the event causal relationship extraction task;
[0009] Encode the background knowledge representation of the event based on the relevant neighbor nodes and construct the background knowledge representation vector of the event;
[0010] Input the sentence into the pre-trained language model to obtain the word vector representation of the words in the sentence, and fuse the word vector representation with the background knowledge representation vector;
[0011] The fused semantic information enhancement vector is input into the downstream neural network model to assign corresponding causal semantic role labels to each word in the sentence, thereby realizing the extraction of event causal relationships.
[0012] Furthermore, the sentence is preprocessed to obtain words representing events, and the specific steps include:
[0013] Construct a stop word list for the judicial field based on expert knowledge;
[0014] Use the word segmentation toolkit to segment the input sentence and obtain the word set W of the sentence S after segmentation;
[0015] Perform part-of-speech analysis on the words in the sentence to obtain the part-of-speech set POS;
[0016] The words in the word set W are filtered by combining the constructed stop word list with the word parts of speech, and the word set E that can represent the event is selected.
[0017] Furthermore, the specific steps of screening the neighbor knowledge nodes associated with the event in the knowledge graph and retaining the neighbor nodes related to the event causal relationship extraction task include:
[0018] For the event word set E = {e1, e2, ..., e m Event e in} i , retrieve and event e in the knowledge graph i Associated neighbor nodes;
[0019] Filter neighbor nodes based on the relationship between nodes, and only retain neighbor nodes that have a relationship with the event node that is relevant to the event causal relationship extraction task;
[0020] According to the strength of the association between nodes in the knowledge graph, the event i The top n neighbor nodes with the highest correlation {N1, N2, N3, ...N n} and its corresponding association weights {W1, W2, W3, ...W n}.
[0021] Furthermore, the specific steps of encoding the background knowledge representation of the event based on the relevant neighbor nodes and constructing the background knowledge representation vector of the event include:
[0022] For event e i Neighbor node N j , calculate the node in event ei The weight ratio α in the background knowledge representation j ;
[0023] Get neighbor nodes N from the word vector table of the knowledge graph j The corresponding word vector representation v j ;
[0024] Based on the obtained weight ratio α j With word vector representation v j , computing nodes N j Knowledge representation k in background knowledge encoding tasks j ;
[0025] Repeat the above steps to get event e i The knowledge representation set K of all neighbor nodes;
[0026] Event-based i The neighbor node knowledge representation set K is equal to e i Encode background knowledge and get e i Background knowledge representation
[0027] Furthermore, the specific steps of inputting the sentence into the pre-trained language model to obtain word vector representations of the words in the sentence and fusing the word vector representations with the background knowledge representation vectors include:
[0028] Input the sentence into the pre-trained language model to obtain the word vector representation of each word in the sentence
[0029] Represent each word’s word vector The corresponding background knowledge representation Fusion, get the semantic information enhanced vector representation F of the word i .
[0030] Furthermore, if the current word cannot represent an event, its corresponding background knowledge representation vector Set to a vector of all 0s.
[0031] Furthermore, the fused semantic information enhancement vector is input into the downstream neural network model to assign a corresponding causal semantic role label to each word in the sentence, and the specific steps of extracting the event causal relationship include:
[0032] The semantic information enhancement vectors corresponding to each word in the sentence are concatenated and integrated to form the feature vector matrix of the entire sentence;
[0033] The obtained sentence feature vector matrix is used as the input of the lower-layer bidirectional long short-term memory neural network model to obtain the semantic vector matrix based on the sentence context features;
[0034] The obtained semantic vector matrix is used as the input of the downstream conditional random field model. The conditional random field model is used to score the causal semantic role label sequence corresponding to each word in the sentence to obtain the global optimal label chain for the given input sequence.
[0035] Select the causal semantic role label with the highest score for each word in the sentence, output the sentence and the causal semantic role label corresponding to each word in it, and complete the event causal relationship extraction task.
[0036] Furthermore, the causal semantic role labels are divided into cause, result and others.
[0037] As a second aspect of the present invention, there is provided an electronic device, comprising:
[0038] one or more processors;
[0039] a memory for storing one or more programs;
[0040] When the one or more programs are executed by the one or more processors, the one or more processors implement the event causal relationship extraction method as described in any one of the above items.
[0041] As a third aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the event causal relationship extraction method as described in any one of the above items are implemented.
[0042] Compared with the prior art, the present invention has the following beneficial effects:
[0043] The present invention proposes a method for extracting causal relationships of judicial case events based on event background knowledge. First, words representing events are obtained from sentences; for each event word, the neighboring knowledge nodes associated with it are obtained and screened in the knowledge graph; the top n neighboring nodes with the highest degree of relevance to the event causal relationship extraction task are retained, and the background knowledge representation of the event is encoded based on the relevant nodes; and the background knowledge representation vector of the word is fused with the word vector obtained from the pre-trained language model to obtain the semantic information enhancement vector of the word; on this basis, the causal semantic role label of each word in the sentence is obtained by combining the bidirectional long short-term memory neural network and the conditional random field to realize the extraction of event causal relationships. It is helpful to extract the implicit event causal relationships contained in the text when there are no explicit causal words in the text, quickly discover the causal relationship between events, and simplify the complex legal text content through the causal relationship between events, providing convenience for relevant practitioners in the judicial industry. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 This is a flow chart of a method for extracting causal relationships of judicial case events based on event background knowledge of the present invention;
[0045] Figure 2 It is a schematic diagram of encoding background knowledge of events in a sentence;
[0046] Figure 3 It is the overall model structure for extracting causal relationships between judicial case events;
[0047] Figure 4 A schematic diagram of an electronic device showing an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0048] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0049] Example 1
[0050] like Figure 1 FIG. 1 is a flow chart of a method for extracting causal relationships of judicial case events based on event background knowledge of the present invention, which specifically includes the following steps:
[0051] Step A: Preprocess the input sentence to obtain the words representing the event;
[0052] The specific steps of step A are as follows:
[0053] Step A1: Construct a stop word list for the judicial field based on expert knowledge;
[0054] Step A2: Use the open source Chinese word segmentation toolkit to segment the input sentence and obtain the word set W of the sentence S after segmentation = {w1, w2, ..., w k};
[0055] Among them, w j Represents the jth word in the word set after word segmentation;
[0056] Step A3: Analyze the word parts of speech in the sentence and obtain the part-of-speech set POS = {pos1, pos2, ..., pos k};
[0057] Among them, pos i Indicates the part of speech corresponding to the i-th word in the word set;
[0058] Step A4: Filter the words in the word set W by combining the stop word list constructed in step A1 with the word part of speech, and select the word set E = {e1, e2, ..., e m};
[0059] Among them, e i Represents the i-th event word in the sentence.
[0060] Step B: Filter the neighboring knowledge nodes associated with the event in the knowledge graph and retain the nodes related to the event causal relationship extraction task;
[0061] The specific steps of step B are as follows:
[0062] Step B1: For the event word set E = {e1, e2, ..., e m Event e in} i , retrieve the neighbor nodes associated with it in the knowledge graph;
[0063] Step B2: Filter neighbor nodes based on the relationship between nodes, and only retain neighbor nodes that have a causal relationship with the event node such as "cause" or "lead" that is relevant to the event causal relationship extraction task;
[0064] Step B3: Retain the nodes related to event e according to the strength of association between nodes in the knowledge graph. i The top n neighbor nodes with the highest correlation {N1, N2, N3, ...N n} and its corresponding association weights {W1, W2, W3, ...W n}.
[0065] Step C: Encode the background knowledge representation of the event based on the relevant neighbor nodes and construct the background knowledge representation vector of the event;
[0066] The specific steps of step C are as follows:
[0067] Step C1: For event e i Neighbor node N j , calculate the node in event e i The weight ratio α in the background knowledge representation j ;
[0068] Among them, the calculation weight ratio α j The formula is:
[0069]
[0070] W j Represents the current neighbor node N j With event e i The association weight in the knowledge graph;
[0071] Step C2: Get neighbor nodes N from the word vector table of the knowledge graph j The corresponding word vector representation v j ;
[0072] Step C3: Based on the weight ratio α obtained in step C1 j The word vector representation v obtained in step C2 j , computing nodes N j Knowledge representation k in background knowledge encoding tasks j ;
[0073] Among them, computational knowledge represents k j The formula is:
[0074] k j =α j v j
[0075] Step C4: Repeat steps C1-C3 to obtain event e i The knowledge representation set of all neighbor nodes K={k1,k2,k3,…k n};
[0076] Step C5: Based on event e i The neighbor node knowledge representation set K is equal to e i Encode background knowledge and get e i Background knowledge representation
[0077] Among them, calculation The formula is:
[0078]
[0079] Step D: Input the sentence into the pre-trained language model to obtain the word vector representation of the words in the sentence, and fuse it with the background knowledge representation vector;
[0080] The specific steps of step D are as follows:
[0081] Step D1: Input the sentence into the pre-trained language model to obtain the word vector representation of each word in the sentence
[0082] Among them, the subscript i indicates that this is the i-th word in the sentence;
[0083] Step D2: Represent the word vector of each word The corresponding background knowledge representation
[0084] Fusion, get the semantic information enhanced vector representation F of the word i ;
[0085] Step D3: In particular, if the current word cannot represent an event, then its corresponding background knowledge representation vector Set to a vector of all 0s.
[0086] Step E: Input the fused semantic information enhancement vector into the downstream neural network model to assign corresponding causal semantic role labels to each word in the sentence to extract the causal relationship of the event;
[0087] The specific steps of step E are as follows:
[0088] Step E1: concatenate and integrate the semantic information enhancement vectors corresponding to each word in the sentence obtained in step D to form a feature vector matrix for the entire sentence;
[0089] Step E2: Using the sentence feature vector matrix obtained in step E1 as input to the lower-layer bidirectional long short-term memory neural network model to obtain a semantic vector matrix based on the sentence context features;
[0090] Step E3: Use the semantic vector matrix obtained in step E2 as the input of the downstream conditional random field model. The conditional random field model scores the possible causal semantic role label sequences corresponding to each word in the sentence to obtain the global optimal label chain for the given input sequence.
[0091] Step E4: Specifically, we classify the causal semantic role labels into “cause”, “result”, and “other”;
[0092] Step E5: Select the causal semantic role label with the highest score for each word in the sentence, output the sentence and the causal semantic role label corresponding to each word in it, and complete the event causal relationship extraction task.
[0093] In summary, the present invention encodes the background knowledge of the events contained in the sentence through the knowledge graph, adds background knowledge representation features to the event words, and combines the pre-trained language model to obtain the semantic information enhanced vector representation of the words. On this basis, the bidirectional long short-term memory neural network and the conditional random field are used to assign causal semantic role labels to the words in the sentence, and the event causal relationship in the judicial case text sentences is extracted. It is helpful to extract the implicit event causal relationship contained in the text when there is a lack of explicit causal association words, quickly discover the causal relationship between events, and simplify the complex legal text content through the causal relationship between events, providing convenience for relevant practitioners in the judicial industry.
[0094] Example 2
[0095] As a second aspect of the present invention, the present application further provides an electronic device, comprising: one or more processors 11; a memory 12 for storing one or more programs; when the one or more programs are executed by the one or more processors 11, the one or more processors 11 implement the above-mentioned method for extracting causal relationships of judicial case events based on event background knowledge. Figure 4 As shown in FIG, a hardware structure diagram of any device with data processing capability in which the event causal relationship extraction method provided by the embodiment of the present invention is located, except Figure 3 In addition to the processor 11, memory 12 and interface 13 shown, any device with data processing capabilities in which the apparatus in the embodiment is located may also include other hardware according to the actual functions of the device with data processing capabilities, which will not be described in detail.
[0096] Example 3
[0097] As a third aspect of the present invention, the present application also provides a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the event causal relationship extraction method as described above. The computer-readable storage medium can be an internal storage unit of any device with data processing capabilities as described in any of the aforementioned embodiments, such as a hard disk or memory. The computer-readable storage medium can also be an external storage device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), an SD card, a flash card (Flash Card), etc. equipped on the device. Furthermore, the computer-readable storage medium can also include both an internal storage unit and an external storage device of any device with data processing capabilities. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and can also be used to temporarily store data that has been output or is to be output.
[0098] The above describes in detail the preferred embodiments of the present invention. It should be understood that those skilled in the art can make numerous modifications and variations based on the concepts of the present invention without inventive effort. Therefore, any technical solutions that can be derived by those skilled in the art through logical analysis, reasoning, or limited experimentation based on the concepts of the present invention and the prior art should be within the scope of protection defined by the claims.
Claims
1. A method for extracting event causal relationships based on background knowledge, characterized in that: The specific steps include: Input a sentence, preprocess the sentence, and obtain the words representing the event in the sentence; Filter the neighboring knowledge nodes associated with the event in the knowledge graph and retain the neighboring nodes related to the event causal relationship extraction task; Encode the background knowledge representation of the event based on the relevant neighbor nodes and construct the background knowledge representation vector of the event; Input the sentence into the pre-trained language model to obtain the word vector representation of the words in the sentence, and fuse the word vector representation with the background knowledge representation vector. The specific steps include: For events Neighbor nodes , calculate the node in the event The weight ratio in the background knowledge representation ; Get neighbor nodes from the word vector table of the knowledge graph Corresponding word vector representation ; Based on the obtained weight ratio and word vector representation , computing nodes Knowledge representation in background knowledge encoding tasks ; Repeat the above steps to get the event The knowledge representation set of all neighbor nodes ; Event-based Neighbor node knowledge representation set right Encode background knowledge and obtain Background knowledge representation ; The fused semantic information enhancement vector is input into the downstream neural network model to assign corresponding causal semantic role labels to each word in the sentence, thereby realizing the extraction of event causal relationships.
2. The method for extracting event causal relationships based on background knowledge according to claim 1, characterized in that: The sentence is preprocessed to obtain words representing events, and the specific steps include: Construct a stop word list for the judicial field based on expert knowledge; Use the word segmentation toolkit to segment the input sentence and get the sentence after segmentation Collection of words ; Perform part-of-speech analysis on the words in the sentence to obtain a part-of-speech set ; Combine the constructed stop word list with the word part of speech to the word set Filter the words in the , and select the word set that can represent the event .
3. The method for extracting event causal relationships based on background knowledge according to claim 1, characterized in that: The specific steps of screening the neighbor knowledge nodes associated with the event in the knowledge graph and retaining the neighbor nodes related to the event causal relationship extraction task include: For event word sets Events in , search and event in knowledge graph Associated neighbor nodes; Filter neighbor nodes based on the relationship between nodes, and only retain neighbor nodes that have a relationship with the event node that is relevant to the event causal relationship extraction task; According to the strength of the association between nodes in the knowledge graph, the event The most relevant Neighbor nodes The corresponding association weight .
4. The method for extracting event causal relationships based on background knowledge according to claim 1, characterized in that: The specific steps of inputting a sentence into a pre-trained language model to obtain word vector representations of words in the sentence and fusing the word vector representations with the background knowledge representation vectors include: Input the sentence into the pre-trained language model to obtain the word vector representation of each word in the sentence ; Represent each word’s word vector The corresponding background knowledge representation Fusion, to obtain the semantic information enhanced vector representation of words .
5. The method for extracting event causal relationships based on background knowledge according to claim 4 is characterized in that: If the current word cannot represent an event, then its corresponding background knowledge representation vector Set to a vector of all 0s.
6. The method for extracting event causal relationships based on background knowledge according to claim 1, characterized in that: The specific steps of inputting the fused semantic information enhancement vector into the downstream neural network model and assigning corresponding causal semantic role labels to each word in the sentence to extract the causal relationship of events include: The semantic information enhancement vectors corresponding to each word in the sentence are concatenated and integrated to form the feature vector matrix of the entire sentence; The obtained sentence feature vector matrix is used as the input of the lower-layer bidirectional long short-term memory neural network model to obtain the semantic vector matrix based on the sentence context features; The obtained semantic vector matrix is used as the input of the downstream conditional random field model. The conditional random field model is used to score the causal semantic role label sequence corresponding to each word in the sentence to obtain the global optimal label chain for the given input sequence. Select the causal semantic role label with the highest score for each word in the sentence, output the sentence and the causal semantic role label corresponding to each word in it, and complete the event causal relationship extraction task.
7. The method for extracting event causal relationships based on background knowledge according to claim 6, characterized in that: The causal semantic role labels are divided into cause, result, and others.
8. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the event causal relationship extraction method as described in any one of claims 1 to 7.
9. 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 event causal relationship extraction method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Document-level event causal relationship identification method and system, medium, equipment and terminal
CN115577678A
Method and apparatus for ontology construction
WO2020001373A1