Knowledge graph construction method and system
By employing a weighted fusion strategy guided by multi-dimensional feature extraction and temporal and causal ontology, the problem of low entity recognition accuracy in existing technologies is solved, and the accuracy of knowledge graph construction is improved, which has significant application value, especially in power systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID ZHEJIANG ELECTRIC POWER CO LTD
- Filing Date
- 2026-04-13
- Publication Date
- 2026-05-12
AI Technical Summary
In existing technologies, knowledge graph-based operation and maintenance knowledge management solutions suffer from low entity recognition accuracy due to the reliance on single feature extraction methods, which in turn affects the accuracy of knowledge graph construction.
A multi-dimensional feature extraction method is adopted, combined with a weighted fusion strategy guided by temporal and causal ontology. By acquiring multi-source operation and maintenance text data, context vector features, static word vector features, and statistical text features are generated and weighted fused to identify entities and entity relationships, and finally construct a knowledge graph.
It enables accurate identification of entities and their relationships, improves the accuracy of knowledge graph construction, and supports intelligent decision-making and operation and maintenance applications in power systems.
Smart Images

Figure CN122021840A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and more specifically, to a method and system for constructing knowledge graphs. Background Technology
[0002] During system operation and maintenance, operation and maintenance data are scattered across various system carriers, gradually forming a multi-source heterogeneous text data pool. This directly leads to the prominent phenomenon of "islanding" of operation and maintenance knowledge, making it difficult to effectively implement cross-system data calls and cross-scenario intelligent decision-making.
[0003] Knowledge graphs, with their powerful semantic representation and association organization capabilities, have become a core technology for breaking down operational knowledge barriers and solving the "silo" problem. However, current operational knowledge management solutions based on knowledge graphs still have significant shortcomings: entity recognition, as a key link in graph construction, is often addressed by existing technologies through "isolated extraction of single features." This singular feature extraction mode cannot fully cover the deep semantic information of operational texts, directly resulting in low entity recognition accuracy and ultimately insufficient accuracy of the constructed knowledge graph. Summary of the Invention
[0004] Based on this, the present invention provides a knowledge graph construction method and system to solve the shortcomings of existing technologies that result in insufficient accuracy in entity recognition and knowledge graph construction due to single feature extraction.
[0005] To achieve the above objectives, embodiments of the present invention provide a knowledge graph construction method, including: Acquire multi-source operation and maintenance text data; Feature extraction is performed on the multi-source operation and maintenance text data to obtain context vector features, static word vector features, and statistical text features; The context vector features, static word vector features, and statistical text features are weighted and fused to generate a text representation; wherein, the greater the similarity between the multi-source operation and maintenance text data and the pre-constructed temporal and causal ontology, the greater the weight coefficient corresponding to the context vector features; and the temporal and causal ontology is a structured knowledge framework about temporal patterns and causal mechanisms. Based on the text representation, entities and entity relationships are identified to obtain initial identification results; The initial recognition results are subjected to entity alignment and information fusion processing to obtain the target result; A knowledge graph is constructed based on the stated target results.
[0006] To achieve the above objectives, embodiments of the present invention also provide a knowledge graph construction system, comprising: The data acquisition module is used to acquire multi-source operation and maintenance text data; The feature extraction module is used to extract features from the multi-source operation and maintenance text data to obtain context vector features, static word vector features, and statistical text features. The feature fusion module is used to perform weighted fusion of the context vector features, the static word vector features, and the statistical text features to generate a text representation; wherein, the greater the similarity between the multi-source operation and maintenance text data and the pre-constructed temporal and causal ontology, the greater the weight coefficient corresponding to the context vector features; and the temporal and causal ontology is a structured knowledge framework about temporal patterns and causal mechanisms. The entity recognition module is used to identify entities and entity relationships based on the text representation to obtain an initial recognition result; The alignment and fusion module is used to perform entity alignment and information fusion processing on the initial recognition result to obtain the target result; The knowledge graph construction module is used to construct a knowledge graph based on the target result.
[0007] Compared with existing technologies, the knowledge graph construction method and system disclosed in this invention first acquire multi-source operation and maintenance text data; then, feature extraction is performed on the multi-source operation and maintenance text data to generate context vector features, static word vector features, and statistical text features; subsequently, these three types of features are weighted and fused to generate a text representation; wherein, a pre-constructed temporal and causal ontology serves as the basis for weight adjustment, the greater the similarity between the multi-source operation and maintenance text data and this ontology, the greater the weight coefficient corresponding to the context vector features; the temporal and causal ontology is a structured knowledge framework about temporal patterns and causal mechanisms; then, entities and entity relationships are identified based on the generated text representation to obtain an initial identification result; then, the initial identification result is optimized through entity alignment and information fusion processing to form a target result; finally, a knowledge graph is constructed based on the target result. Therefore, this invention, through multi-dimensional feature extraction and a weighted fusion strategy guided by temporal and causal ontology, achieves accurate identification of entities and entity relationships, thereby improving the accuracy of knowledge graph construction. Attached Figure Description
[0008] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0009] Figure 1 This is a flowchart illustrating a knowledge graph construction method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a knowledge graph construction system provided in an embodiment of the present invention. Detailed Implementation
[0010] 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.
[0011] As a first preferred embodiment, see Figure 1 This is a flowchart illustrating a knowledge graph construction method according to an embodiment of the present invention. Specifically, the knowledge graph construction method includes steps S1 to S6: S1. Obtain multi-source operation and maintenance text data.
[0012] For example, in step S1, the multi-source operation and maintenance text data may include operation and maintenance manuals, fault reports, technical procedures, and equipment manuals, etc.
[0013] S2. Extract features from the multi-source operation and maintenance text data to obtain context vector features, static word vector features, and statistical text features.
[0014] Specifically, in step S2, context vector features refer to vectors generated by pre-trained language models (such as Bidirectional Encoder Representations from Transformers (BERT)) or recurrent neural networks. These vectors dynamically capture the semantic changes of words in different contexts, focusing on reflecting the logical connections (such as temporal and causal relationships) in the text that depend on the context. Transformer is a deep learning architecture based on a self-attention mechanism. Static word vector features refer to fixed vectors generated by word embedding models (such as Word to Vector (Word2Vec) or Global Vectors for Word Representation (GloVe)). These vectors focus on reflecting the inherent core semantics of words, are unaffected by context, and are suitable for expressing the stable meanings of specialized terms. Statistical text features refer to features extracted based on quantitative indicators such as the frequency and distribution patterns of words in the text. These features reflect the implicit statistical patterns in the text and help determine the importance or closeness of relationships between concepts.
[0015] For example, for multi-source operational text data: after preprocessing such as word segmentation, the multi-source operational text is input into BERT. Through the synergy of its core self-attention mechanism and feedforward neural network, dynamic and context-sensitive deep feature vectors (i.e., context vector features) are generated. Static word vector features are extracted using Word2Vec. Term Frequency-Inverse Document Frequency (TF-IDF) features are extracted as statistical text features. The self-attention mechanism allows the model to dynamically evaluate the mutual importance between different words or segments in a single input sequence (such as a document or a question), thereby constructing a context-aware, high-quality representation.
[0016] S3. The context vector features, the static word vector features, and the statistical text features are weighted and fused to generate a text representation; wherein, the greater the similarity between the multi-source operation and maintenance text data and the pre-constructed temporal and causal ontology, the greater the weight coefficient corresponding to the context vector features, and the temporal and causal ontology is a structured knowledge framework about temporal patterns and causal mechanisms.
[0017] Specifically, in executing step S3, whether setting fixed weights based on experience (e.g., 50% for context vector features, 30% for static word vector features, and 20% for statistical text features) or relying on the model to automatically learn general weights, neither approach incorporates the textual characteristics of the power operation and maintenance field as a basis for weight adjustment. This leads to a disconnect between weight allocation and the actual semantic needs of the text. For example, when processing fault analysis report data, its core value lies in the temporal and causal relationships it contains. If fixed weights are used to execute step S3, the role of context vector features will not be fully utilized, and key related information is easily lost. When processing equipment manual data, the text focuses on the fixed semantics of technical terms. Over-reliance on context vector features to execute S3 may lead to semantic deviations in terms due to contextual interference. Therefore, this implementation method introduces a pre-constructed temporal and causal ontology (a structured knowledge framework about temporal patterns and causal mechanisms) to guide weight allocation in executing step S3, making the weight coefficients more consistent with the semantic focus of different types of multi-source operation and maintenance text data, thereby obtaining a more accurate text representation. This optimization provides high-quality feature support for step S4, ensuring the accuracy of entity and entity relationship identification, and finally constructing an accurate knowledge graph through steps S5 and S6.
[0018] For example, taking the application of the method to a power system as an example, the construction of the time-series and causal ontology is as follows: (1) The official standard semantic framework of the Common Information Model (CIM) for the power industry is reused. The Protégé ontology editing tool is used, and the domain ontology is constructed based on the Web Ontology Language (OWL). This domain ontology needs to achieve three core functions: First, to clarify the core attributes of power equipment, and refine them to basic information such as specific equipment models and key operating parameters; second, to systematically sort out typical fault types such as equipment overheating, insulation aging, and high-voltage partial discharge, and form a standardized fault classification system; and third, to depict the hierarchical and relational relationships between core entities such as equipment, faults, and operation and maintenance. At the same time, the operation and maintenance experience and business rules accumulated by domain experts are transformed into machine-readable and executable fault risk judgment logic through the Semantic Web Rule Language (SWRL), laying a semantic foundation for the subsequent definition of temporal and causal relationships. Among them, Protégé is a powerful ontology editing tool used to create and maintain ontology.
[0019] (2) Constructing a temporal and causal ontology based on the domain ontology: On the basis of constructing the domain ontology, further construct a professional ontology focusing on temporal and causal relationships: Using OWL and SWRL, a temporal and causal ontology is formed from three levels: "event definition - relationship definition - rule construction".
[0020] Event definition: Define key events for specific power equipment scenarios. For example, for gas-insulated switchgear, define events such as excessive moisture content, partial discharge, abnormal gas pressure drop, and protection device activation. Relationship definition: Temporal relationships are defined by attributes such as "preceded" and "immediately followed", while causal relationships are defined by attributes such as "possible cause" and "direct cause". Rule Construction: Using SWRL, the temporal and causal relationships are solidified into inference rules. For example, "On the same gas-insulated switchgear, if the event of excessive moisture content occurs at time t1, the event of partial discharge occurs at time t2 (t1 precedes t2), and the event of abnormal gas pressure drop occurs at time t3 (t2 precedes t3), then it can be inferred that excessive moisture content is a possible cause of partial discharge, and partial discharge is a possible cause of abnormal gas pressure drop."
[0021] (3) Establish an ontology dynamic optimization mechanism To ensure that the temporal and causal ontology remains synchronized with the actual needs of power operation and maintenance, we regularly integrate newly generated fault reports and cutting-edge knowledge from scientific research papers, and combine this with feedback from on-site operation and maintenance personnel to iteratively update the event classes, relational attributes, and inference rules in the temporal and causal ontology.
[0022] S4. Based on the text representation, identify entities and entity relationships to obtain initial identification results.
[0023] S5. Perform entity alignment and information fusion processing on the initial recognition results to obtain the target result.
[0024] Specifically, to address potential issues such as "hypothetical names" (e.g., "regular inspection" and "periodic maintenance") and "homophones with different meanings" in the initial identification results, entity alignment technology is used to unify and merge them, eliminating redundancy and ambiguity. Information fusion is then performed on the aligned entities and their relationships, and conflict resolution strategies are used to handle contradictory information to obtain the target result. For example, the target result can be generated by fusing the initial identification results through fine-grained co-aggregation and entity-level co-aggregation. Fine-grained co-aggregation refers to aligning, associating, and integrating information at a lower level (e.g., at the word, phrase, or sentence fragment level), while entity-level co-aggregation operates at a higher level, focusing on the core entity and converging and unifying its related descriptions, attributes, and supporting information from different documents.
[0025] S6. Construct a knowledge graph based on the target results.
[0026] Furthermore, based on the target outcome, an initial knowledge graph is constructed. Subsequently, based on the knowledge dictionary and logical framework of the power industry, factual gaps in the initial graph are filled through ontology rule reasoning and graph embedding-based link prediction methods. Next, the completed knowledge is evaluated and scored in multiple dimensions, and the overall confidence level is determined by manual review by domain experts. Finally, high-scoring knowledge above the set score threshold is selected and updated to the core knowledge base. This core knowledge base integrates structured knowledge, rules, and cases in the power industry, which can effectively assist in fault diagnosis and predictive maintenance in operation and maintenance, as well as risk warning and operation ticket verification in power dispatch, improving business efficiency and decision-making accuracy.
[0027] It is worth noting that the method described is applicable to the integration of multi-source operation and maintenance text data in various systems, and has significant application value, especially in power systems. After the knowledge graph is constructed, newly generated multi-source operation and maintenance text data is regularly integrated through supporting modules such as content analysis engine, knowledge construction engine, and content retrieval engine to iteratively update the knowledge graph, thereby achieving continuous optimization of the knowledge graph and more effectively supporting the intelligent application of power grid operation and maintenance.
[0028] Compared with existing technologies, this implementation method achieves accurate identification of entities and entity relationships by extracting multi-dimensional features and combining a weighted fusion strategy guided by temporal and causal ontology, thereby improving the accuracy of knowledge graph construction.
[0029] In a preferred embodiment, based on steps S1 to S6, step S3 specifically includes: Obtain the time series and causal ontology; encode the multi-source operation and maintenance text data into a query vector; encode the time series and causal ontology into a pattern vector; Calculate the cosine similarity between the query vector and the pattern vector; The first target weight coefficient, the second target weight coefficient, and the third target weight coefficient are determined based on the cosine similarity; wherein, the first target weight coefficient is positively correlated with the cosine similarity and corresponds to the context vector feature; the second target weight coefficient and the third target weight coefficient are negatively correlated with the cosine similarity and correspond to the static word vector feature and the statistical text feature, respectively; Based on the first target weight coefficient, the second target weight coefficient, and the third target weight coefficient, the context vector features, the static word vector features, and the statistical text features are fused to generate a text representation.
[0030] Understandably, if multi-source operations and maintenance text data shows a high degree of matching with time-series and causal ontology (i.e., high cosine similarity), it indicates that the core information of the multi-source operations and maintenance text data depends on contextual semantics (e.g., "database connection failed after server restart" needs to be understood in conjunction with time-series and context). Therefore, contextual vector features should be given higher weight. If multi-source operations and maintenance text data shows a low degree of matching with time-series and causal ontology (i.e., low cosine similarity), it indicates that the text is more biased towards independent words or statistical patterns (e.g., high-frequency and simple faults such as "insufficient disk space"). Therefore, static word vector features and statistical text features should be given higher weight.
[0031] For example, a structured knowledge framework (i.e., temporal and causal ontology) is obtained regarding the temporal patterns (such as the order of failures) and causal mechanisms (such as the rules for associating operations and failures) in the operation and maintenance scenario. Multi-source operation and maintenance text data is input into a gated recurrent unit (GRU) encoder. Utilizing its ability to process sequence data, the word order and basic semantics of the multi-source operation and maintenance text data are captured and transformed into a dense vector of fixed dimensions, serving as the query vector. The temporal and causal ontology are transformed into natural language descriptions and then input into the same GRU encoder to generate pattern vectors. The cosine similarity between the query vector and the pattern vector is calculated. Based on the cosine similarity, the first target weight coefficient, the second target weight coefficient, and the third target weight coefficient are determined. Based on these three weight coefficients, context vector features, static word vector features, and statistical text features are weighted and fused to generate a text representation.
[0032] In one implementation, based on the previous implementation, the step of determining the first target weight coefficient, the second target weight coefficient, and the third target weight coefficient based on the cosine similarity includes: Obtain a first initial weight coefficient, a second initial weight coefficient, and a third initial weight coefficient; the first initial weight coefficient corresponds to the context vector feature, the second initial weight coefficient corresponds to the static word vector feature, and the third initial weight coefficient corresponds to the statistical text feature; A causal activation vector is output based on the cosine similarity; wherein the causal activation vector is positively correlated with the cosine similarity. The causal activation vector is sequentially passed through a fully connected network and a sigmoid function to generate a gating signal; The first initial weight coefficient, the second initial weight coefficient, and the third initial weight coefficient are adjusted according to the gating signal to obtain the first target weight coefficient, the second target weight coefficient, and the third target weight coefficient; wherein, the first target weight coefficient is positively correlated with the gating signal and corresponds to the context vector feature; the second target weight coefficient and the third target weight coefficient are negatively correlated with the gating signal and correspond to the static word vector feature and the statistical text feature, respectively.
[0033] Specifically, multi-feature fusion is achieved through a causal attention-gated fusion unit. Its core function is to dynamically adjust the weight coefficients of three types of features—context vector features, static word vector features, and statistical text features—based on temporal and causal ontology, and to filter the fused high-dimensional features by combining an L1 regularized embedded feature selection algorithm, automatically removing redundant information, and finally forming a comprehensive and concise text representation.
[0034] For example, the feature fusion process is as follows: 1. Feature Input and Pattern Matching (1) Input features: context vector features, static word vector features and the statistical text features.
[0035] (2) Pattern matching process: The lightweight model BGE-M3 is used to encode the multi-source operation and maintenance text data into a query vector Vquery, and the temporal and causal ontology is pre-encoded into a pattern vector Vschema. The cosine similarity between Vquery and Vschema is calculated, and the causal activation vector Ac is output. Each dimension of the causal activation vector Ac corresponds to an activation intensity. The causal activation vector Ac is positively correlated with the cosine similarity, that is, the higher the matching degree between the multi-source operation and maintenance text data and the temporal and causal ontology, the greater the activation intensity of the causal activation vector Ac.
[0036] 2. Gating signal generation (1) The causal activation vector Ac is input into the fully connected network (FC) for feature transformation: first, a linear transformation (matrix multiplication) is performed on the hidden layer weight matrix, and a bias term is added; then, a nonlinear transformation is performed through the ReLU activation function; finally, a linear transformation is performed through the output layer to generate a real value, which is used as the input to the sigmoid function (i.e., the Sigmoid activation function). The Chinese name for the ReLU activation function is Modified Linear Unit Activation Function, which is a common nonlinear activation function.
[0037] (2) The output of the fully connected network (FC) is processed using the Sigmoid activation function to obtain the gate signal g, which has a value range of (0,1). It is worth noting that the gate signal g represents the degree of correlation between multi-source operation and maintenance text data and time series and causal ontology; when the gate signal g approaches 1, the multi-source operation and maintenance text data is highly correlated with time series and causal ontology; when the gate signal g approaches 0, the multi-source operation and maintenance text data has a low correlation with time series and causal ontology.
[0038] 3. Dynamic weight adjustment The weighting coefficients of the three types of features are adjusted based on the gating signal g, and the specific formula is as follows: The weight coefficients of the context vector features (i.e., the first target weight coefficients): a1 = a0 × (1 + g); a0 is the first initial weight coefficient; The weight coefficients of static word vector features (i.e., the second target weight coefficients): b1 = b0 × (1 - g / 2); b0 is the first initial weight coefficient; The weighting coefficients of statistical text features (i.e., the third target weighting coefficients): c1 = c0 × (1 - g / 2); c0 is the first initial weighting coefficient; When multi-source operation and maintenance text data is highly correlated with time series and causal ontology, a1 is significantly amplified, while b1 and c1 are moderately weakened, with a focus on context vector features. When multi-source operation and maintenance text data is less correlated with time series and causal ontology, a1, b1, and c1 are basically equal to the initial weight coefficients, and a relatively balanced approach is used to achieve multi-feature fusion.
[0039] It is worth noting that the specific adjustment method is not limited to the above formula and can be set according to the actual situation, but the following conditions must be met: the weight coefficient of the context vector feature is positively correlated with the gating signal g, and the weight coefficient of the static word vector feature and the weight coefficient of the statistical text feature are negatively correlated with the gating signal g.
[0040] 4. Based on the first target weight coefficient, the second target weight coefficient, and the third target weight coefficient obtained above, the three types of features are weighted and fused to obtain a fusion vector; then, the L1 regularized embedded feature selection algorithm is applied to the fusion vector to remove redundant dimensions, and finally a simplified text representation is generated.
[0041] Taking the input text "During inspection, it was found that the No. 2 main transformer was making an abnormal noise, and the oil level gauge pointer was showing a rapid downward trend; infrared thermography showed that the temperature of the A-phase bushing was abnormally high" as an example, its causal activation vector Ac with the temporal and causal entities is relatively large, the gating signal g is close to 1, a1 is significantly amplified, and b1 and c1 are weakened. The final generated text representation focuses on the dynamic context vector features extracted from "abnormal noise", "rapid decline", and "abnormal rise", laying a solid foundation for subsequent accurate identification of entities and relationships such as "oil shortage" and "overheating".
[0042] In a preferred embodiment, based on any of the above embodiments, step S4 specifically includes: The text representation is processed by a bidirectional long short-term memory network to obtain the matching score between each time step in the multi-source operation and maintenance text data and various types of labels in the predefined label set; the pre-trained label transition scores are then loaded. For the current time step, each tag in the predefined tag set is used as a candidate tag for the current time step; By combining the matching score of the candidate label and the transition score from the optimal label in the previous time step to the candidate label, the path score of each transition path is calculated. Based on the path score, the optimal label for the current time step is selected; When all time steps have been traversed, the optimal label sequence is output; wherein, the optimal label sequence is generated based on the optimal labels of all time steps; Based on the optimal label sequence, the entities and entity relationships of the multi-source operation and maintenance text data are identified to obtain the initial identification results.
[0043] Furthermore, the optimal label at the first time step is the label with the highest matching score in the predefined label set.
[0044] Specifically, a basic framework of "Bidirectional Long Short-Term Memory (BiLSTM) feature extraction and Conditional Random Field (CRF) sequence decoding" is built. This framework is then used to identify entities and their relationships. The specific process is as follows: 1. Input the text representation into the BiLSTM layer. The BiLSTM layer captures the bidirectional contextual dependencies of multi-source operation and maintenance text data and obtains the matching degree score between each time step and various types of tags in the predefined tag set, which is used as the emission score of CRF.
[0045] 2. In the CRF layer, a pre-trained matrix of inter-label transition scores is loaded. This matrix represents the probability strength of transitioning from one label to another and can be learned from training data. For each time step t, all candidate labels are traversed, and the path score for "transferring from the optimal label at time step t-1 to the candidate label at time step t" is calculated. The formula for calculating the path score is: Path Score = Emission Score of the candidate label at the current time step + Transition Score from the optimal label at the previous time step to the candidate label. Based on the calculated path score, label selection is performed, and the label with the highest score is selected as the optimal label at time step t. It is worth noting that when t is 1, the emission score of the candidate label is used as the path score.
[0046] 3. Generate the optimal label sequence based on the optimal labels obtained from the screening; identify entities and entity relationships in multi-source operation and maintenance text data based on the optimal label sequence, and output the initial identification results.
[0047] In a preferred embodiment, based on the previous embodiment, the step of calculating the path score for each transition path by combining the matching score of the candidate label and the transition score from the optimal label to the candidate label in the previous time step includes: When the optimal label of the previous time step indicates the end of an event, and the candidate label of the current time step indicates the beginning of another event, the event dependency relationship to be verified between the corresponding event of the previous time step and the corresponding event of the current time step is extracted based on the multi-source operation and maintenance text data. When the dependency of the event to be verified does not meet the requirements of the temporal and causal ontology, the temporal causal score is set to a preset negative value; when the dependency of the event to be verified meets the requirements of the temporal and causal ontology, the temporal causal score is set to a preset positive value. When the optimal label of the previous time step does not indicate the end of an event or the candidate label of the current time step does not indicate the beginning of another event, the temporal causality score is set to a preset intermediate value, which is greater than the preset negative value and less than the preset positive value. By combining the temporal causal score, the matching score of the candidate label, and the transition score from the optimal label in the previous time step to the candidate label, the path score of each transition path is calculated.
[0048] Specifically, this implementation improves path score calculation by adding a "temporal causality score" to the basic framework of "BiLSTM feature extraction and CRF sequence decoding". The improved path score calculation formula is: Path Score = Emission Score of Candidate Label at the Current Time Step + Transition Score from the Optimal Label to the Candidate Label at the Previous Time Step + Temporal Causality Score. The triggering and calculation logic of the temporal causality score is as follows: 1. Triggering conditions: The query of the time series and causal ontology is triggered only when "the optimal label of the previous time step indicates the end of the event" and "the candidate label of the current time step indicates the start of a new event". Other scenarios (such as label transfer within the same event) do not trigger this special constraint, and the time series causal score is set to a preset intermediate value (such as 0).
[0049] 2. Query process for temporal and causal ontology: (1) Input: the best label yi in the previous time step, the current candidate label y{i+1}, and the context (including the complete text and the identified entities); (2) Information extraction: Extract the dependencies of the events to be verified from the context; (3) Ontology verification: Query the timing and causal ontology to determine whether the dependency relationship between the two events conforms to the rules (e.g., whether "line overload causes protection tripping" conforms to the ontology logic of "overload triggers protection"). (4) Score output: If the score meets the rules, a preset positive value will be returned; if the score violates the rules, a preset negative value with an extremely large absolute value will be returned. For example, identifying "personnel accidentally touching" as the cause of "equipment overheating" is in accordance with the rules; however, identifying "equipment overheating" as the cause of "lightning strike" would violate the rules.
[0050] It's worth noting that the preset positive value is set according to the actual situation and is not limited here. The preset negative value is a sufficiently small negative number to ensure that erroneous paths score extremely low and are eliminated.
[0051] In a preferred embodiment, based on the previous embodiment, when the optimal label of the previous time step represents the end of an event and the candidate label of the current time step represents the beginning of another event, extracting the event dependency relationship to be verified between the corresponding event of the previous time step and the corresponding event of the current time step based on the multi-source operation and maintenance text data includes: When the optimal label of the previous time step indicates the end of an event, and the candidate label of the current time step indicates the beginning of another event, locate the text content corresponding to the optimal label of the previous time step and the candidate label of the current time step in the multi-source operation and maintenance text data, and extract the event dependency information. The event dependency relationships to be verified are generated based on the located text content and the event dependency information.
[0052] Specifically, the method for extracting the dependencies of events to be verified is as follows: Based on the alignment relationship between tags and text, the text is accurately located in the multi-source operation and maintenance text to obtain the text content corresponding to the optimal tag (event end) of the previous time step (such as the rapid drop of the oil level gauge pointer) and the text content corresponding to the candidate tag (event start) of the current time step (such as emergency oil release), and event dependency information (such as time-series related words such as "caused" and "subsequently") is extracted; after the information extraction is completed, the text content and event dependency information are combined to generate the dependencies of events to be verified.
[0053] In a preferred embodiment, the path score for each transition path, calculated by combining the temporal causality score, the matching score of the candidate label, and the transition score from the optimal label to the candidate label in the previous time step, as described in the above embodiments, includes: The path score for each transition path is obtained by adding the temporal causality score, the matching score of the candidate label, and the transition score from the optimal label to the candidate label in the previous time step; wherein, the absolute value of the preset negative value is greater than the preset maximum value, and the preset maximum value is the sum of the preset upper limit of the matching score and the preset upper limit of the transition score.
[0054] Specifically, this implementation clearly defines the quantitative standard for temporal causality scores. By imposing hard numerical constraints, it ensures the effectiveness of the constraints on temporal and causal entities, preventing erroneous paths from being eliminated due to insufficient penalties. The absolute value of the preset negative value must be greater than the sum of the upper limits of the emission score and the transfer score, ensuring that the path score is negative after penalty is triggered, thus forcibly eliminating erroneous paths. The value of the preset positive value must be less than the normal range of the sum of the emission score and the transfer score, avoiding excessive interference with the score ranking of reasonable paths.
[0055] The quantization constraints of this implementation method can capture the semantic details of the text through BiLSTM, and filter logical errors such as "causal reversal" and "temporal disorder" through ontology constraints, ensuring that the initial recognition results can be accurately output in the end.
[0056] Compared with existing technologies, in this embodiment of the invention, multi-source operation and maintenance text data is first acquired; then, features are extracted from the multi-source operation and maintenance text data to generate context vector features, static word vector features, and statistical text features; subsequently, these three types of features are weighted and fused to generate a text representation; wherein, a pre-constructed temporal and causal ontology serves as the basis for weight adjustment, the greater the similarity between the multi-source operation and maintenance text data and this ontology, the greater the weight coefficient corresponding to the context vector features; the temporal and causal ontology is a structured knowledge framework about temporal patterns and causal mechanisms; then, entities and entity relationships are identified based on the generated text representation to obtain an initial identification result; then, the initial identification result is optimized through entity alignment and information fusion processing to form a target result; finally, a knowledge graph is constructed based on the target result. Therefore, this embodiment of the invention, through multi-dimensional feature extraction and combined with a weighted fusion strategy guided by temporal and causal ontology, achieves accurate identification of entities and entity relationships, thereby improving the accuracy of knowledge graph construction.
[0057] See Figure 2 , Figure 2 This is a schematic diagram of a knowledge graph construction system provided in an embodiment of the present invention. The knowledge graph construction system 20 includes: Data acquisition module 21 is used to acquire multi-source operation and maintenance text data; Feature extraction module 22 is used to extract features from the multi-source operation and maintenance text data to obtain context vector features, static word vector features and statistical text features; The feature fusion module 23 is used to perform weighted fusion of the context vector features, the static word vector features and the statistical text features to generate a text representation; wherein, the greater the similarity between the multi-source operation and maintenance text data and the pre-constructed temporal and causal ontology, the greater the weight coefficient corresponding to the context vector features, and the temporal and causal ontology is a structured knowledge framework about temporal patterns and causal mechanisms. The entity recognition module 24 is used to recognize entities and entity relationships based on the text representation to obtain an initial recognition result; Alignment and fusion module 25 is used to perform entity alignment and information fusion processing on the initial recognition result to obtain the target result; The knowledge graph construction module 26 is used to construct a knowledge graph based on the target result.
[0058] Furthermore, the feature fusion module 23 is specifically used for: Obtain the time series and causal ontology; encode the multi-source operation and maintenance text data into a query vector; encode the time series and causal ontology into a pattern vector; Calculate the cosine similarity between the query vector and the pattern vector; The first target weight coefficient, the second target weight coefficient, and the third target weight coefficient are determined based on the cosine similarity; wherein, the first target weight coefficient is positively correlated with the cosine similarity and corresponds to the context vector feature; the second target weight coefficient and the third target weight coefficient are negatively correlated with the cosine similarity and correspond to the static word vector feature and the statistical text feature, respectively; Based on the first target weight coefficient, the second target weight coefficient, and the third target weight coefficient, the context vector features, the static word vector features, and the statistical text features are fused to generate a text representation.
[0059] It is worth noting that the specific working process of the knowledge graph construction system can be referred to the working process of the knowledge graph construction method described in the above embodiments, and will not be repeated here.
[0060] Compared with existing technologies, the knowledge graph construction system disclosed in this invention first acquires multi-source operation and maintenance text data; then, it extracts features from the multi-source operation and maintenance text data to generate context vector features, static word vector features, and statistical text features; subsequently, it performs weighted fusion of these three types of features to generate a text representation; wherein, a pre-constructed temporal and causal ontology serves as the basis for weight adjustment, the greater the similarity between the multi-source operation and maintenance text data and this ontology, the greater the weight coefficient corresponding to the context vector features; the temporal and causal ontology is a structured knowledge framework about temporal patterns and causal mechanisms; then, based on the generated text representation, it identifies entities and entity relationships to obtain an initial identification result; then, it optimizes the initial identification result through entity alignment and information fusion processing to form a target result; finally, it constructs a knowledge graph based on the target result. Therefore, this invention, through multi-dimensional feature extraction and combined with a weighted fusion strategy guided by temporal and causal ontology, achieves accurate identification of entities and entity relationships, thereby improving the accuracy of knowledge graph construction.
[0061] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for constructing a knowledge graph, characterized in that, include: Acquire multi-source operation and maintenance text data; Feature extraction is performed on the multi-source operation and maintenance text data to obtain context vector features, static word vector features, and statistical text features; The context vector features, static word vector features, and statistical text features are weighted and fused to generate a text representation; wherein, the greater the similarity between the multi-source operation and maintenance text data and the pre-constructed temporal and causal ontology, the greater the weight coefficient corresponding to the context vector features; and the temporal and causal ontology is a structured knowledge framework about temporal patterns and causal mechanisms. Based on the text representation, entities and entity relationships are identified to obtain initial identification results; The initial recognition results are subjected to entity alignment and information fusion processing to obtain the target result; A knowledge graph is constructed based on the stated target results.
2. The knowledge graph construction method as described in claim 1, characterized in that, The step of weightedly fusing the context vector features, the static word vector features, and the statistical text features to generate a text representation includes: Obtain the time series and causal ontology; encode the multi-source operation and maintenance text data into a query vector; encode the time series and causal ontology into a pattern vector; Calculate the cosine similarity between the query vector and the pattern vector; The first target weight coefficient, the second target weight coefficient, and the third target weight coefficient are determined based on the cosine similarity; wherein, the first target weight coefficient is positively correlated with the cosine similarity and corresponds to the context vector feature; the second target weight coefficient and the third target weight coefficient are negatively correlated with the cosine similarity and correspond to the static word vector feature and the statistical text feature, respectively; Based on the first target weight coefficient, the second target weight coefficient, and the third target weight coefficient, the context vector features, the static word vector features, and the statistical text features are fused to generate a text representation.
3. The knowledge graph construction method as described in claim 2, characterized in that, The determination of the first target weight coefficient, the second target weight coefficient, and the third target weight coefficient based on the cosine similarity includes: Obtain a first initial weight coefficient, a second initial weight coefficient, and a third initial weight coefficient; the first initial weight coefficient corresponds to the context vector feature, the second initial weight coefficient corresponds to the static word vector feature, and the third initial weight coefficient corresponds to the statistical text feature; A causal activation vector is output based on the cosine similarity; wherein the causal activation vector is positively correlated with the cosine similarity. The causal activation vector is sequentially passed through a fully connected network and a sigmoid function to generate a gating signal; The first initial weight coefficient, the second initial weight coefficient, and the third initial weight coefficient are adjusted according to the gating signal to obtain the first target weight coefficient, the second target weight coefficient, and the third target weight coefficient; wherein, the first target weight coefficient is positively correlated with the gating signal and corresponds to the context vector feature; the second target weight coefficient and the third target weight coefficient are negatively correlated with the gating signal and correspond to the static word vector feature and the statistical text feature, respectively.
4. The knowledge graph construction method as described in claim 1, characterized in that, The process of identifying entities and entity relationships based on the text representation to obtain initial identification results includes: The text representation is processed by a bidirectional long short-term memory network to obtain the matching score between each time step in the multi-source operation and maintenance text data and various types of labels in the predefined label set; the pre-trained label transition scores are then loaded. For the current time step, each tag in the predefined tag set is used as a candidate tag for the current time step; By combining the matching score of the candidate label and the transition score from the optimal label in the previous time step to the candidate label, the path score of each transition path is calculated. Based on the path score, the optimal label for the current time step is selected; When all time steps have been traversed, the optimal label sequence is output; wherein, the optimal label sequence is generated based on the optimal labels of all time steps; Based on the optimal label sequence, the entities and entity relationships of the multi-source operation and maintenance text data are identified to obtain the initial identification results.
5. The knowledge graph construction method as described in claim 4, characterized in that, The optimal label at the first time step is the label with the highest matching score in the predefined label set.
6. The knowledge graph construction method as described in claim 4, characterized in that, The path score for each transition path is calculated by combining the matching score of the candidate label and the transition score from the optimal label to the candidate label in the previous time step, including: When the optimal label of the previous time step indicates the end of an event, and the candidate label of the current time step indicates the beginning of another event, the event dependency relationship to be verified between the corresponding event of the previous time step and the corresponding event of the current time step is extracted based on the multi-source operation and maintenance text data. When the dependency of the event to be verified does not meet the requirements of the temporal and causal ontology, the temporal causal score is set to a preset negative value; when the dependency of the event to be verified meets the requirements of the temporal and causal ontology, the temporal causal score is set to a preset positive value. When the optimal label of the previous time step does not indicate the end of an event or the candidate label of the current time step does not indicate the beginning of another event, the temporal causality score is set to a preset intermediate value, which is greater than the preset negative value and less than the preset positive value. By combining the temporal causal score, the matching score of the candidate label, and the transition score from the optimal label in the previous time step to the candidate label, the path score of each transition path is calculated.
7. The knowledge graph construction method as described in claim 6, characterized in that, When the optimal label of the previous time step represents the end of an event, and the candidate label of the current time step represents the beginning of another event, the event dependency relationship to be verified between the corresponding event of the previous time step and the corresponding event of the current time step is extracted based on the multi-source operation and maintenance text data, including: When the optimal label of the previous time step indicates the end of an event, and the candidate label of the current time step indicates the beginning of another event, locate the text content corresponding to the optimal label of the previous time step and the candidate label of the current time step in the multi-source operation and maintenance text data, and extract the event dependency information. The event dependency relationships to be verified are generated based on the located text content and the event dependency information.
8. The knowledge graph construction method as described in claim 6, characterized in that, The path score for each transition path is calculated by combining the temporal causality score, the matching score of the candidate label, and the transition score from the optimal label to the candidate label in the previous time step, including: The path score for each transition path is obtained by adding the temporal causality score, the matching score of the candidate label, and the transition score from the optimal label to the candidate label in the previous time step; wherein, the absolute value of the preset negative value is greater than the preset maximum value, and the preset maximum value is the sum of the preset upper limit of the matching score and the preset upper limit of the transition score.
9. A knowledge graph construction system, characterized in that, include: The data acquisition module is used to acquire multi-source operation and maintenance text data; The feature extraction module is used to extract features from the multi-source operation and maintenance text data to obtain context vector features, static word vector features, and statistical text features. The feature fusion module is used to perform weighted fusion of the context vector features, the static word vector features, and the statistical text features to generate a text representation; wherein, the greater the similarity between the multi-source operation and maintenance text data and the pre-constructed temporal and causal ontology, the greater the weight coefficient corresponding to the context vector features; and the temporal and causal ontology is a structured knowledge framework about temporal patterns and causal mechanisms. The entity recognition module is used to identify entities and entity relationships based on the text representation to obtain an initial recognition result; The alignment and fusion module is used to perform entity alignment and information fusion processing on the initial recognition result to obtain the target result; The knowledge graph construction module is used to construct a knowledge graph based on the target result.
10. The knowledge graph construction system as described in claim 9, characterized in that, The feature fusion module is specifically used for: Obtain the time series and causal ontology; encode the multi-source operation and maintenance text data into a query vector; encode the time series and causal ontology into a pattern vector; Calculate the cosine similarity between the query vector and the pattern vector; The first target weight coefficient, the second target weight coefficient, and the third target weight coefficient are determined based on the cosine similarity; wherein, the first target weight coefficient is positively correlated with the cosine similarity and corresponds to the context vector feature; the second target weight coefficient and the third target weight coefficient are negatively correlated with the cosine similarity and correspond to the static word vector feature and the statistical text feature, respectively; Based on the first target weight coefficient, the second target weight coefficient, and the third target weight coefficient, the context vector features, the static word vector features, and the statistical text features are fused to generate a text representation.