Event context analysis method based on causal relationship
By determining the event keywords to generate and analyze the question documents and inputting the event context analysis model, the problem of insufficient causal context reasoning ability in news analysis is solved, more accurate and complete event causal reasoning is achieved, and the reliability and applicability of causal relationship modeling is improved.
Patent Information
- Application Number
- CN202510748715.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-06
- Publication Date
- 2025-07-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When existing news analysis methods identify the causal relationship between events, there is a problem of insufficient causal context reasoning ability, and it is difficult to accurately present the development process and mutual relationship of events.
By determining the event keywords, generating an analysis question document, and entering an event context analysis model, the pre-trained causal relationship model is used to construct event causal relationships, optimize causal reasoning capabilities, ensure that the analysis results conform to the actual logic, and reduce noise interference.
It realizes more accurate and complete causal reasoning for events, improves the intelligent support of news analysis and information processing, and improves the reliability and applicability of causal relationship modeling.
Smart Images

Figure CN120278281A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of news analysis, and particularly relates to a method, apparatus, device, and storage medium for event context analysis based on causal relationships. Background Art
[0002] In an environment where information dissemination is accelerating day by day, news reports, social media content, and other information sources continuously generate data on various events. These events usually involve different time nodes and may have complex causal relationships. When processing this information, how to effectively identify the associations between events and clarify their causal context has become an important issue in the fields of news analysis and information retrieval. Although existing data analysis methods can provide certain relevance judgments, there is still room for improvement in terms of event evolution paths and causal relationship reasoning.
[0003] Currently, the field of event analysis mainly adopts rule-based methods and statistical models. Among them, rule-based methods identify the relevance of events by artificially setting analysis rules and matching patterns, while statistical model-based methods analyze large-scale news data through machine learning models to infer the relationships between events.
[0004] Although the above methods have certain application values in news analysis, they are unable to accurately capture causal relationships globally, resulting in insufficient reasoning ability for event contexts and thus making it difficult to accurately present the development process and interrelationships of events. Summary of the Invention
[0005] This application aims to provide a method, apparatus, device, and storage medium for event context analysis based on causal relationships, at least solving the problem of insufficient reasoning ability for event contexts.
[0006] In a first aspect, an embodiment of this application discloses a method for event context analysis based on causal relationships, including: Determining at least one event keyword of the result event according to the description document of the result event to be analyzed; Generating an analysis question document for the result event according to all the event keywords; Inputting the analysis question document into an event context analysis model to obtain a context analysis result for the result event; the context analysis result is used to represent the causal association relationship formed between at least one target cause event among multiple cause events and the result event; the event context analysis model is trained according to all the cause events.
[0007] In a second aspect, an embodiment of this application also discloses an apparatus for event context analysis based on causal relationships, including: A keyword module, configured to determine at least one event keyword of the result event according to a description document of the result event to be analyzed; A prompt word module, configured to generate an analysis question document for the result event according to all the event keywords; An analysis module, configured to input the analysis question document into an event context analysis model to obtain a context analysis result of the result event; the context analysis result is used to characterize a causal association relationship formed between at least one target cause event among a plurality of cause events and the result event; the event context analysis model is trained according to all the cause events.
[0008] In a third aspect, an embodiment of the present application further discloses an electronic device, including a processor and a memory, the memory stores a program or instruction that can run on the processor, and when the program or instruction is executed by the processor, the steps of the method described in the first aspect are implemented.
[0009] In a fourth aspect, an embodiment of the present application further discloses a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0010] In summary, in the embodiment of the present application, by using all the cause events participating in the training as learning samples, it is ensured that the target cause events in the generated analysis results come from the cause events for training, enabling the model to accurately master the causal logic between events; furthermore, based on the description document of the result event to be analyzed, event keywords are extracted to accurately locate the core content of the event and improve the focusing ability of the event analysis process; then an analysis question document is generated to ensure that the event context analysis model is trained around the core event, optimizing the causal reasoning ability and enabling the model to focus on the direct influencing factors of the result event, avoiding speculation only based on statistical correlation. At this time, since the model has been trained for multiple cause events, when a new event to be analyzed is input, the model can automatically match the relevant cause events in the training data to ensure that the analysis result conforms to the real logic and avoid inference only based on correlation. Finally, a causal association is constructed through the training data to ensure that the inference result conforms to the development trend of the event, while reducing the interference of noise data on event inference and improving the analysis accuracy. Thus, based on the method of the embodiment of the present application, more accurate and complete event causal reasoning is achieved, providing intelligent support for news analysis and information processing, and at the same time improving the reliability and applicability of causal relationship modeling. Description of the Drawings
[0011] In the drawings: Figure 1 is a flowchart of the steps of a method for event context analysis based on causal relationship provided by an embodiment of the present application; Figure 2 It is a process for generating an analysis question document provided by an embodiment of the present application; Figure 3 It is a flowchart of steps of another event context analysis method based on causal relationship provided by an embodiment of the present application; Figure 4 It is an architecture diagram of an event context analysis model provided by an embodiment of the present application; Figure 5 It is a complete event context analysis process under the method of an embodiment of the present application; Figure 6 It is a program flow of data verification under the method of an embodiment of the present application; Figure 7 It is a block diagram of a device for event context analysis based on causal relationship provided by an embodiment of the present application; Figure 8 It is a block diagram of an electronic device of an embodiment provided by an embodiment of the present application; Figure 9 It is a block diagram of an electronic device of another embodiment provided by an embodiment of the present application. Detailed implementation manners
[0012] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0013] The terms "first", "second", etc. in the description and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are usually of the same type, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and / or" in the description and claims means at least one of the connected objects, and the character " / ", generally represents an "or" relationship between the associated objects before and after.
[0014] As Figure 1 shown, it is an event context analysis method based on causal relationship provided by an embodiment of the present application.
[0015] The method may include the following steps: Step 101, determine at least one event keyword of the result event according to the description document of the result event to be analyzed.
[0016] In some embodiments of the present application, in order to ensure the accuracy of event context analysis, it is necessary to parse the description document of the result event to be analyzed to identify the key content therein. That is, by extracting at least one event keyword of the result event, it provides a basis for generating the subsequent analysis question document, making the analysis process more targeted and accurate. During the execution process, the system first performs word segmentation on the description document of the result event to be analyzed, and combines semantic analysis techniques to identify a set of keywords that can represent the core content of the event. These keywords are used to model the core features of the event, ensuring that the event context analysis model can construct a causal reasoning structure based on these key points. Event keywords refer to a set of representative and directive words that can trigger the extraction of the core information, context relationship, and key elements of the event. The selection of keywords directly affects the accuracy of subsequent event analysis. Therefore, after extracting the keywords, further screening and optimization are required to ensure that the keywords can effectively represent the core information of the result event. In this way, the input data for event context analysis is structured, enabling the model to conduct analysis based on an accurate keyword set during the subsequent causal reasoning process, thereby improving the integrity of the event evolution context, enhancing the reliability of causal reasoning, and reducing the interference of irrelevant information.
[0017] As Figure 2 shown, in a specific example, assume that it is necessary to analyze a news report about the event of "subway suspension in a certain city", which details the time of the suspension, the affected area, and the relevant investigation situation. During the execution process, the system first parses the news text and extracts event keywords such as "subway suspension", "equipment failure", "emergency dispatch", and "resumption of operation" through word segmentation and semantic analysis techniques. These keywords are applied during the subsequent generation of the analysis question document to ensure that the event context analysis model can reason around these keywords, thereby establishing a logical association between the event and possible cause events. After executing according to the above process, the finally generated event context analysis result can accurately display the causes, influencing factors, and subsequent recovery progress of the suspension event, enabling users to more clearly understand the evolution process of the event.
[0018] Step 102: Generate an analysis question document for the result event based on all the event keywords.
[0019] In some embodiments of the present application, in order to ensure the accuracy of event context analysis, it is necessary to construct an analysis question document based on all event keywords, which is used to guide the event context analysis model to focus on core events and establish a causal reasoning structure around them. This enables the model to clarify the scope of analysis, and to construct event relationships according to the preset question-and-answer logic, thereby improving the systematicness and accuracy of event reasoning. For example, during the execution process, the system can first combine the keywords of the event to be analyzed, and generate an analysis question document in a structured format of scenario instructions (instruction), input content (input), and output requirements (output). Among them: instruction is used to define tasks and guide the model to understand the goals and format requirements of event context analysis; input contains all event keywords and is used to describe the basic information of the event to be analyzed; output uses a preset format to set the expected structure of event analysis (data type (such as lightweight data exchange format (JavaScript ObjectNotation, JSON, etc.))) to ensure that the model output results conform to the event development logic. The Analysis Question Document is a structured text format that contains guiding questions about the causal relationship of events, allowing the model to analyze around the correct information during the reasoning process and generate event context results in a predetermined format. Through this document, the model can build a causal chain based on event keywords, improve the integrity of event reasoning, and reduce the impact of irrelevant information.
[0020] like Figure 2 As shown in the figure, in a specific example, suppose that the event of "subway suspension in a certain city" needs to be analyzed, and the keywords of the event include "subway suspension", "equipment failure", "emergency dispatch", and "resumption of operation". During the execution process, the system generates the following analysis question document based on the formatting template of the briefing materials: { "instruction": "You are an expert in sorting out the context of news. Please analyze the context of the event based on the keywords in the input and return it strictly in the json array format of [{\"event\":\"\",\"date\":\"\"}].", "input": ["Subway suspension", "Equipment failure", "Emergency dispatch", "Resume operation"], "output": [] } After executing in the above format, the model will combine historical data during the inference process and generate output based on event keywords, which contains causal information about the event, such as: { "output": {"event": "Sudden equipment failure in the subway system, resulting in train suspension", "date": "2025-03-23"}, {"event": "The operator initiated emergency dispatching and arranged for alternative transportation", "date": "2025-03-23"}, {"event": "The troubleshooting of equipment failure was completed, and the subway resumed operation", "date": "2025-03-24"} } Finally, the generation of the analysis question document gives the event context analysis process a clear structure, and ensures that the model can carry out logical reasoning around the core event during the analysis process, making the presentation of the causal relationship of events more complete and reliable.
[0021] Step 103, input the analysis question document into the event context analysis model to obtain the context analysis result of the result event.
[0022] Among them, the context analysis result is used to represent the causal association relationship formed between at least one target cause event among multiple cause events and the result event; the event context analysis model is trained based on all the cause events.
[0023] In some embodiments of the present application, to ensure the accuracy of event context analysis, it is necessary to input the generated analysis question document into the event context analysis model to obtain the causal context analysis result of the result event, infer the potential causal relationship of the event using pre-trained data, and generate a context analysis result that conforms to the logical development of the event. During the execution process, the system, based on the constructed analysis question document, uses it as input data and sends it into the event context analysis model. When parsing the question document, the model retrieves multiple cause events related to the result event and constructs its causal chain according to the pre-trained data and inference algorithm. Subsequently, the model outputs the event context analysis result in a preset format, enabling users to clearly understand the development process of the event and its potential influencing factors. The event context analysis result (Event Context Analysis Result) is used to characterize the causal relationship between multiple cause events and the result event. Through this result, users can intuitively view the evolution path of the event and analyze the key influencing factors. Since the event context analysis model is trained based on all cause events, the final generated target cause events are derived from the model training data, making the inference result more reasonable and in line with the actual logic. In this way, the event context analysis model can perform inference based on structured input, improve the accuracy of causal analysis, enhance the coherence of the event development context, and at the same time ensure that the final analysis result conforms to the real data logic, making the event context analysis process more reliable and efficient.
[0024] In a specific example, assume that it is necessary to analyze the event of "subway suspension in a certain city". The generated analysis question document contains keywords such as "subway suspension", "equipment failure", "emergency dispatch", and "resumption of operation". During the execution process, the system inputs this analysis question document into the event context analysis model. The model first retrieves historical data and constructs the causal chain of the subway suspension event based on the cause events during the training process. During the inference process, the model identifies "equipment failure" as the main cause event and speculates that "emergency dispatch" affects the recovery process, and finally outputs the following event context analysis result: { "output": {"event": "The subway system suddenly experienced equipment failure, resulting in train suspension", "date": "2025-03-23"}, {"event": "The operator initiated emergency dispatch and arranged alternative transportation", "date": "2025-03-23"}, {"event": "The equipment failure troubleshooting was completed, and the subway resumed operation", "date": "2025-03-24"} } After executing according to the above process, the finally generated event context analysis result accurately shows the causes, influencing factors and recovery process of the subway suspension event, enabling users to comprehensively understand the development context of the event and using the inference result as a decision-making reference.
[0025] In summary, in the embodiment of the present application, by using all the cause events participating in the training as learning samples, it is ensured that the target cause events in the generated analysis results are derived from the cause events for training, enabling the model to accurately master the causal logic between events; furthermore, based on the description document of the result event to be analyzed, event keywords are extracted to accurately locate the core content of the event and improve the focusing ability of the event analysis process; then an analysis question document is generated to ensure that the event context analysis model conducts training around the core event, optimize the causal reasoning ability, enable the model to focus on the direct influencing factors of the result event, and avoid relying solely on statistical correlation for speculation. At this time, since the model has been trained for multiple cause events, when a new event to be analyzed is input, the model can automatically match the relevant cause events in the training data to ensure that the analysis result conforms to the real logic and avoid making inferences based solely on correlation. Finally, by constructing causal associations through training data, it is ensured that the inference result conforms to the development trend of the event, while reducing the interference of noise data on event inference and improving the analysis accuracy. Therefore, based on the method of the embodiment of the present application, more accurate and complete event causal reasoning is achieved, providing intelligent support for news analysis and information processing, and at the same time enhancing the reliability and applicability of causal relationship modeling.
[0026] Figure 3 It is another event context analysis method based on causal relationship provided by the embodiment of the present application.
[0027] The method may include the following steps: Step 201, determine at least one event keyword of the result event according to the description document of the result event to be analyzed.
[0028] The method shown in this step has been described in step 101 and will not be elaborated here.
[0029] Step 202, generate an analysis question document for the result event according to all the event keywords.
[0030] The method shown in this step has been described in step 102 and will not be elaborated here.
[0031] Step 203, input the analysis question document into the event context analysis model to obtain the context analysis result of the result event.
[0032] Among them, the context analysis result is used to represent the causal association relationship formed by at least one target cause event among multiple cause events and the result event; the event context analysis model is trained according to all the cause events.
[0033] The method shown in this step has been described in step 103 and will not be elaborated here.
[0034] Optionally, as Figure 4 shown, the event context analysis model includes multiple encoding modules, and step 203 includes the following sub-steps: Sub-step 2031: Extract the initial token sequence of the result event from the context analysis question document.
[0035] In some embodiments of the present application, in order to ensure that the event context analysis model can accurately parse the text information of the result event, it is necessary to extract the initial token sequence of the result event from the context analysis question document. In this way, the text data can be structured, so that the subsequent encoding process can be carried out around the accurate token sequence, ensuring the accuracy of event analysis. During the execution, the system parses the context analysis question document and uses tokenization technology to convert the result event text into a token sequence. Each token represents the basic semantic unit in the text and is used for the processing of subsequent encoding modules. The structured processing of the token sequence enables event context analysis to be performed based on stable text input data, ensuring the consistency of causal reasoning. A token sequence refers to the basic unit obtained by splitting text data in natural language processing, and each token represents an independent semantic information block. By extracting the token sequence, the event context analysis model can obtain a standardized data input format, enabling the subsequent encoding process to more effectively establish a relationship model between events. In this way, it can be ensured that the input data in the event analysis process meets the expectations, improving the accuracy of extracting event keywords, and at the same time providing structured input for the subsequent encoding module, thereby enhancing the accuracy and stability of event causal reasoning.
[0036] In a specific example, the user needs to analyze the news report of the event of "subway suspension in a certain city". The news report contains multiple descriptive contents related to the development of the event. During the execution, the system first parses the news text and uses tokenization technology to process the text, identifies the text data containing event keywords, and converts it into a token sequence, for example: ["subway", "suspension", "equipment failure", "emergency dispatch", "resumption of operation"] These token sequences are used as the input data for event analysis, ensuring that the subsequent encoding process can be carried out around the core information of the event, thereby forming a stable event context analysis structure. After executing the above process, the system finally successfully extracts the token sequence for subsequent encoding processing, making the event context reasoning process more coherent and accurate.
[0037] Sub-step 2032: Input the initial token sequence into the first encoding module among multiple encoding modules, so that each encoding module processes the token sequence sequentially, and obtain the final token sequence of the result event from the second encoding module among multiple encoding modules.
[0038] Among them, the first encoding module is the first encoding module among multiple encoding modules that processes the token sequence sequentially, and the second encoding module is the last encoding module among multiple encoding modules that processes the token sequence sequentially.
[0039] In some embodiments of the present application, in order to ensure that the event context analysis model can accurately process the text information of the result event, it is necessary to input the initial token sequence into the first encoding module among multiple encoding modules, and perform sequential processing in turn. Finally, obtain the final token sequence of the result event in the second encoding module among multiple encoding modules. In this way, the model can gradually extract semantic features, ensuring the hierarchical and stable processing of the token sequence. During the execution process, the system first inputs the initial token sequence into the first encoding module, and performs feature transformation and semantic representation optimization on the token sequence. Subsequently, the sequence passes through multiple encoding modules in turn, and each encoding module processes the input data deeply, extracting semantic features at different levels until the last encoding module generates the final token sequence. The sequential processing between different encoding modules ensures the hierarchical expression of event text information, enabling the model to more accurately identify the causal relationship between events. The encoding module is composed of multiple computational levels, and each module contains a multi-head attention sub-module and a feed-forward network sub-module, which are used to capture the relationship features inside the text and perform non-linear transformation respectively. Through the layer-by-layer processing of the encoding module, the model can deeply understand the event text, optimize its representation in the event context analysis, and improve the inference accuracy. Finally, ensure that the event text information is fully processed in the encoding modules at different levels, so that the final token sequence of the result event can accurately represent the semantic core of the event text, improving the stability and inference ability of the event context analysis model.
[0040] In a specific example, the user needs to analyze the event of "subway suspension in a certain city". The system first parses the event text and extracts the initial token sequence. During the execution process, the system inputs the token sequence into the first encoding module, which uses the multi-head attention mechanism to extract the basic semantic features of the text. Subsequently, the token sequence passes through multiple encoding modules in turn, and the system identifies the context relationship of event keywords at different levels and optimizes the semantic expression of the sequence. Finally, after being processed by the second encoding module, the system obtains the optimized token sequence. After executing according to the above process, the finally processed token sequence not only retains the core semantics of the event, but also enhances the expression ability of the event evolution context, making the event context analysis process more accurate and efficient.
[0041] Optionally, in order to input the initial token sequence into the first encoding module among multiple encoding modules, sub-step 2032 can be implemented through the following sub-steps: Sub-step 20321: Embed the token sequence into the first multi-head attention sub-module of the first encoding module according to the embedding parameters respectively corresponding to each token in the token sequence.
[0042] In some embodiments of the present application, in order to ensure that the initial token sequence can adapt to the processing structure of the encoding module, it is necessary to embed it into the first multi-head attention sub-module of the first encoding module according to the embedding parameters respectively corresponding to each token in the token sequence. In this way, the system can convert the original text data into a high-dimensional vector representation, improve the information expression ability of tokens in the model, and enhance the semantic correlation degree of event analysis. During the execution process, the system first retrieves each token in the token sequence and looks up the corresponding embedding parameters, which are used to map the tokens into the vector space that the model can process. Subsequently, the system transforms the tokens through the embedding matrix to make them have a fixed dimension, and sends the processed embedding data into the first multi-head attention sub-module of the first encoding module. The multi-head attention mechanism can extract the context relationship of tokens at this stage, enabling the model to identify key factors in the event context and ensuring semantic consistency of the data during subsequent encoding. Embedding Parameters refer to the set of parameters used to map discrete text data into a continuous vector space. Each token will be transformed into a numerical vector during the embedding process to improve the adaptability of the model in semantic analysis and reasoning tasks. Through the token embedding process, the system can ensure that the input data meets the feature extraction requirements of the model, make the subsequent encoding process more stable, and optimize the accuracy of event context analysis. In this way, the system can convert the token sequence into a high-dimensional vector suitable for multi-head attention calculation, enabling the event text to better express its semantic features, improving the model's understanding ability of events, and enhancing the rationality and stability of the event context analysis results.
[0043] In a specific example, when a user needs to analyze the event of "subway outage in a certain city", the system first parses the event text and extracts the initial token sequence: ["subway", "outage", "equipment failure", "emergency dispatch", "resume operation"] During the execution process, the system looks up the embedding parameters corresponding to each token and uses a pre-trained embedding matrix to transform the tokens to make them have a fixed vector representation, for example: { "subway": [0.15, -0.23, 0.87,...], "Outage": [0.64, 0.12, -0.45, ...], "Equipment failure": [0.33, -0.56, 0.74, ...] } The converted embedding vectors are used as inputs and fed into the first multi-head attention submodule of the first encoding module. At this stage, the system calculates the context relationships between the tokens and other tokens, and extracts the key factors in the event context. After executing according to the above process, the final embedding process is completed, enabling the event analysis model to better understand the text information of the subway outage event and optimizing the accuracy of event causal reasoning.
[0044] Optionally, each encoding module respectively includes a multi-head attention submodule used as an input processing layer and a feed-forward network submodule used as an output processing layer. In each encoding module, in order to sequentially process the token sequence through each encoding module, sub-step 2032 includes the following sub-steps: Sub-step 20322: Embed the token sequence used for the input encoding module into the multi-head attention submodule of the encoding module.
[0045] In some embodiments of the present application, in order to ensure that the processing of the token sequence in the encoding module has the ability to understand context, it is necessary to embed the token sequence used for the input encoding module into the multi-head attention submodule of the encoding module. In this way, the model can simultaneously focus on different parts of the token sequence, making the input data have rich semantic information and improving the accuracy of event context analysis. During the execution process, the system first inputs the token sequence into the encoding module and converts it into a vector representation through an embedding matrix. Subsequently, the multi-head attention submodule processes the token sequence. Each attention head focuses on different semantic features, captures the potential relationships between the tokens, and optimizes them in combination with context information. This process enables the model to comprehensively consider the relevance of event keywords, ensuring that the causal reasoning of event context analysis is more reasonable. The multi-head attention submodule is a computational layer used in natural language processing. It calculates the relationships between tokens in parallel through multiple attention heads to enhance the model's ability to understand complex text information. Through this processing, the system can improve the expression ability of event keywords in causal reasoning and enhance the accuracy of event context analysis. In this way, the token sequence is optimized based on the multi-head attention mechanism in the encoding module, enabling the semantic features of the event text to be fully learned and ensuring that the subsequent processing process meets the logical requirements of event causal analysis, improving the stability and reasoning ability of the event context analysis model.
[0046] In a specific example, the user needs to analyze the event of "subway suspension in a certain city". The system first parses the event text and extracts the initial token sequence: ["subway", "suspension", "equipment failure", "emergency dispatch", "resumption of operation"]. During the execution process, the system embeds this token sequence into the multi-head attention sub-module of the encoding module. This module uses multiple attention heads to calculate the relevance between tokens in parallel, and respectively focuses on: the relationship in the time dimension (such as the logical connection between "resumption of operation" and "suspension"), the analysis of causal factors (such as the impact of "equipment failure" on "suspension"), the decision-making correlation of emergency dispatch (such as the impact of "emergency dispatch" on the resumption of operation), etc. After calculation, the multi-head attention sub-module generates an optimized sequence, enhancing the semantic information of each token and improving the accuracy of subsequent event context analysis. After executing the above process, the finally processed token sequence makes the event causal reasoning more in line with real-world logic and ensures the stability of the analysis results.
[0047] Sub-step 20323, determine the token sequence output by the encoding module as the feed-forward output sequence processed by the residual of the multi-head output sequence.
[0048] Among them, the multi-head output sequence is the sequence output by the multi-head attention sub-module, and the feed-forward output sequence is the sequence output by the feed-forward network sub-module of the encoding module.
[0049] In some embodiments of the present application, in order to ensure that the encoding module can output an optimized token sequence, it is necessary to utilize the multi-head output sequence of the multi-head attention sub-module and combine it with the feed-forward output sequence of the feed-forward network sub-module, and determine the final output sequence of the encoding module through a residual processing method. In this way, the system can enhance the semantic structure of the event text and improve the expressive ability of the event context analysis model. During the execution process, the system first obtains the multi-head output sequence from the multi-head attention sub-module, and this sequence contains the context information between tokens. Subsequently, the system obtains the feed-forward output sequence from the feed-forward network sub-module, and this sequence contains the non-linear transformation results of the tokens. Then, the system uses the residual processing method to combine the two, ensuring that the model will not experience a decline in expressive ability due to vanishing gradients during the training process. Finally, the token sequence output by the encoding module retains the context information and enhances the causal expressive ability of the event context. Residual Processing is a method for optimizing the neural network structure. It introduces skip connections to keep the data stable during multi-layer calculations and reduce information loss. Through residual processing, the system can effectively improve the calculation results of the deep encoding layer and ensure that the event context analysis model has stronger reasoning ability. Finally, the encoding module can output an optimized token sequence, making the semantic expression of the event text more accurate, reducing information loss, improving the stability and reasoning effect of event context analysis, and ensuring that the result sequence can be correctly mapped to the final output format of event context analysis.
[0050] In a specific example, the user needs to analyze the event of "subway suspension in a certain city". During the execution process, the system first processes the token sequence. The system extracts the multi-head output sequence from the multi-head attention sub-module and simultaneously extracts the feed-forward output sequence from the feed-forward network sub-module. The system uses residual processing to combine the two. Finally, the encoding module outputs an optimized token sequence, making the event information more expressive and improving the accuracy of event causal analysis.
[0051] Sub-step 2033, update the final token sequence through normalization processing.
[0052] In some embodiments of the present application, in order to ensure that the token sequence output by the event context analysis model is stable and suitable for subsequent processing, it is necessary to perform normalization processing on the final token sequence to optimize the distribution and expressive ability of the token sequence. This can reduce the impact of noisy data on model inference and ensure the consistency and reliability of the token sequence during the event context analysis process. During the execution process, the system first performs a normalization operation on the final token sequence to adjust the scale and distribution of the token data to conform to a preset normalization standard. The normalization process can adopt methods such as Mean Normalization or Standardization to ensure the stability of the input tokens during encoding processing at different levels. The normalized token sequence is used as the optimized input, enabling the event analysis model to more accurately infer the causal relationships between events and improving the accuracy of the event context analysis results. Normalization refers to performing a numerical transformation on the input data to adjust the data distribution within a preset range and improve the compatibility of the data in different calculation modules. Through normalization, the model can avoid unstable calculations caused by abnormal input data, improving the overall consistency and interpretability of the event inference process. Finally, through this step, it is ensured that the expression of the token sequence in the event context analysis model is more stable, enabling the event text information to better adapt to the inference process after normalization, improving the accuracy of causal inference, and reducing the numerical deviation during the model calculation process.
[0053] In a specific example, the user needs to analyze the event of "subway outage in a certain city". The system first parses the event text. During the execution process, the system performs normalization processing on the token sequence to ensure that the expression of each token conforms to a preset standard distribution. The normalized token sequence reduces redundant information, making the tokens more in line with the requirements of event causal inference and improving the expressive ability of the subsequent event context analysis model for event information. After executing according to the above process, the result of the final normalization processing makes the event inference more accurate, improves the stability of model calculation, and optimizes the reliability of event context analysis.
[0054] Sub-step 2034, map the final token sequence to the context analysis result through linear transformation processing.
[0055] In some embodiments of the present application, in order to ensure that the event context analysis model can convert the finally processed token sequence into a standardized event context analysis result, it is necessary to perform a linear transformation process on the final token sequence. In this way, the model can convert the sequence data into a structured format, making the event analysis result conform to the established output specifications. During the execution process, the system first performs matrix operations on the final token sequence and adjusts its numerical space through linear mapping technology to make the distribution of the data more stable. The linear transformation optimizes the feature expression of the token sequence through matrix multiplication and bias terms, enabling it to be more naturally mapped to the preset format of the event context analysis result. In addition, the linear transformation can also ensure the consistency of the data between different calculation layers, improving the output reliability of the event reasoning model. Linear Transformation is a mathematical operation method used to adjust the scale and distribution of data and ensure that the input data can be used in a standardized format for subsequent reasoning processes. Through linear transformation, the model can optimize the structure of the data and make it conform to the logical relationship of event context analysis, improving the applicability of the data in causal reasoning. In this way, the event context analysis result is standardized, enabling the model to output structured event development information, improving the stability of the analysis result, and ensuring the interpretability and logical consistency of the event evolution process.
[0056] In a specific example, the user needs to analyze the event of "subway suspension in a certain city". The system first extracts and normalizes the token sequence. During the execution process, the system performs a linear transformation process on the token sequence, adjusts the token features through matrix operations, and enables it to be mapped to a structured event context analysis result. After executing according to the above process, the finally output event context analysis result conforms to the preset standardized format, and ensures that the data can accurately present the evolution process of the event, improving the accuracy and integrity of event causal reasoning. In some embodiments of the present application, the event context analysis model can implement the above process through a linear transformation processing sub-module. In some embodiments of the present application, the above process can be implemented through a normalization processing sub-module set in each encoding module as an intermediate processing layer.
[0057] Step 204, perform data verification on the context analysis result, and determine the output method of the context analysis result according to the verification result of the data verification.
[0058] Among them, the execution process of the output method is one of direct output, adjusted output, and error reporting output.
[0059] In some embodiments of the present application, to ensure the accuracy of the event context analysis results, it is necessary to verify the context analysis data generated by the model and determine an appropriate output method based on the verification results. By reducing errors, redundancies, or format anomalies in the data generated by the model, the reliability of the event context analysis is improved. During the execution process, the system first performs data verification on the context analysis results. For example, format verification can be performed to check whether the generated results conform to a preset structured data format (such as JSON array format) to ensure the integrity of the data structure; or confirm that the output content contains necessary event information (such as time, event description), and eliminate abnormal key-value pairs; or detect duplicate events in the output data to avoid the impact of redundant information on the analysis quality. Data Validation refers to performing logical checks on the data output by the model to ensure that it conforms to preset rules and can be used for further analysis. By performing data verification, the credibility of the event context can be enhanced, making subsequent causal reasoning more accurate. After the verification is completed, the system determines the output method based on the verification results, and then adopts one of direct output, adjusted output, or error reporting output. Ultimately, the quality of the event context analysis results is ensured, the stability of the analysis model is improved, and users can obtain accurate and reliable event development context information.
[0060] In a specific example, assume that the event context analysis model generates an analysis result for the event of "subway suspension in a certain city". The system first performs data verification. During the execution process, the system discovers that some events in the JSON array output by the model lack time information, and there are duplicate event descriptions, such as: { "output": {"event": "Subway equipment failure leads to suspension", "date": "2025-03-23"}, {"event": "Subway equipment failure leads to suspension", "date": "2025-03-23"}, {"event": "The operator initiates emergency dispatching", "date": ""}, {"event": "Equipment fault troubleshooting completed, subway resumes operation", "date": "2025-03-24"} } Through format verification, data integrity verification, and repeatability verification, the system identifies that there are duplicate events: "Subway equipment failure leads to suspension" appears twice and needs to be de-duplicated, and there is a lack of time information: the event of "The operator initiates emergency dispatching" lacks a date and needs to supplement or adjust the data format. Then, based on the verification results, the system performs adjusted output, optimizes the data, and generates the final analysis result: { "output": {"event": "Subway equipment failure leads to suspension of service", "date": "2025-03-23"}, {"event": "The operator initiates emergency dispatching", "date": "2025-03-23"}, {"event": "Equipment fault troubleshooting completed, subway resumes operation", "date": "2025-03-24"} } After executing according to the above process, the finally output data conforms to the expected format, and ensures that the result of the event context analysis accurately reflects the development process of the subway suspension event, enabling users to more clearly understand the impact and causal logic of the event.
[0061] Optionally, step 204 includes the following sub-steps: Sub-step 2041, when the context analysis result meets the preset data format requirements, and the key values stored in the context analysis result meet the preset first key value rationality requirements and the first data repeatability requirements, directly output the context analysis result.
[0062] Among them, the first key value rationality requirement is used to represent that all key values are reasonable data; the first data repeatability requirement is used to represent that all key values do not repeat each other.
[0063] In some embodiments of the present application, to ensure that the data output by the event context analysis model meets the preset format requirements, it is necessary to directly output the context analysis result when the context analysis result meets the preset data format requirements, and the stored key - value pairs meet the first key - value rationality requirement and the first data uniqueness requirement. During the execution process, the system first performs a format check on the context analysis result to confirm whether the data conforms to the preset structured standard (such as JSON array format). Subsequently, the system verifies whether the stored key - value pairs meet the first key - value rationality requirement, that is, all key - value pairs belong to a reasonable data range and do not contain abnormal or unrecognizable content. At the same time, the system checks the first data uniqueness requirement to ensure that all key - value pairs are non - repetitive with each other, avoiding the impact of redundant data on the accuracy of event analysis. After meeting these conditions, the system directly outputs the context analysis result without further adjusting or correcting the data. The key - value rationality requirement (Key Value Validity Requirement) is used to ensure that the stored data is available and conforms to the expected information, while the data uniqueness requirement (Data Uniqueness Requirement) is used to prevent duplicate data from affecting the calculation result. Through these verification criteria, the system can directly output the analysis result on the premise of ensuring data quality, improve the efficiency of the processing process, and reduce unnecessary consumption of computing resources. In this way, the system can efficiently output the context analysis result that meets the preset requirements, make the event context analysis process smoother, improve the usability of the data, and ensure that subsequent analysis and decision - making are based on accurate information.
[0064] In a specific example, the user needs to analyze the event of "subway suspension in a certain city". The system first generates a context analysis result based on historical data and checks whether the data format conforms to the JSON structure: { "output": {"event": "Subway equipment failure leads to suspension", "date": "2025 - 03 - 23"}, {"event": "The operator starts emergency dispatching", "date": "2025 - 03 - 23"}, {"event": "Equipment fault troubleshooting completed, subway resumes operation", "date": "2025 - 03 - 24"} } During the execution process, the system first confirms that the data meets the preset format requirements and checks the stored key - value pairs: Key-value rationality verification: All event data conform to the standards of event context analysis and do not contain abnormal information; data repeatability verification: All event descriptions are independent events and there are no duplicates. Since the data meets the format requirements, key-value rationality requirements, and data uniqueness requirements, the system directly outputs the context analysis results, enabling users to view the development process of events and conduct further analysis. After executing the above process, the final context analysis results are output without adjustment, improving the stability and reliability of data processing.
[0065] Sub-step 2042, when the context analysis results meet the preset data format requirements, the key values stored in the context analysis results meet the preset second key-value rationality requirements and / or second data repeatability requirements, adjust the context analysis results and output the adjusted context analysis results.
[0066] Among them, the second key-value rationality requirement is used to represent that some key values are reasonable data; the second data repeatability requirement is used to represent that there are duplicates in the key values.
[0067] In some embodiments of the present application, to ensure the accuracy of the event context analysis results and the data quality, it is necessary to adjust the event context analysis results and output the adjusted results when the context analysis results meet the preset data format requirements, and the stored key values meet the second key value rationality requirement and / or the second data repeatability requirement. In this way, the system can optimize errors or redundant information during the data verification process, improve the accuracy of event analysis, and ensure that the finally output data meets the rationality standard. During the execution process, the system first performs a format verification on the event context analysis results to confirm that the data structure conforms to the preset standard (such as JSON array format). Subsequently, the system checks whether the stored key values meet the second key value rationality requirement, that is, some key values belong to reasonable data, but there may be format exceptions or missing content. At the same time, the system detects the second data repeatability requirement to identify whether there are duplicate items in the data, such as multiple records representing the same event but with inconsistent time information. For the detected abnormal data, the system executes adjustment strategies, including: format correction: adjusting the data structure to conform to the preset requirements; content optimization: supplementing missing information or standardizing the data expression; deduplication: removing duplicate data to ensure that each event appears only once in the event context analysis results. The second key value rationality requirement (Key ValuePartial Validity Requirement) is used to ensure the reasonable overall data structure, but allows some fields to require optimization, while the second data repeatability requirement (Data Deduplication Requirement) is used to identify and adjust duplicate items. Through these optimization strategies, the system can improve the data availability and ensure that the finally output event context analysis results are more reliable. In this way, the system can optimize the event context analysis results while ensuring the data quality, improve the integrity of the data structure, reduce unnecessary duplicate information, and ensure the logical correctness of event causal analysis, enabling users to obtain more accurate event context information.
[0068] In a specific example, the user needs to analyze the event of "subway suspension in a certain city". The system first generates preliminary event context analysis results: { "output": {"event": "Subway equipment failure leads to suspension", "date": "2025-03-23"}, {"event": "Equipment failure leads to suspension", "date": "2025-03-23"}, {"event": "The operator starts emergency dispatching", "date": ""}, {"event": "Equipment fault troubleshooting completed, subway resumed operation", "date": "2025-03-24"} } During the execution process, the system found the following problems: Data duplication problem: The events of "Subway equipment failure leading to suspension of operation" and "Equipment failure leading to suspension of operation" are duplicated and need to be de-duplicated; The system executes the adjustment strategy: { "output": {"event": "Subway equipment failure leading to suspension of operation", "date": "2025-03-23"}, {"event": "Operator initiated emergency dispatch", "date": ""}, {"event": "Equipment fault troubleshooting completed, subway resumed operation", "date": "2025-03-24"} } After executing according to the above process, the final adjusted context analysis result meets the format requirements, removes duplicate data, and makes the event analysis result more complete and accurate.
[0069] Sub-step 2043, in the case where the context analysis result does not meet the preset data format requirements and / or the key values stored in the context analysis result do not meet the first key value rationality requirement and the second key value rationality requirement, discard the context analysis result and output an error instruction.
[0070] In some embodiments of the present application, to ensure the data quality and format compliance of the event context analysis results, when the context analysis results do not meet the preset data format requirements, or the stored key - values do not meet the first key - value rationality requirement and the second key - value rationality requirement, the system will discard the analysis results and output an error message. Through this step, it is possible to effectively prevent incorrect data from affecting the accuracy of event context analysis and ensure that only the analysis results that meet the expectations are used in the subsequent processing. During the execution, the system first checks whether the context analysis results meet the data format requirements, that is, ensures that the output data is stored in a preset structured format (such as JSON array format). If the data format does not meet the requirements, the system directly determines that the analysis results are unavailable. Subsequently, the system verifies whether the stored key - values meet the first key - value rationality requirement, that is, all key - values should be reasonable data without abnormal or unparsable content. At the same time, the system checks the second key - value rationality requirement to ensure that at least some key - values meet the rationality standard. If all key - values do not meet the requirements, the data is determined to be unavailable. When any of the error conditions is met, the system executes the error - handling strategy, including: Error message recording: The system records the error type and reason for subsequent diagnostic analysis; Data discarding: Clears the analysis results to prevent unqualified data from affecting subsequent reasoning; Error message output: Notifies the system or user that the current analysis results are unavailable and prompts the possible reasons for the error. The key - value rationality requirement (Key Value Validity Requirement) is used to ensure that the data meets the preset standards, while the data format requirement (Data Format Requirement) is used to ensure the structured specification of the system output. Through these verification standards, the system can quickly identify abnormal data and take necessary measures to improve the credibility and stability of event context analysis. Ultimately, the system can effectively filter out the analysis results that do not meet the format or data rationality requirements, ensure that the finally output data meets high - quality standards, and at the same time prevent incorrect data from affecting the causal reasoning ability of event context analysis, enabling users to obtain more accurate analysis results.
[0071] In a specific example, the user needs to analyze the event of "subway suspension in a certain city", and the system generates preliminary context analysis results: { "output": {"event": "A subway system failure caused the trains to stop operating"}, {"event": "Returned to normal operation", "date": "2025 - 03 - 24"} } During the execution process, the system found that: data format error: the "subway system malfunctioned, resulting in train suspension" event lacked a date field and did not conform to the preset JSON array format. At the same time, the key-value did not meet the rationality requirements: the time information of the "resumed normal operation" event was complete, but the event description was vague and did not provide enough information. Since the analysis result did not meet the data format requirements and the stored key-value did not meet the first key-value rationality requirements, the system executed an error handling strategy, such as recording the error information, marking the data as unavailable, or discarding the analysis result, to avoid the impact of incorrect data on event causality analysis and output an error message: "error": "The analysis result format is incorrect or contains abnormal data and cannot be used. Please check the input data or adjust the analysis parameters and then re-execute the analysis." After executing the above process, the incorrect data was effectively identified and processed, enabling the system to only retain qualified data, ensuring that the event context analysis result met the expected standards, and improving the accuracy and reliability of the overall analysis.
[0072] As Figure 5 shown, is a complete event context analysis process under the method of the embodiment of the present application: Event context generation process S1: S11, Prompt engineering: Format the event keywords through prompt engineering to provide structured input for the event context analysis model, so as to improve the model's task understanding ability and the consistency of the output format. The prompt contains task instructions, context information, and the expected output format to guide the model to accurately generate event context data; S12, Generate event context based on the model: After the event keywords are processed, they are sent into the event context analysis model. Based on the pre-trained data and the causal reasoning mechanism, the model constructs the evolution path of the event. Through the multi-head attention mechanism and deep encoding processing, the model can identify the causal relationship between events and generate an event context analysis result that conforms to the established format; Data verification process S2: S21, Format verification: Verify the format of the generated event context analysis result to ensure that the data conforms to the preset structured format (such as JSON array). The system checks the integrity of the data to avoid the impact of format anomalies on the reliability of the analysis result; S22, Key-value verification: Verify the rationality of the key-values stored in the event context analysis result to ensure that all event descriptions and time information meet the expected requirements. The system screens out non-standard data and adjusts some data that does not meet the requirements; S23, Data duplication verification Check whether there are duplicate event records in the event context analysis result to ensure the uniqueness of the event context data. The system removes redundant data to make the analysis result more accurate and usable.
[0073] AsFigure 6 As shown, it is a program flow for data verification under the method of the embodiment of the present application: R1. Format verification: Check whether the result of context analysis conforms to the preset data format requirements, such as whether it is in the JSON array format. If the data format is abnormal, the system will mark the data as unavailable and prevent subsequent processing; R2. Integrity verification of key fields: The system verifies whether the result of context analysis contains necessary key fields, such as event description (event) and event time (date). Data missing key fields will be marked and enter the adjustment or elimination process; R3. Logical consistency verification: The system checks whether the time information and event sequence in the result of event context analysis are logical. For example, if the event order does not match the time axis, the system will adjust the order or mark the data as abnormal; R4. Rationality verification of key values: Identify whether the key values in the result of context analysis are reasonable, such as whether they contain abnormal characters, non-standard event descriptions, or time formats that cannot be parsed. Data that meets some rationality criteria enters the adjustment process, and data that does not meet the criteria will be eliminated; R5. Data duplication verification: The system checks whether there are duplicate data in the result of context analysis. For example, whether the same event description appears repeatedly at different time nodes. If duplicate data is found, the system will perform deduplication processing to improve the uniqueness of the analysis result; R6. Output processing: After the verification is completed, execute the final output strategy according to the verification results, including direct output, adjusted output, or error output: Data that meets all requirements is directly output; data that meets some requirements is output after adjustment; data that does not meet the requirements is discarded and an error message is output.
[0074] In summary, in the embodiments of the present application, by using all the cause events participating in the training as learning samples, it is ensured that the target cause events in the generated analysis results come from the cause events used for training, enabling the model to accurately master the causal logic between events. Furthermore, based on the description document of the result event to be analyzed, event keywords are extracted to accurately locate the core content of the event and improve the focusing ability during the event analysis process. Then, an analysis question document is generated to ensure that the event context analysis model is trained around the core event, optimizing the causal reasoning ability and enabling the model to focus on the direct influencing factors of the result event, avoiding speculation solely based on statistical correlation. At this time, since the model has been trained on multiple cause events, when a new event to be analyzed is input, the model can automatically match the relevant cause events in the training data to ensure that the analysis results conform to real-world logic and avoid making inferences solely based on correlation. Finally, a causal association is constructed through the training data to ensure that the reasoning results conform to the development trend of the event, while reducing the interference of noise data on event inference and improving the analysis accuracy. Thus, based on the method of the embodiments of the present application, more accurate and complete event causal reasoning is achieved, providing intelligent support for news analysis and information processing, and at the same time enhancing the reliability and applicability of causal relationship modeling.
[0075] Reference Figure 7 , which shows an event context analysis device 30 based on causal relationship provided by the embodiments of the present application, including: A keyword module 301, configured to determine at least one event keyword of the result event according to the description document of the result event to be analyzed; A prompt word module 302, configured to generate an analysis question document for the result event according to all the event keywords; An analysis module 303, configured to input the analysis question document into an event context analysis model to obtain a context analysis result for the result event; the context analysis result is used to represent the causal association relationship formed between at least one target cause event among multiple cause events and the result event; the event context analysis model is trained according to all the cause events.
[0076] Optionally, the analysis module 303 includes: A sequence extraction sub-module, configured to extract an initial token sequence of the result event from the context analysis question document; A sequence processing sub-module, configured to input the initial token sequence into a first encoding module among multiple encoding modules, so that each encoding module sequentially processes the token sequence, and obtain a final token sequence of the result event from a second encoding module among multiple encoding modules; the first encoding module is the first encoding module among the multiple encoding modules that sequentially processes the token sequence, and the second encoding module is the last encoding module among the multiple encoding modules that sequentially processes the token sequence; A result acquisition sub-module, configured to map the final token sequence to a context analysis result through linear transformation processing.
[0077] Optionally, the analysis module 303 further includes: A normalization sub-module, configured to update the final token sequence through normalization processing.
[0078] Optionally, each encoding module respectively includes a multi-head attention sub-module serving as an input processing layer and a feed-forward network sub-module serving as an output processing layer. In each encoding module, the sequence processing sub-module includes: A multi-head attention input unit, configured to embed the token sequence for input to the encoding module into the multi-head attention sub-module of the encoding module. An encoding output unit, configured to determine the token sequence output by the encoding module from the feed-forward output sequence processed by residual processing of the multi-head output sequence; the multi-head output sequence is the sequence output by the multi-head attention sub-module, and the feed-forward output sequence is the sequence output by the feed-forward network sub-module of the encoding module.
[0079] Optionally, the sequence processing sub-module includes: An initial input unit, configured to embed the token sequence into the first multi-head attention sub-module of the first encoding module according to the embedding parameters respectively corresponding to each token in the token sequence.
[0080] Optionally, the causal relationship-based event context analysis device 30 further includes: A verification module, configured to perform data verification on the context analysis result and determine the output mode of the context analysis result according to the verification result of the data verification; the execution process of the output mode is one of direct output, adjusted output, and error reporting output.
[0081] Optionally, the verification module includes: A direct output sub-module, configured to directly output the context analysis result when the context analysis result meets the preset data format requirements, the key values stored in the context analysis result meet the preset first key value rationality requirements and the first data repeatability requirements; the first key value rationality requirements are used to represent that all key values are reasonable data; the first data repeatability requirements are used to represent that all key values are not repeated with each other; An adjusted output sub-module, configured to adjust the context analysis result and output the adjusted context analysis result when the context analysis result meets the preset data format requirements, the key values stored in the context analysis result meet the preset second key value rationality requirements and / or the second data repeatability requirements; the second key value rationality requirements are used to represent that some key values are reasonable data; the second data repeatability requirements are used to represent that there are duplicates in the key values; An error reporting sub-module is configured to discard the context analysis result and output an error reporting instruction when the context analysis result does not meet the preset data format requirements and / or the key values stored in the context analysis result do not meet the first key value rationality requirement and the second key value rationality requirement.
[0082] In summary, in the embodiments of the present application, by using all the cause events participating in the training as learning samples, it is ensured that the target cause events in the generated analysis results are derived from the cause events used for training, enabling the model to accurately master the causal logic between events. Furthermore, based on the description document of the result event to be analyzed, event keywords are extracted to accurately locate the core content of the event, improving the focusing ability during the event analysis process. Then, an analysis question document is generated to ensure that the event context analysis model conducts training around the core event, optimizing the causal reasoning ability and enabling the model to focus on the direct influencing factors of the result event, avoiding speculation solely based on statistical correlation. At this time, since the model has been trained on multiple cause events, when a new event to be analyzed is input, the model can automatically match the relevant cause events in the training data, ensuring that the analysis result conforms to the real logic and avoiding inference solely based on correlation. Finally, causal associations are constructed through the training data to ensure that the inference result conforms to the development trend of the event, while reducing the interference of noise data on event inference and improving the analysis accuracy. Thus, based on the method of the embodiments of the present application, more accurate and complete event causal reasoning is achieved, providing intelligent support for news analysis and information processing, while enhancing the reliability and applicability of causal relationship modeling.
[0083] Referring to Figure 8 , the electronic device 500 may include one or more of the following components: a processing component 502, a memory 504, a power supply component 506, a multimedia component 508, an audio component 510, an input / output (I / O) interface 512, a sensor component 514, and a communication component 516.
[0084] The processing component 502 generally controls the overall operation of the electronic device 500, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 502 may include one or more processors 520 to execute instructions to complete all or part of the steps of the above methods. In addition, the processing component 502 may include one or more modules to facilitate the interaction between the processing component 502 and other components. For example, the processing component 502 may include a multimedia module to facilitate the interaction between the multimedia component 508 and the processing component 502.
[0085] The memory 504 is used to store various types of data to support the operation of the electronic device 500. Examples of such data include instructions for any application or method operating on the electronic device 500, contact data, phone book data, messages, pictures, multimedia, and the like. The memory 504 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a magnetic disk, or an optical disk.
[0086] The power supply component 506 provides power to various components of the electronic device 500. The power supply component 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 500.
[0087] The multimedia component 508 includes an interface that provides an output interface between the electronic device 500 and the user. In some embodiments, the interface may include a liquid crystal display (LCD) and a touch panel (TP). If the interface includes a touch panel, the interface can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can not only sense the boundaries of touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 508 includes a front camera and / or a rear camera. When the electronic device 500 is in an operating mode, such as a shooting mode or a multimedia mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.
[0088] The audio component 510 is used to output and / or input audio signals. For example, the audio component 510 includes a microphone (MIC) that is used to receive external audio signals when the electronic device 500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 504 or transmitted via the communication component 516. In some embodiments, the audio component 510 further includes a speaker for outputting audio signals.
[0089] The input / output I / O interface 512 provides an interface between the processing component 502 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, etc. These buttons can include, but are not limited to: a home button, a volume button, a start button, and a lock button.
[0090] The sensor assembly 514 includes one or more sensors for providing a status assessment of various aspects of the electronic device 500. For example, the sensor assembly 514 can detect the on / off state of the electronic device 500, the relative positioning of components, such as the display and keypad of the electronic device 500. The sensor assembly 514 can also detect a change in the position of the electronic device 500 or a component of the electronic device 500, the presence or absence of user contact with the electronic device 500, the orientation or acceleration / deceleration of the electronic device 500, and a change in the temperature of the electronic device 500. The sensor assembly 514 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 514 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0091] The communication component 516 is used to facilitate communication between the electronic device 500 and other devices in a wired or wireless manner. The electronic device 500 can access a wireless network based on communication standards, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 516 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0092] In an exemplary embodiment, the electronic device 500 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for implementing the methods provided in the embodiments of the present application.
[0093] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 504 including instructions that can be executed by a processor 520 of the electronic device 500 to complete the above method. For example, the non-transitory storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0094] Figure 9It is a block diagram of an electronic device 600 according to another embodiment of the present invention. For example, the electronic device 600 may be provided as a server.
[0095] Referring to Figure 8 , the electronic device 600 includes a processing component 622, which further includes one or more processors, and memory resources represented by a memory 632 for storing instructions executable by the processing component 622, such as application programs. The application programs stored in the memory 632 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 622 is configured to execute instructions to perform the methods provided by the embodiments of the present application.
[0096] The electronic device 600 may further include a power component 626 configured to perform power management of the electronic device 600, a wired or wireless network interface 650 configured to connect the electronic device 600 to a network, and an input / output (I / O) interface 658. The electronic device 600 may operate based on an operating system stored in the memory 632, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSD TM or the like.
[0097] It should be noted that, for the method embodiments of the present application, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of the present application are not limited by the described action sequence, because according to the embodiments of the present application, certain steps may be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential for the embodiments of the present application.
[0098] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common general knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only to be considered as exemplary, and the true scope and spirit of the present application are pointed out by the following claims.
[0099] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.
Claims
1. A method for analyzing event context based on causal relationships, characterized in that, Including: Determine at least one event keyword of the result event according to the description document of the result event to be analyzed; Generate an analysis question document for the result event according to all the event keywords; Input the analysis question document into an event context analysis model to obtain a context analysis result for the result event; The context analysis result is used to characterize the causal association relationship formed between at least one target cause event among multiple cause events and the result event; the event context analysis model is trained according to all the cause events.
2. The method for analyzing event context based on causal relationship according to claim 1, wherein The event context analysis model includes multiple encoding modules. The step of inputting the analysis question document into the event context analysis model to obtain a context analysis result for the result event includes: Extract the initial token sequence of the result event from the context analysis question document; Input the initial token sequence into a first encoding module among the multiple encoding modules, so that the token sequence is sequentially processed by each encoding module, and a final token sequence of the result event is obtained from a second encoding module among the multiple encoding modules; the first encoding module is the first encoding module among the multiple encoding modules that sequentially processes the token sequence, and the second encoding module is the last encoding module among the multiple encoding modules that sequentially processes the token sequence; Map the final token sequence to the context analysis result through linear transformation processing.
3. The method for analyzing event context based on causal relationship according to claim 2, wherein Each encoding module respectively includes a multi-head attention sub-module used as an input processing layer and a feed-forward network sub-module used as an output processing layer. In each encoding module, the step of sequentially processing the token sequence by each encoding module includes: Embed the token sequence input to the encoding module into the multi-head attention sub-module of the encoding module; Determine the token sequence output by the encoding module as the feed-forward output sequence processed by the residual of the multi-head output sequence; the multi-head output sequence is the sequence output by the multi-head attention sub-module, and the feed-forward output sequence is the sequence output by the feed-forward network sub-module of the encoding module.
4. The method for analyzing event context based on causal relationship according to claim 2, characterized in that, The step of inputting the initial token sequence into a first encoding module among the multiple encoding modules includes: Embed the token sequence into the first multi-head attention sub-module of the first encoding module according to the embedding parameters respectively corresponding to each token in the token sequence.
5. The method for analyzing event context based on causality according to claim 1, characterized in that The event context analysis method based on causal relationship further includes: Perform data verification on the context analysis result, and determine the output mode of the context analysis result according to the verification result of the data verification; the execution process of the output mode is one of direct output, adjusted output, and error reporting output.
6. The method for analyzing event context based on causality according to claim 5, wherein The step of performing data verification on the context analysis result and determining the output mode of the context analysis result according to the verification result of the data verification includes: When the context analysis result meets the preset data format requirements, and the key values stored in the context analysis result meet the preset first key value rationality requirement and the first data repeatability requirement, directly output the context analysis result; the first key value rationality requirement is used to represent that all the key values are reasonable data; the first data repeatability requirement is used to represent that all the key values do not repeat each other; When the context analysis result meets the preset data format requirements, and the key values stored in the context analysis result meet the preset second key value rationality requirement and / or the second data repeatability requirement, adjust the context analysis result, and output the adjusted context analysis result; the second key value rationality requirement is used to represent that some of the key values are reasonable data; the second data repeatability requirement is used to represent that there are duplicates among the key values; When the context analysis result does not meet the preset data format requirements and / or the key values stored in the context analysis result do not meet the first key value rationality requirement and the second key value rationality requirement, discard the context analysis result, and output an error instruction.
7. An event context analysis device based on causal relationships, characterized in that, Comprising: A keyword module, configured to determine at least one event keyword of the result event according to the description document of the result event to be analyzed; A prompt word module, configured to generate an analysis question document for the result event according to all the event keywords; An analysis module, configured to input the analysis question document into an event context analysis model to obtain a context analysis result for the result event; The context analysis result is used to represent the causal association relationship formed between at least one target cause event among a plurality of cause events and the result event; the event context analysis model is trained according to all the cause events.
8. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the causal relationship-based event context analysis method according to any one of claims 1 to 6.
9. An electronic device, characterized in that, Comprising a processor, a memory, and a computer program stored on the memory and executable on the processor, and when the computer program is executed by the processor, it implements the steps of the causal relationship-based event context analysis method according to any one of claims 1 to 6.
10. A computer program product, characterized in that, A computer program is stored on the computer program product, and when the computer program is executed by a processor, it implements the steps of the causal relationship-based event context analysis method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Text relation processing method, device and equipment based on text analysis
CN114817475A
Causal event extraction method based on causal event extraction model
CN116431789A
Event context generation method and device, equipment and storage medium
CN116501975A
Power distribution project cost analysis work data filling auxiliary system
CN116911896A
Method, device and equipment for identifying event causal relationship of Chinese text
CN119720951A