Search

CN-121480653-B - Intelligent power grid question-answering method and system based on knowledge graph path reasoning

CN121480653BCN 121480653 BCN121480653 BCN 121480653BCN-121480653-B

Abstract

The invention provides a power grid intelligent question-answering method and system based on knowledge graph path reasoning, comprising the steps of analyzing user input, extracting problem entity, intention and attribute constraint, determining an anchoring entity through entity link, searching paths by using a reinforcement learning strategy network with the anchoring entity as a starting point, pruning low-probability actions to obtain a plurality of candidate paths, calculating time stamp variance of each path, obtaining time consistency score after normalization, obtaining comprehensive score by weighting and summing the time consistency score and path confidence coefficient, selecting the path with the highest comprehensive score as an optimal path, and generating natural language answer output according to the optimal path.

Inventors

  • ZHANG ZHIYUAN
  • PENG BAI
  • XING HAIYING
  • ZHANG HUI
  • ZHANG ZIXIN
  • WANG YIFEI
  • JIANG YUNZHOU
  • LI XINYI
  • NA QIONGLAN
  • ZHANG NING
  • YU RAN
  • SHAO BOWEN
  • SUN JIANING
  • CUI PENGTAO
  • Zhou Zikuo
  • CHEN ZHONGTAO
  • WANG SEN

Assignees

  • 国网冀北电力有限公司信息通信分公司

Dates

Publication Date
20260508
Application Date
20251110

Claims (9)

  1. 1. The intelligent power grid question-answering method based on knowledge graph path reasoning is characterized by comprising the following steps of: acquiring a natural language power grid problem input by a user, and analyzing the power grid problem to obtain a problem entity, a problem intention and entity attribute constraint; Based on the problem entity, entity attribute constraint and a preset entity type template, entity linking is carried out in a power grid knowledge graph, and when the weighted sum of the text similarity score and the attribute satisfaction of the candidate entity is higher than a linking threshold value, the candidate entity is determined to be an anchoring entity; The anchor entity is used as a starting point, a pre-trained reinforcement learning strategy network is utilized to search paths in the power grid knowledge graph, and in each step of expansion of the paths, actions, of which the probability given by the strategy network is lower than a preset pruning threshold value, are removed to obtain a plurality of candidate paths meeting the problem intention; For each candidate path, calculating the time stamp variance of all the triplet facts in the path, and obtaining a path time consistency score by carrying out normalized reciprocal operation on the time stamp variance; the path time consistency score and the confidence coefficient of the path output by the strategy network are weighted and summed to obtain the comprehensive score of the candidate path; And when the weighted sum of the text similarity score and the attribute satisfaction of the candidate entity is higher than the link threshold, determining the candidate entity as an anchor entity comprises the following steps: calculating text similarity scores of the candidate entities and the problem entities by adopting a Jaro-Winkler distance algorithm; Calculating the proportion of the number of attribute constraints satisfied by the candidate entity to the number of all entity attribute constraints, and taking the proportion as the attribute satisfaction; And carrying out weighted summation on the text similarity score and the attribute satisfaction according to weights of 0.6 and 0.4, and determining the candidate entity as an anchoring entity when the sum is greater than 0.85.
  2. 2. The method of claim 1, wherein resolving the grid problem to obtain problem entity, problem intent, and entity attribute constraints comprises: The two-way long-short-term memory network-conditional random field model is adopted to carry out sequence labeling on the power grid problem, and named entities serving as problem entities and entity attribute constraint are identified and extracted; and classifying the power grid problems by adopting a text convolutional neural network model, and determining the intention of the problems.
  3. 3. The method of claim 1, wherein the performing a path search in the grid knowledge graph using a pre-trained reinforcement learning strategy network comprises: Splicing the current entity vector and the historical path vector to be used as the input of a strategy network; The strategy network adopts a multi-layer perceptron comprising two full-connection layers, each full-connection layer is connected with a modified linear unit activation function, and an output layer of the network is a Softmax function and is used for calculating probability distribution expanding to a next-hop relation and an entity.
  4. 4. The method according to claim 1, wherein said act of removing, in each step of extension of the path, the probability given by the policy network being lower than a preset pruning threshold comprises: At each step of path searching, all possible actions output by a strategy network and probabilities corresponding to the possible actions are obtained; And removing the action with the expansion probability lower than the preset pruning threshold from the candidate action set of the current step.
  5. 5. The method of claim 1, wherein the deriving a path time consistency score by performing a normalized reciprocal operation on the timestamp variance comprises: extracting the time stamp corresponding to each triplet fact in the path to form a time stamp sequence; Calculating the variance of the sequence of time stamps ; By the formula Calculating to obtain a path time consistency score 。
  6. 6. The method of claim 1, wherein said weighting the path time consistency score with the confidence of the path output by the policy network to obtain a composite score for the candidate path comprises: Confidence of path Is the product of the probabilities of all actions on the path; the following formula is used to calculate the composite score : Wherein, the And k1 and k2 are weights for the path time consistency score.
  7. 7. The method of claim 1, wherein the generating and outputting natural language answers based on the entities and relationships in the optimal path comprises: extracting a starting point anchoring entity of the path and a tail entity of the last triplet from the optimal path as answer entities; And filling the anchoring entity and the answer entity into a preset answer template to obtain and output a complete natural language answer.
  8. 8. The intelligent power grid question-answering system based on knowledge graph path reasoning is characterized by comprising the following modules: The analysis module is used for acquiring the natural language power grid problem input by the user, and analyzing the power grid problem to obtain a problem entity, a problem intention and entity attribute constraint; The determining module is used for carrying out entity link in the power grid knowledge graph based on the problem entity, the entity attribute constraint and the preset entity type template, and determining the candidate entity as an anchoring entity when the weighted sum of the text similarity score and the attribute satisfaction of the candidate entity is higher than a link threshold; The system comprises a removing module, a judging module and a judging module, wherein the removing module is used for carrying out path searching in the power grid knowledge graph by taking the anchoring entity as a starting point and utilizing a pre-trained reinforcement learning strategy network, and removing actions, which are given by the strategy network, of which the probability is lower than a preset pruning threshold value in each step of path expansion to obtain a plurality of candidate paths meeting the problem intention; The generation module is used for calculating the time stamp variance of all the triplet facts in the paths for each candidate path, obtaining a path time consistency score by carrying out normalized reciprocal operation on the time stamp variance, carrying out weighted summation on the path time consistency score and the confidence coefficient of the paths output by the strategy network to obtain a comprehensive score of the candidate path, selecting the path with the highest comprehensive score as an optimal path, and generating and outputting a natural language answer according to the entity and the relation in the optimal path; And when the weighted sum of the text similarity score and the attribute satisfaction of the candidate entity is higher than the link threshold, determining the candidate entity as an anchor entity comprises the following steps: calculating text similarity scores of the candidate entities and the problem entities by adopting a Jaro-Winkler distance algorithm; Calculating the proportion of the number of attribute constraints satisfied by the candidate entity to the number of all entity attribute constraints, and taking the proportion as the attribute satisfaction; And carrying out weighted summation on the text similarity score and the attribute satisfaction according to weights of 0.6 and 0.4, and determining the candidate entity as an anchoring entity when the sum is greater than 0.85.
  9. 9. The system of claim 8, wherein said resolving the grid problem to obtain problem entity, problem intent, and entity attribute constraints comprises: The two-way long-short-term memory network-conditional random field model is adopted to carry out sequence labeling on the power grid problem, and named entities serving as problem entities and entity attribute constraint are identified and extracted; and classifying the power grid problems by adopting a text convolutional neural network model, and determining the intention of the problems.

Description

Intelligent power grid question-answering method and system based on knowledge graph path reasoning Technical Field The application belongs to the field of intelligent question and answer, and particularly relates to a power grid intelligent question and answer method and system based on knowledge graph path reasoning. Background With the continuous expansion of the power grid scale and the improvement of the informatization level, massive multi-source heterogeneous data are generated in the running, overhauling and managing processes of the power grid. Traditional keyword retrieval or fixed template based question and answer systems have difficulty understanding user query intent. The knowledge-graph-based question-answering method generally converts a question-answering process into a process of performing path reasoning on a graph, i.e., starting from an entity in a question, an answer is obtained by searching a relationship path connected to the answer entity. In the entity linking stage, the entity names of the power grid equipment often have short names, names or ambiguities, and the entity identification errors are easily caused by linking only depending on text similarity. In the path reasoning stage, the power grid knowledge graph has huge scale and complex relationship, a large search space is faced when the path searching is carried out, the traditional path searching algorithm has low efficiency, is easy to sink into local optimum, and is difficult to find a correct reasoning path which accords with the real intention of a user. Facts in the grid knowledge graph often have strong temporal properties, such as device status, alarm information, operational records, etc., all related to a specific point in time or period of time. Most of the existing path reasoning methods neglect the time consistency among different facts in the path, and the facts in different time backgrounds can be connected in series in an error mode to form a reasonable and actually non-logical reasoning path, so that wrong answers are generated, and the reliability of the question-answering system in processing time-related complex problems is affected. Disclosure of Invention The invention provides a power grid intelligent question-answering method based on knowledge graph path reasoning, which is used for solving the problem that the existing question-answering system is difficult to find a correct reasoning path which accords with the real intention of a user, and comprises the following steps: acquiring a natural language power grid problem input by a user, and analyzing the power grid problem to obtain a problem entity, a problem intention and entity attribute constraint; Based on the problem entity, entity attribute constraint and a preset entity type template, entity linking is carried out in a power grid knowledge graph, and when the weighted sum of the text similarity score and the attribute satisfaction of the candidate entity is higher than a linking threshold value, the candidate entity is determined to be an anchoring entity; The anchor entity is used as a starting point, a pre-trained reinforcement learning strategy network is utilized to search paths in the power grid knowledge graph, and in each step of expansion of the paths, actions, of which the probability given by the strategy network is lower than a preset pruning threshold value, are removed to obtain a plurality of candidate paths meeting the problem intention; And calculating the time stamp variance of all the triplet facts in the paths for each candidate path, obtaining a path time consistency score by carrying out normalized reciprocal operation on the time stamp variance, carrying out weighted summation on the path time consistency score and the confidence coefficient of the paths output by the strategy network to obtain the comprehensive score of the candidate path, selecting the path with the highest comprehensive score as an optimal path, and generating and outputting natural language answers according to the entity and the relation in the optimal path. Optionally, the analyzing the power grid problem to obtain a problem entity, a problem intention, and an entity attribute constraint includes: The two-way long-short-term memory network-conditional random field model is adopted to carry out sequence labeling on the power grid problem, and named entities serving as problem entities and entity attribute constraint are identified and extracted; and classifying the power grid problems by adopting a text convolutional neural network model, and determining the intention of the problems. Optionally, when the weighted sum of the text similarity score and the attribute satisfaction of the candidate entity is higher than the link threshold, determining the candidate entity as the anchor entity includes: calculating text similarity scores of the candidate entities and the problem entities by adopting a Jaro-Winkler distance algorithm; Calculating the propor