A method for constructing grid governance knowledge graph based on multi-agent

Through a multi-agent-based method, large-scale pre-trained language model and reflection mechanism are used to solve the problems of insufficient automation of grid governance knowledge graph construction and perspective collapse, and high-quality, end-to-end knowledge graph construction is achieved.

CN119150978BActive Publication Date: 2025-03-14ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411626400.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-03-14
Estimated Expiration
2044-11-14

AI Technical Summary

Technical Problem

The existing grid governance knowledge graph construction methods are insufficiently automated, have domain limitations, and large-scale pre-trained language models have perspective collapse problems, affecting the quality of generation.

Method used

Using an end-to-end approach based on multi-agents, using the learned knowledge of large-scale pre-trained language models and the multi-perspective characteristics of multi-agents, a knowledge graph in the field of grid governance is constructed through natural language dialogue, and a reflection mechanism and cross-verification of the two-line alignment results are used to improve the quality of the graph.

Benefits of technology

It has achieved high-quality, end-to-end grid governance knowledge graph construction, lowered the construction threshold, improved the field generalization and map quality, and avoided the problem of perspective collapse.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119150978B_ABST
    Figure CN119150978B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for constructing a knowledge graph for grid governance based on multiple agents, and belongs to the field of knowledge graph construction. The present invention comprises the following steps: pre-designing agent role information, writing agent prompts for each agent, and constructing corresponding agents, performing role alignment according to the agent role information, and optimizing agent prompts when there is a deviation between the actual ability of the agent and the agent role configuration, until an agent that meets the requirements is generated; constructing a knowledge graph in the form of natural language dialogue; when new knowledge needs to be added to the constructed knowledge graph, the corresponding agent updates the knowledge graph on demand to complete the construction of the knowledge graph. The method of the present invention makes full use of the acquired knowledge, natural language processing capabilities, and task generalization capabilities of large-scale pre-trained language models, and enhances the quality of task execution results based on the multi-perspective characteristics of multiple agents and the reflection mechanism of large-scale pre-trained language models.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of knowledge graph construction, and in particular relates to a method for constructing a grid governance knowledge graph based on multi-agents. Background Art

[0002] Grid governance, as an innovative social governance model, has significant practical significance for improving social service management, enhancing administrative efficiency, and modernizing social service management capabilities. The application of artificial intelligence (AI) technology in grid governance, enabling intelligent management and services, has become a key option for advancing grid governance modernization. With the widespread application of AI technology, knowledge graphs, as a key means of knowledge representation, have laid a solid foundation for the storage and intelligent application of domain knowledge. Therefore, building high-quality domain knowledge graphs is crucial for advancing grid governance modernization.

[0003] Existing knowledge graph construction methods mainly include manual construction by domain experts and automatic construction by algorithms.

[0004] Manual construction of knowledge graphs by domain experts relies primarily on their own knowledge. This involves defining entity types, determining the types of relationships between entities, planning the knowledge graph's hierarchy, and defining attributes, thereby generating an ontology model for the knowledge graph. Experts then identify entities and relationships from raw knowledge in the form of documents and manually input these identification results into the ontology model, ultimately resulting in a constructed domain knowledge graph. Manual graph construction based on expert experience is currently the predominant approach in practical engineering applications. Its core approach is to structure entities and relationships in the form of triples. This discrete symbolic representation can effectively structure data, but these symbols cannot express semantically relevant information in computers or perform semantic computations, making them inefficient for downstream applications. Furthermore, due to the inefficiency of manual construction and its over-reliance on expert knowledge, its application in grid governance is inefficient and ineffective.

[0005] Some work focuses on automating the construction of knowledge graphs. For entity recognition, a common approach currently uses a combined architecture of BERT, BiLSTM, and CRF. BERT generates initialized word vectors, BiLSTM receives these word vectors for sequence modeling, and CRF models the label sequence to achieve a globally optimal solution. Relation extraction is another important task, with two main strategies: step-by-step extraction and joint extraction with entities. Step-by-step extraction is generally implemented using derivatives of deep neural networks such as CNNs, RNNs, and GCNs.

[0006] There are also some optimization works in the field of automated construction of knowledge graphs. HAKE proposed using low-dimensional distributed embeddings in real-valued point-by-point space as representations of relations, and mapping entities to polar coordinates to capture semantic hierarchies. After capturing the embedding representations of entities and relations, ENEL proposed an end-to-end entity linking method, considering all possible text fragments as potential entities, and establishing entity links by learning the contextual similarity scores between all candidate entities. Furthermore, in order to maintain the consistency of information about the same entity underground at different times / different grids, GCNAlign proposed introducing graph convolutional neural networks to model global information, designing two graph neural networks to encode knowledge graph entities from different sources into a unified vector space, and optimizing the distance between them through contrast loss or triple loss.

[0007] In recent years, large-scale pre-trained models have demonstrated amazing generalization capabilities, enabling the discovery and transfer of common knowledge across different domains and tasks. Some work has used large-scale pre-trained models to build more accurate and comprehensive knowledge graphs. COMET proposed distilling difficult-to-obtain common sense knowledge from large models to small student models, and then conducting fine-grained learning of domain-specific knowledge on lightweight student models, and finally using the student model to complete the knowledge graph construction. In order to guide the model to autonomously correct the existing knowledge graph, PiVe trains an external validator by constructing a perturbed knowledge graph dataset, and adds the validator's feedback on the prediction results of the large-scale pre-trained model to the prompt text, iteratively guiding the large model to optimize the quality of the previously predicted knowledge graph subgraph.

[0008] Building high-quality domain knowledge graphs is crucial for modernizing grid governance. However, compared to more vertical and standardized sectors like healthcare and electricity, grid governance covers a wide range of areas, has complex business logic, involves a large amount of governance logic and rules, and has limited formalized knowledge. This presents challenges in building grid governance knowledge graphs. Overcoming these challenges and more efficiently building high-quality domain knowledge graphs for grid governance is a pressing technical challenge. Summary of the Invention

[0009] The technical problems to be solved by the present invention are: first, the existing grid governance knowledge graph construction method has insufficient degree of automation and mainly adopts manual construction methods by domain experts; second, the existing automatic construction method has domain limitations, and small models need to be retrained and related implementation details need to be adjusted for different sub-domains of grid governance; third, the large-scale pre-trained language model (LLM) has the problem of perspective collapse. After several rounds of dialogue, it will be limited to a specific perspective, which in turn affects the generation quality. The existing LLM-based method is also affected by this problem.

[0010] Based on the above shortcomings, the present invention makes full use of the acquired knowledge, natural language processing capabilities and task generalization capabilities of LLM in the field of grid governance, and at the same time utilizes the multi-perspective characteristics of multi-agent (Multi-Agent) based on the same LLM and the reflection mechanism (Reflection) of LLM to enhance the quality of task execution results, forming an end-to-end, generalizable and high-quality grid governance knowledge graph construction method, namely: a grid governance knowledge graph construction method based on multi-agent.

[0011] In order to achieve the above-mentioned object of the invention, the present invention specifically adopts the following technical solutions:

[0012] A method for constructing a grid governance knowledge graph based on multi-agents includes the following steps:

[0013] S1: Based on the task requirements of the grid governance field and the version of the large-scale pre-trained language model called, the required agent role information is pre-designed to form an agent role configuration. After writing agent prompts for each agent according to the agent role configuration, the corresponding agent is constructed based on the agent prompts of each agent, and the role alignment based on the ability is performed against the agent role information. When there is a deviation between the actual ability of the agent and the agent role configuration, the agent prompts are optimized and adjusted, and the role alignment is performed again until each agent meets the predetermined ability requirements;

[0014] S2: Based on the intelligent agent built in S1 and meeting the capability requirements, it builds a knowledge graph in the field of grid governance through natural language dialogue;

[0015] S3: When new knowledge needs to be added to the constructed knowledge graph, the intelligent agent constructed in S1 updates the fused knowledge triple list corresponding to the new knowledge into the knowledge graph according to S2 to generate a new knowledge graph in the field of grid governance.

[0016] Based on the above solution, each step can be implemented in the following preferred specific manner.

[0017] Preferably, in step S1, the agent roles are specifically project manager agent, data engineer agent and knowledge engineer agent; the agent role information is specifically the role name, role capabilities or responsibilities, usage scenarios, available tools, action restrictions and output style of each role.

[0018] Preferably, the specific process of step S2 is as follows:

[0019] S21: Based on the dialogue environment, the project manager agent obtains the user input of the requirement text for building a domain-specific knowledge graph. The project manager agent reorganizes the language based on the user input requirement text, generates a specific task description that is easy for the data engineer agent and the knowledge engineer agent to understand, and waits for the user to confirm the task. After the user confirms the specific task description, the project manager agent starts the task and sends the instruction to start data preparation to the data engineer agent.

[0020] S22: After receiving the instructions from the project manager agent, the data engineer agent first begins data collection. Then, the data engineer agent uses its own large-scale pre-trained language model semantic understanding capabilities to identify duplication and irrelevance in the entire amount of collected data, and obtains preliminary recognition results.

[0021] S23: After obtaining the preliminary recognition results, the data engineer agent uses the reflection mechanism of the large-scale pre-trained language model to evaluate and judge the preliminary recognition results. If there are any problems with the preliminary recognition results, they are corrected based on the reflection results, and duplicate and irrelevant files are further removed until there are no more problems. If there are no problems with the preliminary recognition results, the data engineer agent cleans the preliminary recognition results, outputs the pre-processed data, and sends an instruction to the project manager agent that the data preparation work has been completed.

[0022] S24: After the project manager agent receives the instruction from the data engineer agent, the knowledge engineer agent begins the knowledge processing work. First, the knowledge engineer agent and the human expert design the ontology model in the form of dialogue, define the entity types, relationships and attributes, and obtain the preliminary ontology model;

[0023] S25: The knowledge engineer agent uses the reflection mechanism to re-evaluate the preliminary ontology model. If the preliminary ontology model is unqualified, the knowledge engineer agent regenerates and adjusts the unqualified preliminary ontology model until all preliminary ontology models are qualified after reflection, thus obtaining the final ontology model.

[0024] S26: The knowledge engineer agent extracts and outputs an initial triple list from the preprocessed data one by one according to the final ontology model. The knowledge engineer agent re-evaluates each knowledge triple in the initial triple list using a reflection mechanism. If the initial triple list fails, the knowledge engineer agent regenerates and adjusts the failed knowledge triples in the initial triple list until all the initial triple lists pass after reflection, thereby obtaining a final triple list.

[0025] S27: The knowledge engineer agent performs two-line entity alignment and cross-validation on all entities in the final triple list using a method of cross-validation and reflection on the two-line alignment results. If the verification is inconsistent, the knowledge engineer agent re-reflects on the inconsistently verified entities in the final triple list and determines the alignment results of the inconsistently verified entities to obtain an aligned entity set; wherein the aligned entity set consists of verified entities representing the same semantics;

[0026] S28: The knowledge engineer agent selects an entity name that best reflects the semantics from each set of aligned entities representing the same semantics as the surface name of the entity mention, outputs a list of fused knowledge triples, and sends an instruction to the project manager agent that the knowledge processing work has been completed;

[0027] S29: When the project manager agent receives the instruction from the knowledge engineer agent, the knowledge engineer agent starts the knowledge graph construction work. Based on the fused knowledge triple list, the knowledge engineer agent calls the knowledge graph construction tool to complete the construction and visualization of the knowledge graph, and sends the instruction of the knowledge graph construction completion to the project manager agent. The project manager agent feedbacks to the user that the knowledge graph has been constructed, and finally obtains the constructed knowledge graph.

[0028] Preferably, in S23, the data cleaning process is specifically as follows: the data engineer intelligent agent calls the watermark removal tool to remove the watermarks from the files with watermarks in the preliminary recognition results, and the data engineer intelligent agent calls the format conversion tool to convert the PDF format files in the preliminary recognition results into Word format files.

[0029] Preferably, in S24, the specific process of designing the ontology model in the form of dialogue is as follows:

[0030] S241. The knowledge engineer agent generates a triple type list, a corresponding entity type list, a relationship list, and an attribute list based on the learned knowledge according to the specific description of the task issued by the project manager agent;

[0031] S242. After the user manually checks the generated triple type list, entity type list, relationship list, and attribute list, the user interacts with the knowledge engineer agent in a dialog format.

[0032] S243. After the knowledge engineer agent obtains the current problems and adjustment methods input by the user, the knowledge engineer agent adjusts the triple type list, entity type list, relationship list and attribute list according to the user's requirements, and feeds back the newly generated triple type list, entity type list, relationship list and attribute list to the user, who will manually check them again until the user completely confirms that there are no problems with the generated triple type list, entity type list, relationship list and attribute list, and then obtains the preliminary ontology model.

[0033] Preferably, in S27, the specific process of performing two-line entity alignment on all entities in the final triple list by the method of cross-validation and reflection of the two-line alignment results is as follows:

[0034] S271. Input all entities extracted from the final triple list into the knowledge engineer agent to obtain the intelligent alignment result;

[0035] S272. Input all entities extracted from the final triple list into the pre-trained model for triple entity embedding, output the Transformer-enhanced triple entity embedding representation, perform clustering alignment on the triple entity embedding representations of all entities, obtain clustering results of the triple entity embedding representations, and then reversely obtain the entity text based on the index to obtain the clustering alignment result; wherein the pre-trained model is implemented by replacing the self-attention mechanism in the Transformer model with a relationship-aware self-attention mechanism;

[0036] S273. The knowledge engineer agent cross-validates the intelligent alignment results and the cluster alignment results, retains the same parts of the intelligent alignment results and the cluster alignment results, and inputs the different parts of the intelligent alignment results and the cluster alignment results into the knowledge engineer agent for reflection and correction until a consistent alignment result is finally obtained.

[0037] Preferably, in S272, the specific process of performing triple entity embedding by the pre-trained model is as follows:

[0038] First, the final triple list is preprocessed, and then each triple in the preprocessed final triple list is segmented to obtain the word element of each triple. A vocabulary is constructed from all the obtained word elements, and each word element is assigned a unique index in the vocabulary; then the semantic information, position information and entity type information of each word element are converted into corresponding word embedding vectors, position embedding vectors and entity type embedding vectors to form an entity-specific layer; after the word embedding vector, position embedding vector and entity type embedding vector of each word element are converted into a vector space of the same dimension, the word embedding matrix of the triple is formed by the word embedding vectors of all word elements, the position embedding matrix of the triple is formed by the position embedding vectors of all word elements, and the entity type embedding matrix of the triple is formed by the entity type embedding vectors of all word elements. The word embedding matrix, position embedding matrix and entity type embedding matrix are added together to obtain the initial embedding representation of the triple; the initial embedding representation of the triple is input into the pre-trained model, and the Transformer-enhanced triple entity embedding representation is output.

[0039] Preferably, when converting the semantic information, position information and entity type information of each word unit into a word embedding vector, a position embedding vector and an entity type embedding vector, the GloVe model is used to generate a word embedding vector for each word unit, and each word unit is positionally encoded to obtain a position embedding vector. Finally, the entity type name defined in the ontology model is input into the GloVe model to obtain the entity type embedding vector of the corresponding word unit.

[0040] Preferably, the functional form of the relationship-aware self-attention mechanism is:

[0041]

[0042] in, The computational results of the self-attention mechanism representing the relationship perception; 、 、 It is the matrix obtained by transforming the entity embedding matrix through the three learned parameter matrices respectively; represents the scaling factor; is the relation embedding matrix; It is a coefficient used to adjust the strength of the relationship; Represents matrix transpose; Represents the softmax activation function.

[0043] Preferably, in the knowledge graph in the field of grid governance, entity types include personnel, grids, events, enterprises, addresses, and rules and regulations.

[0044] Compared with the prior art, the present invention has the following beneficial effects:

[0045] 1. This invention innovatively completes the construction of a grid governance knowledge graph in a multi-agent form. Compared with the currently more common manual construction methods and small models and manual collaborative semi-automatic construction methods, this invention achieves end-to-end grid governance knowledge graph construction, lowering the construction threshold;

[0046] 2. This invention fully utilizes the knowledge acquired by large-scale pre-trained language models and the flexibility of multiple agents to significantly improve the domain generalization of grid governance knowledge graph construction, avoiding the drawbacks of current methods;

[0047] 3. The present invention makes full use of the reflection mechanism to weaken the perspective collapse problem existing in a single large-scale pre-trained language model itself, and adopts the method of cross-validation and reflection of double-line alignment results. Compared with the current method of directly constructing a graph using a large-scale pre-trained language model, it can improve the quality of the grid governance knowledge graph. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 1 is a flow chart of the overall steps of the method of the present invention;

[0049] Figure 2 A flow chart of the steps involved in constructing an agent for the present invention;

[0050] Figure 3 A flowchart of the steps for constructing a knowledge graph for the present invention;

[0051] Figure 4 A schematic diagram of entity alignment using the method of cross-validation and reflection of double-line alignment results of the present invention;

[0052] Figure 5 Schematic diagram of the specific process of triple entity embedding using a pre-trained model in the present invention;

[0053] Figure 6 A partial schematic diagram of a grid governance map constructed according to an embodiment of the present invention. DETAILED DESCRIPTION

[0054] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways than those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. The technical features in the embodiments of the present invention can be combined accordingly without conflicting with each other.

[0055] like Figure 1As shown in FIG, in a preferred implementation of the present invention, multiple intelligent agents are designed and constructed, and these intelligent agents are used to construct a knowledge graph in the field of grid governance end to end. A method for constructing a grid governance knowledge graph based on multiple intelligent agents is proposed. The basic process is as follows: Figure 1 As shown, it includes the following steps S1 to S3, and the specific implementation processes are described below.

[0056] S1: Based on the task requirements of the grid governance field and the version of the large-scale pre-trained language model called, the required agent role information is pre-designed to form an agent role configuration (Agent Profile). After writing an agent prompt (Prompt) for each agent according to the agent role configuration, the corresponding agent (Agent) is constructed based on the agent prompt of each agent, and the role alignment (Role Alignment) based on the ability is performed against the agent role information. When there is a deviation between the actual ability of the agent and the agent role configuration, the agent prompt is optimized and adjusted, and the role alignment is performed again until each agent meets the predetermined ability requirements.

[0057] It should be noted that in the present invention, the large-scale pre-trained language model version LLM can be selected from the version publicly available on the Internet or the open source version that can be deployed locally. The specific large-scale pre-trained language model version used can be replaced as needed. In this embodiment, to maximize the natural language processing capabilities, gpt-4-turbo is selected as the large-scale pre-trained language model version to drive the intelligent agent.

[0058] It should be noted that, in the present invention, Figure 2 As shown, when building an agent, the agent role is first designed, followed by the agent prompts, and finally the constructed agent is created. In this embodiment, the agent roles are specifically three: the Project Manager Agent (PMA), the Data Engineer Agent (DEA), and the Knowledge Engineer Agent (KEA). Agent role information specifically includes each role's name, capabilities or responsibilities, usage scenarios, available tools, action restrictions, and output format.

[0059] In this embodiment, specifically focusing on the above three roles, the corresponding agent role configuration information is as follows:

[0060] Table 1. Project manager agent role configuration information

[0061] Character Name: Project Manager Character Abilities: Confirm requirements, define and confirm overall tasks; initiate tasks and promote their execution, including data preparation, knowledge processing, and graph construction. Usage scenarios: In the task confirmation scenario, we communicate with users to confirm the specific requirements and task objectives of the grid governance knowledge graph construction; in the task promotion scenario, we communicate with other intelligent agents to promote task execution. Available tools: none Movement restrictions: The content of your conversation with the user mainly revolves around the confirmation of requirements and tasks for the construction of the grid governance knowledge graph, and other content is answered perfunctorily; your conversation with other intelligent agents is limited to the promotion of task execution. Output style: The dialogue format is concise and clear

[0062] Table 2. Data Engineer Agent Role Configuration Information

[0063] Character Name: Data Engineer Character Abilities: Communicate with users and guide them to upload files, provide links, and obtain original data; perform data pre-processing operations such as deduplication, irrelevant data removal, format conversion, and watermark removal; reflect on execution results as required Usage scenarios: In the data collection scenario, the user communicates with the user to collect grid governance related data; in the data preprocessing scenario, the user completes data preprocessing based on the collected grid governance related data. Available tools: File upload module; web content acquisition module; file format conversion tool; watermark removal tool Movement restrictions: You can only communicate with users and project manager agents; the content of your conversations with users mainly revolves around data collection related to grid governance, and other content is answered perfunctorily. Output style: The dialogue format is concise and clear

[0064] Table 3. Knowledge Engineer Agent Role Configuration Information

[0065] Character Name: Knowledge Engineer Character Abilities: Design ontology models based on task requirements; extract and output knowledge triples in a preset format; perform entity alignment and entity disambiguation on knowledge triples; call graph construction tools to complete the final construction; reflect on execution results as required Usage scenarios: Ontology design scenario: dialogue with users to design the grid governance knowledge graph ontology model; knowledge extraction scenario: extract grid governance related knowledge from pre-processed data based on the ontology model; knowledge fusion scenario: fuse the extracted grid governance related knowledge; graph construction scenario: call tools to complete the grid governance knowledge graph construction Available tools: Knowledge graph construction tools Movement restrictions: You can communicate with users in the grid governance knowledge graph ontology design scenario; you can communicate with the project manager agent to provide feedback after the task is completed; you cannot communicate with other agents; the content of your conversation with users mainly revolves around the grid governance knowledge graph ontology design, and other content is perfunctory. Output style: The dialogue format is concise and clear; the output triples are in the form of (head entity, relationship, tail entity); within the framework of the ontology model and within the scope of preprocessed data, as many knowledge triples as possible are extracted.

[0066] It should be noted that, in this disclosure, agent prompts refer to the input text provided to a large-scale pre-trained language model, used to guide the large-scale pre-trained language model to generate specific outputs or perform specific tasks. The agent prompts contain at least the corresponding content from the agent's role configuration information, and may also include additional information to better extract the target perspective and capabilities from the large-scale pre-trained language model.

[0067] Generally speaking, agent prompts can be divided into two categories based on their scope of influence: system prompts and user prompts. System prompts primarily predefine roles and behavior settings that have a lasting impact on the entire conversation. For example, they can predefine the role and capabilities of a large-scale pre-trained language model during a conversation. User prompts primarily affect a specific round of dialogue. For example, during a conversation, by inputting the prompt "What is the prompt?" into a large-scale pre-trained language model, the definition and explanation of the prompt can be obtained.

[0068] In this embodiment, the agent prompts used are system prompts. The specific system prompts around these three roles are initialized as follows: You are a {role name} who participates in completing the grid governance knowledge graph construction task, and you have these capabilities: {role capabilities}. When the following scenarios occur, you need to stand up and reasonably select and use the capabilities just mentioned according to specific needs until all the tasks you are responsible for are completed: {usage scenarios}. When using capabilities, you can reasonably select and use the following tools as needed: {available tools}. You must act with caution, and the following restrictions must be followed: {action restrictions}. When generating output, you must also comply with these requirements: {output style}. {role name}, now the grid governance knowledge graph construction task has begun, please keep paying attention to this task before it is fully executed, and you must ensure that you do not miss the execution of the task you are responsible for.

[0069] It should be noted that in the present invention, each agent is constructed on an agent construction platform. This can be based on an open agent construction platform service available on the internet, or the agent construction code can be written independently. In this embodiment, the agent is constructed based on the four-element architecture of memory, tools, action, and planning. This framework is also the main architecture for constructing agents. The specific construction method has been published and will not be repeated in this embodiment.

[0070] It should be noted that in this invention, initializing the agent prompt requires capability verification on the constructed agent based on the agent's role configuration information to ensure that the agent's role capabilities are consistent with expectations. If the verification finds a deviation between the agent's actual capabilities and the agent's role configuration information, the prompt needs to be adjusted accordingly and re-verified until the role capabilities are aligned.

[0071] S2: An intelligent agent that meets the capability requirements built based on S1, which constructs a knowledge graph in the field of grid governance through natural language dialogue.

[0072] It should be noted that, in the present invention, Figure 3 As shown, the specific process of step S2 is as follows:

[0073] 1) Task definition

[0074] S21: Based on the dialogue environment, the project manager agent obtains the user input requirement text for building a knowledge graph in a specific field. The project manager agent reorganizes the language according to the user input requirement text, generates a specific task description that is easy for the data engineer agent and the knowledge engineer agent to understand, and waits for user confirmation. After the user confirms the specific task description, the project manager agent starts the task and sends instructions to the data engineer agent to start data preparation.

[0075] In this embodiment, the requirement text input by the user is in the form of "Draw a grid governance map to solve the ** problem"; the specific description of the task finally confirmed is in the form of "Build a knowledge map in the field of grid governance, which is used to solve the discovery of the ** problem and provide processing suggestions and based on rules and regulations"; the instruction of the project manager intelligent agent is in the form of "Start the task: {task specific description}. Data engineer, start data preparation now, and provide me with feedback when you are ready."

[0076] 2) Data Preparation

[0077] S22: After receiving the instructions from the project manager agent, the data engineer agent first starts data collection. Then, the data engineer agent uses its own large-scale pre-trained language model semantic understanding ability to identify the duplication and irrelevance of the entire collected data and obtains preliminary recognition results.

[0078] It should be noted that in S22 of the present invention, since the original data required for the construction of the domain knowledge base mainly comes from three aspects: user private domain knowledge, Internet publicly released knowledge, and large model learned knowledge, and the large model learned knowledge is already in the intelligent agent, the data engineer intelligent agent mainly collects the first two types of knowledge during data collection. Specifically, the data engineer intelligent agent calls the file upload module tool and the web crawler module tool to provide users with an entrance for file upload and link input. After the user uploads the file or provides the link address, the data engineer intelligent agent crawls the full amount of data and completes the data collection. Among them, the files uploaded by users are mainly rules and regulations and policy documents in the field of grid governance in PDF and Word formats. At the same time, users also provide some file link addresses that are publicly available on the Internet.

[0079] It should be noted that in S22 of the present invention, the data engineer agent first identifies the duplication and irrelevance of the entire data to obtain a preliminary identification result; wherein the preliminary identification result is composed of deduplicated and irrelevant files.

[0080] S23: After obtaining the preliminary recognition results, the data engineer agent uses the reflection mechanism (Reflection) of the large-scale pre-trained language model to evaluate and judge the preliminary recognition results. If there are problems with the preliminary recognition results, they are corrected according to the reflection results, and repetitive and irrelevant files are further removed until there are no problems. If there are no problems with the preliminary recognition results, the data engineer agent cleans the preliminary recognition results, outputs the pre-processed data, and sends instructions to the project manager agent that the data preparation work has been completed.

[0081] It should be noted that in S23 of the present invention, the reflection mechanism is a mechanism that allows a large-scale pre-trained language model to improve task execution performance through self-inspection and iterative improvement. This mechanism enables the large-scale pre-trained language model to not only generate initial results, but also continuously optimize its output through multiple reflections and modifications.

[0082] To facilitate understanding by those skilled in the art, the principle of the reflection mechanism will be described in detail below.

[0083] For question Q posed to a large-scale pre-trained language model, the first task T1 performed by the large-scale pre-trained language model is to generate a preliminary answer A using the learned knowledge K. This process can be formalized as A=T1(Q;K). A second task T2 can then be defined to evaluate whether the question Q and the answer A are reasonably matched under the learned knowledge K. The evaluation result is recorded as E. This process can be formalized as E=T2(Q,A;K). If E is a negative result, the large-scale pre-trained language model is called to re-execute T1 and T2 on the deviated part until E becomes a positive result. Through this task form conversion, the same task can be performed from two perspectives, so the effect of checking iteration can be achieved.

[0084] It should be noted that in S23 of the present invention, the data cleaning process is specifically performed by the data engineer agent calling module tools such as format conversion and watermark removal. In this embodiment, if a small number of uploaded PDF files contain watermarks, the data engineer agent calls the watermark removal tool to remove the watermarks from the PDFs and calls the file format conversion tool to convert the PDF files into Word files. If there are some files in the form of links, the data engineer agent directly uses its own capabilities to parse and crawl the corresponding file content. Due to the powerful natural language processing capabilities of the large-scale pre-trained language model, the captured file content is of higher quality than that of the crawler.

[0085] It should be noted that in S23 of the present invention, after the data engineer agent completes data cleaning, it provides feedback to the project manager agent (that is, the data engineer agent sends an instruction that the data preparation work has been completed to the project manager agent), in the form of "Project manager, data preparation work is completed."

[0086] 3) Knowledge Processing

[0087] S24: After the project manager agent receives instructions from the data engineer agent, the knowledge engineer agent begins knowledge processing. First, the knowledge engineer agent and the human expert design the ontology model in a dialogue, defining entity types, relationships, and attributes, and obtain the preliminary ontology model S0(E,R,T,A). Where E={e1,e2,…,em} represents the entity type set, R={r1,r2,…,rn} represents the relationship set, T={(e1,r1,e2),(e1,r1,e3),…} represents the triple type set, and A={a1,a2,…,al} represents the attribute set.

[0088] It should be noted that in this embodiment, in S24, after the project manager agent receives feedback from the data engineer agent that data preparation has been completed, the project manager agent sends a command to the knowledge engineer agent, instructing the knowledge engineer agent to begin knowledge processing. The notification sent by the project manager agent specifically reads, "Data preparation is complete. Knowledge engineer, start knowledge processing now and provide me with feedback after processing is complete."

[0089] It should be noted that, in S24 of the present invention, the process of designing the ontology model in a dialogue form is:

[0090] S241. The knowledge engineer agent generates a triple type list, a corresponding entity type list, a relationship list, and an attribute list based on the learned knowledge according to the specific description of the task issued by the project manager agent;

[0091] S242. After the user manually checks the generated triple type list, entity type list, relationship list, and attribute list, the user interacts with the knowledge engineer agent in a dialog format.

[0092] S243. After the knowledge engineer agent obtains the current problems and adjustment methods input by the user, the knowledge engineer agent adjusts the triple type list, entity type list, relationship list and attribute list according to the user's requirements, and feeds back the newly generated triple type list, entity type list, relationship list and attribute list to the user, who will manually check them again until the user completely confirms that there are no problems with the generated triple type list, entity type list, relationship list and attribute list, and then obtains the preliminary ontology model.

[0093] S25: The knowledge engineer agent uses the reflection mechanism to re-evaluate the preliminary ontology model. If the preliminary ontology model is unqualified, the knowledge engineer agent will regenerate and adjust the unqualified preliminary ontology model until all preliminary ontology models are qualified after reflection, and the final ontology model S(E, R, T, A) is obtained.

[0094] It should be noted that in S25 of the present invention, since the quality of the ontology model directly affects the quality of the final knowledge graph, the initially generated ontology model needs to be evaluated. If it is unqualified, the knowledge engineer intelligent agent needs to use the reflection mechanism to strengthen the evaluation until all the initial ontology models are evaluated as qualified and the final ontology model is obtained.

[0095] S26: The knowledge engineer agent extracts and outputs the initial triple list T0(Eh, R, Et) from the preprocessed data one by one according to the final ontology model, where Eh represents the head entity set derived from the entity type set, and Et represents the tail entity set derived from the entity type set. The knowledge engineer agent then uses the reflection mechanism to re-evaluate each knowledge triple in the initial triple list. If the initial triple list fails, the knowledge engineer agent regenerates and adjusts the unqualified knowledge triples in the initial triple list until all the initial triple lists pass after reflection, resulting in the final triple list T(Eh, R, Et).

[0096] It should be noted that in S26 of the present invention, since triple extraction also has a great impact on the quality of the final knowledge graph, the preliminary generated triple list needs to be evaluated. If it is unqualified, the knowledge engineer intelligent agent needs to use the reflection mechanism to strengthen the evaluation until all the preliminary triple lists are evaluated to be qualified and the final triple list is obtained.

[0097] S27: The knowledge engineer agent uses the method of cross-validation and reflection of the two-line alignment results to perform two-line entity alignment and cross-validation on all entities in the final triple list. If the verification is inconsistent, the knowledge engineer agent re-reflects on the inconsistently verified entities in the final triple list and determines the alignment results of the inconsistently verified entities to obtain an aligned entity set; wherein the aligned entity set is composed of verified entities representing the same semantics.

[0098] It should be noted that, in step S27, to ensure the quality of entity alignment, the entity alignment in the present invention is enhanced by an innovative method of cross-validation and reflection of the double-line alignment results. Figure 4 As shown, the first line extracts all entities from the final triple list and inputs these entities into the knowledge engineer agent, directly obtaining the intelligent alignment results. The second line directly inputs all entities extracted from the final triple list into the pre-trained model for triple entity embedding, outputting the Transformer-enhanced triple entity embedding representation. Clustering alignment is performed on the triple entity embedding representations of all entities to obtain the clustering results of the triple entity embedding representations. The entity text is then retrieved reversely based on the index to obtain the cluster alignment results. After obtaining the alignment results of the two lines, the knowledge engineer agent first cross-validates the intelligent alignment results and the cluster alignment results, retaining the common parts of the two and inputting the differences into the knowledge engineer agent for reflection and correction until a consistent alignment result is finally obtained.

[0099] Furthermore, in the second line, triple entity embedding by pre-trained model mainly includes triple preprocessing, embedding initialization, embedding enhancement and output steps, such as Figure 5 The specific instructions are as follows:

[0100] a) First, the final triple list T(Eh, R, Et) is preprocessed.

[0101] In this embodiment, a single triple in the final triple list is recorded as t(eh,r,et), where eh, r, and et are elements in Eh, R, and Et respectively. Before embedding the triple entity, splicing is performed first. The splicing operation removes redundant information in the original text to prevent the introduction of semantic noise. At the same time, in order to better distinguish the boundaries between the head entity, relationship, and tail entity, special markers, <rel> 、 <tail>Separate the concatenated sentences. Thus, the concatenated sentences can be written as "eh <rel> r <tail>et". Among them, <rel> 、 <tail>They represent the head entity tag, relation tag, and tail entity tag respectively.

[0102] b) Segment each triple in the final triple list T(Eh, R, Et) after preprocessing to obtain the token of each triple. Build a vocabulary from all the tokens obtained and assign a unique index to each token in the vocabulary.

[0103] In this embodiment, although the entity name is not very long, there may still be some situations where it is not suitable for direct embedding. Therefore, this embodiment performs tokenization to obtain a token for each triple.

[0104] c) The semantic information, position information, and entity type information of each word are then converted into corresponding word embedding vectors, position embedding vectors, and entity type embedding vectors to form the entity-specific layer.

[0105] In the present invention, the representation of entity vectors can be achieved by selecting different embedding models. In this embodiment, the GloVe model is used for word embedding and entity type embedding.

[0106] For word embedding, initialize the word embedding matrix and extract the embedding vector of the i-th word from the matrix The word embedding process of this embodiment adopts the GloVe model. The implementation method of the GloVe model belongs to the existing technology and will not be repeated here.

[0107] Regarding position embedding, considering the directionality of the triples themselves, this embodiment calculates the position encoding for each word to preserve the position information: and , indexed as The word position is mapped to a dimensional position vector , the first The value of the element is .

[0108] For entity type embedding, this embodiment takes into account that each entity in the triple belongs to a specific entity type in the ontology model. In order to further enrich the semantic information of the entity, the entity type name defined in the ontology model is combined with the GloVe model to perform additional entity type embedding of the triple. That is, the entity type name defined in the final ontology model is input into the GloVe model to obtain the entity type embedding vector of the corresponding word. .

[0109] d) After converting the word embedding vector, position embedding vector, and entity type embedding vector of each word element into a vector space of the same dimension, the embedding vectors of all word elements are combined to form an embedding matrix to obtain the word embedding matrix of the triplet. , position embedding matrix , entity type embedding matrix , and add the triple's word embedding matrix, position embedding matrix, and entity type embedding matrix to get the initial embedding representation of the triple Where n is the number of tokens obtained after the triple is segmented. Respectively represent word embedding vector of word units; Respectively represent The position embedding vector of each word; Respectively represent The entity type embedding vector of each word.

[0110] In this embodiment, in order to facilitate subsequent combination and addition operations, the embedding vector of each entity needs to be converted to a vector space with the same dimension. The specific method adopted is to use the maximum dimension as the basis and fill the embedding vectors below the dimension with 0 values ​​to achieve this.

[0111] e) Inputting the initial embedding representation of the triple into a pre-trained model. The pre-trained model replaces the self-attention mechanism in the Transformer model with a relation-aware self-attention mechanism, and outputs a Transformer-enhanced triple entity embedding representation. The triple entity embedding representation contains the entity's name information, location information, type information, and relationship information.

[0112] In this embodiment, the Transformer architecture is used for the initial embedding representation of the entity, and information is further fused on the basis of the initial embedding to enhance the entity representation. Specifically, encoding, embedding enhancement and output are performed through a multi-layer Transformer encoder. In particular, considering that the initial embedding representation of the entity only includes word embedding, position embedding and entity type embedding, and the relationship will obviously affect the semantic richness of the entity embedding, this embodiment transforms the traditional Transformer model and replaces the self-attention mechanism therein with a relationship-aware self-attention mechanism to capture and fuse relationship information.

[0113] In this embodiment, the relation-aware self-attention function is:

[0114]

[0115] in, The computational results of the self-attention mechanism representing the relationship perception; 、 、 The matrix is ​​obtained by transforming the entity embedding matrix through the three learned parameter matrices. Each row represents the feature vector of a word in the query text, and the matrix Each row represents the feature vector of a word in the key text, and the matrix Each row represents the feature vector of a word in the value text; represents the scaling factor; is the relation embedding matrix, which is obtained by embedding the corresponding relations of the corresponding entities in the triples through a learned parameter matrix; It is a coefficient used to adjust the strength of the relationship; Represents matrix transpose; Represents the softmax activation function.

[0116] In addition, in the present invention, the generation method of query text, key text and value text is the same as the generation method of query text, key text and value text in the self-attention mechanism, and will not be repeated.

[0117] S28: The knowledge engineer agent selects an entity name that best reflects the semantics from each set of aligned entities representing the same semantics as the surface name of the entity mention, outputs a list of fused knowledge triples, and sends an instruction that the knowledge processing work has been completed to the project manager agent.

[0118] In this embodiment, the message sent by the knowledge engineer agent to the project manager agent is "Project manager, the knowledge processing work is completed."

[0119] 4) Graph construction

[0120] S29: When the project manager agent receives the instruction from the knowledge engineer agent, the knowledge engineer agent starts the knowledge graph construction work. Based on the fused knowledge triple list, the knowledge engineer agent calls the knowledge graph construction tool to complete the construction and visualization of the knowledge graph, and sends the instruction of the knowledge graph construction completion to the project manager agent. The project manager agent then feedbacks to the user that the knowledge graph has been constructed, and finally obtains the constructed knowledge graph.

[0121] It should be noted that in S29 of this embodiment, after the project manager agent receives feedback from the knowledge engineer agent on the completion of knowledge processing, it notifies the knowledge engineer agent to start the graph construction work. The specific form of the notification is "Knowledge engineer, start the graph construction now, and provide me with feedback after the construction is completed."

[0122] It should be noted that in this embodiment S29, a self-developed knowledge graph construction platform is used to automatically build the knowledge, and the knowledge is stored in the Neo4j graph database. After the construction is completed, the knowledge engineer agent notifies the project manager agent that the graph construction work has been completed, for example, "Project manager, the graph construction work is complete." After receiving the feedback, the project manager agent generates user-oriented feedback, such as "Hello, {task description} has been completed."

[0123] S3: When new knowledge needs to be added to the constructed knowledge graph, the intelligent agent constructed in S1 updates the fused knowledge triple list corresponding to the new knowledge into the knowledge graph according to S2 to generate a new knowledge graph in the field of grid governance.

[0124] It should be noted that in S3 of the present invention, when new knowledge needs to be added to the constructed knowledge graph, the knowledge graph is updated and maintained as needed with reference to the knowledge graph construction process in S2, that is, the corresponding intelligent agent performs the three processes of data preparation, knowledge processing and graph construction, and finally updates the fused knowledge triple list to the knowledge graph, which will not be repeated here.

[0125] In order to better demonstrate the specific implementation and technical effects of the present invention, a multi-agent based grid governance knowledge graph construction method shown in steps S1 to S3 in the above preferred implementation method is applied to a specific example.

[0126] Example

[0127] The specific implementation process of the multi-agent-based grid governance knowledge graph construction method adopted in this embodiment is as described above and will not be repeated here.

[0128] like Figure 6 Figure 2 shows a partial schematic diagram of a grid governance map constructed using the aforementioned method. This map includes entity types such as personnel, grids, events, enterprises, addresses, and regulations. Using common grid governance issues as examples, the map displays event-related information and associated policy documents to assist grassroots governance personnel in resolving issues.

[0129] The embodiment described above is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Persons skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent substitution or equivalent transformation falls within the scope of protection of the present invention.< / tail> < / rel> < / tail> < / rel> < / tail> < / rel>

Claims

1. A method for constructing a grid governance knowledge graph based on multi-agent, characterized in that: The following steps are involved: S1: According to the task requirements in the field of grid governance and the version of the large-scale pre-trained language model called, the required agent role information is pre-designed to form an agent role configuration. After writing agent prompts for each agent according to the agent role configuration, the corresponding agent is constructed based on the agent prompts of each agent, and the role alignment based on the ability is performed in accordance with the agent role information. When there is a deviation between the actual ability of the agent and the agent role configuration, the agent prompts are optimized and adjusted, and the role alignment is performed again until each agent meets the predetermined ability requirements; S2: Based on the intelligent agent built in S1 that meets the capability requirements, it builds a knowledge graph in the field of grid governance through natural language dialogue; S3: When new knowledge needs to be added to the constructed knowledge graph, the intelligent agent constructed in S1 updates the fused knowledge triple list corresponding to the new knowledge into the knowledge graph according to S2 to generate a new knowledge graph in the field of grid governance; In step S1, the agent roles are specifically project manager agent, data engineer agent and knowledge engineer agent; the agent role information is specifically the role name, role capabilities or responsibilities, usage scenarios, available tools, action restrictions and output style of each role; The specific process of step S2 is as follows: S21: Based on the dialogue environment, the project manager agent obtains the user input requirement text for building a knowledge graph in a specific field. The project manager agent reorganizes the language according to the user input requirement text, generates a specific task description that is easy for the data engineer agent and the knowledge engineer agent to understand, and waits for the user to confirm. After the user confirms the specific task description, the project manager agent starts the task and sends the instruction to start data preparation to the data engineer agent. S22: After receiving the instruction from the project manager agent, the data engineer agent first starts data collection. Then, the data engineer agent uses its own large-scale pre-trained language model semantic understanding ability to identify the duplication and irrelevance of the collected data and obtains preliminary recognition results. S23: After obtaining the preliminary recognition results, the data engineer agent uses the reflection mechanism of the large-scale pre-trained language model to evaluate and judge the preliminary recognition results. If there are problems with the preliminary recognition results, they are corrected according to the reflection results, and repetitive and irrelevant files are further removed until there are no problems. If there is no problem with the preliminary recognition result, the data engineer agent will clean the preliminary recognition result, output the preprocessed data, and send the instruction that the data preparation work has been completed to the project manager agent; S24: After the project manager agent receives the instruction from the data engineer agent, the knowledge engineer agent starts the knowledge processing work. First, the knowledge engineer agent and the human expert design the ontology model in the form of dialogue, define the entity types, relationships and attributes, and obtain the preliminary ontology model; S25: The knowledge engineer agent re-evaluates the preliminary ontology model using the reflection mechanism. If the preliminary ontology model is unqualified, the knowledge engineer agent regenerates and adjusts the unqualified preliminary ontology model until all preliminary ontology models are qualified after reflection, thereby obtaining the final ontology model. S26: The knowledge engineer agent extracts and outputs the initial triple list one by one from the preprocessed data according to the final ontology model. The knowledge engineer agent re-evaluates each knowledge triple in the initial triple list by using the reflection mechanism. If the initial triple list is unqualified, the knowledge engineer agent regenerates and adjusts the unqualified knowledge triples in the initial triple list until all the initial triple lists are qualified after reflection, thereby obtaining the final triple list. S27: the knowledge engineer agent uses the method of cross-validation and reflection of the two-line alignment results to perform two-line entity alignment and cross-validation on all entities in the final triple list. If the verification is inconsistent, the knowledge engineer agent re-reflects on the inconsistently verified entities in the final triple list and determines the alignment results of the inconsistently verified entities to obtain an aligned entity set; wherein the aligned entity set is composed of verified entities representing the same semantics; S28: The knowledge engineer agent selects an entity name that best reflects the semantics from each set of aligned entities representing the same semantics as the surface name of the entity mention, outputs a list of fused knowledge triples, and sends an instruction that the knowledge processing work has been completed to the project manager agent; S29: When the project manager agent receives the instruction from the knowledge engineer agent, the knowledge engineer agent starts the knowledge graph construction work. Based on the fused knowledge triple list, the knowledge engineer agent calls the knowledge graph construction tool to complete the construction and visualization of the knowledge graph, and sends the instruction of the knowledge graph construction completion to the project manager agent. The project manager agent gives feedback to the user that the knowledge graph has been constructed, and finally obtains the constructed knowledge graph; In the knowledge graph of grid governance, entity types include personnel, grids, events, enterprises, addresses, and rules and regulations.

2. A method for constructing a multi-agent-based grid governance knowledge graph as claimed in claim 1, characterized in that: In S23, the data cleaning process is specifically as follows: the data engineer intelligent agent calls the watermark removal tool to remove the watermarks from the files with watermarks in the preliminary recognition results, and the data engineer intelligent agent calls the format conversion tool to convert the PDF format files in the preliminary recognition results into Word format files.

3. A method for constructing a multi-agent-based grid governance knowledge graph as claimed in claim 1, characterized in that: In S24, the specific process of designing the ontology model in the form of dialogue is as follows: S241. The knowledge engineer agent generates a triple type list, a corresponding entity type list, a relationship list, and an attribute list based on the learned knowledge according to the specific description of the task issued by the project manager agent; S242. After the user manually checks the generated triple type list, entity type list, relationship list and attribute list, the user interacts with the knowledge engineer agent in the form of a dialogue; S243. After the knowledge engineer agent obtains the current problems and adjustment methods input by the user, the knowledge engineer agent adjusts the triple type list, entity type list, relationship list and attribute list according to the user's requirements, and feeds back the newly generated triple type list, entity type list, relationship list and attribute list to the user, who will manually check them again until the user completely confirms that there are no problems with the generated triple type list, entity type list, relationship list and attribute list, and then obtains the preliminary ontology model.

4. A method for constructing a multi-agent-based grid governance knowledge graph as claimed in claim 1, characterized in that: In S27, the specific process of performing two-line entity alignment on all entities in the final triple list by the method of cross-validation and reflection of the two-line alignment results is as follows: S271. Input all entities extracted from the final triple list into the knowledge engineer agent to obtain intelligent alignment results; S272. Input all entities extracted from the final triple list into the pre-trained model for triple entity embedding, output the triple entity embedding representation enhanced by Transformer, perform clustering alignment on the triple entity embedding representation of all entities, obtain the clustering result of the triple entity embedding representation, and then reversely obtain the entity text according to the index to obtain the clustering alignment result; wherein, the pre-trained model is implemented by replacing the self-attention mechanism in the Transformer model with the relationship-aware self-attention mechanism; S273. The knowledge engineer agent cross-validates the smart alignment results and the cluster alignment results, retains the same parts of the smart alignment results and the cluster alignment results, and inputs the different parts of the smart alignment results and the cluster alignment results into the knowledge engineer agent for reflection and correction until a consistent alignment result is finally obtained.

5. A method for constructing a multi-agent-based grid governance knowledge graph as claimed in claim 4, characterized in that: In S272, the specific process of embedding triple entities by the pre-trained model is as follows: First, the final triple list is preprocessed, and then each triple in the final triple list after preprocessing is segmented to obtain the word element of each triple, and a vocabulary is constructed from all the obtained word elements, and each word element is assigned a unique index in the vocabulary; then the semantic information, position information and entity type information of each word element are converted into corresponding word embedding vectors, position embedding vectors and entity type embedding vectors to form an entity specific layer; after the word embedding vector, position embedding vector and entity type embedding vector of each word element are converted to the vector space of the same dimension, the word embedding vectors of all word elements form the word embedding matrix of the triple, the position embedding vectors of all word elements form the position embedding matrix of the triple, and the entity type embedding vectors of all word elements form the entity type embedding matrix of the triple, and the word embedding matrix, position embedding matrix and entity type embedding matrix are added together to obtain the initial embedding representation of the triple; The initial embedding representation of the triple is input into the pre-trained model, and the Transformer-enhanced triple entity embedding representation is output.

6. A method for constructing a multi-agent-based grid governance knowledge graph as claimed in claim 5, characterized in that: When converting the semantic information, position information and entity type information of each word unit into word embedding vector, position embedding vector and entity type embedding vector, the GloVe model is used to generate the word embedding vector of each word unit, and each word unit is positionally encoded to obtain the position embedding vector. Finally, the entity type name defined in the ontology model is input into the GloVe model to obtain the entity type embedding vector of the corresponding word unit.

7. A method for constructing a multi-agent-based grid governance knowledge graph as claimed in claim 4, characterized in that: The functional form of the relationship-aware self-attention mechanism is: ; in, Represents the computational results of the relation-aware self-attention mechanism; , , It is the matrix obtained by transforming the entity embedding matrix through three learned parameter matrices respectively; represents the scaling factor; is the relation embedding matrix; It is a coefficient used to adjust the strength of the relationship influence; Represents matrix transpose; Represents the softmax activation function.

Citation Information

Patent Citations

  • Geographic information-oriented knowledge graph construction method

    CN117453928A

  • Complex information retrieval system and method

    CN118779364A