Multi-agent-based grid treatment knowledge graph construction method

Through the combination of multi-agents and large-scale pre-trained language models, natural language dialogue-based knowledge graph construction is carried out, which solves the problems of insufficient automation of grid governance knowledge graph construction and the limitations of field, improves the quality and generalization of the graph, and solves the problem of insufficient automation of grid governance knowledge graph construction, thus improving the quality and generalization of the graph, and solving the problem of The problem of perspective collapse.

CN119150978AActive Publication Date: 2024-12-17ZHEJIANG UNIV

Patent Information

Application Number
CN202411626400.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2024-12-17
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, which affects the quality of generation.

Method used

Using an end-to-end approach based on multi-agents, through designing agent roles and prompts, using the natural language processing capabilities and reflection mechanism of large-scale pre-trained language models, the knowledge graph of natural language dialogue is constructed in combination with dual-line alignment. Cross-verification and reflection of the results improve the quality and generalization of the knowledge graph.

Benefits of technology

It has achieved high-quality and generalizable grid governance knowledge graph construction, lowered the construction threshold, avoided the drawbacks of existing methods, and improved the quality and field generalization of the knowledge graph.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119150978A_ABST
    Figure CN119150978A_ABST
Patent Text Reader

Abstract

The invention discloses a grid treatment knowledge graph construction method based on multiple agents, and belongs to the field of knowledge graph construction. The method comprises the following steps: pre-designing agent role information, compiling an agent prompt for each agent, constructing a corresponding agent, carrying out role alignment according to the agent role information, and optimizing the agent prompt when the actual capability of the agent is deviated from the agent role configuration. The intelligent agent meeting the requirement is generated; constructing a knowledge graph in a natural language dialogue form; and when new knowledge needs to be supplemented into the constructed knowledge graph, updating the knowledge graph by the corresponding intelligent agent as required, and completing the construction of the knowledge graph. According to the method, the learned knowledge, the natural language processing ability and the task generalization ability of the large-scale pre-training language model are fully utilized, and the quality of the task execution result is enhanced based on the multi-view characteristic of multiple agents and the reflection mechanism of the large-scale pre-training language model.
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] As an innovative social governance model, grid governance has significant practical significance in improving the level of social service management, enhancing administrative efficiency, and promoting the modernization of social service management capabilities. The application of artificial intelligence technology in grid governance has become an important choice for promoting the modernization of grid governance to achieve intelligent management and services. With the widespread application of artificial intelligence technology, knowledge graphs, as a key way to express knowledge, have laid a solid foundation for the storage and intelligent application of domain knowledge. Therefore, building high-quality domain knowledge graphs is crucial to promoting the modernization of grid governance.

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

[0004] Domain experts manually construct knowledge graphs mainly based on their own knowledge, define entity types, determine the relationship types between entities, plan the hierarchical structure of the knowledge graph, and define attributes to obtain the ontology model of the knowledge graph. Then, experts identify entities and relationships from original knowledge in the form of documents, and manually input the identified results into the ontology model to finally obtain a constructed domain knowledge graph. The method of manually constructing graphs based on expert experience is the main method for current practical engineering applications. Its core is to structure entities and relationships in the form of triples. This discrete symbolic expression can structure data very effectively, but these symbols cannot express information at the corresponding semantic level in computers, nor can they perform semantic calculations, which is not friendly to downstream applications. On the other hand, due to the low efficiency of manual construction and excessive reliance on expert knowledge, the application efficiency in the field of grid governance is not high and the application effect is not obvious.

[0005] Some work focuses on automatically building knowledge graphs. For entity recognition tasks, the current common architecture is a combination of BERT, BiLSTM, and CRF, where BERT is used to generate initialized word vectors, BiLSTM receives these word vectors for sequence modeling, and CRF models the label sequence to obtain the global optimal solution. Relation extraction is another important task. There are two main strategies: step-by-step extraction and joint extraction with entities. Step-by-step extraction is generally implemented based on derivative networks of deep neural networks such as CNN, RNN, and GCN.

[0006] There are also some optimization works in the field of automated construction of knowledge graphs. HAKE proposed to use low-dimensional distributed embeddings in real-valued point-by-point space as representations of relations, and mapped entities to polar coordinates to capture semantic hierarchies. After capturing the embedded 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 of the same entity underground at different times / different grids, GCNAlign proposed to introduce graph convolutional neural networks to model global information, design two graph neural networks, encode knowledge graph entities from different sources into a unified vector space, and optimize 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 between different fields and tasks. Some work uses large-scale pre-trained models to build more accurate and comprehensive knowledge graphs. COMET proposes to distill the hard-to-obtain common sense knowledge from large models to small student models, and then conduct fine-grained learning of domain-specific knowledge on lightweight student models, and finally use 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, adds the validator's feedback on the prediction results of the large-scale pre-trained model to the prompt text, and iteratively guides the large model to optimize the quality of the previously predicted knowledge graph subgraph.

[0008] Building a high-quality domain knowledge graph is crucial to promoting the modernization of grid governance. Compared with other more vertical and standardized fields such as medical care and electricity, grid governance has a wide coverage, complex business logic, involves a large amount of governance logic and rules, and there is little formal summary of grid governance knowledge, which brings challenges to the construction of grid governance knowledge graph. How to overcome these problems and build a high-quality grid governance domain knowledge graph more efficiently is a technical problem that needs to be solved urgently. 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 the method of manual construction 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, and 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-mentioned deficiencies, 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 invention object, 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: 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;

[0014] 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;

[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 scheme, 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 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.

[0020] 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.

[0021] S23: After obtaining the preliminary recognition result, the data engineer agent uses the reflection mechanism of the large-scale pre-trained language model to evaluate and judge the preliminary recognition result. If there is a problem with the preliminary recognition result, it is corrected according to the reflection result, and repetitive and irrelevant files are further removed until there is no problem. If there is no problem with the preliminary recognition result, the data engineer agent cleans the preliminary recognition result, outputs the pre-processed data, and sends the instruction that the data preparation work has been completed to the project manager agent.

[0022] 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;

[0023] 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.

[0024] 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.

[0025] 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;

[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 that the knowledge processing work has been completed to the project manager agent;

[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 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 agent calls a watermark removal tool to remove watermarks from files with watermarks in the preliminary recognition results, and the data engineer agent calls a 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 the form of a dialogue;

[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 intelligent alignment results;

[0035] 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;

[0036] 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.

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

[0038] 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 constitute the word embedding matrix of the triple, the position embedding vectors of all word elements constitute the position embedding matrix of the triple, and the entity type embedding vectors of all word elements constitute 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.

[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 relationship-aware self-attention mechanism function is in the form of:

[0041]

[0042] 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.

[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. The present invention innovatively completes the construction of the grid governance knowledge graph in a multi-agent form. Compared with the currently more common manual construction and small model and manual collaborative semi-automatic construction methods, the present invention realizes end-to-end grid governance knowledge graph construction and lowers the construction threshold;

[0046] 2. The present invention makes full use of the acquired knowledge of large-scale pre-trained language models and the flexibility of multi-agents, greatly improving the domain generalization of grid governance knowledge graph construction and 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 a 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 is a flow chart of the overall steps of the method of the present invention;

[0049] Figure 2 A flow chart of the steps for 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 a method for cross-validation and reflection of double-line alignment results of the present invention;

[0052] Figure 5 A schematic diagram of a specific process of embedding triple entities by a pre-trained model in the present invention;

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

[0054] In order to make the above-mentioned purpose, features and advantages of the present invention more obvious and easy to understand, the specific implementation mode of the present invention is described in detail below in conjunction with 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 different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention, so the present invention is not limited by 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. 1 , in a preferred implementation of the present invention, multiple agents are designed and constructed, and these agents are used to construct a knowledge graph in the field of grid governance end-to-end. A method for constructing a knowledge graph for grid governance based on multiple 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 in detail below.

[0056] 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 (Agent Profile). After writing agent prompts (Prompt) for each agent according to the agent role configuration, the corresponding agent (Agent) is constructed based on the agent prompts 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 prompts are 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 select the version publicly provided on the Internet, or the open source version that can be deployed locally, and the specific large-scale pre-trained language model version adopted can be replaced as needed. In this embodiment, in order to improve the natural language processing capability as much as possible, gpt-4-turbo is selected as the large-scale pre-trained language model version of the driving agent.

[0058] It should be noted that, in the present invention, Figure 2 As shown in the figure, when constructing an agent, the agent role is first designed, then the agent prompt is designed, and finally the constructed agent is obtained. In this embodiment, the agent roles are specifically three roles: project manager agent (PMA), data engineer agent (DEA), and knowledge engineer agent (KEA). The agent role information specifically includes the role name, role ability or responsibility, usage scenario, available tools, action restrictions, and output style of each role.

[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] Role Name: Project Manager Character Abilities: Confirm requirements, define and confirm overall tasks; initiate tasks and promote their execution, including data preparation, knowledge processing, graph construction, etc. Use scenarios: In the task confirmation scenario, we will talk with users to confirm the specific requirements and task objectives of the grid governance knowledge graph construction; in the task promotion scenario, we will talk 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 advancement of task execution Output style: The dialogue format is concise and clear

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

[0063] Role Name: Data Engineer Character Abilities: Communicate with users and guide them to upload files, provide links, and obtain original data; perform data preprocessing operations such as data deduplication, irrelevant data removal, format conversion, and watermark removal; reflect on execution results as required Use scenarios: In the data collection scenario, we communicate with users to collect grid management related data; in the data preprocessing scenario, we complete data preprocessing based on the collected grid management related data. Available tools: File upload module; web page 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 conversation 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] Role Name: Knowledge Engineer Character Abilities: Design ontology models according to task requirements; extract and output knowledge triples in a preset style; perform entity alignment and entity disambiguation on knowledge triples; call graph construction tools to complete the final construction; reflect on execution results as required Use scenarios: Ontology design scenario, dialogue with users to design the grid governance knowledge graph ontology model; knowledge extraction scenario, based on the ontology model, extract grid governance related knowledge from preprocessed data; knowledge fusion scenario, fuse the extracted grid governance related knowledge; graph construction scenario, call tools to complete the construction of grid governance knowledge graph Available tools: Knowledge graph construction tool Movement restrictions: You can talk to users in the grid governance knowledge graph ontology design scenario; you can talk to the project manager agent to give feedback after the task you are responsible for is completed; you cannot talk to 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 the preprocessed data, as many knowledge triples as possible are extracted

[0066] It should be noted that, in the present invention, the agent prompt refers to the input text provided to the large-scale pre-trained language model, which is used to guide the large-scale pre-trained language model to generate specific outputs or perform specific tasks. The content of the agent prompt at least includes the corresponding content in the agent role configuration information, and some additional information can be added to better extract the target perspective and ability from the large-scale pre-trained language model.

[0067] Generally speaking, agent prompts can be divided into two categories according to their scope of influence: system prompts and user prompts. The former are mainly predefined roles and behavior settings that have a lasting impact on the entire conversation process. For example, the roles and capabilities of a large-scale pre-trained language model in the conversation process can be pre-set. The latter mainly affects a specific round of conversation. For example, during the conversation, the definition and explanation of the prompt can be obtained by inputting the prompt "What is the prompt?" into the large-scale pre-trained language model.

[0068] In this embodiment, the agent prompts used are system prompts. The 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 appear, 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 outputs, you must also comply with these requirements: {output style}. {role name}, now the grid governance knowledge graph construction task has begun, please keep your attention on 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 the agent construction platform, which can be based on the agent construction platform service open on the Internet, or the agent agent construction code can be written by oneself. In this embodiment, the agent is constructed based on the four-element architecture of memory, tool, action, and planning. This framework is also the main architecture for constructing agents at present. The specific construction method has been disclosed, and this embodiment will not be repeated.

[0070] It should be noted that in the present invention, the prompt for the initialization of the intelligent agent needs to be verified on the constructed intelligent agent based on the intelligent agent role configuration information to ensure that the role capabilities of the intelligent agent are consistent with expectations. If the verification finds that the actual capabilities of the intelligent agent are different from the intelligent agent role configuration information, the prompt needs to be adjusted specifically and re-verified until the role capabilities are aligned.

[0071] S2: An intelligent agent that meets the capability requirements built based on S1, which builds 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 ** problems"; the specific description of the task that is finally confirmed is in the form of "Build a knowledge graph in the field of grid governance, which is used to solve the discovery of ** problems and provide processing suggestions and based on rules and regulations"; the instruction of the project manager agent is in the form of "Start the task: {specific description of the task}. Data engineer, start data preparation now and provide me feedback when you are ready."

[0076] 2) Data preparation

[0077] 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 entire amount of collected data to obtain 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 built into 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 captures 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 de-duplicated and de-irrelevant files.

[0080] S23: After obtaining the preliminary recognition result, the data engineer agent uses the reflection mechanism (Reflection) of the large-scale pre-trained language model to evaluate and judge the preliminary recognition result. If there is a problem with the preliminary recognition result, it will be corrected according to the reflection result, and repetitive and irrelevant files will be further removed until there is no problem. If there is no problem with the preliminary recognition result, the data engineer agent will clean the preliminary recognition result, output the pre-processed data and send the instruction that the data preparation work has been completed to the project manager agent.

[0081] It should be noted that in S23 of the present invention, the reflection mechanism (Reflection) is a mechanism that allows a large-scale pre-trained language model to improve the task execution effect through self-examination 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, as follows:

[0083] For question Q asked to the large-scale pre-trained language model, the first task T1 performed by the large-scale pre-trained language model is to use the learned knowledge K to generate a preliminary answer A. This process can be formalized as A=T1(Q;K). After that, the second task T2 can 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 executed 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 the format conversion, watermark removal and other module tools. In this embodiment, if a small number of uploaded PDF files have watermarks, the data engineer agent calls the watermark removal tool to remove the watermarks in the PDF, and calls the file format conversion tool to convert the PDF file into a Word file; if there are some files in the form of links, the data engineer agent directly uses its own ability to parse and capture the content of the file corresponding to the link. Due to the powerful natural language processing capabilities of the large-scale pre-trained language model, the quality of the captured file content is higher 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 (i.e., the data engineer agent sends an instruction to the project manager agent that the data preparation work has been completed), in the form of "Project manager, data preparation work is completed."

[0086] 3) Knowledge Processing

[0087] 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 type, relationship and attribute, and obtain the preliminary ontology model S0 (E, R, T, A). Among them, 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 S24, after the project manager agent receives the feedback from the data engineer agent that the data preparation is completed, the project manager agent sends an instruction to the knowledge engineer agent to enable the knowledge engineer agent to start knowledge processing. The notification sent by the project manager agent is specifically "Data preparation is completed. Knowledge engineer, start knowledge processing now and provide me with feedback after processing."

[0089] It should be noted that, in S24 of the present invention, the process of designing the ontology model in the form of dialogue 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 the form of a dialogue;

[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, because 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 agent needs to use the reflection mechanism to strengthen the evaluation until the initial ontology model evaluation is all qualified to obtain the final ontology model.

[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. Then, the knowledge engineer agent re-evaluates each knowledge triple in the initial triple list 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, and the final triple list T (Eh, R, Et) is obtained.

[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 initially generated triple list needs to be evaluated. If it is unqualified, the knowledge engineer agent needs to use the reflection mechanism to strengthen the evaluation until all the initial 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 will re-reflect on the inconsistently verified entities in the final triple list and determine 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, in order 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 in the figure, the first line extracts all entities from the final triple list, and the first line inputs these entities into the knowledge engineer agent to directly obtain the intelligent alignment result. The second line directly inputs all entities extracted from the final triple list into the pre-trained model for triple entity embedding, outputs the triple entity embedding representation enhanced by Transformer, performs clustering alignment on the triple entity embedding representation of all entities, obtains the clustering result of the triple entity embedding representation, and then obtains the entity text in reverse according to the index to obtain the cluster alignment result. 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, retains the same parts of the two, and inputs the different parts of the two 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 triple entities, 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 sentence 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, construct 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 are still some situations that are not suitable for direct embedding. Therefore, this embodiment performs tokenization to obtain the token of each triple.

[0104] c) The semantic information, position information and entity type information of each word unit are then converted into corresponding word embedding vectors, position embedding vectors and entity type embedding vectors to form an 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 is performed using the GloVe model. The implementation of the GloVe model belongs to the prior art and will not be described in detail.

[0107] For position embedding, considering the directional nature of the triples themselves, in order to retain the position information, this embodiment calculates the position encoding for each word: and , indexed as The word position is mapped to a The position vector of , this vector 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 additionally embed the entity type 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 unit to the vector space of the same dimension, the embedding vectors of all word units are used to form an embedding matrix to obtain the word embedding matrix of the triplet , position embedding matrix , entity type embedding matrix , and add the word embedding matrix, position embedding matrix, and entity type embedding matrix of the triple to obtain the initial embedding representation of the triple . Where n is the number of tokens obtained after the triple is segmented. Respectively represent The word embedding vector of the word unit; Respectively represent The position embedding vector of each word; Respectively represent The entity type embedding vector of each token.

[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 of the same dimension. The specific method is to use the maximum dimension as a reference 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, wherein the pre-trained model replaces the self-attention mechanism in the Transformer model with a relation-aware self-attention mechanism, and outputting a Transformer-enhanced triple entity embedding representation, which includes the name information, location information, type information, and relationship information of the entity.

[0112] In this embodiment, for the initial embedding representation of the entity, the Transformer architecture is used to further fuse information based on 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 have an impact on 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 in the form of:

[0114]

[0115] in, Represents the computational results of the relation-aware self-attention mechanism; , , is the matrix obtained by transforming the entity embedding matrix through 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 of represents the feature vector of a word element of 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 influence; 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, what the knowledge engineer agent sends to the project manager agent is specifically "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 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 a constructed knowledge graph is obtained.

[0121] It should be noted that in this embodiment S29, 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 graph construction. The specific form of the notification is "Knowledge engineer, start graph construction now, and provide me feedback after construction."

[0122] It should be noted that in this embodiment S29, the self-developed knowledge graph construction platform is called to complete the automatic construction, and the knowledge is stored in the Neo4j graph database. After the construction is completed, the knowledge engineer agent informs the project manager agent that the graph construction work has been completed, for example, "Project manager, the graph construction work is completed." After receiving the feedback, the project manager agent forms user-oriented feedback, such as "Hello, {task specific 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 method for constructing a grid governance knowledge graph based on multiple agents as 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 The figure shows a partial schematic diagram of the grid governance map constructed based on the above method, which includes entity types such as personnel, grids, events, enterprises, addresses, rules and regulations, etc. This map uses common problems in the field of grid governance as an example to display event-related information and related policy documents to assist grassroots governance personnel in problem handling.

[0129] The above-described embodiment is only a preferred solution of the present invention, but it is not intended to limit the present invention. A person skilled in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.< / tail> < / rel> < / tail> < / rel> < / tail> < / rel>

Claims

1. A method for constructing a knowledge graph for grid governance based on multi-agents. It is 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.

2. A method for constructing a grid governance knowledge graph based on multi-agents as claimed in claim 1, It is characterized in that 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.

3. A method for constructing a multi-agent-based grid governance knowledge graph as claimed in claim 2, It is characterized in that 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 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.

4. A method for constructing a multi-agent-based grid governance knowledge graph as claimed in claim 3, It is 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.

5. A method for constructing a grid governance knowledge graph based on multi-agents as claimed in claim 3, It is 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.

6. A method for constructing a multi-agent-based grid governance knowledge graph as claimed in claim 3, It is 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.

7. A method for constructing a multi-agent-based grid governance knowledge graph as claimed in claim 6, It is 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.

8. A method for constructing a multi-agent-based grid governance knowledge graph as claimed in claim 7, It is 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.

9. A method for constructing a multi-agent-based grid governance knowledge graph as claimed in claim 6, It is 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.

10. A method for constructing a grid governance knowledge graph based on multi-agents as claimed in claim 1, It is characterized in that In the knowledge graph of grid governance, entity types include personnel, grids, events, enterprises, addresses, and rules and regulations.

Citation Information

Patent Citations

  • System for realizing rapid traceability and screening management and control of key crowds based on big data and AI technology in infectious disease prevention and control, and method and application thereof

    CN114078602A

  • Geographic information-oriented knowledge graph construction method

    CN117453928A

  • Automatic knowledge graph construction method based on priori knowledge and knowledge connection

    CN118520945A

  • Complex information retrieval system and method

    CN118779364A

  • Intelligent question and answer method based on cooperation of large language model and knowledge graph

    CN118797017A

Cited By

  • Construction method, device and equipment of intelligent criminal investigation platform and storage medium

    CN119357339A

  • Underground pipeline hidden danger management file information extraction method and device based on large model

    CN119903025A

  • Intelligent knowledge architecture graph construction method and system based on large model

    CN120144790A

  • Network security situation analysis method and device based on multi-agent cooperation

    CN120263466A

  • LLM-based multi-modal data management intelligent code generation method

    CN121029179A