A forest fire danger report semantic analysis method based on a knowledge graph
By constructing a knowledge graph-based semantic analysis method for forest fire risk reports and combining graph-text interaction attention and multi-task learning, the modeling problem of complex semantic relationships in forest fire risk monitoring reports is solved, thereby improving the interpretability and decision support capabilities of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QINGDAO HAOHAI NETWORK TECH
- Filing Date
- 2026-03-24
- Publication Date
- 2026-06-09
AI Technical Summary
Existing technologies struggle to effectively model and utilize the complex structured semantic relationships in forest fire risk monitoring reports, lack in-depth insights into risk decision-making, suffer from insufficient model interpretability, and lack a mechanism for explicitly injecting prior knowledge from domain experts.
We employ a knowledge graph-based semantic analysis method for forest fire risk reporting. By constructing a knowledge subgraph, a graph-text interaction attention layer, a graph convolutional network with relation strength modulation and spatial awareness, and combining it with a multi-task learning framework, we achieve refined modeling and decision support for forest fire risk.
It has enabled a deep understanding and refined modeling of forest fire risk, improved the interpretability and generalization ability of the model, and provided more discriminative risk decision support.
Smart Images

Figure CN121902817B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of natural language processing technology, specifically relating to a semantic analysis method for forest fire risk reports based on knowledge graphs. Background Technology
[0002] Against the backdrop of escalating global climate change, the frequency and severity of forest fires pose a serious challenge to the ecological environment and public safety. Forestry and emergency management departments at all levels generate a large volume of forest fire risk monitoring reports, early warning notices, and response records daily. This textual data is unstructured, highly specialized, and contains complex spatiotemporal and causal relationships, such as how specific meteorological conditions affect fire behavior in specific geographical areas.
[0003] Existing methods suffer from the following drawbacks: Traditional text analysis methods struggle to model and utilize complex structured semantic relationships between entities, leading to limitations in understanding domain expertise and contextual logic; general graph neural networks, when dealing with domain-specific problems, typically homogenize all edges and nodes, neglecting key domain-specific constraints such as the modulation of relationship strength by external attributes and the decay of risk factors with spatial distance; single text classification or entity recognition tasks often only output isolated conclusions, lacking in-depth revelation of the basis for risk decisions, resulting in insufficient model interpretability; conventional multi-task learning usually relies solely on data-driven loss weighting, lacking a mechanism to explicitly and differentiably inject prior knowledge from domain experts into the model learning process. Summary of the Invention
[0004] To achieve the above objectives, the present invention employs the following technical solution:
[0005] This invention provides a semantic analysis method for forest fire risk reporting based on knowledge graphs, comprising the following steps:
[0006] S1. Collect original forest fire risk report texts and construct a forest fire risk report dataset;
[0007] S2. Construct a semantic analysis model for forest fire risk reporting, including a knowledge subgraph construction and encoding module, a deep fusion representation generation module, a graph convolution calculation module, and a multi-task output module;
[0008] The forest fire risk reporting semantic analysis model is trained and optimized by a multi-task collaborative loss function to obtain a well-trained forest fire risk reporting semantic analysis model.
[0009] S3. Input the new forest fire risk report text into the trained forest fire risk report semantic analysis model to obtain the forest fire risk report semantic analysis results.
[0010] Furthermore, the knowledge subgraph construction and encoding module extracts entities and relationships from the original notification text, constructs a knowledge subgraph for the current text, and encodes it as graph structure data:
[0011] Define a corresponding knowledge subgraph for each input forest fire risk report text. This subgraph is a directed heterogeneous graph used to structurally represent the entities and their semantic relationships in the text.
[0012] Pre-trained natural language processing tools are used to extract structured information from the original report text and fill in the defined knowledge subgraph structure.
[0013] For each entity node in the knowledge subgraph, an initial feature vector is generated that integrates its type semantics and textual context information.
[0014] Furthermore, the deep fusion representation generation module employs a graph-text interaction attention layer to mutually query and enhance the node features of the knowledge subgraph and the sequence features of the original notification text, generating context-aware node representations:
[0015] The original notification text is encoded using a pre-trained language model to obtain a text feature matrix. The text feature matrix is then projected onto the same vector space as the graph node features through a linear transformation to obtain the projected text feature matrix.
[0016] For each position in the text sequence, calculate the attention weight between that position and each node in the knowledge subgraph; for each node in the knowledge subgraph, calculate the attention weight between that node and each position in the text sequence; based on the separately calculated text-to-graph attention and graph-to-text attention, a bidirectional feature interaction mechanism is formed.
[0017] The initial features of each knowledge node are fused with the information aggregated from the text to generate enhanced node features.
[0018] Furthermore, the graph convolution calculation module employs a multi-layer graph convolutional network with relation strength modulation and spatial awareness. By introducing dynamic relation strength coefficients based on external knowledge computation into message passing and simulating the effect of risk attenuation with distance, it achieves refined modeling of the complex evolutionary logic of forest fire risk.
[0019] For each directed edge in the knowledge subgraph, a dynamic relation strength modulation coefficient is calculated by combining the features of the head and tail nodes connected by the edge, the node attributes obtained from the external knowledge base, and the global semantic information aggregated from the text. This coefficient is used to finely weight the contribution of the edge in the information transmission process.
[0020] By employing graph convolution operations that fuse relation intensity modulation and spatial attenuation effects, multi-relation neighborhood information is aggregated to simulate the physical constraint that fire risk factors attenuate with increasing distance in real space, generating feature vectors calculated by graph convolution.
[0021] After multi-layer graph convolution, each node obtains multi-hop semantic information from direct neighbors to higher-order neighbors. In order to adaptively fuse features from different levels of local details to global context, a gating mechanism is used to aggregate the features of the node in all layers to generate an aggregated feature vector.
[0022] Furthermore, the multi-task output module adopts a multi-task learning framework, simultaneously performing graph-level forest fire risk classification, node-level key entity recognition, and edge-level missing relationship detection. By sharing underlying feature encoding and jointly optimizing multiple related tasks, it enables the model to learn a forest fire risk representation with greater generalization ability and semantic discriminative power. The multi-task output module includes a node-level entity importance classification task, an edge-level relationship completeness detection task, and a graph-level forest fire risk classification task.
[0023] Furthermore, the node-level entity importance classification task: based on the aggregated feature vectors of nodes, predict whether each entity node in the knowledge subgraph belongs to a key entity that is crucial to fire risk assessment.
[0024] Furthermore, the edge-level relation completeness detection task aims to enhance the model's reasoning ability regarding the completeness of the knowledge structure. By calculating the predicted probability of a potential semantic relationship between any two nodes, it determines whether there is a potential semantic relationship between the nodes that was not discovered in the initial extraction.
[0025] Furthermore, the graph-level forest fire risk classification task involves calculating the probability of an input sample being classified into each forest fire risk level based on the entire report text and its corresponding knowledge subgraph, and then comprehensively judging the overall forest fire risk level described.
[0026] Furthermore, a dynamic task weighting strategy based on the rate of change of loss is adopted, and combined with a rule-based term that encourages key entities to have significant representations, to construct a composite loss function that can promote balanced learning between tasks and the integration of domain prior knowledge. The total loss function consists of the main task loss of forest fire risk level classification, the losses of two auxiliary tasks of entity importance classification and relation completeness detection, and a rule-based term.
[0027] Furthermore, the forest fire risk reporting dataset includes the original reporting text, the corresponding entity set, relation triples, entity importance labels, forest fire risk level labels, and positive and negative sample pairs for relation detection.
[0028] The advantages of this invention are:
[0029] This invention employs a "bidirectional graph-text interaction attention" mechanism to achieve deep fusion and semantic complementarity between structured knowledge subgraphs and unstructured original report texts, going beyond simple feature splicing and enabling the model to make fuller use of both types of information. It utilizes a graph convolutional network with "relationship strength modulation" and "spatial awareness" to dynamically introduce external attributes (such as coordinates and meteorological values) and spatial distance attenuation effects into the message passing process, achieving refined modeling of the evolutionary logic of the forest fire risk domain. A three-layer multi-task learning framework of "graph-node-edge" is constructed to jointly optimize fire risk level classification, key entity identification, and potential relationship detection, enabling the model to learn a unified representation with greater discriminative and generalization capabilities, and enhancing the interpretability of the results. A "rule-based term" based on prior knowledge is introduced into the loss function, explicitly encouraging the model to make the representation of key entities more significant and non-key entities more gradual, thereby embedding domain knowledge into the learning process and proactively improving the transparency and interpretability of model decisions. Attached Figure Description
[0030] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.
[0031] Figure 1 This is a flowchart of the steps of the method of the present invention;
[0032] Figure 2 This is a flowchart of the knowledge subgraph construction and encoding module of the present invention;
[0033] Figure 3 This is a flowchart of the multi-task output process of the present invention;
[0034] Figure 4 This is an example diagram of the forest fire risk knowledge graph of the present invention;
[0035] Figure 5 This is a critical path diagram between the key entities of this invention. Detailed Implementation
[0036] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0037] Example 1
[0038] In this embodiment, as Figure 1 As shown, this invention provides a semantic analysis method for forest fire risk reporting based on knowledge graphs, the specific steps of which include:
[0039] S1. Data Acquisition and Training Dataset Construction
[0040] This invention constructs a forest fire risk notification dataset for training and evaluating semantic analysis models. First, it collects original forest fire risk notification texts from open-source historical archives, monitoring reports, and early warning information platforms. The texts cover notification cases under different seasons, regions, and risk levels, ensuring the diversity and representativeness of data sources.
[0041] After obtaining the original notification text, it was subjected to rigorous cleaning and preprocessing, including removing irrelevant formatting information, correcting obvious typos, standardizing the expression format of numbers and units, and splitting long documents into independent samples according to the notification events to form a structured original notification text corpus.
[0042] Then, each report text in the corpus is finely labeled to construct the supervision signals required for model training. The labeling work mainly includes the following aspects:
[0043] 1) Perform entity recognition and classification labeling.
[0044] Domain experts define the boundaries and type the key information units in the text based on a predefined entity type system. The entity types used include, but are not limited to, "location" (such as mountains and forests), "fire point" (such as specific latitude and longitude coordinates), "meteorological factors" (such as high temperature, drought, and wind), "time" (such as the date of occurrence and duration), and "response measures" (such as personnel deployment and isolation zone setting).
[0045] 2) Based on entity annotation, perform relation extraction annotation.
[0046] The annotators determine and mark the semantic relationships between entity pairs, such as the possible "occurrence" relationship between "location" and "weather factor", and the possible "intensification" or "mitigation" relationship between "weather factor" and "fire point", forming a triple of (head entity, relationship, tail entity).
[0047] 3) Perform entity importance labeling.
[0048] For each identified entity, it is labeled as a "critical entity" or a "non-critical entity" based on its criticality in the fire risk assessment.
[0049] 4) Classify and label forest fire risk levels at the map level.
[0050] Assign an overall fire hazard rating label to each complete notification text, such as "low", "medium", "high" or "extremely high".
[0051] In addition, to support the training of the edge-level relation completeness detection task, when constructing the knowledge subgraph, not only are the labeled relation triples included as positive examples, but negative examples are also generated by randomly sampling entity pairs without labeled relations.
[0052] All annotation work must be independently annotated and cross-checked by multiple annotators, and any discrepancies must be arbitrated to ensure the accuracy and consistency of the annotated data.
[0053] Based on this, a large-scale, high-quality training dataset was constructed through the above process, which includes the original notification text, the corresponding entity set, relation triples, entity importance labels, forest fire risk level labels, and positive and negative sample pairs for relation detection.
[0054] S2. Semantic Analysis Model Construction and Training
[0055] S201, Knowledge Subgraph Construction and Encoding
[0056] Forest fire risk reports are characterized by being unstructured, multi-source, heterogeneous, and highly specialized. They contain a large number of implicit semantic relationships between entities, and conventional text processing methods are unable to explicitly model the structured relationships between entities, resulting in insufficient understanding of professional domain knowledge and contextual logic by the model.
[0057] This invention first extracts entities and relationships from the original report text, constructs a local knowledge subgraph for the current text, and encodes it as graph-structured data, thereby injecting structured prior knowledge into the model, such as... Figure 2 As shown, the specific steps are as follows:
[0058] 1) Define the knowledge subgraph structure
[0059] Define a corresponding knowledge subgraph for each input forest fire risk report text. This subgraph is a directed heterogeneous graph used to structurally represent the entities and their semantic relationships in the text.
[0060] Specifically, definition Indicates the first The knowledge subgraph corresponding to each notification text ;
[0061] in, This represents the sample index, with a value range of [value range missing]. ; Indicates the total number of training samples;
[0062] Representing a knowledge subgraph The set of nodes in the text, where each node represents an entity extracted from the text, and the size of the set depends on the number of entities in the text;
[0063] Representing a knowledge subgraph The set of directed edges in the array, where each edge represents a structured triplet fact, in the form of: ; This represents the head entity index in the triple; Indicates the relation type identifier in a triple; Indicates the tail entity index in the triple;
[0064] Representing a knowledge subgraph The set of all relation types that appear in the text.
[0065] 2) Entity and Relation Extraction
[0066] Pre-trained natural language processing tools are used to extract structured information from the original report text and fill it into a defined knowledge subgraph structure.
[0067] In specific implementation, for the first The notification text is first identified using a named entity recognition model to determine the entity boundaries and types, thus forming a node set. Then, a relation extraction model is used to determine the semantic relationships between the identified entities, and the extracted form is as follows: The set of triplets, where all triplets form the edge set. Relation types constitute a set .
[0068] In one implementation, for Chinese forest fire risk notification texts, natural language processing tools pre-trained on general or domain-specific texts can be selected. For example, in the named entity recognition task, pre-trained models such as "ERNIE-3.0", "BERT-BiLSTM-CRF" or "RoBERTa-wwm-ext" can be used. They can also be fine-tuned on labeled data in fields such as "meteorology" and "forestry" to identify entities such as "location" (e.g., "northern foothills of the Greater Khingan Mountains"), "fire point" (e.g., "119.5°E, 52.8°N"), and "meteorological factors" (e.g., "high temperature" and "drought"). In the relation extraction task, a relation classification model based on the ERNIE pre-trained language model can be used to determine the relationship between identified entity pairs. For example, given the entities "northern foothills of the Greater Khingan Mountains" (type: location) and "high temperature" (type: meteorological factor), the model can extract the relation type as "occurrence".
[0069] 3) Initial feature encoding of nodes
[0070] For each entity node in the knowledge subgraph, an initial feature vector is generated that integrates its type semantics and textual context information, represented as:
[0071] ,
[0072] In the formula, Represents entity nodes The initial feature vector, which integrates entity type semantics and text-specific contextual information, is the starting point for graph neural network computation;
[0073] This represents an entity type embedding matrix with dimension 1. , is a trainable parameter matrix used to map discrete entity types to dense vectors; Represents the entity projection matrix, with dimension . , is a trainable parameter matrix used to transform the dimension of word vectors after average pooling; This represents the dimension of the text features output by the pre-trained language model, with an example value of 768. The preset dimension of the feature vector is a hyperparameter that determines the length of all feature vectors; an example value is 256. This indicates the total number of predefined entity types, which may include "location", "fire point", "weather factor", etc. Representing entities One-hot vectors of type This is used to indicate the specific type to which the entity belongs, and is determined based on the named entity recognition results; Indicates the index of the entity node; Representing entities In the text A set of all position indices that appear in the text; Indicates the first The original text of the forest fire risk report; Indicates the first The context word vectors at each position are obtained from the text through a pre-trained language model. In position The context vectors at each position are used. For example, for the sentence "High temperatures occurred on the northern slopes of the Greater Khingan Mountains", BERT is used to encode the entire sentence and output the context vector for each input token. If the entity "northern slopes of the Greater Khingan Mountains" is segmented into token positions 2, 3, and 4, then... Average pooling will aggregate , and Obtain the textual context representation of the entity; Indicates a specific position index within a text sequence; This represents the average pooling operation, used to aggregate entities. Contextual word vectors for all occurrences of the entity are used to capture the overall contextual semantics of the entity in the text.
[0074] S202, Deep Fusion Representation Generation of Knowledge Subgraph and Original Report Text
[0075] Using only structured knowledge subgraphs may lose detailed information about the text, while using only the original report text ignores structured relationships. Simple feature splicing strategies are insufficient to achieve deep interaction between the two.
[0076] This invention employs a graph-text interaction attention layer, enabling the node features of the knowledge subgraph and the sequence features of the original notification text to mutually query and enhance each other, generating context-aware node representations. The specific steps are as follows:
[0077] 1) Text feature extraction and dimensionality projection
[0078] The original notification text is encoded using a pre-trained language model to obtain a text feature matrix. This matrix is then projected onto a vector space identical to the graph node features using a linear transformation, resulting in the projected text feature matrix, which is represented as follows:
[0079] ,
[0080] In the formula, Represents the text feature matrix, with dimension 1. It is obtained by encoding the original notification text by a pre-trained language model, containing contextual semantic information for each position, and is represented as... ;
[0081] Indicates the length of the text, that is, the number of words or sub-words in the text; Indicates the first in the text sequence Word vectors at each position; This represents the text position index, with a value range of 100. ; This represents the projected text feature matrix, with dimensions of . Its feature dimensions The feature dimensions are consistent with those of the graph nodes to enable cross-modal attention computation; This represents the projection weight matrix, with dimension 1. , are trainable parameters used to transform text features from dimensionality Transform to dimension ; The projection bias vector is a trainable parameter with dimension . .
[0082] In one implementation, the text feature matrix The original announcement text is encoded by a pre-trained BERT language model. Specifically, the original announcement text is input into the model, and its last (or last few) hidden states are obtained as the context representation for each text location. The context representation of each text position is called a word vector. .
[0083] 2) Bidirectional graph-text attention interaction computation
[0084] For each position in the text sequence, calculate the attention weight between that position and each node in the knowledge subgraph. Simultaneously, for each node in the knowledge subgraph, calculate the attention weight between that node and each position in the text sequence. Based on the separately calculated text-to-graph and graph-to-text attention, a bidirectional feature interaction mechanism is formed, represented as:
[0085] ,
[0086] ,
[0087] In the formula, Indicates text position The context vectors obtained by aggregating from the knowledge subgraph are incorporating relevant structured knowledge information; Indicates the node index in the knowledge subgraph; Indicates the first text sequence after projection The position in the knowledge subgraph is the first The attention weight of each node, the larger the value, the stronger the semantic relevance between the text position and the node, and the calculation method is expressed as follows:
[0088] ,
[0089] Represents entity nodes The initial feature vector; Represents entity nodes The initial feature vector;
[0090] Representing knowledge nodes The context vector, obtained by aggregating from the entire text sequence, incorporates relevant unstructured text details. Indicates difference from The node index in the knowledge subgraph;
[0091] Represents nodes in a knowledge subgraph For the projected text sequence, the first... Attention weights are assigned to each position. Larger values indicate a stronger semantic relevance between the text position and the node. The calculation method is as follows:
[0092] ,
[0093] Represents entity nodes The initial feature vector; Indicates difference from The text position index, with a value range of 100. ; This represents the first attention weight vector, which is a trainable parameter used to calculate the relevance score of the concatenated vector; express Transpose of; Represents the feature matrix of the projected text The Middle The vector at each position, i.e., the projected text feature matrix The Middle A vector of rows; Indicates difference from The text position index; Represents the feature matrix of the projected text The Middle The vector at each position, i.e., the projected text feature matrix The Middle A vector of rows; Represents the feature matrix of the projected text The Middle The vector at each position, i.e., the projected text feature matrix The Middle A vector of rows; This represents a vector concatenation operation; This represents the second attention weight vector, which is a trainable parameter used to calculate the relevance score of graph-to-text attention; express The transpose of .
[0094] 3) Generate enhanced node features
[0095] The initial features of each knowledge node are fused with the information aggregated from the text to generate enhanced node features.
[0096] ,
[0097] In the formula, Representing knowledge nodes The feature vectors of knowledge nodes are... The initial feature vector enhanced by graph-text interaction contains both structured entity knowledge and unstructured text context information.
[0098] This represents a feedforward neural network, preferably a two-layer feedforward neural network structure, which includes linear transformations and nonlinear activation functions for fusing the spliced features.
[0099] S203, Graph Convolution Calculation of Relationships and Spatial Awareness
[0100] Conventional graph convolutional networks homogenize all edges and nodes, easily overlooking the characteristics of relationship strength being modulated by external attributes and risk factors decaying with spatial distance in forest fire risk scenarios.
[0101] This invention employs a multi-layer graph convolutional network with relation strength modulation and spatial awareness. By introducing dynamic relation strength coefficients based on external knowledge computation into message passing and simulating the effect of risk attenuation with distance, it achieves refined modeling of the complex evolutionary logic of forest fire risk. The specific steps are as follows:
[0102] 1) Calculation of Relation Strength Modulation Coefficient
[0103] For each directed edge in the knowledge subgraph, a dynamic relation strength modulation coefficient is calculated by combining the features of the head and tail nodes connected by the edge, the node attributes obtained from external knowledge base queries, and the global semantic information aggregated from the text. This coefficient is used to finely weight the contribution of the edge in the information transmission process, and is represented as follows:
[0104] ,
[0105] In the formula, Indicates from node Through relation type Pointing to node The edge relation strength modulation coefficient, whose value is constrained by the Sigmoid activation function. The larger the value in the interval, the stronger the semantic association or influence represented by the edge, and the higher the weight in the graph convolution calculation. This represents the Sigmoid activation function, which maps the calculated raw scores to... Within the range; Representation of relation type The associated weight vector consists of trainable parameters used to fuse different types of features. express Transpose of; Represents the head entity node The feature vector has a dimension of . It is the head entity node. Initial feature vector enhanced by graph-text interaction; Represents the tail entity node The feature vector has a dimension of . It is the tail entity node. Initial feature vector enhanced by graph-text interaction; Representation of relation type The relevant attribute interaction feature vectors have a dimension of Calculated based on an external knowledge base, for example, when the relation type When the geographical distance is less than, The function can be based on the node and nodes latitude and longitude attributes and Calculate the actual distance and encode it as a feature vector; This refers to attribute vectors, such as geographic coordinates and meteorological values, that are queried from external knowledge bases associated with the head entity or parsed from its original notification text description. This refers to attribute vectors, such as geographic coordinates and meteorological values, that are queried from external knowledge bases associated with tail entities or parsed from their original notification text descriptions. Represents a global text semantic vector, consisting of text locations. The context vectors corresponding to all text positions, including the one containing the text, are obtained by average pooling, with dimension 1. This is used to inject the global intent of the entire text into the determination of relation strength, where text position... The context vector obtained from aggregation in the knowledge subgraph is ; Representation of relation type The relevant bias terms are trainable parameters.
[0106] In practical implementation, the relation strength modulation coefficient The model dynamically reflects the semantic importance of each edge. For example, in fire risk analysis, the strength of the "intensification" relationship between the entities "fire point" and "high temperature" may be higher than the strength of the "proximity" relationship between "fire point" and "distant water source". By integrating the dynamically changing inputs, the model generates a unique weight for each edge that reflects its importance in the current context and attributes, thereby achieving dynamic weighting.
[0107] In the specific implementation, for nodes and nodes The attribute vector can be obtained by querying external knowledge bases or parsing the original notification text description. and Specifically, if obtained by querying an external knowledge base, if the entity has a unique identifier (such as a standard place name or coordinates), it can be linked to a geographic information system, meteorological database, etc., to query its latitude and longitude, altitude, historical average temperature, and other numerical or categorical attributes, and encode these attributes into vectors. If obtained by parsing the original notification text description, for attribute values explicitly given in the notification text (such as "temperature 35℃" and "wind force 5"), they can be parsed out through rules and converted into numerical values. Optionally, a pre-trained lightweight neural network can be used to encode the above structured attributes or text descriptions into fixed-dimensional attribute vectors.
[0108] 2) Spatial-aware graph convolutional layer computation
[0109] By employing graph convolution operations that fuse relation strength modulation and spatial attenuation effects, not only is multi-relation neighborhood information aggregated, but the physical constraint of fire hazard factors attenuating with increasing distance in real space is also simulated, expressed as:
[0110] ,
[0111] In the formula, Represents a node After the first The feature vectors obtained by layer graph convolution are Represents a node After the first The feature vector obtained by layer graph convolution, when hour, ; This indicates that the target node index of the feature is currently being updated; Indicates the graph convolutional layer index; The feature vector of the target node u has a dimension of . , is the initial feature vector of the target node u after graph-text interaction enhancement; Indicates from node Through relation type Pointing to node The edge relationship intensity modulation coefficient; This indicates that the modified linear unit activation function introduces a nonlinear transformation into the output of the graph convolutional layer; Indicates the first The weight matrix used for transforming the features of a node in a layer is a trainable parameter; Indicates in relation type Down pointer node The neighbor node index; Indicates in relation type All nodes pointed to below The set of tail nodes, i.e. ; Indicates node-based With nodes Implicit spatial distance between The attenuation function is used to simulate the effect of actual influence decreasing with increasing distance, and its calculation method is expressed as follows: ; Represents a node With nodes The implicit spatial distance between entities is calculated based on entity coordinates or estimated based on entity type and context. This represents the distance attenuation coefficient, a preset positive scalar, with an example value of 0.5; This represents the normalization factor used to stabilize the training process; it can be selected as the number of neighboring nodes. Or the weighted sum of all neighbors ; Indicates the first Layer and relation type The corresponding weight matrix consists of trainable parameters.
[0112] In practical implementation, the implicit spatial distance is calculated based on entity coordinates or estimated based on entity type and context. If the node... With nodes If it has clearly defined geographic coordinate attributes (such as entities like "fire point" or "location"), then It can be obtained directly by calculating the Euclidean distance or spherical distance. If the entity does not have explicit coordinates... Estimation can be performed based on entity type and contextual semantics, for example, by computing nodes using pre-trained word vectors or entity embeddings. With nodes The cosine similarity of the initial features is calculated, and the similarity is mapped to distance.
[0113] 3) Multi-hop information gating aggregation
[0114] After multi-layer graph convolution, each node obtains multi-hop semantic information from its direct neighbors to higher-order neighbors. To adaptively fuse features from different levels, from local details to global context, a gating mechanism is used to aggregate the features of the node across all layers, generating an aggregated feature vector, represented as follows:
[0115] ,
[0116] In the formula, Represents a node The aggregated feature vector is a fusion of the initial node features and the multi-level features enhanced by multi-hop neighborhood information. This represents element-wise multiplication; This indicates updating the gate vector, with dimension . The final representation controls the degree of adoption of candidate states, and is calculated jointly by the initial features of the nodes, the mean values of features at each layer, and the text context vector, represented as follows: ;
[0117] Representing dimensions and The same vector of all 1s; Represents a candidate state vector with dimension . It is calculated by combining the initial features of the nodes, the mean values of features at each layer, and the text context vector, and is represented as follows: ; This represents the weight matrix used to calculate the update gate, and it consists of trainable parameters; This represents the bias vector used to compute the update gate, which is a trainable parameter; This represents the weight matrix used to calculate the candidate state, and consists of trainable parameters; This represents the bias vector used to compute the candidate state, and is a trainable parameter;
[0118] Represents a node In all The average value of the feature vector output by the layer graph convolution is expressed as:
[0119] This is used to aggregate multi-hop neighborhood information;
[0120] This represents the total number of layers in the graph convolutional network, preferably set to [value]. layer; This represents the context vector that node u is aggregated from the entire text sequence.
[0121] S204, Task output based on a multi-task learning framework
[0122] This invention employs a multi-task learning framework, simultaneously performing graph-level forest fire risk classification, node-level key entity recognition, and edge-level missing relationship detection. By sharing low-level feature encoding and jointly optimizing multiple related tasks, it enables the model to learn a more generalizable and semantically discriminative forest fire risk representation, such as... Figure 3 As shown, the specific steps are as follows:
[0123] 1) Node-level entity importance classification task
[0124] Based on the aggregated feature vectors of nodes, the prediction of whether each entity node in the knowledge subgraph belongs to a key entity that is crucial to fire risk assessment is represented as follows:
[0125] ,
[0126] In the formula, Represents a node The probability distribution vectors classified into each importance category, with dimension . ; This indicates the total number of importance categories, with an example value of 2, including "critical entities" and "non-critical entities". This represents the Softmax normalization function, which transforms the raw scores output by the multilayer perceptron into a probability distribution; This refers to a multilayer perceptron specifically designed for node-level classification tasks. Its structure includes linear transformation layers and nonlinear activation functions, and it is a trainable network module.
[0127] Represents a node The global graph context vector, with dimensions of The node is represented by aggregating information from all nodes in the graph through an attention mechanism. Information within the global context of the entire knowledge subgraph is computed and represented as follows:
[0128] ; Represents a node Aggregated feature vectors; For nodes For nodes The attention weights are calculated through the attention mechanism, and the calculation method is expressed as follows:
[0129] ;
[0130] The function for calculating the dot product score is represented as follows:
[0131] ;
[0132] Represents a node Aggregated feature vectors; express Transpose of; This represents a knowledge subgraph that is distinct from the current node. Other node indexes.
[0133] 2) Border-level relation completeness detection task
[0134] To enhance the model's reasoning ability regarding the completeness of the knowledge structure, the predicted probability of a latent semantic relationship between any two nodes is calculated to determine whether there is a latent semantic relationship between nodes that was not discovered in the initial extraction. This is represented as:
[0135] ,
[0136] In the formula, Represents a node With nodes The predicted probability of a potential semantic relationship exists between them, and a scalar is calculated using the Sigmoid activation function; The weight vector used to calculate the edge existence score is a trainable parameter with dimension O(n). ; express Transpose of; The weight matrix used for feature transformation of the head node is a trainable parameter with dimension 1. ; The weight matrix used for tail node feature transformation is a trainable parameter with dimension 1. ; The weight matrix used for the transformation of node feature interaction terms is a trainable parameter with dimension 1. ; Represents a node Aggregated feature vectors; Represents a node Aggregated feature vectors; and This represents a pair of distinct node indices in a knowledge subgraph, i.e. and ; The dimension of the intermediate feature vector is a hyperparameter, with an example value of 128.
[0137] It should be noted that during the training phase, this task samples and generates negative examples for each knowledge subgraph, which are pairs of nodes that do not actually have edges. These negative examples, together with the existing positive example edges, constitute the training data.
[0138] 3) Map-level forest fire risk classification task
[0139] The forest fire risk level classification task, based on the entire report text and its corresponding knowledge subgraph, calculates the probability of an input sample being classified into each forest fire risk level, and comprehensively judges the overall forest fire risk level described, represented as:
[0140] ,
[0141] In the formula, This represents the probability distribution vector of an input sample being classified into various forest fire risk levels, with dimension 1. ; This indicates the total number of categories for forest fire risk levels, with an example value of 4, including "low", "medium", "high" and "extremely high". This represents a multilayer perceptron specifically designed for graph-level classification tasks. Its structure includes linear transformation layers and nonlinear activation functions, and it is a trainable network module. This represents the graph-level representation vector obtained through the graph readout function, with dimension . This is used to summarize the semantics of the entire knowledge subgraph, and the reading method is represented as follows:
[0142] ;
[0143] Indicates targeting the node The attention weights are used to determine the contribution of each node to the semantic representation of the entire graph. They are calculated using a trainable attention mechanism, and the calculation method is as follows:
[0144] ;
[0145] The attention query vector is a trainable parameter with dimension . ; express Transpose of; The attention weight matrix is a trainable parameter with dimension . ; The attention bias vector is a trainable parameter with dimension . ; This represents the special classification label corresponding to the original notification text after it has been encoded by a pre-trained language model. The hidden state vector, with dimension . This vector encapsulates the global semantic information of the text.
[0146] S205, Calculation of Multi-Task Collaborative Loss Function
[0147] This invention employs a dynamic task weighting strategy based on the rate of change of loss, combined with a regularization term that encourages key entities to have significant representations, to construct a composite loss function that promotes balanced learning between tasks and the integration of domain prior knowledge. The total loss function consists of the main task loss for forest fire risk level classification, the losses from two auxiliary tasks—entity importance classification and relation completeness detection—and a regularization term, expressed as:
[0148] ,
[0149] In the formula, The total loss function is the overall objective function that needs to be minimized during the model training phase. It combines the losses from the main task and the auxiliary task, as well as the regularization constraints.
[0150] The cross-entropy loss represents the error of the model in predicting forest fire risk levels, and is used to measure the error of the model in predicting forest fire risk levels. It is obtained by calculating the cross-entropy between the probability distribution predicted by the model and the actual fire risk level label. The cross-entropy loss represents the error of the model in classifying the importance of entities at the node level. It is calculated by averaging the cross-entropy between the predicted importance probability and the true importance label of each node over all nodes. The binary cross-entropy loss represents the edge-level relation completeness detection task. It is used to measure the error of the model in judging the existence of potential relations. It is obtained by calculating the binary cross-entropy between the relation existence prediction probability of each sampled node pair (including real edges and negative sampled edges) and the real edge label (1 or 0).
[0151] This represents the dynamic weight scalar of the graph-level task loss, with an example value of 1.0. This represents a dynamic weight scalar representing the node-level task loss, with an example value of 0.7. This represents the dynamic weight scalar of the edge task loss, with an example value of 0.5.
[0152] It is a hyperparameter scalar used to control the strength of the regularization term in the total loss, with an example value of 0.01;
[0153] The regularization loss term is used to incorporate domain prior knowledge, encouraging the model to learn representations where the feature vectors of key entities have a larger norm (more significant) and the feature vectors of non-key entities have a smaller norm (more gradual), thereby enhancing the model's interpretability and discriminative ability. The calculation method is expressed as follows:
[0154] ;
[0155] This function represents the function that takes the larger of two parameters.
[0156] represents the marginal hyperparameter scalar, which represents the lower bound of the L2 norm of the expected key entity node representation vector, with an example value of 5.0;
[0157] Represents the L2 norm; This represents the subset of nodes in the current knowledge subgraph that are marked as "key entities"; This represents the subset of nodes in the current knowledge subgraph that are marked as "non-critical entities"; Represents a set The number of nodes in the middle; Represents a set The number of nodes in the middle; Represents a node The aggregated feature vector.
[0158] S206, Semantic Analysis Model Training
[0159] After defining the model structure and constructing the training dataset, the semantic analysis model is trained end-to-end. The training process uses an optimization algorithm based on gradient descent and sets hyperparameters such as the initial learning rate and batch size.
[0160] In each training iteration, a batch of samples is sampled from the training dataset. Each sample includes the original notification text, the initial knowledge subgraph structure data extracted and encoded through preprocessing, and the real labels corresponding to each task.
[0161] The batch data is input into the model, and forward propagation steps such as knowledge subgraph construction and encoding, graph-text deep fusion representation generation, and graph convolution calculation of relation and spatial awareness are executed in sequence to obtain graph-level, node-level and edge-level prediction outputs.
[0162] Then, based on the multi-task collaborative loss function defined in S205, the graph-level forest fire risk classification loss, node-level entity importance classification loss, edge-level relationship completeness detection loss, and regularization loss term are calculated respectively, and the total loss function value is obtained by weighted summation according to the dynamic weight strategy.
[0163] The gradient of the total loss with respect to all trainable parameters of the model is calculated using the backpropagation algorithm, and these parameters are updated using an optimizer to minimize the total loss objective.
[0164] The training process will continue for multiple rounds, with the model continuously learning and adjusting parameters on the training set, and periodically evaluating performance on the retained validation dataset, monitoring changes in metrics for the main task (such as fire risk classification accuracy) and auxiliary tasks.
[0165] The criterion for stopping iteration is usually triggered when the performance of the validation set no longer improves or begins to decline (i.e., overfitting occurs). Specifically, an early stopping strategy can be adopted. When the validation set loss no longer decreases within a certain number of consecutive training rounds, the training process is terminated and the model parameters are rolled back to the state of the model with the best validation performance. The model parameters in this state are saved as the final semantic analysis model after training.
[0166] In one embodiment, a forest fire risk knowledge graph is as follows: Figure 4 As shown; the critical path between key entities is as follows: Figure 5 As shown (the path is highlighted in orange).
[0167] S3. Semantic Analysis of Forest Fire Risk Reporting Based on Knowledge Graph
[0168] Once the semantic analysis model is trained, it can be used to perform automated semantic analysis on new, unlabeled forest fire risk report texts.
[0169] The analysis process first preprocesses the new incoming notification text in the same way as the training phase, and then uses pre-trained natural language processing tools to extract entities and relations, construct the corresponding initial knowledge subgraph, and then encode it into graph structure data.
[0170] Then, the processed text data and graph data are input into the pre-trained semantic analysis model, which will automatically execute the entire computation process: fusing unstructured text and structured knowledge information through a graph-text interaction attention layer; iteratively updating node representations through a relational and spatially aware graph convolutional network to capture complex dependencies and influence relationships between entities; and finally, generating multi-dimensional analysis results synchronously through the output layer of a multi-task learning framework.
[0171] The analysis results include: graph-level forest fire risk level prediction, which provides an overall fire risk level assessment for the scenario described in the report; node-level key entity identification, which identifies key entities in the report text that play a decisive role in the fire risk situation, such as core fire points and major disaster-causing meteorological factors; and edge-level potential relationship detection, which indicates semantic relationships that may exist in the model but are not explicitly stated in the original report text, assisting in knowledge discovery and reasoning.
[0172] Through the above analysis of the new notification text, this invention can transform unstructured natural language descriptions into structured, quantifiable, and in-depth risk semantic understanding, providing a technical foundation for rapid assessment of forest fire risk, accurate extraction of early warning information, and subsequent decision support.
[0173] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A semantic analysis method for forest fire risk reporting based on knowledge graphs, characterized in that, Includes the following steps: S1. Collect original forest fire risk report texts and construct a forest fire risk report dataset; S2. Construct a semantic analysis model for forest fire risk reports, including a knowledge subgraph construction and encoding module, a deep fusion representation generation module, a graph convolution calculation module, and a multi-task output module; the knowledge subgraph construction and encoding module extracts entities and relations from the original report text, constructs a knowledge subgraph for the current text, and encodes it as graph structure data; The deep fusion representation generation module employs a graph-text interaction attention layer to mutually query and enhance the node features of the knowledge subgraph and the sequence features of the original notification text, generating context-aware node representations. The deep fusion representation generation module specifically includes: The original notification text is encoded using a pre-trained language model to obtain a text feature matrix. This text feature matrix is then projected onto a vector space identical to the graph node features using a linear transformation, resulting in a projected text feature matrix. For each position in the text sequence, the attention weight between that position and each node in the knowledge subgraph is calculated. Similarly, for each node in the knowledge subgraph, the attention weight between that node and each position in the text sequence is calculated. Based on the separately calculated text-to-graph and graph-to-text attention, a bidirectional feature interaction mechanism is formed, represented as: , , In the formula, Indicates text position The context vector obtained by aggregating from the knowledge subgraph; Indicates the node index in the knowledge subgraph; Representing a knowledge subgraph The set of nodes in; Indicates the first text sequence after projection The position in the knowledge subgraph is the first Attention weights for each node; Represents entity nodes The initial feature vector; Representing knowledge nodes The context vector obtained by aggregating from the entire text sequence; Indicates text length; Represents nodes in a knowledge subgraph For the projected text sequence, the first... Attention weights for each position; Represents the feature matrix of the projected text The Middle A vector at each position; The initial features of each knowledge node are fused with the information aggregated from the text to generate enhanced node features; represented as: , In the formula, Representing knowledge nodes eigenvectors; This represents a feedforward neural network; Represents entity nodes The initial feature vector; This represents a vector concatenation operation; The graph convolution calculation module employs a multi-layer graph convolutional network with relation strength modulation and spatial awareness. It introduces dynamic relation strength coefficients based on external knowledge computation into message passing and simulates the effect of risk attenuation with distance. Specifically, the graph convolution calculation module includes: For each directed edge in the knowledge subgraph, a dynamic relation strength modulation coefficient is calculated by combining the features of the head and tail nodes connected by the edge, the node attributes obtained from the external knowledge base, and the global semantic information aggregated from the text; expressed as: , In the formula, Indicates from node Through relation type Pointing to node The edge relationship intensity modulation coefficient; This represents the Sigmoid activation function; Representation of relation type Associated weight vector; express transpose; Represents the head entity node eigenvectors; Represents the tail entity node eigenvectors; Representation of relation type Related attribute interaction feature vectors; Represents the global text semantic vector; Representation of relation type Related bias terms; A graph convolution operation that combines relation strength modulation and spatial attenuation effect is adopted to aggregate multi-relation neighborhood information, simulate the physical constraint that fire risk factors attenuate with increasing distance in real space, and generate feature vectors calculated by graph convolution. After multiple layers of graph convolution, each node obtains multi-hop semantic information from direct neighbors to higher-order neighbors. A gating mechanism is used to aggregate the features of the node in all layers to generate an aggregated feature vector. The multi-task output module adopts a multi-task learning framework, which simultaneously performs graph-level forest fire risk level classification, node-level key entity recognition, and edge-level missing relationship detection, by sharing underlying feature encoding and jointly optimizing multiple related tasks. The forest fire risk reporting semantic analysis model is trained and optimized using a multi-task collaborative loss function to obtain a well-trained model. The total loss function consists of the main task loss (forest fire risk level classification), the losses from two auxiliary tasks (entity importance classification and relation completeness detection), and a regularization term, expressed as follows: , In the formula, Represents the total loss function; A dynamic weight scalar representing the loss of graph-level tasks; This represents the cross-entropy loss in the graph-level forest fire risk classification task. A dynamic weighted scalar representing the node-level task loss; Represents the cross-entropy loss for node-level entity importance classification tasks; A dynamic weight scalar representing the loss of edge-level tasks; The binary cross-entropy loss represents the boundary-level relation completeness detection task. It is a hyperparameter scalar; Represents the regularized loss term; S3. Input the new forest fire risk report text into the trained forest fire risk report semantic analysis model to obtain the forest fire risk report semantic analysis results.
2. The semantic analysis method for forest fire risk reporting based on knowledge graphs according to claim 1, characterized in that, The knowledge subgraph construction and encoding module specifically includes: For each input forest fire risk report text, a corresponding knowledge subgraph is defined, which is a directed heterogeneous graph. The original report text is extracted using pre-trained natural language processing tools to fill the defined knowledge subgraph structure. For each entity node in the knowledge subgraph, an initial feature vector is generated that integrates its type semantics and text context information.
3. The semantic analysis method for forest fire risk reporting based on knowledge graphs according to claim 2, characterized in that, The multi-task output module includes a node-level entity importance classification task, a border-level relation completeness detection task, and a graph-level forest fire risk level classification task.
4. The semantic analysis method for forest fire risk reporting based on knowledge graphs according to claim 3, characterized in that, Node-level entity importance classification task: Based on the aggregated feature vectors of nodes, predict whether each entity node in the knowledge subgraph belongs to a key entity that is crucial to fire risk assessment.
5. The semantic analysis method for forest fire risk reporting based on knowledge graphs according to claim 4, characterized in that, Edge-level relation completeness detection task: By calculating the predicted probability that there is a potential semantic relationship between any two nodes, determine whether there is a potential semantic relationship between the nodes that was not discovered in the initial extraction.
6. The semantic analysis method for forest fire risk reporting based on knowledge graphs according to claim 5, characterized in that, Forest fire risk level classification task: Based on the entire report text and its corresponding knowledge subgraph, calculate the probability that the input sample is classified into each forest fire risk level, and comprehensively judge the overall forest fire risk level described.
7. The semantic analysis method for forest fire risk reporting based on knowledge graphs according to claim 6, characterized in that, The forest fire risk report dataset includes the original report text, the corresponding entity set, relation triples, entity importance labels, forest fire risk level labels, and positive and negative sample pairs for relation detection.
Citation Information
Patent Citations
CN119558392A
CN119963386A