An event trend judgment method and device based on an event knowledge graph

CN117473099BActive Publication Date: 2026-09-22ZHEJIANG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311415128.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-30
Publication Date
2026-09-22
Estimated Expiration
2043-10-30

AI Technical Summary

Benefits of technology

[0061]本发明的优点是:本发明利用了BERT模型的文本理解能力和GAT模型的图结构分析能力,有效提升了因果关系提取的多样性和准确性,并在事件趋势判断中增强了对事件关联关系的深度学习,使预测结果更加精准和可靠。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117473099B_ABST
    Figure CN117473099B_ABST
Patent Text Reader

Abstract

An event trend judgment method and device based on an event knowledge graph, the method comprising: S1, collecting information texts in a relevant field, preprocessing input text data to obtain processed text information; S2, using a cause-effect sentence recognition, cause-effect relationship annotation and cause-effect pair recognition model to extract cause-effect relationships from the processed text information to obtain a complete event knowledge graph; S3, training a prediction model based on the event knowledge graph using a total loss function, the total loss function comprising an event prediction loss function and a graph structure prediction loss function, the event prediction loss function being used to measure errors when the model predicts the correlation degree between events, and the graph structure prediction loss function being used to measure differences between a predicted graph structure and an actual graph structure; and S4, based on the trained model, inferring the connection strength between events in the predicted graph structure through a graph attention network to realize event prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence, and in particular to a method and apparatus for judging event trends based on event knowledge graphs. Background Technology

[0002] In the current fields of information processing and decision support, causal relationship extraction and event trend judgment have always been important research directions. While existing causal relationship extraction methods have achieved certain results in identifying causal relationships and predicting events, some limitations remain. For example, they can only predict single causal relationships, whereas multiple possible causal relationships exist in practical applications, thus limiting their identification capabilities. Furthermore, in terms of event trend judgment, existing methods are often constrained by data dimensionality and the modeling of correlations, leading to room for improvement in the accuracy and stability of prediction results. Summary of the Invention

[0003] The present invention aims to overcome the above-mentioned shortcomings of the prior art and provide a method and apparatus for judging event trends based on event knowledge graph.

[0004] This invention uses the BERT model to accurately identify causal relationships in text, and then constructs a powerful event knowledge graph from these causal relationships and related events. Events in the knowledge graph are represented as nodes, while the causal relationships between events are represented as edges in the graph. Next, a graph neural network (GAT) is used to analyze the event knowledge graph to predict event trends.

[0005] To achieve the above objectives, the present invention provides a method for determining event trends based on event knowledge graphs, comprising the following steps:

[0006] S1. Collect relevant text information, preprocess the input text data, and obtain the processed text information;

[0007] S2. Using causal sentence recognition, causal relationship labeling, and causal pair recognition models, causal relationships are extracted from the processed text information to obtain a complete event knowledge graph.

[0008] S3. Train the prediction model based on the event knowledge graph using the total loss function. The total loss function includes the event prediction loss function and the graph structure prediction loss function. The event prediction loss function is used to measure the error of the model when predicting the degree of correlation between events, and the graph structure prediction loss function is used to measure the difference between the predicted graph structure and the actual graph structure.

[0009] S4. Based on the trained model, a graph attention network is used to infer the connection strength between events in the predicted graph structure, thereby achieving event prediction.

[0010] As a preferred embodiment, step S1 includes:

[0011] When collecting information from text, the first step is to identify the relevant domain and gather text data related to that domain. This can include obtaining text information from the internet, databases, or other sources. Once the text data is acquired, the next step is preprocessing it. Preprocessing includes steps such as text cleaning, word segmentation, stop word removal, stemming, or lemmatization to ensure the quality and consistency of the text data. The cleaning step removes noise, special characters, or HTML tags and other non-critical information from the text. Word segmentation breaks the text down into words or phrases. Stop word removal filters out common but irrelevant words, while stemming or lemmatization helps restore words to their original forms for better understanding of the text's meaning. This preprocessing aims to prepare the text data for various natural language processing tasks, such as text classification, information retrieval, or text mining, to extract useful information and insights.

[0012] As a preferred embodiment, step S2 includes:

[0013] S2.1. Use the prediction model for causal sentence recognition to process all sentences. When the causal sentence recognition model identifies a sentence that contains a causal relationship, mark the sentence as a potential causal sentence.

[0014] S2.2 For sentences marked as containing causal relationships, use the causal relationship labeling task to extract text fragments containing cause and effect parameters;

[0015] S2.3 For sentences marked as containing causal relationships, use the causal pair recognition task to further refine the causal relationships;

[0016] S2.4. Use the SimCSE model to group semantically similar arguments together and separate semantically different arguments to achieve word embedding;

[0017] S2.5. Use hierarchical clustering algorithm to merge arguments with the same cause and arguments with the same result.

[0018] As a preferred embodiment, in step S2.1, the causal sentence recognition task can identify whether a sentence contains a causal relationship. The embedding of the [CLS] tag obtained based on BERT encoding is processed through a Dropout layer, and then a classification layer is used to generate the predicted log.

[0019]

[0020] Among them, P cr Let P represent the probability that the sentence contains a causal relationship, and z represent the logarithmic value of the model output. crIf the value exceeds the threshold of 0.5, the sentence contains a causal relationship; otherwise, the sentence is classified as not containing a causal relationship.

[0021] As a preferred embodiment, in step S2.2, causal relationship labeling is a sequence labeling task that labels the causes and effects in a sentence as text segments. The predicted value corresponding to each word or tag in the text sequence obtained by BERT encoding is passed through the Dropout layer and the classification layer to obtain the predicted log number of each token. A label is assigned to each word or tag in the input text to indicate whether they belong to the cause, effect, or other part of the causal relationship.

[0022] As a preferred embodiment, in step S2.3, the causal pair recognition task can identify whether there is a causal relationship between a pair of marked parameters (Cas, Res) in a sentence, where Cas causes Res. For each pair of Cas, Res combinations, a probability score is generated to indicate whether there is a causal relationship.

[0023] If a sentence marked as containing a causal relationship has multiple causal relationships, each causal relationship corresponds to a different combination of Cas and Res. Based on the prediction results of the causal pair recognition task, multiple causal relationships are retained.

[0024] As a preferred approach, in step S2.4, the high-dimensional vectors encoded by the BERT model are embedded into a low-dimensional space through contrastive learning. Texts with similar semantics are considered closer together, while texts with different semantics are considered further apart. The optimization objective is to maximize the contrastive similarity of positive samples and minimize the contrastive similarity of negative samples.

[0025] As a preferred approach, in step S2.5, the hierarchical clustering algorithm groups the feature vectors obtained in S2.4 and determines which arguments are semantically similar by calculating a similarity metric between them. The similarity metric can be calculated based on the distance or relevance between vectors. The clustering algorithm merges the most similar arguments at each level, gradually forming a hierarchical structure where similar arguments are grouped into the same category, and dissimilar arguments are grouped into different categories. Ultimately, the result of this hierarchical clustering can be used to merge arguments with the same cause or effect, thereby extracting causal relationships or other semantic information from the text.

[0026] As a preferred solution, the traffic domain event knowledge graph EG=(V,R) consists of the event set V={v1,v2,…,v...} n} and the relation set R = {r1, r2, ..., r t The relation r is composed of , ... ... t =(v i ,v j This indicates a causal relationship between two events, where v i As a causal argument, vj For the result argument.

[0027] As a preferred embodiment, step S3 includes:

[0028] S3.1 Obtain the graph structure A based on the relation set R;

[0029] S3.2 Construct an improved total loss function L;

[0030] As a preferred option, in step S3.1, based on each relation r t =(v i ,v j The weight W is calculated. ij The calculation formula is:

[0031]

[0032] Where, count(v i ,v j ) represents a (v i ,v j The frequency of W's occurrence ij Indicates v j It is v i The probability of subsequent events. Using weight W. ij Calculate the initial weights of graph structure A if event v i v j There exists a causal relationship between A and R, and A exists in the relation set R. ij Initialize to W ij Otherwise, A ij Initialize to 0.

[0033] As a preferred option, in step S3.2, the total loss function L mainly includes two parts: the event prediction loss Li. 事件预测 And graph structure prediction loss L 图结构预测 ;

[0034] The formula for calculating the total loss function L is as follows:

[0035] L = L 事件预测 +λL 图结构预测 (3)

[0036] Where λ is a hyperparameter used to balance the prediction loss and the graph structure prediction.

[0037] The cross-entropy loss function is used to measure the difference between the model's predictions and the actual labels, and the difference is calculated for each event pair (v). i ,v j The average cross-entropy loss:

[0038]

[0039] Among them, Y ij ∈[0,1] is the actual label, Y′ ij These are the predicted labels from the model.

[0040] Cross-entropy loss is used to measure the difference between the predicted graph structure and the actual graph structure. The graph structure prediction loss L is calculated. 图结构预测 formula:

[0041]

[0042] As a preferred embodiment, step S4 includes:

[0043] S4.1 Calculate the connection strength score between two events by stacking n GAT layers;

[0044] S4.2. Normalize the connection strength score between any two events using the softmax function to obtain the prediction graph structure A. ′ ;

[0045] S4.3, Based on the predicted graph structure A obtained in step S4.2 ′ Execute event relationship prediction.

[0046] As a preferred embodiment, in step S4.1, attention coefficients between events are calculated by stacking n GAT layers, then deep event representations are calculated, and connection strength scores between two events are calculated based on the deep event representations.

[0047] Formula for calculating the attention coefficient between event i and other events j in the l-th layer:

[0048]

[0049] in, These are trainable parameters, and || represents the vector concatenation operation.

[0050] Based on the attention weights with other events, the deep event representation formula for event i in layer l is calculated as follows:

[0051]

[0052] Where σ represents the activation function.

[0053] Based on the deep event representation after completing n GAT layers, the formula for calculating the original connection strength score between two events is as follows:

[0054]

[0055] in, These are trainable parameters, and T(·) is the transpose operation.

[0056] As a preferred embodiment, in step S4.2, the original connection strength score Γ between the two events obtained in S4.1 is used. ij The softmax function converts the original scores into a probability distribution, that is, it calculates the connection strength between events i and j in the prediction graph structure A′, such that all connection strength scores are between 0 and 1, and the sum is 1.

[0057] As a preferred embodiment, in step S4.3, the probability values ​​of the prediction graph structure A′ are compared to predict whether event i will be followed by event j in the event sequence. If A′ ij If the correlation exceeds a threshold, it can be assumed that there is some kind of association or dependency between event i and event j, which may be a causal relationship or other connection; conversely, it can be inferred that event i does not immediately follow event j in the event sequence. This analytical process helps to predict the subsequent trend of the event sequence, providing a reliable method based on the probability of event association to help better understand the relationships and development trends between events.

[0058] A second aspect of the present invention relates to an event trend judgment device based on an event knowledge graph, comprising a memory and one or more processors, wherein the memory stores executable code, and the one or more processors execute the executable code to implement an event trend judgment method based on an event knowledge graph according to the present invention.

[0059] A third aspect of the present invention relates to a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements an event trend judgment method based on an event knowledge graph according to the present invention.

[0060] The working principle of this invention is as follows: This invention proposes an event trend judgment method based on BERT and GAT. In the causal relationship extraction, the BERT model is used to extract multiple causal relationships in the text, and the GAT model is used to make more accurate predictions and judgments on the correlation between events.

[0061] The advantages of this invention are: it utilizes the text understanding capabilities of the BERT model and the graph structure analysis capabilities of the GAT model, effectively improving the diversity and accuracy of causal relationship extraction, and enhancing the deep learning of event correlation in event trend judgment, making the prediction results more accurate and reliable. Attached Figure Description

[0062] Figure 1 This is a flowchart of the method of the present invention.

[0063] Figure 2 This is a flowchart of a method for predicting traffic congestion according to an embodiment of the present invention. Detailed Implementation

[0064] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0065] It should be noted that, unless otherwise specified, the features in the following embodiments and implementation methods can be combined with each other.

[0066] Example 1

[0067] Reference Figure 1 , Figure 2 This embodiment provides a traffic congestion prediction method based on an event trend judgment method using an event knowledge graph according to the present invention, including the following steps:

[0068] S1. Collect relevant text information, preprocess the input text data to obtain processed text information; specifically including:

[0069] When collecting information text in the transportation sector, it involves gathering transportation-related text data, which can include text information obtained from the internet, databases, or other sources. Once the text data is acquired, the next step is preprocessing. Preprocessing includes steps such as text cleaning, word segmentation, stop word removal, stemming, or lemmatization to ensure the quality and consistency of the text data. The cleaning step removes noise, special characters, or HTML tags and other non-critical information from the text. Word segmentation breaks the text down into words or phrases. Stop word removal filters out common but irrelevant words, while stemming or lemmatization helps restore words to their original forms for better understanding of the text's meaning. This preprocessing process aims to prepare the text data for various natural language processing tasks, such as text classification, information retrieval, or text mining, to extract useful information and insights.

[0070] S2. Utilizing causal sentence recognition, causal relationship annotation, and causal pair recognition models, causal relationships are extracted from the processed text information to obtain a complete event knowledge graph; specifically including:

[0071] S2.1. The prediction model for causal sentence recognition is used to process all sentences. When the causal sentence recognition model identifies a sentence that contains a causal relationship, the sentence is marked as a potential causal sentence. The causal sentence recognition task can identify whether a sentence contains a causal relationship.

[0072] The embedding of the [CLS] tag obtained based on BERT encoding is processed through a Dropout layer, and then a classification layer is used to generate the predicted log.

[0073]

[0074] Among them, P cr Let P represent the probability that the sentence contains a causal relationship, and z represent the logarithmic value of the model output. cr If the value exceeds the threshold of 0.5, the sentence contains a causal relationship; otherwise, the sentence is classified as not containing a causal relationship.

[0075] Specifically, if the information text is "Continuous heavy rain for several days has caused flooding on the main roads and highways in the city, bringing traffic to a standstill," the causal sentence recognition task can identify that this sentence contains a causal relationship.

[0076] S2.2 For sentences marked as containing causal relationships, use the causal relationship labeling task to extract text fragments of cause and effect parameters; causal relationship labeling is a sequence labeling task that marks the cause and effect in a sentence as text fragments.

[0077] The predicted value corresponding to each word or token in the text sequence obtained by BERT encoding is passed through the Dropout layer and the classification layer to obtain the predicted log number of each token. Each word or token in the input text is assigned a label to indicate whether it belongs to the cause, effect or other part of the causal relationship.

[0078] Specifically, the labeled text fields obtained through the causal relationship labeling task are:

[0079] <res> Several days of torrential rain< / res> ,lead to <cas>urban area <res> Flooding occurred on major roads and highways< / res> < / cas> , <cas> Traffic came to a standstill< / cas> .

[0080] S2.3 For sentences marked as containing causal relationships, a causal pair recognition task is used to further refine the causal relationships. The causal pair recognition task can identify whether a causal relationship exists between a pair of marked parameters (Cas, Res) in a sentence, where Cas causes Res. For each Cas, Res pair combination, a probability score is generated to indicate whether a causal relationship exists.

[0081] If a sentence marked as containing a causal relationship has multiple causal relationships, each causal relationship corresponds to a different combination of Cas and Res. Based on the prediction results of the causal pair recognition task, multiple causal relationships are retained.

[0082] Specifically, the following causal relationship is obtained through the causal pair recognition task:

[0083] <res> Several days of torrential rain< / res>,lead to <cas>Flooding occurred on major roads and highways in the city. <cas>Traffic came to a standstill.

[0084] Several days of continuous heavy rain have led to flooding in the city. <res> Flooding occurred on major roads and highways< / res> , <cas> Traffic came to a standstill< / cas> .

[0085] <res> Several days of torrential rain< / res> This led to flooding on major roads and highways in the city. <cas> Traffic came to a standstill< / cas> .

[0086] S2.4. The SimCSE model is used to group semantically similar arguments together and separate semantically different arguments to achieve word embedding. Through contrastive learning, the high-dimensional vectors encoded by the BERT model are embedded into a low-dimensional space, where semantically similar texts are closer together, and semantically different texts are further apart. The optimization objective is to maximize the contrastive similarity of positive samples and minimize the contrastive similarity of negative samples.

[0087] S2.5. Hierarchical clustering algorithm is used to merge arguments with the same cause and the same result. The hierarchical clustering algorithm groups the feature vectors obtained in S2.4 and determines which arguments are semantically similar by calculating a similarity metric between them. The similarity metric can be calculated based on the distance or correlation between vectors. The clustering algorithm merges the most similar arguments at each level, gradually forming a hierarchical structure where similar arguments are grouped into the same category, and dissimilar arguments are grouped into different categories. Ultimately, the result of this hierarchical clustering can be used to merge arguments with the same cause or result, thereby extracting causal relationships or other semantic information from the text.

[0088] Specifically, in step S2.3, if there are the same causal argument "continuous days of heavy rain" and the same result argument "traffic is at a standstill", the causal arguments and result arguments will be merged respectively.

[0089] S3. Train the prediction model based on the event knowledge graph using a total loss function. This total loss function includes an event prediction loss function and a graph structure prediction loss function. The event prediction loss function measures the error of the model in predicting the correlation between events, while the graph structure prediction loss function measures the difference between the predicted graph structure and the actual graph structure. Specifically, it includes:

[0090] S3.1 Obtain the graph structure A based on the relation set R;

[0091] Based on each relation r t =(v i v j The weight W is calculated. ij The calculation formula is:

[0092]

[0093] Where, count(v i v j ) represents a (v i v j The frequency of W's occurrence ij Indicates v j It is v i The probability of subsequent events. Using weight W. ij Calculate the initial weights of graph structure A if event v i v j There exists a causal relationship between A and R, and A exists in the relation set R. ij Initialize to W ij Otherwise, A ij Initialize to 0.

[0094] S3.2 Constructing an improved total loss function L; the total loss function L mainly consists of two parts, namely the event prediction loss Li. 事件预测 And graph structure prediction loss L 图结构预测 ;

[0095] The formula for calculating the total loss function L is as follows:

[0096] L = L 事件预测 +λL 图结构预测 (3)

[0097] Where λ is a hyperparameter used to balance the prediction loss and the graph structure prediction.

[0098] The cross-entropy loss function is used to measure the error of the model in predicting the degree of correlation between events, and the error is calculated for each event pair (v i v j The average cross-entropy loss:

[0099]

[0100] Among them, Y ij ∈[0,1] is the actual label, Y′ ij These are the predicted labels from the model.

[0101] Cross-entropy loss is used to measure the difference between the predicted graph structure and the actual graph structure. The graph structure prediction loss L is calculated. 图结构预测 formula:

[0102]

[0103] S4. Based on the trained model, a graph attention network is used to infer the connection strength between events in the predicted graph structure, thereby achieving event prediction; specifically including:

[0104] S4.1 Calculate the connection strength score between two events by stacking n GAT layers; calculate the attention coefficient between events by stacking n GAT layers, then calculate the deep event representation, and calculate the connection strength score between two events based on the deep event representation;

[0105] Formula for calculating the attention coefficient between event i and other events j in the l-th layer:

[0106]

[0107] in, These are trainable parameters, and || represents the vector concatenation operation.

[0108] Based on the attention weights with other events, the deep event representation formula for event i in layer l is calculated as follows:

[0109]

[0110] Where σ represents the activation function.

[0111] Based on the deep event representation after completing n GAT layers, the formula for calculating the original connection strength score between two events is as follows:

[0112]

[0113] in, These are trainable parameters, and T(·) is the transpose operation.

[0114] S4.2. The softmax function is used to normalize the connection strength score between any two events to obtain the prediction graph structure A′; based on the original connection strength score Γ between the two events obtained in S4.1... ij The softmax function converts the original scores into a probability distribution, that is, it calculates the connection strength between events i and j in the prediction graph structure A′, such that all connection strength scores are between 0 and 1, and the sum is 1.

[0115] S4.3, Based on the predicted graph structure A obtained in step S4.2 ′ Perform event relationship prediction. By comparing the prediction graph structure A ′ The probability value is used to predict whether event j will follow event i in an event sequence. If A ′ ij If the correlation exceeds a threshold, it can be assumed that there is some kind of association or dependency between event i and event j, which may be a causal relationship or other connection; conversely, it can be inferred that event i does not immediately follow event j in the event sequence. This analytical process helps to predict the subsequent trend of the event sequence, providing a reliable method based on the probability of event association to help better understand the relationships and development trends between events.

[0116] Specifically, the graph prediction structure A following the event "continuous days of torrential rain". ′ ij The probability value of A. ′ ij The probability value corresponding to the event "flooding on major roads and highways" is relatively high. Therefore, it can be predicted that the event "flooding on major roads and highways" may follow the event "continuous heavy rain for several days", thus causing "traffic to come to a standstill".

[0117] S5. Input the latest traffic data into the model to predict traffic congestion.

[0118] When the system obtains new traffic data or adds new road segment information to the existing data, the new data is input into the trained model to obtain traffic situation predictions for the newly added road segments.

[0119] Example 2

[0120] This embodiment relates to an event trend judgment device based on event knowledge graph, including a memory and one or more processors. The memory stores executable code. When the one or more processors execute the executable code, they are used to implement the traffic congestion prediction method based on event knowledge graph of the present invention, which is an application of the event trend judgment method based on event knowledge graph of the present invention in Embodiment 1.

[0121] Example 3

[0122] This embodiment relates to a computer-readable storage medium storing a program that, when executed by a processor, implements the traffic congestion prediction method of the present invention based on an event trend judgment method using an event knowledge graph, as described in Embodiment 1.< / cas> < / cas>

Claims

1. A method for determining event trends based on event knowledge graphs, comprising the following steps: S1. Collect relevant text information, preprocess the input text data, and obtain the processed text information; S2. Utilizing causal sentence recognition, causal relationship annotation, and causal pair recognition models, causal relationships are extracted from the processed text information to obtain a complete event knowledge graph; specifically including: S2.1 The prediction model for causal sentence recognition is used to process all sentences. When the causal sentence recognition model identifies a sentence that contains a causal relationship, the sentence is marked as a potential causal sentence. The causal sentence recognition task can identify whether a sentence contains a causal relationship. The embedding of the [CLS] tag obtained based on BERT encoding is processed through a Dropout layer and then a classification layer is used to generate the predicted log. (1) in, This represents the probability that the sentence contains a causal relationship, and z represents the logarithmic value of the model output. If the value exceeds the threshold of 0.5, the sentence contains a causal relationship; otherwise, the sentence is classified as not containing a causal relationship. S2.2 For sentences labeled as containing causal relationships, a causal relationship labeling task is used to extract text fragments containing cause and effect parameters. Causal relationship labeling is a sequence labeling task that labels the cause and effect in a sentence as text fragments. The predicted value corresponding to each word or token in the text sequence obtained by BERT encoding is passed through the Dropout layer and the classification layer to obtain the predicted log number of each token. Each word or token in the input text is assigned a label to indicate whether it belongs to the cause, effect or other part of the causal relationship. S2.3 For sentences marked as containing causal relationships, a causal pair recognition task is used to further refine the causal relationships. The causal pair recognition task can identify whether a causal relationship exists between a pair of marked parameters (Cas, Res) in a sentence, where Cas causes Res. A probability score is generated for each Cas, Res pair combination to indicate whether a causal relationship exists. If a sentence marked as containing a causal relationship has multiple causal relationships, each causal relationship corresponds to a different combination of Cas and Res. Based on the prediction results of the causal pair recognition task, multiple causal relationships are retained. S2.

4. Use the SimCSE model to group semantically similar arguments together and separate semantically different arguments to achieve word embedding; S2.

5. Use hierarchical clustering algorithm to merge arguments with the same cause and arguments with the same result; S3. Train the prediction model based on the event knowledge graph using the total loss function. The total loss function includes the event prediction loss function and the graph structure prediction loss function. The event prediction loss function is used to measure the error of the model when predicting the degree of correlation between events, and the graph structure prediction loss function is used to measure the difference between the predicted graph structure and the actual graph structure. S4. Based on the trained model, a graph attention network is used to infer the connection strength between events in the predicted graph structure, thereby achieving event prediction.

2. The event trend judgment method based on event knowledge graph as described in claim 1, characterized in that, Step S1 includes: When collecting information text, the first step is to identify the relevant field and collect text data related to that field, including obtaining text information from the Internet, databases, or other sources. Once the text data is obtained, the next step is to preprocess it. The preprocessing process includes text cleaning, word segmentation, removal of stop words, stemming, or word form restoration to ensure the quality and consistency of the text data.

3. The event trend judgment method based on event knowledge graph as described in claim 1, characterized in that, In step S2.4, the high-dimensional vectors encoded by the BERT model are embedded into a low-dimensional space through contrastive learning, where semantically similar texts are closer together, while semantically different texts are further apart; the optimization objective is to maximize the contrastive similarity of positive samples and minimize the contrastive similarity of negative samples. In step S2.5, the hierarchical clustering algorithm groups the feature vectors obtained in S2.4 and determines which arguments are semantically similar by calculating the similarity measure between them. The similarity measure is calculated based on the distance or correlation between the vectors. The clustering algorithm merges the most similar arguments at each level, gradually forming a hierarchical structure in which similar arguments are grouped into the same category, while dissimilar arguments are divided into different categories. Finally, the result of this hierarchical clustering is used to merge arguments with the same cause or effect, thereby extracting causal relationships or other semantic information from the text.

4. The event trend judgment method based on event knowledge graph as described in claim 1, characterized in that, Knowledge graph of events in the transportation sector From event set and relation set Composition, each relationship This indicates that there is a causal relationship between two events, where As a causal element, For the result argument.

5. The event trend judgment method based on event knowledge graph as described in claim 4, characterized in that, Step S3 includes: S3.1, Based on the set of relations We obtain graph structure A; S3.2 Constructing an improved total loss function ; In step S3.1, based on each relation Calculate the weights The calculation formula is: in, Represent a Frequency of occurrence express yes The probability of subsequent events; using weights Calculate the initial weights of graph structure A if the event There exists a causal relationship between them and they exist in the relation set R. Initialize to ;otherwise, Initialize to 0; In step S3.2, the total loss function It mainly consists of two parts: event prediction loss and event prediction loss. Graph structure prediction loss ; Total loss function Calculation formula: in, It is a hyperparameter used to balance prediction loss and graph structure prediction; The cross-entropy loss function is used to measure the difference between the model's predictions and the actual labels, and the calculation is performed for each event pair. Average cross-entropy loss: in, It is the actual label. These are the model's predicted labels; Cross-entropy loss is used to measure the difference between the predicted graph structure and the actual graph structure, and the graph structure prediction loss is calculated. formula: 。 6. The event trend judgment method based on event knowledge graph as described in claim 5, characterized in that, Step S4 includes: S4.1 Calculate the connection strength score between two events by stacking n GAT layers; S4.

2. Normalize the connection strength score between any two events using the softmax function to obtain the prediction graph structure. ; S4.3, Prediction graph structure obtained from step S4.2 Perform event relationship prediction; In step S4.1, attention coefficients between events are calculated by stacking n GAT layers, then deep event representations are calculated, and connection strength scores between two events are calculated based on the deep event representations. Formula for calculating the attention coefficient between event i and other events j in the l-th layer: in, These are trainable parameters, and || represents the vector concatenation operation. Based on the attention weights with other events, the deep event representation formula for event i in layer l is calculated as follows: in, Indicates the activation function; Based on the deep event representation after completing n GAT layers, the formula for calculating the original connection strength score between two events is as follows: in, These are trainable parameters. It is a transpose operation; In step S4.2, the original connection strength score between the two events obtained in S4.1 is used. The softmax function transforms the original scores into a probability distribution, i.e., it calculates the predicted graph structure. The connection strength between events i and j is such that all connection strength scores are between 0 and 1, and the sum is 1; In step S4.3, the predicted graph structure is compared. The probability value is used to predict whether event j will follow event i in the event sequence; if If the value is greater than the threshold, it is assumed that there is some kind of correlation or dependency between event i and event j; otherwise, it can be inferred that event i does not immediately follow event j in the event sequence.

7. An event trend judgment device based on event knowledge graph, characterized in that, The device includes a memory and one or more processors, wherein the memory stores executable code, and the one or more processors execute the executable code to implement the event trend judgment method based on event knowledge graph as described in any one of claims 1-6.

8. A computer-readable storage medium, characterized in that, It stores a program that, when executed by a processor, implements the event trend judgment method based on an event knowledge graph as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Method and system for constructing Chinese event library and method and system for analyzing and predicting meta-events based on meta-event library

    CN116383331A

  • Automatic event graph construction method and device for multi-source vulnerability information

    US20230035121A1