An event prediction method based on knowledge-enhanced causal chain reasoning
By establishing an event sign recognition framework based on context learning, the existing event prediction methods are solved, and efficient and accurate event prediction is achieved.
Patent Information
- Application Number
- CN202510007426.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2045-01-03
AI Technical Summary
Existing event prediction methods are costly, time-consuming, and difficult to generalize to different semantic backgrounds.
The event prediction method of knowledge-enhanced causal chain reasoning is adopted, and an event sign recognition framework is established. This framework is a large language model based on context learning, including establishing an event ontology model, defining event types, dividing event patterns, and constructing event causal knowledge graphs, obtaining event texts and performing event summary and classification, argument extraction and matching, and using Monte Carlo simulation method for inference and probability estimation of event signs.
It significantly reduces the cost of event prediction, improves the efficiency and accuracy of prediction, and can adapt to prediction tasks with different semantic backgrounds.
Smart Images

Figure CN119416063B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of text processing, and in particular to an event prediction method of knowledge-enhanced causal chain reasoning. Background Art
[0002] An event refers to a series of actions or things that happen in the real world at a specific time and place with a specific structure and meaning. In the time dimension, events have certain evolution laws and patterns. Events are one of the core concepts of human society, and human social activities are often event-driven. Compared with ordinary events, complex events have multiple steps of evolution, and each step has multiple evolution paths. They are more difficult to predict and have higher research value. Complex event prediction is to predict the subsequent complex evolution of events based on events that have already occurred and related information, which can provide strong support for further decision-making analysis.
[0003] Existing event prediction methods are mainly based on deep learning models, which identify the interaction patterns and potential links of events from massive texts to improve the accuracy of predictions and the scientific nature of decision-making. Such models usually require a large amount of labeled data to train, which is not only costly and time-consuming, but also difficult to generalize to different semantic contexts. Summary of the invention
[0004] In order to solve the technical problems of high cost and long time consumption of existing event prediction methods, an embodiment of the present invention provides an event prediction method of knowledge-enhanced causal chain reasoning.
[0005] The technical solution of the embodiment of the present invention is achieved as follows:
[0006] The embodiment of the present invention provides an event prediction method for knowledge-enhanced causal chain reasoning, the method comprising: establishing an event symptom recognition framework; the event symptom recognition framework is a large language model based on context learning; the establishment of the event symptom recognition framework comprises establishing an event ontology model, defining event types, dividing event patterns and constructing an event causal knowledge graph; obtaining event text, using the event symptom recognition framework to perform event summary and classification, argument extraction and matching operations on the event text, and obtaining a matching causal knowledge graph corresponding to the event text; based on the matching causal knowledge graph, using a Monte Carlo simulation method to perform reasoning and probability estimation on the event symptoms corresponding to the matching causal knowledge graph, and determine the probability of the event symptoms occurring; and formatting the node information in the matching causal knowledge graph as prompt words for event symptom reasoning, and inputting the prompt words into the event symptom recognition framework to obtain the probability of the event symptoms occurring.
[0007] In one embodiment, the event ontology model established is:
[0008] EO=<UECS, LECS, R, Rules, Individuals>;
[0009] Among them, EO represents the event ontology structure of event symptom identification; UECS, LECS, R, Rules and Individuals are the arguments in the event ontology structure, among which UECS represents the upper event class, which is a hierarchical structure; LECS represents the lower event class, which is a network structure; R is a relationship set, R={r / r is the relationship between event classes}; Rules are reasoning rules, including classification rules for upper event classes and event relationship reasoning rules for lower event classes, and Individuals is an instance set of event classes.
[0010] In one embodiment, the defining of event types includes: determining the event background to be identified, and determining a search keyword list based on the event background to be identified; crawling data within a preset date on the Internet using the search keyword list to obtain news data; using a latent Dirichlet allocation topic model to pre-classify the news data into events, and obtaining statistical information of the pre-classification results, wherein the statistical information is the occurrence frequency and proportion of the pre-classified events; and determining the classified event type after adjusting and supplementing the pre-classification results based on the statistical information.
[0011] In one embodiment, the event pattern division includes: obtaining an established event ontology model and defined event types; based on the event ontology model, performing a six-element event analysis on the event type to determine the arguments corresponding to the event type in the event ontology model, and determining the event pattern based on the analysis results.
[0012] In one embodiment, the construction of the event causal knowledge graph includes: obtaining the occurrence time of the event corresponding to the event pattern, and generating an event time series stamp according to the occurrence time of the event; using a vector autoregression model to perform correlation analysis on the events in the event time series stamp to obtain an event causal knowledge graph; the event causal knowledge graph includes the causal relationship between the events and the causal relationship between the event and the event symptoms to be predicted.
[0013] In one embodiment, the event text is summarized and classified using the event symptom recognition framework, including: determining a prompt word template for the event text at an event summary stage, inputting the prompt word template at the event summary stage and the event text into the event symptom recognition framework to perform an event summary operation and obtain an event summary text; determining a prompt word template for the event text at an event classification stage, inputting the prompt word template at the event classification stage and the event summary text into the event symptom recognition framework to perform an event classification operation and determine the event type corresponding to the event summary text; the prompt word template is used to help the event symptom recognition framework understand the corresponding task requirements and task modes, and perform corresponding task operations.
[0014] In one embodiment, the event symptom recognition framework is used to perform argument extraction and matching operations on the event text, including: based on the event type corresponding to the event summary text, extracting corresponding arguments from the event summary text to form an event pattern corresponding to the event summary text; matching the arguments in the event pattern corresponding to the event summary text with the nodes in the event causal knowledge graph, and deleting the unmatched nodes in the event causal knowledge graph to obtain a matching causal knowledge graph.
[0015] In one embodiment, a Monte Carlo simulation method is used to infer and estimate the probability of event symptoms corresponding to the matching causal knowledge graph to determine the probability of the event symptoms occurring, including: for each event symptom node in the matching causal knowledge graph, all event type nodes directly or indirectly connected to the event symptom node are determined to obtain an event type node set; the event type node set includes directly driven nodes and indirectly driven nodes; the driving strength of all directly driven nodes in the event type node set and the driving strength of all indirectly driven nodes in the event type node set are calculated; the probability of the event symptom occurring is calculated based on the driving strength of the directly driven nodes and the driving strength of the indirectly driven nodes.
[0016] In one embodiment, calculating the driving strengths of all directly driven nodes in the event type node set and the driving strengths of all indirectly driven nodes in the event type node set includes: calculating the driving strengths of all directly driven nodes in the event type node set includes: calculating the driving strengths of the directly driven nodes using the following calculation formula:
[0017] ;
[0018] in, is the drive strength of the direct drive node, and Respectively represent the promotion and inhibition event symptom nodes in the matching causal knowledge graph The set of nodes where this occurs, is the weight value of the node, i is the number of times the weight value is randomly extracted from the Gaussian distribution of the node weight interval, , is the node’s drive strength attribute, ;
[0019] Calculating the driving strength of all indirect driving nodes in the event type node set includes: calculating the driving strength of the indirect driving node using the following calculation formula:
[0020] ;
[0021] in, is the drive strength of the indirect drive node, Event symptom nodes All edges on the indirect connection path are promotion edges and all are inhibition edges. is the weight value of the node, i is the number of times the weight value is randomly extracted from the Gaussian distribution of the node weight interval, , is the drive strength attribute of the node, , Represents the number of edges in the path.
[0022] In one embodiment, the probability of occurrence of an event symptom is calculated based on the driving strength of the direct driving node and the driving strength of the indirect driving node, including: calculating each event symptom node using the following calculation formula: The probability of occurrence of all The average Probability of occurrence as an incident:
[0023] ;
[0024] in, is the scaling constant, is the drive strength of the direct drive node, is the drive strength of the indirect driver node.
[0025] An embodiment of the present invention also provides an event prediction system for knowledge-enhanced causal chain reasoning, the event prediction system for knowledge-enhanced causal chain reasoning comprising: a framework establishment module, used to establish an event symptom recognition framework; the event symptom recognition framework is a large language model based on context learning; the establishment of the event symptom recognition framework comprises establishing an event ontology model, defining event types, dividing event patterns and constructing an event causal knowledge graph; an execution module, used to obtain event text, perform event summary and classification, argument extraction and matching operations on the event text using the event symptom recognition framework, and obtain a matching causal knowledge graph corresponding to the event text; an inference module, used to perform inference and probability estimation on the event symptoms corresponding to the matching causal knowledge graph based on the matching causal knowledge graph using a Monte Carlo simulation method, and determine the probability of the occurrence of the event symptoms; and format the node information in the matching causal knowledge graph as prompt words for event symptom reasoning, and input the prompt words into the event symptom recognition framework to obtain the probability of the event symptoms.
[0026] An embodiment of the present invention further provides an electronic device, comprising: a processor and a memory for storing a computer program that can be run on the processor; wherein the processor executes the steps of the above method when running the computer program.
[0027] An embodiment of the present invention further provides a storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.
[0028] The event prediction method of knowledge-enhanced causal chain reasoning provided by the embodiment of the present invention establishes an event symptom recognition framework; the event symptom recognition framework is a large language model based on context learning; the establishment of the event symptom recognition framework includes establishing an event ontology model, defining event types, dividing event patterns and constructing an event causal knowledge graph; obtaining event text, using the event symptom recognition framework to perform event summary and classification, argument extraction and matching operations on the event text, and obtaining a matching causal knowledge graph corresponding to the event text; based on the matching causal knowledge graph, using the Monte Carlo simulation method to reason and estimate the probability of the event symptom corresponding to the matching causal knowledge graph, and determining the probability of the occurrence of the event symptom; and formatting the node information in the matching causal knowledge graph into a prompt word for event symptom reasoning, and inputting the prompt word into the event symptom recognition framework to obtain the probability of the occurrence of the event symptom. The scheme provided by the present invention is to use a large language model as a base, and use the established event symptom recognition framework to recognize event symptoms. Since the large language model is self-supervised pre-trained in a large corpus, it is not necessary to use a large amount of labeled data for training. Therefore, compared with the deep learning model, the cost can be significantly reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 A schematic diagram of a flow chart of an event prediction method using knowledge-enhanced causal chain reasoning according to an embodiment of the present invention;
[0030] Figure 2 This is a schematic diagram of an example of an original causal knowledge graph and a matching causal knowledge graph according to an embodiment of the present invention;
[0031] Figure 3 A schematic diagram of the structure of an event prediction system for knowledge-enhanced causal chain reasoning according to an embodiment of the present invention;
[0032] Figure 4 1 is a diagram showing the internal structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0033] Before introducing the solution of this embodiment in detail, the relevant background content of this embodiment is briefly introduced.
[0034] 1.1 About event ontology reasoning
[0035] Event Ontology Reasoning (EOR) uses predefined event ontologies to organize and understand events and their relationships, solving tasks such as event identification, classification, relationship building, and evolution prediction. The purpose of reasoning is to predict the possibility of future events given historical data, or to identify key influencing factors in a complex chain of events.
[0036] There have been quite a few studies on event ontology modeling. The Simple Event Model (SEM) effectively expresses event instances, but has poor expression capabilities for relationships; CIDOC CRM is an object-oriented conceptual reference model that describes the attributes of parent and child classes in a hierarchical structure, but does not clearly distinguish the definition of event classes; the ABC model represents events by describing concepts such as events, scenarios, actions, and agents, but cannot describe event relationships; the Discrete-event Modeling Ontology (DeMO) models general discrete events in complex systems for application in community simulation, but fails to clarify the concepts of events and actions; EventML-G2 is used to describe news events that are about to be reported, have been reported, or have been reported suddenly.
[0037] In the research on event ontology modeling, the event ontology can be subdivided into three levels: upper event class, lower event class and instance layer, and applied to the domain knowledge modeling of emergencies, in which the lower event class shows the multidimensional relationship between event classes.
[0038] 1.2 About Large Language Model
[0039] A large language model refers to a pre-trained language model with a large number of parameters and complex structure. It has rich knowledge and strong semantic understanding capabilities. It can not only generate coherent and logical text, but also imitate the human reasoning process to a certain extent, providing a strong foundation and tools for NLP tasks.
[0040] Prompt Learning aims to guide large language models to perform specific tasks by providing specific prompts or instructions. This approach is different from traditional model training or fine-tuning. It focuses more on how to influence the output of the model through input design, providing a more flexible and scalable way to exploit the capabilities of the model. In-Context Learning (ICL) is a form of prompt learning that adapts the model to new tasks or knowledge domains by adjusting the contextual information of the input (usually examples). ICL prompts usually include two parts: task instructions and examples. Task instructions explicitly describe the task requirements, and examples help LLM understand the specific pattern of the task. Chain of Thoughts (CoT) prompts help LLM better understand problems and generate more accurate answers by introducing a series of logically coherent intermediate steps or reasoning processes in the prompt words.
[0041] The event symptom recognition framework proposed in this embodiment uses carefully designed ICL templates and CoT prompts to guide LLM to complete tasks such as event summarization, event classification, and argument extraction under zero samples. It can process diverse text content and provide more efficient and accurate event prediction support.
[0042] The present invention will be described in further detail below with reference to the accompanying drawings and embodiments.
[0043] The embodiment of the present invention provides an event prediction method based on knowledge-enhanced causal chain reasoning, such as Figure 1 As shown, the method includes:
[0044] Step 101: Establishing an event symptom recognition framework; the event symptom recognition framework is a large language model based on context learning; the establishment of the event symptom recognition framework includes establishing an event ontology model, defining event types, dividing event patterns, and constructing an event causal knowledge graph;
[0045] Step 102: Acquire event text, use the event symptom recognition framework to perform event summary and classification, argument extraction and matching operations on the event text, and obtain a matching causal knowledge graph corresponding to the event text;
[0046] Step 103: Based on the matching causal knowledge graph, use the Monte Carlo simulation method to infer and estimate the probability of the event symptoms corresponding to the matching causal knowledge graph to determine the probability of the event symptoms occurring; and format the node information in the matching causal knowledge graph into prompt words for event symptom reasoning, and input the prompt words into the event symptom recognition framework to obtain the probability of the event symptoms occurring.
[0047] This embodiment uses a large language model as a foundation to construct an event sign recognition framework. The large language model can perform self-supervised pre-training in a large corpus, and has general capabilities such as semantic understanding, contextual learning, and step-by-step reasoning in zero-sample scenarios. It can effectively retrieve and integrate external knowledge to complete various field-specific tasks. Therefore, this embodiment does not require the use of a large amount of annotated data for training, which can significantly reduce costs compared to deep learning models. The event sign recognition framework established in this embodiment is the EKL-SEW framework, which can have scenario universality. It only needs to adjust the ontology model and the causal knowledge graph to adapt to prediction tasks in different event contexts.
[0048] In order to complete the event analysis and reasoning in event symptom prediction, this embodiment first defines the event ontology model. Then, the event type and its corresponding pattern are determined, and finally the event causal knowledge graph is constructed using event statistical data as a reference. The event ontology model, event type and event causal knowledge graph can serve as the basic basis for subsequent symptom reasoning and prediction.
[0049] Specifically, ontology is a formalized representation system used to define entity types, attributes, and relationships between entities. Event Ontology Model (EOM) is a formalized model that describes events and their relationships. Ontology models are usually used to define the attributes and categories of events, as well as the relationships between different events.
[0050] Before introducing the event ontology model established in this embodiment, the following concepts are introduced:
[0051] 1. Events
[0052] In ontology research, an event is a specific thing that occurs at a specific time and environment, involves several roles, and exhibits several action characteristics. In the context of event symptom prediction, this embodiment defines an event as a sextuple consisting of six elements:
[0053] Calculation formula (1)
[0054] Regarding the meaning of these six elements, Indicates action elements, that is, trigger words for events. Indicates the subject of the event (the party that implements the action). Represents the object of the event (the object of action implementation). Indicates the time when the event occurred. Indicates the location where the event occurred. Represents semantic elements unique to each event type.
[0055] 2. Event Class
[0056] An event class is a collection of events with common characteristics, which is defined as follows:
[0057] Calculation formula (2)
[0058] in, Represents a collection of events; express The event in The collection of common features on the elements, express The event in A common attribute (i.e., an argument role) shared by all elements.
[0059] 3. Event Mode
[0060] Event Schema defines the argument roles associated with each event class. These roles are subclasses of the six core elements of events and are used to organize and parse event-related information to make it easier to understand and analyze. For example, for the event class "Economy-Sale / Acquisition", its event schema is defined as: {"event_type": "Economy-Sale / Acquisition", "role_list": [{"role": "Transaction Behavior"}, {"role": "Time"}, {"role": "Seller"}, {"role": "Transaction Item"}, {"role": "Selling Price"}, {"role": "Acquirer"}], "class": "Finance / Transaction"}, where "Transaction Behavior" is a subclass of A, "Seller" is a subclass of S, "Acquirer" is a subclass of O, "Time" is a subclass of T, the subclass of P is the empty set, and the subclass of D includes "Transaction Item".
[0061] 4. Event Relationship
[0062] Event Relationships represent the connections between different events, including hierarchical relationships and non-hierarchical relationships. Hierarchical relationships include superordinate and subordinate relationships of event classes, and non-hierarchical relationships include accompanying relationships, composition relationships, causal relationships, and temporal relationships.
[0063] Here, the event ontology model established in this embodiment is:
[0064] EO=<UECS, LECS, R, Rules, Individuals> Calculation (3)
[0065] Among them, EO represents the event ontology structure of event symptom prediction; UECS, LECS, R, Rules and Individuals are the arguments in the event ontology structure, among which UECS represents the upper event class, which is a hierarchical structure; LECS represents the lower event class, which is a network structure; R is a relationship set, R={r / r is the relationship between event classes}; Rules are reasoning rules, including classification rules for upper event classes and event relationship reasoning rules for lower event classes, and Individuals is an instance set of event classes.
[0066] In the process of establishing the event ontology model, for the event symptom prediction task, this embodiment only retains the event causal relationship that can be directly used for reasoning, and refers to the basic concept of the "system loop diagram" to further distinguish the causal relationship into "promotion" relationship and "inhibition" relationship .
[0067] In addition, for the elements of the event, this embodiment converts them into attributes (argument roles) in the event pattern. Therefore, for a specific event class, a more simplified event ontology structure model can be established.
[0068] In the event symptom recognition framework, reasonable event classification and pattern definition are the basis for fully mining text information and improving prediction accuracy. They help eliminate noise in text data, facilitate the analysis and reasoning of event ontology models, and ensure that the prediction system can specifically identify and respond to the occurrence of various potential events.
[0069] Specifically, the process of defining event types in this embodiment is as follows: determining the event background to be identified, and determining a search keyword list based on the event background to be identified; crawling data within a preset date on the Internet using the search keyword list to obtain news data; using a latent Dirichlet allocation topic model to pre-classify the news data into events, and obtaining statistical information of the pre-classification results, wherein the statistical information is the occurrence frequency and proportion of the pre-classified events; after adjusting and supplementing the pre-classification results based on the statistical information, determining the classified event type.
[0070] Correspondingly, the process of dividing event patterns in this embodiment is: obtaining an established event ontology model and defined event types; based on the event ontology model, performing six-element event analysis on the event type, determining the arguments corresponding to the event type in the event ontology model, and determining the event pattern based on the analysis results.
[0071] The process of constructing an event causal knowledge graph in this embodiment is: obtaining the occurrence time of the event corresponding to the event pattern, and generating an event time series stamp according to the occurrence time of the event; using a vector autoregression model to perform correlation analysis on the events in the event time series stamp to obtain an event causal knowledge graph; the event causal knowledge graph includes the causal relationship between the events and the causal relationship between the event and the event symptoms to be predicted.
[0072] Constructing an event causal knowledge graph is the most critical step in event symptom prediction, which is directly related to whether the prediction results are accurate and valuable. In the event ontology model, the essence of the event causal knowledge graph is the network structure in LECS, and the causal relationship between events and symptoms is additionally added.
[0073] Below, this embodiment will use a specific embodiment as a research background to introduce the above-mentioned process of establishing an event ontology model, defining event types, dividing event patterns, and constructing an event causal knowledge graph.
[0074] Specifically, the specific process of event classification in this embodiment is as follows:
[0075] This embodiment determines the event type according to the steps of pre-classification, data statistics, and expert adjustment. First, based on the search keyword list (Table 1), relevant news from January 1, 2020 to January 1, 2022 are crawled from the Internet, classified using the Latent Dirichlet Allocation (LDA) topic model, and statistics on the frequency and proportion of events.
[0076] Based on the pre-classification results and statistical information, the pre-classification results were adjusted and supplemented. Finally, the events were classified into 5 categories with a total of 30 event types.
[0077] After defining the event type, it is necessary to clarify the event behavior that needs to be predicted, that is, the event signs.
[0078] After executing the classification of event types, this embodiment also needs to determine the mode of each event type and clarify the necessary attributes (arguments) of each type of event for subsequent event matching. The specific implementation method is: based on the "six elements" of the event, a list of event attributes (i.e., argument roles) is given. Then, the given list is integrated to obtain the final event mode.
[0079] After the event classification, it is necessary to construct an event causal knowledge graph based on the classified event type. The construction process of the event causal knowledge graph in this embodiment is as follows:
[0080] To ensure the rationality of the causal knowledge graph, this embodiment constructs the causal knowledge graph according to the two steps of correlation analysis and expert analysis.
[0081] Step 1: Event Class Correlation Analysis
[0082] All the acquired news is converted into a multivariate time series. At a certain timestamp (here, a certain day), if the event occurs, it is assigned a value of 1, otherwise it is assigned a value of 0. Then, a vector auto-regressive model (VAR) is used for correlation analysis. VAR is a statistical model used to analyze the relationship and dynamic impact between variables in multivariate time series data. time series of variables with lags of The VAR model form is:
[0083] Calculation formula (4)
[0084] in, is a dimensional vector, containing Moment variables, is a constant vector, is a parameter matrix describing the interactions (i.e., correlations) between variables at different time lags, is the error term vector. After VAR modeling, the maximum residual correlation within a given time lag upper limit is selected as the correlation of the event.
[0085] Step 2: Expert Analysis
[0086] The event correlation data was distributed to experts as a reference to fully combine the actual situation with expert knowledge. Through discussion and analysis, experts analyzed whether there was a causal relationship between events one by one, and clarified the type of causal relationship (promotion or inhibition) and the direction of the causal relationship. Then, each event class was analyzed to see whether there was a promoting or inhibiting effect on the four event symptoms. The event causal knowledge graph finally formed contains two major types of relationships, one is the causal relationship between event classes, and the other is the causal relationship between event classes and symptoms.
[0087] The constructed event causal knowledge graph can have a total of 285 directed edges, representing 285 pairs of event / symptom causal relationships. In the graph, "+" represents a promoting causal relationship, and "-" represents an inhibiting causal relationship.
[0088] Since the strength of causal relationships between different event classes is different, in this embodiment, a certain weight is assigned to all edges in the causal graph to quantify the possibility that the cause node promotes / inhibits the occurrence of the result node. Specifically, a weight interval is given to each edge, where. The method for determining the weight is: a formal questionnaire is given, and each expert gives a subjective evaluation interval for the weight of each edge based on experience, and then the upper and lower limits of the intervals given by all experts are averaged, and one decimal place is retained as the weight interval.
[0089] After determining the event type, event pattern, ontology structure model and causal knowledge graph, for the input event text, it only needs to be processed in a certain way to correspond it to the nodes of the causal knowledge graph, and further analysis, reasoning and prediction can be carried out.
[0090] Further analysis, reasoning, and prediction include event summarization and classification, argument extraction, and matching operations.
[0091] Among them, event summary and classification include: determining the prompt word template of the event text in the event summary stage, inputting the prompt word template of the event summary stage and the event text into the event symptom recognition framework to perform event summary operation and obtain event summary text; determining the prompt word template of the event text in the event classification stage, inputting the prompt word template of the event classification stage and the event summary text into the event symptom recognition framework to perform event classification operation and determine the event type corresponding to the event summary text; the prompt word template is used to help the event symptom recognition framework understand the corresponding task requirements and task modes, and perform corresponding task operations.
[0092] The argument extraction and matching operation includes: based on the event type corresponding to the event summary text, extracting corresponding arguments from the event summary text to form an event pattern corresponding to the event summary text; matching the arguments in the event pattern corresponding to the event summary text with the nodes in the event causal knowledge graph, and deleting the unmatched nodes in the event causal knowledge graph to obtain a matching causal knowledge graph.
[0093] This embodiment uses a Monte Carlo simulation method to infer and estimate the probability of event symptoms corresponding to the matching causal knowledge graph to determine the probability of the event symptoms occurring, including: for each event symptom node in the matching causal knowledge graph, determine all event type nodes directly or indirectly connected to the event symptom node, and obtain an event type node set; the event type node set includes directly driven nodes and indirectly driven nodes; calculate the driving strength of all directly driven nodes in the event type node set and the driving strength of all indirectly driven nodes in the event type node set; calculate the probability of the event symptom occurring based on the driving strength of the directly driven node and the driving strength of the indirectly driven node.
[0094] Specifically, for the event text entered The EKL-SEW framework in this embodiment is based on predefined event types , Event Mode , Event Causal Knowledge Graph , through the following three steps: ① event summary and classification; ② argument extraction and matching; ③ symptom reasoning and probability calculation, and finally output the symptoms of concern The probability of happening in the future , and its explanation EKL-SEW uses a large language model as its base to complete the above tasks through context learning, thought chain prompts, and tool calls.
[0095] ① Event summary and classification
[0096] 1.1 Event Summary
[0097] The original event data text is usually lengthy and contains a lot of irrelevant information. In order to facilitate the classification of events and the extraction and analysis of key information, the original event text is first summarized using LLM. The prompt words consist of system information, auxiliary information, question information, and response format.
[0098] 1.2 Event Classification
[0099] After completing the summary, instruct LLM to classify the input event summary text. Specifically, convert event classification into a two-stage multiple-choice task. The first stage confirms which of the five major categories the event belongs to, and the second stage determines the specific subcategories. The prompt words for event classification are shown in Table 1. The prompt words for the first stage include system information (task instructions), auxiliary information, question information, and response format; the second stage is a question and answer based on the first stage. The prompt words include system information, auxiliary information, and response format. At the same time, LLM will answer based on the input and output results of the first stage. If there is more than one event type matched in the first stage, subcategory classification questions and answers are required for each type.
[0100] In addition to the two regular question-answering stages, each time a text classification question is completed, it is necessary to determine whether the answer is in the candidate list to prevent LLM from generating incorrect answers due to hallucinations. If the generated answer is not in the candidate list, a prompt word is used for feedback to guide LLM to reselect. If the answer is still not correct after this selection, None is returned directly. Here is the preset upper limit of the number of feedbacks.
[0101] Table 1 Event classification prompt word template
[0102]
[0103] ②Argument extraction and matching
[0104] 2.1 Argument Extraction
[0105] The purpose of argument extraction is to extract structured event information and understand the semantics of events at a deeper level so as to match them with nodes in the event causal knowledge graph. Specifically, based on the subclasses corresponding to the text, attributes (argument content) are extracted according to predefined event patterns. The extraction process is transformed into a multi-round answering task to maintain the consistency of the extraction. Similar to event-type question answering, in order to reduce the generation of incorrect answers due to LLM hallucinations (i.e., the output text fragment is not in the input text), feedback correction is also performed after each argument extraction is completed until the preset upper limit of the number of feedbacks is reached. The prompt words for event argument extraction are shown in Table 2.
[0106] Table 2 Event argument extraction prompt word template
[0107]
[0108] 2.2 Event Matching
[0109] The purpose of event matching (argument matching) is to map events in event text data to the event causal knowledge graph to determine whether the nodes in the graph are "activated". Specifically, for the set of argument content extracted from the event text, if ① the extracted content elements are complete (i.e., one-to-one correspondence with the argument roles); and ② the attribute content of the location, subject or object contains the target object of concern in the prediction, then the event type is considered to be matched successfully.
[0110] In the original event causal knowledge graph, if a certain type of node directly connected to the symptom of interest is matched successfully, it will be marked as 1 (direct drive); if a node is indirectly connected to the symptom node, and the edges on the connection path are all of the "promotion" or "inhibition" type, then the nodes on the path are all marked as 2 (indirect drive). The purpose of this step is to fully consider all possible potential promotion or inhibition factors. After completing the matching of all event texts, delete those unmarked nodes to generate a matching causal knowledge graph, such as Figure 2 shown.
[0111] ③Symptom reasoning and probability estimation
[0112] Based on the matching causal knowledge graph and the relevant information of the event node, the Monte-Carlo Simulation (MCS) method is used to infer the symptoms and estimate the probability of occurrence. , the set of each event type node directly or connected to it is , Indicates a directly driven node, Represents an indirect driver node. Each node in contains the drive strength attribute , indicating the frequency of occurrence of an event class within a certain period of time; each edge contains a weight interval , indicating the importance of the causal relationship. When reasoning, the probability of the symptom occurring is estimated according to the following four steps:
[0113] 1. Repeated sampling. , from the Gaussian distribution of its weight interval A value is randomly drawn from . This process is repeated in the simulation times, each sampling may get a different weight value ;
[0114] 2. Drive strength calculation. ① Direct drive strength. If , define the influence value and ,express All nodes in the promotion and inhibition The degree of occurrence, and then calculate the difference between the two impacts to get the comprehensive impact The calculation formula is:
[0115] Calculation formula (5)
[0116] in, is the drive strength of the direct drive node, and Respectively represent the promotion and inhibition event symptom nodes in the matching causal knowledge graph The set of nodes where this occurs, is the weight value of the node, i is the number of times the weight value is randomly extracted from the Gaussian distribution of the node weight interval, , is the node’s drive strength attribute, .
[0117] ② Indirect driving strength. If , then the indirect driving strength is calculated as:
[0118] Calculation formula (6)
[0119] in, is the drive strength of the indirect drive node, Event symptom nodes All edges on the indirect connection path are promotion edges and all are inhibition edges. is the weight value of the node, i is the number of times the weight value is randomly extracted from the Gaussian distribution of the node weight interval, , is the drive strength attribute of the node, , Represents the number of edges in the path.
[0120] 3. Symptom probability estimation. The weight value obtained for each sampling , using a simple sigmoid function to estimate the probability of an event occurring:
[0121] Calculation formula (7)
[0122] in, is the scaling constant, is the drive strength of the direct drive node, is the drive strength of the indirect driver node.
[0123] Then, the calculated data The 95% confidence interval , providing uncertainty information about the predicted probability.
[0124] 4. Generate explanations. The above probability estimation process is encapsulated into a tool SEW_predictor (encapsulated Python function). After completing the classification, extraction and matching of events, LLM automatically calls this tool to perform probability estimation. Finally, based on this calculation process, LLM explains the probability estimation results of the event symptoms.
[0125] The event prediction method of knowledge-enhanced causal chain reasoning provided by the embodiment of the present invention establishes an event symptom recognition framework; the event symptom recognition framework is a large language model based on context learning; the establishment of the event symptom recognition framework includes establishing an event ontology model, defining event types, dividing event patterns and constructing an event causal knowledge graph; obtaining event text, using the event symptom recognition framework to perform event summary and classification, argument extraction and matching operations on the event text, and obtaining a matching causal knowledge graph corresponding to the event text; based on the matching causal knowledge graph, using the Monte Carlo simulation method to reason and estimate the probability of the event symptom corresponding to the matching causal knowledge graph, and determining the probability of the occurrence of the event symptom; and formatting the node information in the matching causal knowledge graph into a prompt word for event symptom reasoning, and inputting the prompt word into the event symptom recognition framework to obtain the probability of the occurrence of the event symptom. The scheme provided by the present invention is to use a large language model as a base, and use the established event symptom recognition framework to recognize event symptoms. Since the large language model is self-supervised pre-trained in a large corpus, it is not necessary to use a large amount of labeled data for training. Therefore, compared with the deep learning model, the cost can be significantly reduced.
[0126] In order to implement the method of the embodiment of the present invention, the embodiment of the present invention also provides an event prediction system for knowledge-enhanced causal chain reasoning, such as Figure 3 As shown, the event prediction system of knowledge-enhanced causal chain reasoning includes: a framework building module 301, an execution module 302 and a reasoning module 303; wherein:
[0127] A framework building module 301 is used to build an event symptom recognition framework; the event symptom recognition framework is a large language model based on context learning; the building of the event symptom recognition framework includes building an event ontology model, defining event types, dividing event patterns, and constructing an event causal knowledge graph;
[0128] An execution module 302 is used to obtain an event text, perform event summary and classification, argument extraction and matching operations on the event text using the event symptom recognition framework, and obtain a matching causal knowledge graph corresponding to the event text;
[0129] The reasoning module 303 is used to use the Monte Carlo simulation method to perform reasoning and probability estimation on the event symptoms corresponding to the matching causal knowledge graph based on the matching causal knowledge graph, and determine the probability of the occurrence of the event symptoms; and format the node information in the matching causal knowledge graph into prompt words for event symptom reasoning, and input the prompt words into the event symptom recognition framework to obtain the probability of the event symptoms.
[0130] In actual application, the framework building module 301, the execution module 302 and the reasoning module 303 can be implemented by a processor in the event prediction system 300 of knowledge-enhanced causal chain reasoning.
[0131] It should be noted that: when the above-mentioned device provided in the above-mentioned embodiment is executed, only the division of the above-mentioned program modules is used as an example. In actual application, the above-mentioned processing can be assigned to different program modules as needed, that is, the internal structure of the terminal is divided into different program modules to complete all or part of the above-mentioned processing. In addition, the above-mentioned device provided in the above-mentioned embodiment and the above-mentioned method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0132] In order to implement the method of the embodiment of the present invention, the embodiment of the present invention also provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of the above method.
[0133] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiment of the present invention, the embodiment of the present invention further provides an electronic device (computer device). Specifically, in one embodiment, the computer device may be a terminal, and its internal structure diagram may be as follows: Figure 4As shown. The computer device includes a processor A01, a network interface A02, a display screen A04, an input device A05 and a memory (not shown in the figure) connected through a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A06. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor A01, the method of any one of the above embodiments is implemented. The display screen A04 of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device A05 of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0134] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0135] The device provided by the embodiment of the present invention includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the method of any one of the above embodiments is implemented.
[0136] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0137] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0138] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0139] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0140] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0141] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0142] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0143] It can be understood that the memory of the embodiment of the present invention can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAMbus random access memory (DRRAM, Direct Rambus Random Access Memory).The memories described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memories.
[0144] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0145] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A knowledge-enhanced causal chain reasoning event prediction method, characterized in that: The method comprises: Establishing an event symptom recognition framework; the event symptom recognition framework is a large language model based on context learning; the establishment of the event symptom recognition framework includes establishing an event ontology model, defining event types, dividing event patterns and constructing an event causal knowledge graph; Acquire event text, perform event summary and classification, argument extraction and matching operations on the event text using the event symptom recognition framework, and obtain a matching causal knowledge graph corresponding to the event text; Based on the matching causal knowledge graph, using a Monte Carlo simulation method to perform reasoning and probability estimation on event symptoms corresponding to the matching causal knowledge graph to determine the probability of occurrence of the event symptoms; The Monte Carlo simulation method is used to infer and estimate the probability of the event symptoms corresponding to the matching causal knowledge graph to determine the probability of the event symptoms occurring, including: For each event symptom node in the matching causal knowledge graph, determine all event type nodes directly or indirectly connected to the event symptom node, and obtain an event type node set; the event type node set includes a directly driven node and an indirectly driven node; Calculating the driving strengths of all directly driven nodes in the event type node set and the driving strengths of all indirectly driven nodes in the event type node set; The probability of occurrence of an event symptom is calculated based on the driving strength of the direct driving node and the driving strength of the indirect driving node.
2. The event prediction method of knowledge-enhanced causal chain reasoning according to claim 1 is characterized in that: The event ontology model established is: EO=<UECS, LECS, R, Rules, Individuals>; Among them, EO represents the event ontology structure of event symptom identification; UECS, LECS, R, Rules and Individuals are the arguments in the event ontology structure, among which UECS represents the upper event class, which is a hierarchical structure; LECS represents the lower event class, which is a network structure; R is a relationship set, R={r / r is the relationship between event classes}; Rules are reasoning rules, including classification rules for upper event classes and event relationship reasoning rules for lower event classes, and Individuals is an instance set of event classes.
3. The event prediction method of knowledge-enhanced causal chain reasoning according to claim 1 is characterized in that: The defined event types include: Determining an event context to be identified, and determining a search keyword list based on the event context to be identified; Using the search keyword list to crawl data within a preset date on the Internet to obtain news data; Using a latent Dirichlet allocation topic model to pre-classify events in the news data, and obtaining statistical information of the pre-classification results, wherein the statistical information is the occurrence frequency and proportion of the pre-classified events; After adjusting and supplementing the pre-classification result based on the statistical information, the classified event type is determined.
4. The event prediction method of knowledge-enhanced causal chain reasoning according to claim 1 is characterized in that: The partitioning event mode includes: Obtain the established event ontology model and defined event types; On the basis of the event ontology model, the six elements of the event are analyzed for the event type to determine the arguments corresponding to the event type in the event ontology model, and the event mode is determined based on the analysis results.
5. The event prediction method of knowledge-enhanced causal chain reasoning according to claim 4 is characterized in that: The construction of the event causal knowledge graph includes: Obtaining the occurrence time of the event corresponding to the event pattern, and generating an event time series stamp according to the occurrence time of the event; A vector autoregression model is used to perform correlation analysis on the events in the event time series stamps to obtain an event causal knowledge graph; the event causal knowledge graph includes the causal relationship between the events and the causal relationship between the events and the event symptoms to be predicted.
6. The event prediction method of knowledge-enhanced causal chain reasoning according to claim 1 is characterized in that: The event text is summarized and classified using the event symptom recognition framework, including: Determine a prompt word template of the event text at the event summary stage, input the prompt word template of the event summary stage and the event text into the event symptom recognition framework to perform an event summary operation, and obtain an event summary text; Determine the prompt word template of the event text in the event classification stage, input the prompt word template of the event classification stage and the event summary text into the event symptom recognition framework to perform event classification operations, and determine the event type corresponding to the event summary text; the prompt word template is used to help the event symptom recognition framework understand the corresponding task requirements and task modes, and perform corresponding task operations.
7. The event prediction method of knowledge-enhanced causal chain reasoning according to claim 6 is characterized in that: The event symptom recognition framework is used to perform argument extraction and matching operations on the event text, including: Based on the event type corresponding to the event summary text, extract corresponding arguments from the event summary text to form an event pattern corresponding to the event summary text; The arguments in the event pattern corresponding to the event summary text are matched with the nodes in the event causal knowledge graph, and the unmatched nodes in the event causal knowledge graph are deleted to obtain a matching causal knowledge graph.
8. The event prediction method of knowledge-enhanced causal chain reasoning according to claim 1 is characterized in that: Calculating the driving strengths of all directly driven nodes in the event type node set and the driving strengths of all indirectly driven nodes in the event type node set, including: Calculating the driving strength of all directly driven nodes in the event type node set, including: The drive strength of a direct drive node is calculated using the following formula: ; in, is the drive strength of the direct drive node, and Respectively represent the promotion and inhibition event symptom nodes in the matching causal knowledge graph The set of nodes where this occurs, is the weight value of the node, i is the number of times the weight value is randomly extracted from the Gaussian distribution of the node weight interval, , is the node’s drive strength attribute, ; Calculating the driving strength of all indirect driving nodes in the event type node set, including: The drive strength of an indirect drive node is calculated using the following formula: ; in, is the drive strength of the indirect drive node, Event symptom nodes All edges on the indirect connection path are promotion edges and all are inhibition edges. is the weight value of the node, i is the number of times the weight value is randomly extracted from the Gaussian distribution of the node weight interval, , is the node’s drive strength attribute, , Represents the number of edges in the path.
9. The event prediction method of knowledge-enhanced causal chain reasoning according to claim 8 is characterized in that: Calculating the probability of occurrence of an event symptom based on the driving strength of the direct driving node and the driving strength of the indirect driving node, including: Use the following formula to calculate each event symptom node The probability of occurrence of all The average Probability of occurrence as an incident: ; in, is the scaling constant, is the drive strength of the direct drive node, is the drive strength of the indirect driver node.
Citation Information
Patent Citations
Drainage basin drought and flood event long-term prediction method based on event knowledge graph construction
CN113159451A
Verb tense-based generalization causal network construction method, equipment and medium
CN116227601A