Document-level Chinese event relation detection method and system

Through the combination of syntactic semantic dependency analysis graph and BERT model, a document-level Chinese event relationship detection method capable of detecting multiple types of event relationships is constructed, which solves the problem of existing models focusing on a single relationship type and achieves high accuracy and reliability. Sexual detection effect.

CN118761407APending Publication Date: 2024-10-11CENT SOUTH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410736390.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

Existing event relationship detection models lack comprehensiveness and universality, mainly focus on a single relationship type, and are difficult to detect multiple types of event relationships.

Method used

Document-level Chinese event relationship detection is implemented using the methods of syntactic and semantic dependency analysis graph construction, event extraction, event pair construction, event element embedding and BERT relationship classifier training. Specific steps include the construction of syntactic and semantic dependency analysis trees, extraction and completion of event subjects, predicates and objects, clustering and data enhancement of event pairs, embedding of event element information, and training of the BERT model.

Benefits of technology

It achieves high reliability and high accuracy of document-level Chinese event relationship detection, can detect multiple types of event relationships, and improves the comprehensiveness and universality of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118761407A_ABST
    Figure CN118761407A_ABST
Patent Text Reader

Abstract

The invention discloses a document-level Chinese event relationship detection method. The method comprises the following steps: acquiring an existing Chinese document; constructing a syntax semantic dependency analysis graph; extracting a Chinese event; constructing an event pair; event element information is embedded; constructing a BERT relation classifier and training to obtain an event relation prediction model; and carrying out relation detection on the document-level Chinese events by adopting the obtained event relation prediction model. The invention also discloses a system for realizing the document-level Chinese event relationship detection method. According to construction of a syntax semantic dependency analysis chart, extraction of Chinese events and construction of event pairs, the basis of event relation judgment is guaranteed, and meanwhile relation detection of document-level Chinese events is achieved according to a BERT relation classifier; and moreover, the reliability is higher, and the precision is higher.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of data mining, and in particular relates to a document-level Chinese event relationship detection method and system. Background Art

[0002] An event is an objective fact that a specific person, thing, or event interacts with each other at a specific time and place. Event trigger words refer to verbs or verb phrases that express the occurrence or change of an event, such as "marriage" and "death". The occurrence of an event is often not an isolated phenomenon, and there must be other events related to it, such as cause events, result events, and concurrent events. This logical form of mutual dependence and association between events is called event relations. Event relations exist objectively between events and act on originally isolated sets of events. Event relations can connect events that are discrete in the text to form an event relationship network and the topological context of event development. Therefore, analyzing event relations has important application value for current large-scale information analysis and processing, such as clustering of related events, construction of relationship networks for news events, and reasoning and prediction of emergencies.

[0003] Event relationship detection is a task that deeply determines what kind of logical relationship exists between two events. At present, the methods of event relationship detection can be divided into rule-based methods and machine learning-based methods. Rule-based methods mainly rely on manually defined rules or templates to extract event relationships, while machine learning-based methods learn the patterns of event relationships by training large-scale corpora. Among the machine learning-based methods, deep learning technologies such as CNN, LSTM and Transformer are widely used in event relationship detection tasks. These methods usually convert text input into vector representation and use vector operations to simulate human understanding and reasoning process of text. However, most of the existing event relationship detection models only focus on the determination of a specific event relationship type (such as "causal" relationship), which is not comprehensive and universal; secondly, previous work mainly focuses on fine-grained problems of a single relationship type, such as implicit causal relationship, document-level causal relationship and domain causal relationship, which are tailored for specific problems and are not suitable for detecting multiple types of event relationships. Summary of the invention

[0004] One of the purposes of the present invention is to provide a document-level Chinese event relationship detection method with high reliability and high accuracy.

[0005] A second objective of the present invention is to provide a system for implementing the document-level Chinese event relationship detection method.

[0006] The document-level Chinese event relationship detection method provided by the present invention comprises the following steps:

[0007] S1. Obtain existing Chinese documents;

[0008] S2. Constructing a syntactic and semantic dependency analysis graph for the Chinese document obtained in step S1;

[0009] S3. Extract Chinese events based on the syntactic semantic dependency analysis graph constructed in step S2;

[0010] S4. According to the Chinese events extracted in step S3, construct event pairs;

[0011] S5. Embed event element information for the event pair obtained in step S4;

[0012] S6. Build and train the BERT relation classifier to obtain an event relation prediction model;

[0013] S7. Use the event relationship prediction model obtained in step S6 to perform document-level Chinese event relationship detection.

[0014] Step S2 constructs a syntactic and semantic dependency analysis graph for the Chinese document obtained in step S1, specifically including the following steps:

[0015] Construction of syntactic-semantic dependency analysis tree based on syntactic-semantic dependency analysis:

[0016] Use grammar parsing tools to perform word segmentation, part-of-speech tagging, and grammatical semantic analysis on documents;

[0017] According to the results of grammatical and semantic analysis, the document is converted into a dependency syntactic analysis tree; the nodes in the dependency syntactic analysis tree represent words, the edges represent grammatical and semantic dependency relationships, and the nodes before and after the parent node are the child nodes on the left and right sides;

[0018] Number all word nodes in ascending order according to the order in which they appear in the document, with the root node numbered 0;

[0019] Pruning the dependency syntactic analysis tree: keeping only the main components to reduce the number of nodes in the dependency syntactic analysis tree; the main components include the subject, trigger words and object; performing semantic dependency analysis on the pruned dependency syntactic analysis tree to obtain the semantic association between the trigger words; and adding the obtained semantic association to the original dependency syntactic analysis tree;

[0020] The semantic dependency between events is represented by eXX; for non-eXX relationships between trigger words, they are queried and obtained in the dependent child nodes and used as semantic associations between trigger words; the eXX includes eCOO, ePurp and eSUCC: eCOO represents a parallel relationship, which refers to several parallel semantic events; ePurp represents a precedent relationship, which refers to events that occur in order in time and space or events that occur before in logic and semantics with a correlation greater than the set strength; eSUCC represents a successor relationship, which refers to semantically further result-type events, including subsequent events that occur in time, space, logic or semantics;

[0021] Adjustment of syntactic and semantic dependency analysis tree based on trigger words and semantic structure:

[0022] Trigger word adjustment: raising the level of each trigger word node in the trigger word chain so that all trigger word nodes and the core root node in the adjusted syntactic semantic dependency analysis tree have the same level; the core root node only includes the core words of the sentence before adjustment, and includes the direct child nodes of the root node after adjustment;

[0023] Adjustment of preposition structure: the node level of the subject or object introduced by the preposition is raised, so that the adjusted node is the direct child node of the corresponding core root node;

[0024] Passive voice adjustment: improve the level of nodes corresponding to passive sentences and modify syntactic dependencies;

[0025] Finally, the construction of the syntactic and semantic dependency analysis graph is completed.

[0026] Step S3 extracts Chinese events based on the syntactic-semantic dependency analysis graph constructed in step S2, which specifically includes the following steps:

[0027] Scan the core root nodes and corresponding child nodes in the syntactic semantic dependency analysis graph in sequence;

[0028] Extract the event subject, predicate, and object, and complete them using the following rules:

[0029] Rule 1: If the event triggered by the core root node does not have an earlier event with a semantic dependency, completion will not be performed;

[0030] Rule 2: If there is a direct component missing, and the sdp in the ERT is a non-initiating relationship, if there is only one subject in the most recent related event, then the subject of the related event is queried in the most recent related event and used to complete the missing subject;

[0031] Rule 3: If there is a direct component missing, and the sdp in the ERT is an initiating relationship, if there are several subjects in the most recently connected event, then the subject farthest from the current event in the most recently connected event is used to complete the missing subject;

[0032] Rule 4: If the subject of the most recent related event does not belong to POL and the subject has an attributive, then the first attributive of the subject is used to complete the default subject;

[0033] Rule 5: If the subject of the most recent related event does not belong to POL and the subject does not have an attributive, the entire related event is used to complete the default subject;

[0034] Rule 6: If the subject of the most recent related event is a noun or belongs to POL, the subject of the related event is directly used to complete the default subject;

[0035] Rule 7: If the preposition-induced component is missing and sdp is an induced relationship, then find the subject in the most recent related event to complete the missing subject or object;

[0036] Rule 8: If the component caused by the passive voice is missing, and sdp is an initiating relationship, the subject of the most recent related event is used to complete the object component of the missing event;

[0037] Rule 9: If the subject of the related event has a POL part of speech, and the subject has an attributive, and the attributive also has a POL part of speech, then the attributive farthest from the current event in the most recent related event is used to complete the missing modification part of the subject;

[0038] Rule 10: If the subject of the related event belongs to POL and there is no attributive in the subject, then the subject farthest from the current event in the most recent related event is used to complete the missing modification part of the subject;

[0039] The ERT is a time relation binary (dp, sdp), where dp is a syntactic dependency and sdp is a semantic dependency; the POL is a part-of-speech set {ni, nz, nh, j}, where ni is an organization, nz is a proper noun, nh is a name, and j is an abbreviation.

[0040] Step S4 constructs event pairs based on the Chinese events extracted in step S3, including the following steps:

[0041] For cross-document data, document clustering is performed to reduce the complexity of matching: the Word2vec algorithm is used to represent the document as a high-dimensional vector, and then the document vector is embedded into a low-dimensional latent space based on a convolutional neural network and an autoencoder. Finally, the spectral clustering algorithm is used to cluster the obtained low-dimensional representation of the document.

[0042] Perform data enhancement on the clustered data to complete the construction of event pairs.

[0043] The step S4 specifically comprises the following steps:

[0044] The Word2vec algorithm is used to represent documents as high-dimensional vectors;

[0045] Based on convolutional neural networks and autoencoders, document vectors are embedded into a low-dimensional latent space:

[0046] The constructed autoencoder includes an encoder and a decoder; the encoder is constructed using a convolutional neural network, and the decoder is constructed using a deconvolutional network;

[0047] The encoder has N convolution kernels, and the kth convolution kernel is N k , with a bias of b k and c k ; For the input data x, the input h of the kth convolution kernel k and the decoder's reconstructed data It is expressed as:

[0048] h k =σ(x*w k +b k )

[0049]

[0050] Where w k is the weight matrix of the kth feature map; * is the two-dimensional convolution operation; σ() is the mapping function; h k Is the input of the kth convolution kernel; w k The transpose of

[0051] During training, the following error function L is used for training:

[0052]

[0053] In the formula is the decoder output; η is the regularization coefficient; w is the model weight vector; || || is regularization, and the 2 in the upper right corner represents L2 regularization;

[0054] The spectral clustering algorithm is used to cluster the obtained low-dimensional representation of the document:

[0055] Document preprocessing: perform Chinese word segmentation, remove stop words and represent the document with vectors; Chinese word segmentation is completed using Jieba, a word segmentation library; based on the Word2vec method, the Skip-gram method is used to obtain word vectors, and each document is regarded as a combination of the words it contains. The word vectors of the words contained in the document are stacked to form a document-word matrix, which is used to represent the corresponding document; set D j is the vector representation of the jth document, n j is the number of words contained in the jth document, w i is the word vector obtained by Skip-gram, then the final document matrix is ​​expressed as

[0056] An autoencoder is used to embed the high-dimensional document matrix into a low-dimensional latent vector space;

[0057] The obtained low-dimensional vector representation is used to perform spectral clustering to obtain the final clustering result;

[0058] Perform data enhancement on the clustered data to complete the construction of event pairs:

[0059] The following rules are used for data enhancement:

[0060] Rule 1: Mutuality, if a and b are related, then b and a are also related;

[0061] Rule 2: Transitivity, if a and b are in a temporal relationship, and b and c are in a temporal equivalence relationship, then a and c are also in a temporal relationship;

[0062] Rule 3: Transitivity, if a and b are in a temporal relationship, and b and c are in a co-reference relationship, then a and c are also in a temporal relationship;

[0063] Rule 4: Transitivity, if a and b are in a causal relationship, and b and c are in a coreference relationship, then a and c are also in a causal relationship;

[0064] Rule 5: Transitivity, if a and b are in a containment relationship and a contains b, and b and c are in a coreference relationship, then a and c are also in a containment relationship and a contains c;

[0065] Rule 6: Transitivity, if a and b are in a containment relationship and a contains b, and a and c are in a coreference relationship, then c and b are also in a containment relationship and c contains b;

[0066] Rule 7: Transitivity, if a and b are in a content information mention relationship and a mentions b, and b and c are in a coreference relationship, then a and c are also in a content information mention relationship and a mentions c;

[0067] Rule 8: Transitivity, if a and b are in a content information mention relationship and a mentions b, and a and c are in a coreference relationship, then c and b are also in a content information mention relationship and c mentions b;

[0068] Rule 9: Transitivity, if a and b are in a coreference relationship, and a and c are in a coreference relationship, then b and c are also in a coreference relationship;

[0069] Rule 10: Transitivity, if a and b are in a temporal equivalence relationship, and a and c are in a temporal equivalence relationship, then b and c are also in a temporal equivalence relationship;

[0070] Event type embedding: put the information uniformly into the beginning of the recovered event sentence, and add setting marks on both sides of the information to distinguish the original information.

[0071] Step S5 embeds event element information for the event pair obtained in step S4, and specifically includes the following steps:

[0072] Building an embedding model based on the BERT model, and using the embedding model to embed event element information into the event pairs obtained in step S4;

[0073] The built embedding model includes Event Core Embedding layer, Token Embeddings layer, SegmentEmbeddings layer and Position Embeddings layer;

[0074] Event Core Embedding layer: First, obtain several core elements of the event; then for each core element, record the start and end positions of the core element in the event recovery sentence; finally, mark the tokens in the start range and end range with Em c , other content tagged as Em -c ,

[0075] Token Embeddings layer: converts each word into a vector of fixed dimension; at the same time, inserts the set token information at the result and beginning of tokenization;

[0076] Segment Embeddings layer: The two sentences in a sentence pair are concatenated and input into the Segment Embeddings layer. The Segment Embeddings layer includes two vector representations. The first vector assigns 0 to each token in the first sentence, and the second vector assigns 1 to each token in the second sentence, thereby distinguishing different sentences in the sentence pair.

[0077] Position Embeddings layer: used to obtain the position information of the sequence;

[0078] Finally, the outputs of the Event Core Embedding layer, Token Embeddings layer, Segment Embeddings layer, and Position Embeddings layer are directly added together and output after passing through a layer of LayerNorm+dropout to complete the embedding of event element information.

[0079] The step S6 of constructing and training a BERT relation classifier to obtain an event relation prediction model specifically includes the following steps:

[0080] Add the specified token information to the input sequence so that the BERT model can accept sentence-level input;

[0081] At the output end of the BERT model, add a fully connected layer and a softmax layer to output the final classification probability;

[0082] During the training process, the following function is used as the loss function LL:

[0083]

[0084] Where n is the number of data in the same batch during training; w i is the BERT model weight of the i-th data; t i is the predicted target category vector of the i-th data; output i is the output of the original BERT model for the i-th data; sigmoid() is the activation function, and

[0085] The model is trained based on the Adam algorithm.

[0086] The training of the model based on the Adam algorithm specifically includes the following steps:

[0087] The following formula is used as the iterative update formula for the weight value:

[0088] v'=b1v+(1-b1)dw

[0089] s'=b2s+(1-b2)dw 2

[0090]

[0091] Where v' is the first-order momentum after update; b1 is the first exponential decay rate of the Adam algorithm for moment estimation; v is the first-order momentum before update; dw is the first-order gradient of parameter w; s' is the second-order momentum after update; b2 is the second exponential decay rate of the Adam algorithm for moment estimation; dw2 is the second-order gradient of parameter w; w' is the optimized parameter after update; w is the optimized parameter before update; α is the learning rate; ε is the learning step size; s is the second-order momentum before update.

[0092] The present invention also provides a system for implementing the document-level Chinese event relationship detection method, comprising a data acquisition module, a graph construction module, an event extraction module, an event pair construction module, an information embedding module, a relationship prediction module and a relationship detection module; the data acquisition module, the graph construction module, the event extraction module, the event pair construction module, the information embedding module, the relationship prediction module and the relationship detection module are connected in series in sequence; the data acquisition module is used to acquire existing Chinese documents and upload the data information to the graph construction module; the graph construction module is used to construct a syntactic and semantic dependency analysis graph for the acquired Chinese documents based on the received data information, and upload the data information to the event extraction module; the event extraction module is used to construct a syntactic and semantic dependency analysis graph based on the received data information Dependency analysis graph, extract Chinese events, and upload data information to the event pair construction module; the event pair construction module is used to construct event pairs according to the received data information and the extracted Chinese events, and upload the data information to the information embedding module; the information embedding module is used to embed event element information for the obtained event pairs according to the received data information, and upload the data information to the relationship prediction module; the relationship prediction module is used to construct and train the BERT relationship classifier according to the received data information, obtain the event relationship prediction model, and upload the data information to the relationship detection module; the relationship detection module is used to perform document-level Chinese event relationship detection based on the received data information and the obtained event relationship prediction model.

[0093] The document-level Chinese event relationship detection method and system provided by the present invention ensure the basis of event relationship judgment based on the construction of syntactic semantic dependency analysis graph, extraction of Chinese events and construction of event pairs, and at the same time realize document-level Chinese event relationship detection based on BERT relationship classifier; and the reliability of the present invention is higher and the accuracy is higher. BRIEF DESCRIPTION OF THE DRAWINGS

[0094] Figure 1 The figure is a schematic diagram of the method flow of the present invention.

[0095] Figure 2 Schematic diagram of the functional modules of the system of the present invention. DETAILED DESCRIPTION

[0096] like Figure 1 The functional module diagram of the system of the present invention is shown as follows: The document-level Chinese event relationship detection method disclosed in the present invention comprises the following steps:

[0097] S1. Obtain existing Chinese documents;

[0098] S2. Constructing a syntactic and semantic dependency analysis graph for the Chinese document obtained in step S1; specifically comprising the following steps:

[0099] Construction of syntactic-semantic dependency analysis tree based on syntactic-semantic dependency analysis:

[0100] Dependency syntactic structure contains rich information. Both deep learning and rule matching methods regard it as an important clue. Syntactic dependency can be used to identify missing components in the structure, thereby starting component completion. However, the dependency syntactic analysis method alone cannot completely solve the above-mentioned missing completion problem. It is also necessary to establish semantic associations between events. Therefore, an event extraction method that combines syntactic and semantic analysis is adopted, namely the syntactic semantic analysis (SSDP) method.

[0101] Use grammar parsing tools (preferably LTP tools) to perform word segmentation, part-of-speech tagging, and grammatical semantic analysis on the document;

[0102] According to the results of grammatical and semantic analysis, the document is converted into a dependency syntactic analysis tree; the nodes in the dependency syntactic analysis tree represent words, the edges represent grammatical and semantic dependency relationships, and the nodes before and after the parent node are the child nodes on the left and right sides;

[0103] Number all word nodes in ascending order according to the order in which they appear in the document, with the root node numbered 0;

[0104] The dependency parsing annotation relationship and meaning are shown in Table 1:

[0105] Table 1 Dependency parsing annotation relationship and meaning diagram

[0106]

[0107] Semantic Dependency Parsing (SDP) focuses on the semantic relationship between trigger words and arguments, trigger words and trigger words, arguments and arguments, and the semantic relationship within arguments. It can provide semantic analysis for us to adjust the structure of some nodes in the DP tree, and also provide a way for us to establish associations between events.

[0108] Pruning the dependency syntactic analysis tree: keeping only the main components to reduce the number of nodes in the dependency syntactic analysis tree; the main components include the subject, trigger words and object; performing semantic dependency analysis on the pruned dependency syntactic analysis tree to obtain the semantic association between the trigger words; and adding the obtained semantic association to the original dependency syntactic analysis tree;

[0109] In addition, trigger words represent events to a certain extent, and the semantic dependency between events is represented by eXX; for non-eXX relationships between trigger words, they are queried and obtained in the dependent child nodes and used as semantic associations between trigger words; the eXX includes eCOO, ePurp and eSUCC: eCOO represents a parallel relationship, referring to several parallel semantic events, such as: the brothers talked while walking; (walk, talk, parallel eCOO); ePurp represents a precedent relationship, referring to events that occur in order in time and space or events that occur before in logic and semantics with a correlation greater than the set strength, such as: to succeed, you must work hard; (success, hard work, precedent ePurp); eSUCC represents a successor relationship, referring to semantically further result-type events, including subsequent events in time, space, logic or semantics, such as he got dressed and walked out the door. (wear, walk, successor eSUCC);

[0110] Adjustment of syntactic and semantic dependency analysis tree based on trigger words and semantic structure:

[0111] In the same sentence, although the occurrence of each event has a sequence, they should be in the same position in the syntactic structure (including the trigger word, subject and object of each event, etc.), which can make the syntactic structure clear at a glance and facilitate the identification and extraction of events;

[0112] Trigger word adjustment: the level of each trigger word node in the trigger word chain is raised, so that all trigger word nodes and core root nodes in the adjusted syntactic semantic dependency analysis tree have the same level; the core root node only includes the core words of the sentence before adjustment, and includes the direct child nodes of the root node after adjustment; this adjustment is the key to adjust the SSDP (Syntactic Semantic Dependency Parsing, SSDP, Syntactic Semantic Dependency Parsing) tree to an SSDP graph, which is not only conducive to the division of events, but also indirectly promotes the nodes of the same components to be at the same level to a certain extent;

[0113] Adjustment of preposition structure: the node level of the subject or object introduced by the preposition is raised, so that the adjusted node is the direct child node of the corresponding core root node;

[0114] Passive voice adjustment: improve the level of nodes corresponding to passive sentences and modify syntactic dependencies;

[0115] Finally, the construction of the syntactic and semantic dependency analysis graph is completed;

[0116] S3. Extracting Chinese events based on the syntactic semantic dependency analysis graph constructed in step S2; specifically comprising the following steps:

[0117] Scan the core root node and corresponding child nodes in the syntactic semantic dependency analysis graph in sequence;

[0118] Extract the event subject, predicate, and object, and complete them using the following rules:

[0119] Rule 1: If the event triggered by the core root node does not have an earlier event with a semantic dependency, completion will not be performed;

[0120] Rule 2: If there is a direct component missing, and the sdp in the ERT is a non-initiating relationship, if there is only one subject in the most recent related event, then the subject of the related event is queried in the most recent related event and used to complete the missing subject;

[0121] Rule 3: If there is a direct component missing, and the sdp in the ERT is an initiating relationship, if there are several subjects in the most recently connected event, then the subject farthest from the current event in the most recently connected event is used to complete the missing subject;

[0122] Rule 4: If the subject of the most recent related event does not belong to POL and the subject has an attributive, then the first attributive of the subject is used to complete the default subject;

[0123] Rule 5: If the subject of the most recent related event does not belong to POL and the subject does not have an attributive, the entire related event is used to complete the default subject;

[0124] Rule 6: If the subject of the most recent related event is a noun or belongs to POL, the subject of the related event is directly used to complete the default subject;

[0125] Rule 7: If the preposition-induced component is missing and sdp is an induced relationship, then find the subject in the most recent related event to complete the missing subject or object;

[0126] Rule 8: If the component caused by the passive voice is missing, and sdp is an initiating relationship, the subject of the most recent related event is used to complete the object component of the missing event;

[0127] Rule 9: If the subject of the associated event has a POL part of speech, and the subject has an attributive, and the attributive also has a POL part of speech, then the attributive farthest from the current event in the most recent associated event (the first attributive of the associated event) is used to complete the missing modification part of the subject;

[0128] Rule 10: If the subject of the associated event belongs to POL and there is no attributive in the subject, then the subject farthest from the current event in the most recent associated event (the first subject of the associated event) is used to complete the missing modification part of the subject;

[0129] The ERT is a temporal relation tuple (dp, sdp), where dp is a syntactic dependency and sdp is a semantic dependency; the POL is a part-of-speech set {ni, nz, nh, j}, where ni is an organization, nz is a proper noun, nh is a name, and j is an abbreviation;

[0130] S4. According to the Chinese events extracted in step S3, construct an event pair; comprising the following steps:

[0131] For cross-document data, document clustering is performed to reduce the complexity of matching: the Word2vec algorithm is used to represent the document as a high-dimensional vector, and then the document vector is embedded into a low-dimensional latent space based on a convolutional neural network and an autoencoder. Finally, the spectral clustering algorithm is used to cluster the obtained low-dimensional representation of the document.

[0132] Perform data enhancement on the clustered data to complete the construction of event pairs;

[0133] When implementing it, you can take the following steps:

[0134] The Word2vec algorithm is used to represent documents as high-dimensional vectors;

[0135] Based on convolutional neural networks and autoencoders, document vectors are embedded into a low-dimensional latent space:

[0136] An autoencoder is a feedforward neural network. The simplest autoencoder consists of three layers of neural networks: input layer, hidden layer and output layer. The input layer to the hidden layer is called the encoder part, and the hidden layer to the output layer is called the decoder part. The number of input nodes of the encoder is equal to the number of output nodes of the decoder. The purpose is to learn an identity mapping through training so that the input and output are as equal as possible, so as to find the potential hidden associations between the original data. Assume that the original data is x = {x1, x2, ..., x m} indicates that the decoder output is The middle hidden layer is represented by h = {h1,h2,...,h k} indicates that the mapping function is σ e and σ d , the connection weights of the two adjacent layers of the network are and The bias terms are expressed as and It means that the connection weights and bias terms between the input layer and the output layer and the intermediate hidden layer are continuously adjusted through the back propagation algorithm training, so that That is, the reconstructed output obtained by the decoder is as equal to the original data as possible. The output of the encoder h j And the final reconstructed output of the original data x They are

[0137]

[0138]

[0139] Therefore, the present invention is based on the above scheme, and the autoencoder constructed includes an encoder and a decoder; the encoder is constructed by using a convolutional neural network, and the decoder is constructed by using a deconvolutional network; the convolutional neural network can effectively extract the intrinsic features of the original data in layers;

[0140] The encoder has N convolution kernels, and the kth convolution kernel is N k , with a bias of b k and c k ; For the input data x, the input h of the kth convolution kernel k and the decoder's reconstructed data It is expressed as:

[0141] h k =σ(x*w k +b k )

[0142]

[0143] Where w k is the weight matrix of the kth feature map; * is the two-dimensional convolution operation; σ() is the mapping function; h k Is the input of the kth convolution kernel; w k The transpose of

[0144] During training, the following error function L is used for training:

[0145]

[0146] In the formula is the decoder output; η is the regularization coefficient; w is the model weight vector; || || is regularization, and the 2 in the upper right corner represents L2 regularization;

[0147] The spectral clustering algorithm is used to cluster the obtained low-dimensional representation of the document:

[0148] Document preprocessing: perform Chinese word segmentation, remove stop words and represent the document with vectors; Chinese word segmentation is completed using Jieba, a word segmentation library; based on the Word2vec method, the Skip-gram method is used to obtain word vectors (this method predicts the words around the current word based on the current word, thereby learning the vector representation of the current word), and each document is regarded as a combination of the words it contains. The word vectors of the words contained in the document are stacked to form a document-word matrix, which is used to represent the corresponding document; set D jis the vector representation of the jth document, n j is the number of words contained in the jth document, w i is the word vector obtained by Skip-gram, then the final document matrix is ​​expressed as

[0149] The document vectors obtained above are usually of high dimension and contain a lot of redundant information. If clustering is performed directly, it is difficult to capture its internal potential associations. Therefore, a convolutional autoencoder is used to embed the obtained high-dimensional document matrix into a low-dimensional latent vector space through training and learning. While reducing the vector dimension, the internal structure of the original data is retained to the greatest extent, so as to shorten the time required for clustering.

[0150] An autoencoder is used to embed the high-dimensional document matrix into a low-dimensional latent vector space;

[0151] The obtained low-dimensional vector representation is used to perform spectral clustering to obtain the final clustering result;

[0152] Perform data enhancement on the clustered data to complete the construction of event pairs:

[0153] The following rules are used for data enhancement:

[0154] Rule 1: Reciprocity. If a and b are related, then b and a are also related. This may be the same (such as a coreference relationship) or the opposite (such as a causal relationship).

[0155] Rule 2: Transitivity, if a and b are in a temporal relationship, and b and c are in a temporal equivalence relationship, then a and c are also in a temporal relationship;

[0156] Rule 3: Transitivity, if a and b are in a temporal relationship, and b and c are in a co-reference relationship, then a and c are also in a temporal relationship;

[0157] Rule 4: Transitivity, if a and b are in a causal relationship, and b and c are in a coreference relationship, then a and c are also in a causal relationship;

[0158] Rule 5: Transitivity, if a and b are in a containment relationship and a contains b, and b and c are in a coreference relationship, then a and c are also in a containment relationship and a contains c;

[0159] Rule 6: Transitivity, if a and b are in a containment relationship and a contains b, and a and c are in a coreference relationship, then c and b are also in a containment relationship and c contains b;

[0160] Rule 7: Transitivity, if a and b are in a content information mention relationship and a mentions b, and b and c are in a coreference relationship, then a and c are also in a content information mention relationship and a mentions c;

[0161] Rule 8: Transitivity, if a and b are in a content information mention relationship and a mentions b, and a and c are in a coreference relationship, then c and b are also in a content information mention relationship and c mentions b;

[0162] Rule 9: Transitivity, if a and b are in a coreference relationship, and a and c are in a coreference relationship, then b and c are also in a coreference relationship;

[0163] Rule 10: Transitivity, if a and b are in a temporal equivalence relationship, and a and c are in a temporal equivalence relationship, then b and c are also in a temporal equivalence relationship;

[0164] Event type embedding: Event type is important information to distinguish an event, but this information is not in the recovered event sentence; therefore, the information is uniformly placed at the beginning of the recovered event sentence, and setting markers are added on both sides of the information (such as <type>) to distinguish the original information; for example, "He asked Tom to get his coat." becomes " <type>Order <type>He asked Tom to get his coat. ";

[0165] S5. For the event pair obtained in step S4, embedding event element information; specifically comprising the following steps:

[0166] Building an embedding model based on the BERT model, and using the embedding model to embed event element information into the event pairs obtained in step S4;

[0167] BERT, the full name of which is Bidirectional Encoder Representation from Transformers, is a deep bidirectional pre-trained Transformer based on semantic understanding. Transformer is a neural network architecture based on the attention mechanism that can process sequence data and improve the effect of translation and recording;

[0168] Therefore, the constructed embedding model includes the Event Core Embedding layer, the Token Embeddings layer, the Segment Embeddings layer and the Position Embeddings layer; wherein the Event Core Embedding layer is a newly added module layer of the present invention;

[0169] Event Core Embedding layer: First, obtain several core elements of the event; then for each core element, record the start and end positions of the core element in the event recovery sentence; finally, mark the tokens in the start range and end range with Em c , other content tagged as Em -c , in specific implementation, Em c Represented by 1, Em -c It is represented by 0; this layer can be understood as a marker of the importance of information in the event sentence. The position of important information (core elements of the event) is marked as 1, and the position of unimportant information (non-core elements of the event) is marked as 0;

[0170] Token Embeddings layer: converts each word into a vector of fixed dimension. At the same time, inserts the set token information at the result and beginning of tokenization. For example, [CLS] is inserted at the beginning and [SEP] is inserted at the end. They serve the subsequent classification tasks and sentence pair division.

[0171] Segment Embeddings layer: The two sentences in a sentence pair are concatenated and input into the Segment Embeddings layer. The Segment Embeddings layer includes two vector representations. The first vector assigns 0 to each token in the first sentence, and the second vector assigns 1 to each token in the second sentence, thereby distinguishing different sentences in the sentence pair.

[0172] Position Embeddings layer: used to obtain the position information of the sequence; because BERT's network structure does not have RNN or LSTM, it is impossible to obtain the position information of the sequence, so a position embedding needs to be constructed; BERT initializes a position embedding and then learns it through training; Transformers cannot encode the order of the input sequence, and adding position embeddings will allow BERT to understand the following situation: I think, therefore I am, the first "I" and the second "I" should have different vector representations; BERT can handle input sequences of up to 512 tokens; this means that the Position Embedding layer is actually a lookup table of size (512,768), the first row of the table represents the first position of the first sequence, the second row represents the second position of the sequence, and so on; therefore, if there are two sentences like "Hello world" and "Hi there", "Hello" and "Hi" will have exactly the same position embedding because they are the first word of the sentence. Similarly, "world" and "there" will have the same position embedding;

[0173] Thus, we will obtain four different vector representations for the input sequence of length n, which are:

[0174] Token Embeddings, (1,n,768), vector representation of words;

[0175] Segment Embeddings, (1, n, 768), help BERT distinguish the vector representation of the two sentences in a sentence pair;

[0176] Position Embeddings, (1, n, 768), allow BERT to learn vector representations of the sequential attributes of the input;

[0177] event core embedding, (1, n, 768), a vector representation of the importance of information in the event sentence;

[0178] Finally, the outputs of the Event Core Embedding layer, Token Embeddings layer, Segment Embeddings layer, and Position Embeddings layer are directly added together and output after passing through a layer of LayerNorm+dropout to complete the embedding of event element information.

[0179] S6. Build and train a BERT relation classifier to obtain an event relation prediction model; specifically, the following steps are included:

[0180] For the input sequence, add the set token information (corresponding to adding [CLS] and [SEP], [SEP] is used to separate the two sentences in the sequence, and the output of the corresponding position of [CLS] is used to obtain the classification result) so that the BERT model can accept sentence-level input;

[0181] At the output end of the BERT model, add a fully connected layer and a softmax layer to output the final classification probability;

[0182] During the training process, the following function is used as the loss function LL:

[0183]

[0184] Where n is the number of data in the same batch during training; w i is the BERT model weight of the i-th data; t i is the predicted target category vector of the i-th data; output i is the output of the original BERT model for the i-th data, and the final output is the original output + activation function, that is, the output vector interval is mapped to (0,1); sigmoid() is the activation function, and

[0185] The model is trained based on the Adam algorithm; the specific steps include:

[0186] The following formula is used as the iterative update formula for the weight value:

[0187] v'=b1v+(1-b1)dw

[0188] s'=b2s+(1-b2)dw 2

[0189]

[0190] Where v' is the first-order momentum after update; b1 is the first exponential decay rate of the Adam algorithm for moment estimation; v is the first-order momentum before update; dw is the first-order gradient of parameter w; s' is the second-order momentum after update; b2 is the second exponential decay rate of the Adam algorithm for moment estimation; dw 2 is the second-order gradient of parameter w; w' is the optimized parameter after update; w is the optimized parameter before update; α is the learning rate; ε is the learning step size; s is the second-order momentum before update;

[0191] S7. Use the event relationship prediction model obtained in step S6 to perform document-level Chinese event relationship detection.

[0192] like Figure 2 The figure shows a schematic diagram of the functional modules of the system of the present invention: the system disclosed in the present invention for realizing the document-level Chinese event relationship detection method comprises a data acquisition module, a graph construction module, an event extraction module, an event pair construction module, an information embedding module, a relationship prediction module and a relationship detection module; the data acquisition module, the graph construction module, the event extraction module, the event pair construction module, the information embedding module, the relationship prediction module and the relationship detection module are connected in series in sequence; the data acquisition module is used to acquire existing Chinese documents and upload the data information to the graph construction module; the graph construction module is used to construct a syntactic and semantic dependency analysis graph for the acquired Chinese documents according to the received data information, and upload the data information to the event extraction module; the event extraction module is used to construct a syntactic and semantic dependency analysis graph for the acquired Chinese documents according to the received data information, and upload the data information to the event extraction module; the event extraction module is used to construct a syntactic and semantic dependency analysis graph for the acquired Chinese documents according to the received data information, and upload the data information to the event extraction module Based on the constructed syntactic and semantic dependency analysis graph, Chinese events are extracted, and the data information is uploaded to the event pair construction module; the event pair construction module is used to construct event pairs according to the received data information and the extracted Chinese events, and upload the data information to the information embedding module; the information embedding module is used to embed event element information for the obtained event pairs according to the received data information, and upload the data information to the relationship prediction module; the relationship prediction module is used to construct and train the BERT relationship classifier according to the received data information, obtain the event relationship prediction model, and upload the data information to the relationship detection module; the relationship detection module is used to perform document-level Chinese event relationship detection based on the received data information and the obtained event relationship prediction model.< / type> < / type> < / type>

Claims

1. A document-level Chinese event relationship detection method comprises the following steps: S1. Obtain existing Chinese documents; S2. Constructing a syntactic and semantic dependency analysis graph for the Chinese document obtained in step S1; S3. Extract Chinese events based on the syntactic semantic dependency analysis graph constructed in step S2; S4. According to the Chinese events extracted in step S3, construct event pairs; S5. Embed event element information for the event pair obtained in step S4; S6. Build and train the BERT relation classifier to obtain an event relation prediction model; S7. Use the event relationship prediction model obtained in step S6 to perform document-level Chinese event relationship detection.

2. The document-level Chinese event relationship detection method according to claim 1 is characterized in that Step S2 constructs a syntactic and semantic dependency analysis graph for the Chinese document obtained in step S1, specifically including the following steps: Construction of syntactic-semantic dependency analysis tree based on syntactic-semantic dependency analysis: Use grammar parsing tools to perform word segmentation, part-of-speech tagging, and grammatical semantic analysis on documents; According to the results of grammatical and semantic analysis, the document is converted into a dependency syntactic analysis tree; the nodes in the dependency syntactic analysis tree represent words, the edges represent grammatical and semantic dependency relationships, and the nodes before and after the parent node are the child nodes on the left and right sides; Number all word nodes in ascending order according to the order in which they appear in the document, with the root node numbered 0; Pruning the dependency syntactic analysis tree: keeping only the main components to reduce the number of nodes in the dependency syntactic analysis tree; the main components include the subject, trigger words and object; performing semantic dependency analysis on the pruned dependency syntactic analysis tree to obtain the semantic association between the trigger words; and adding the obtained semantic association to the original dependency syntactic analysis tree; The semantic dependency between events is represented by eXX; for non-eXX relationships between trigger words, they are queried and obtained in the dependent child nodes and used as semantic associations between trigger words; the eXX includes eCOO, ePurp and eSUCC: eCOO represents a parallel relationship, which refers to several parallel semantic events; ePurp represents a precedent relationship, which refers to events that occur in order in time and space or events that occur before in logic and semantics with a correlation greater than the set strength; eSUCC represents a successor relationship, which refers to semantically further result-type events, including subsequent events that occur in time, space, logic or semantics; Adjustment of syntactic and semantic dependency analysis tree based on trigger words and semantic structure: Trigger word adjustment: improve the level of each trigger word node in the trigger word chain, so that all trigger word nodes and core root nodes in the adjusted syntactic and semantic dependency analysis tree have the same level; The core root node includes only the core words of the sentence before adjustment, and includes the direct child nodes of the root node after adjustment; Adjustment of preposition structure: the node level of the subject or object introduced by the preposition is raised, so that the adjusted node is the direct child node of the corresponding core root node; Passive voice adjustment: improve the level of nodes corresponding to passive sentences and modify syntactic dependencies; Finally, the construction of the syntactic and semantic dependency analysis graph is completed.

3. The document-level Chinese event relationship detection method according to claim 2 is characterized in that Step S3 extracts Chinese events based on the syntactic-semantic dependency analysis graph constructed in step S2, which specifically includes the following steps: Scan the core root node and corresponding child nodes in the syntactic semantic dependency analysis graph in sequence; Extract the event subject, predicate, and object, and complete them using the following rules: Rule 1: If the event triggered by the core root node does not have an earlier event with a semantic dependency, completion will not be performed; Rule 2: If there is a direct component missing, and the sdp in the ERT is a non-initiating relationship, if there is only one subject in the most recent related event, then the subject of the related event is queried in the most recent related event and used to complete the missing subject; Rule 3: If there is a direct component missing, and the sdp in the ERT is an initiating relationship, if there are several subjects in the most recently connected event, then the subject farthest from the current event in the most recently connected event is used to complete the missing subject; Rule 4: If the subject of the most recent related event does not belong to POL and the subject has an attributive, the first attributive of the subject is used to complete the default subject; Rule 5: If the subject of the most recent related event does not belong to POL and the subject does not have an attributive, the entire related event is used to complete the default subject; Rule 6: If the subject of the most recent related event is a noun or belongs to POL, the subject of the related event is directly used to complete the default subject; Rule 7: If the preposition-induced component is missing and sdp is an induced relationship, then find the subject in the most recent related event to complete the missing subject or object; Rule 8: If the component caused by the passive voice is missing, and sdp is an initiating relationship, the subject of the most recent related event is used to complete the object component of the missing event; Rule 9: If the subject of the related event has a POL part of speech, and the subject has an attributive, and the attributive also has a POL part of speech, then the attributive farthest from the current event in the most recent related event is used to complete the missing modification part of the subject; Rule 10: If the subject of the related event belongs to POL and there is no attributive in the subject, then the subject farthest from the current event in the most recent related event is used to complete the missing modification part of the subject; The ERT is a time relation binary (dp, sdp), where dp is a syntactic dependency and sdp is a semantic dependency; the POL is a part-of-speech set {ni, nz, nh, j}, where ni is an organization, nz is a proper noun, nh is a name, and j is an abbreviation.

4. The document-level Chinese event relationship detection method according to claim 3 is characterized in that Step S4 constructs event pairs based on the Chinese events extracted in step S3, including the following steps: For cross-document data, document clustering is performed to reduce the complexity of matching: the Word2vec algorithm is used to represent the document as a high-dimensional vector, and then the document vector is embedded into a low-dimensional latent space based on a convolutional neural network and an autoencoder. Finally, the spectral clustering algorithm is used to cluster the obtained low-dimensional representation of the document. Perform data enhancement on the clustered data to complete the construction of event pairs.

5. The document-level Chinese event relationship detection method according to claim 4 is characterized in that The step S4 specifically comprises the following steps: The Word2vec algorithm is used to represent documents as high-dimensional vectors; Based on convolutional neural networks and autoencoders, document vectors are embedded into a low-dimensional latent space: The constructed autoencoder includes an encoder and a decoder; the encoder is constructed using a convolutional neural network, and the decoder is constructed using a deconvolutional network; The encoder has N convolution kernels, and the kth convolution kernel is N k , with a bias of b k and c k ; For the input data x, the input h of the kth convolution kernel k and decoder reconstructed data It is expressed as: h k =σ(x*w k +b k ) Where w k is the weight matrix of the kth feature map; * is the two-dimensional convolution operation; σ() is the mapping function; h k Is the input of the kth convolution kernel; w k The transpose of During training, the following error function L is used for training: In the formula is the decoder output; η is the regularization coefficient; w is the model weight vector; || || is regularization, and the 2 in the upper right corner represents L2 regularization; The spectral clustering algorithm is used to cluster the obtained low-dimensional representation of the document: Document preprocessing: perform Chinese word segmentation, remove stop words and represent the document with vectors; Chinese word segmentation is completed using Jieba, a word segmentation library; based on the Word2vec method, the Skip-gram method is used to obtain word vectors, and each document is regarded as a combination of the words it contains. The word vectors of the words contained in the document are stacked to form a document-word matrix, which is used to represent the corresponding document; set D j is the vector representation of the jth document, n j is the number of words contained in the jth document, w i is the word vector obtained by Skip-gram, then the final document matrix is ​​expressed as An autoencoder is used to embed the high-dimensional document matrix into a low-dimensional latent vector space; The obtained low-dimensional vector representation is used to perform spectral clustering to obtain the final clustering result; Perform data enhancement on the clustered data to complete the construction of event pairs: The following rules are used for data enhancement: Rule 1: Mutuality, if a and b are related, then b and a are also related; Rule 2: Transitivity, if a and b are in a temporal relationship, and b and c are in a temporal equivalence relationship, then a and c are also in a temporal relationship; Rule 3: Transitivity, if a and b are in a temporal relationship, and b and c are in a co-reference relationship, then a and c are also in a temporal relationship; Rule 4: Transitivity, if a and b are in a causal relationship, and b and c are in a coreference relationship, then a and c are also in a causal relationship; Rule 5: Transitivity, if a and b are in a containment relationship and a contains b, and b and c are in a coreference relationship, then a and c are also in a containment relationship and a contains c; Rule 6: Transitivity, if a and b are in a containment relationship and a contains b, and a and c are in a coreference relationship, then c and b are also in a containment relationship and c contains b; Rule 7: Transitivity, if a and b are in a content information mention relationship and a mentions b, and b and c are in a coreference relationship, then a and c are also in a content information mention relationship and a mentions c; Rule 8: Transitivity, if a and b are in a content information mention relationship and a mentions b, and a and c are in a coreference relationship, then c and b are also in a content information mention relationship and c mentions b; Rule 9: Transitivity, if a and b are in a coreference relationship, and a and c are in a coreference relationship, then b and c are also in a coreference relationship; Rule 10: Transitivity, if a and b are in a temporal equivalence relationship, and a and c are in a temporal equivalence relationship, then b and c are also in a temporal equivalence relationship; Event type embedding: put the information uniformly into the beginning of the recovered event sentence, and add setting marks on both sides of the information to distinguish the original information.

6. The document-level Chinese event relationship detection method according to claim 5 is characterized in that Step S5 embeds event element information for the event pair obtained in step S4, and specifically includes the following steps: Building an embedding model based on the BERT model, and using the embedding model to embed event element information into the event pairs obtained in step S4; The built embedding model includes Event Core Embedding layer, Token Embeddings layer, SegmentEmbeddings layer and Position Embeddings layer; Event Core Embedding layer: First, obtain several core elements of the event; then for each core element, record the start and end positions of the core element in the event recovery sentence; finally, mark the tokens in the start range and end range with Em c , other content tagged as Em -c , Token Embeddings layer: converts each word into a vector of fixed dimension; at the same time, inserts the set token information at the result and beginning of tokenization; Segment Embeddings layer: The two sentences in a sentence pair are concatenated and input into the Segment Embeddings layer. The Segment Embeddings layer includes two vector representations. The first vector assigns 0 to each token in the first sentence, and the second vector assigns 1 to each token in the second sentence, thereby distinguishing different sentences in the sentence pair. Position Embeddings layer: used to obtain the position information of the sequence; Finally, the outputs of the Event Core Embedding layer, Token Embeddings layer, Segment Embeddings layer, and Position Embeddings layer are directly added together and output after passing through a layer of LayerNorm+dropout to complete the embedding of event element information.

7. The document-level Chinese event relationship detection method according to claim 6 is characterized in that The step S6 of constructing and training a BERT relation classifier to obtain an event relation prediction model specifically includes the following steps: Add the specified token information to the input sequence so that the BERT model can accept sentence-level input; At the output end of the BERT model, add a fully connected layer and a softmax layer to output the final classification probability; During the training process, the following function is used as the loss function LL: Where n is the number of data in the same batch during training; w i is the BERT model weight of the i-th data; t i is the predicted target category vector of the i-th data; output i is the output of the original BERT model for the i-th data; sigmoid() is the activation function, and The model is trained based on the Adam algorithm.

8. The document-level Chinese event relationship detection method according to claim 7 is characterized in that The training of the model based on the Adam algorithm specifically includes the following steps: The following formula is used as the iterative update formula for the weight value: v'=b1v+(1-b1)dw s'=b2s+(1-b2)dw 2 Where v' is the first-order momentum after update; b1 is the first exponential decay rate of the Adam algorithm for moment estimation; v is the first-order momentum before update; dw is the first-order gradient of parameter w; s' is the second-order momentum after update; b2 is the second exponential decay rate of the Adam algorithm for moment estimation; dw 2 is the second-order gradient of parameter w; w' is the optimized parameter after update; w is the optimized parameter before update; α is the learning rate; ε is the learning step size; s is the second-order momentum before update.

9. A system for implementing the document-level Chinese event relationship detection method according to any one of claims 1 to 8, characterized in that It includes a data acquisition module, a graph construction module, an event extraction module, an event pair construction module, an information embedding module, a relationship prediction module and a relationship detection module; the data acquisition module, the graph construction module, the event extraction module, the event pair construction module, the information embedding module, the relationship prediction module and the relationship detection module are connected in series in sequence; the data acquisition module is used to acquire existing Chinese documents and upload the data information to the graph construction module; the graph construction module is used to construct a syntactic and semantic dependency analysis graph for the acquired Chinese documents according to the received data information, and upload the data information to the event extraction module; The event extraction module is used to extract Chinese events based on the received data information and the constructed syntactic semantic dependency analysis graph, and upload the data information to the event pair construction module; The event pair construction module is used to construct event pairs according to the received data information and the extracted Chinese events, and embed the data information upload information into the module; The information embedding module is used to embed event element information for the obtained event pairs according to the received data information, and upload the data information to the relationship prediction module; The relationship prediction module is used to build and train the BERT relationship classifier based on the received data information, obtain the event relationship prediction model, and upload the data information to the relationship detection module; The relationship detection module is used to perform document-level Chinese event relationship detection based on the received data information and the obtained event relationship prediction model.