Entity alignment and graph fusion method and device based on large language model

By processing general knowledge graphs using large language models, entity and relation descriptions are generated. Similarity is calculated by combining existing entity alignment models, which solves the problem of inconsistent graph structures, achieves efficient entity alignment and graph fusion, and improves the accuracy and application value of knowledge graphs.

CN120409634APending Publication Date: 2025-08-01BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510280593.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-11
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

Existing entity alignment algorithms cannot effectively utilize attribute triples and descriptive information caused by inconsistent graph structures when fusing domain knowledge graphs generated based on RAG with general knowledge graphs, resulting in low entity alignment accuracy and poor graph fusion effect.

Method used

By processing general knowledge graphs through large language models, entity and relation description information is generated, data format is unified, and the similarity of structure, entity description and relation description is calculated by combining existing entity alignment models, and weighted fusion is performed to achieve entity alignment and graph fusion.

Benefits of technology

It improves the accuracy of entity alignment and the quality of graph fusion, generating a richer and more accurate knowledge graph suitable for applications such as intelligent question answering, semantic search, and recommendation systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120409634A_ABST
    Figure CN120409634A_ABST
Patent Text Reader

Abstract

The invention provides an entity alignment and graph fusion method and device based on a large language model, and the method comprises the steps: processing triple data of a general knowledge graph through a large language model, enabling the triple data to be consistent with a to-be-fused domain knowledge graph in format, and extracting an entity set and a relation triple set; calculating structural similarity, entity description similarity and relation description similarity among entities by utilizing the entity alignment model and the large language model; performing weighted fusion on the similarity, calculating entity similarity, merging entities meeting alignment conditions, and directly adding unaligned entities and relationships thereof into a new map; and storing fused atlas data by using a complex network analysis library to obtain a fused new atlas. Through a multi-information fusion mode, the method comprehensively considers the structure, description, relation and other features of the entity, greatly improves the accuracy of entity alignment, and improves the quality of map fusion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of graph fusion, and particularly to a method and device for entity alignment and graph fusion based on a large language model. Background Art

[0002] With the rapid development of large language models (LLMs), the derivative technology Retrieval-Augmented Generation (RAG) has been widely applied to the generation and retrieval of knowledge graphs. RAG utilizes the powerful text processing and generation capabilities of large language models to efficiently perform structured parsing, entity relationship extraction, knowledge storage, and semantic enhancement on private knowledge bases. Through this process, RAG can quickly and accurately generate knowledge graphs and add descriptive attributes based on context information to each entity and associated relationship. However, due to the limitation of the amount of information in private knowledge bases, the domain knowledge graphs generated by the RAG method usually lack general knowledge, which restricts its application in knowledge-driven tasks.

[0003] To solve this problem, knowledge graph fusion has become an effective solution. The goal of knowledge graph fusion is to integrate knowledge graphs from different sources, merge and associate relevant information in different graphs, so as to construct a more comprehensive and rich knowledge system. Through knowledge graph fusion, not only can the knowledge gaps in a single graph be filled, but also the performance of the graph in various practical applications can be improved, especially playing an important role in fields such as intelligent question answering, semantic search, and recommendation systems. As a key step in realizing knowledge graph fusion, entity alignment can expand the scale of the knowledge graph and promote its development in multiple tasks by aligning entities that represent the same real-world meaning in different graphs.

[0004] Currently, most mainstream entity alignment methods are based on graph neural networks (GNNs). These methods usually use the structural information of knowledge graphs for entity alignment. For example, graph convolutional neural networks (GCNs) are used to extract the graph structure features of entities, or siamese networks are used to compare the similarity of entities in different graphs. At the same time, there are also some methods that combine multiple feature information, such as learning the semantic relevance of entities through pre-trained language models, or fusing meta-semantic information and relation-aware self-attention mechanisms to improve the alignment accuracy.

[0005] However, the currently publicly available general knowledge graphs, such as DBpedia, Wikidata, and YAGO, are significantly different in graph structure from the domain knowledge graphs generated based on RAG. Taking the GraphRAG and LightRAG frameworks as examples, the domain knowledge graphs generated based on them are saved in Extensible Markup Language (XML). Entities and relationships are not stored in the form of triples, but are separately stored in the form of nodes and edges. There is only one relationship between two entities, and the relationship between entities is described in detail by adding descriptive attributes. At the same time, entities do not have attribute triples, but the overview generated by the large language model based on the context is used as the descriptive information of the entity. General knowledge graphs are saved in the form of triples. There are multiple relationships between two entities, there is no additional descriptive information, and at the same time, entities do not have descriptive information, and the relevant information exists in the form of multiple attribute triples.

[0006] Existing entity alignment algorithms are all trained based on general knowledge graph datasets (such as DBP15K and DWY100K). When it comes to the fusion problem of domain knowledge graphs generated based on RAG and general knowledge graphs, the inconsistent graph structures cause entity alignment algorithms to only utilize the common structural information of the two graphs during application, and cannot separately utilize attribute triples or descriptive information with a large amount of semantics, resulting in low accuracy of entity alignment algorithms and poor graph fusion effects. Summary of the Invention

[0007] This application aims to at least solve one of the technical problems in the related art to some extent.

[0008] To this end, the first object of this application is to propose an entity alignment and graph fusion method based on a large language model.

[0009] The second object of this application is to propose an entity alignment and graph fusion device based on a large language model.

[0010] The third object of this application is to propose an electronic device.

[0011] The fourth object of this application is to propose a computer-readable storage medium.

[0012] The fifth object of this application is to propose a computer program product.

[0013] To achieve the above object, the first aspect embodiment of this application proposes an entity alignment and graph fusion method based on a large language model, including:

[0014] Use a large language model to process the triple data of the general knowledge graph to make it consistent with the format of the domain knowledge graph to be fused, and extract the entity set and the relationship triple set of the general knowledge graph and the domain knowledge graph respectively;

[0015] Use an existing entity alignment model, combine the extracted relationship triple set with the alignment seeds, and calculate the structural similarity between entities; extract the entity description information in the entity set, call the large language model to generate the entity description similarity; extract the relationship description information in the relationship triple set, and use the large language model to generate the relationship description similarity;

[0016] Perform weighted fusion on the structural similarity, entity description similarity, and relationship description similarity, calculate the entity similarity, for entities that meet the alignment conditions, extract and merge their entity description information and relationship description information, directly add the unaligned entities and their relationships to the new graph, and retain their description information;

[0017] Use a complex network analysis library to save the fused entity relationships and related description information to obtain a fused new graph.

[0018] Optionally, the use of the large language model to process the general knowledge graph includes:

[0019] Input the general knowledge graph;

[0020] Call the large language model to generate entity description information based on the entity attribute triples in the general knowledge graph. Among them, if there are multiple attribute triples, merge the entity description information of each attribute triple to form a complete description of the entity;

[0021] After generating the entity description information, delete the entity attribute triples from the general knowledge graph;

[0022] Call the large language model to generate corresponding relationship description information based on the relationship triples in the general knowledge graph. Among them, if there are multiple relationships between two entities, merge these relationships into one and generate the merged relationship description information;

[0023] Use a complex network analysis library to save the processed entity description information and relationship description information to obtain a general knowledge graph in XML format.

[0024] Optionally, the use of the existing entity alignment model, combining the extracted relationship triple set with the alignment seeds, to calculate the structural similarity between entities includes:

[0025] Input the alignment seeds;

[0026] Taking the set of relational triples and the alignment seeds as inputs, and using existing entity alignment algorithms to transform the structural information of the general knowledge graph and the domain knowledge graph into structural embedding vectors;

[0027] By calculating the similarity of the structural embedding vectors between each pair of entities, a structural similarity matrix of the two graphs is obtained, and the matrix elements are the structural similarities Sim between entity pairs. str 。

[0028] Optionally, extracting the entity description information in the entity set and calling a large language model to generate entity description similarities includes:

[0029] Obtaining the description information of each entity from the entity set and inputting it into the large language model for processing;

[0030] Using the large language model to calculate the similarity between entity description information to obtain the entity description similarity Sim between each pair of entities. ent 。

[0031] Optionally, extracting the relationship description information in the set of relational triples and using a large language model to generate relationship description similarities includes:

[0032] According to the set of relational triples, obtaining all adjacent entities of the entities to be aligned;

[0033] Using the alignment seeds to determine whether the entities to be aligned have the same adjacent entities and extracting relationship description information;

[0034] Using the large language model to calculate the similarity between relationship description information to obtain the relationship description similarity Sim. rel 。

[0035] Optionally, performing weighted fusion on the structural similarity, entity description similarity, and relationship description similarity to calculate entity similarity. For entities that meet the alignment conditions, extracting and merging their entity description information and relationship description information, directly adding the unaligned entities and their relationships to the new graph, and retaining their description information, including:

[0036] Performing weighted fusion on the structural similarity Sim str 、entity description similarity Sim ent 、relationship description similarity Sim rel to calculate the entity similarity;

[0037] Setting a similarity threshold. If the calculated entity similarity exceeds the similarity threshold, it is considered that the entity pair belongs to the aligned entities and meets the alignment conditions;

[0038] For entities that meet the alignment conditions, extract the merged entity description information and relationship description information, and add them to the new knowledge graph;

[0039] For unaligned entities and their relationships, directly add the entities and their relationships to the new knowledge graph, and retain the original description information of the entities and their relationships.

[0040] To achieve the above objective, an embodiment of the second aspect of this application proposes an entity alignment and knowledge graph fusion device based on a large language model, including:

[0041] A knowledge graph preprocessing and entity extraction module, configured to use a large language model to process the triple data of a general knowledge graph to make its format consistent with that of the domain knowledge graph to be fused, and respectively extract the entity set and relationship triple set of the general knowledge graph and the domain knowledge graph;

[0042] A calculation and generation module, configured to use an existing entity alignment model, combine the extracted relationship triple set with alignment seeds, and calculate the structural similarity between entities; extract the entity description information in the entity set, call the large language model to generate entity description similarity; extract the relationship description information in the relationship triple set, and use the large language model to generate relationship description similarity;

[0043] A similarity fusion and knowledge graph merging module, configured to perform weighted fusion on the structural similarity, entity description similarity, and relationship description similarity, calculate entity similarity, for entities that meet the alignment conditions, extract and merge their entity description information and relationship description information, directly add the unaligned entities and their relationships to the new knowledge graph, and retain their description information;

[0044] A knowledge graph saving and output module, configured to use a complex network analysis library to save the fused entity relationships and related description information to obtain a new fused knowledge graph.

[0045] To achieve the above objective, an embodiment of the third aspect of this application proposes an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0046] The memory stores computer execution instructions;

[0047] The processor executes the computer execution instructions stored in the memory to implement the method described in any one of the first aspects.

[0048] To achieve the above objective, an embodiment of the fourth aspect of this application proposes a computer-readable storage medium, in which computer execution instructions are stored, and when the computer execution instructions are executed by a processor, they are used to implement the method described in any one of the first aspects.

[0049] To achieve the above object, an embodiment of the fifth aspect of the present application proposes a computer program product, and when the computer program is executed by a processor, it implements the method described in any one of the first aspect.

[0050] The technical solutions provided by the embodiments of the present application at least bring the following beneficial effects:

[0051] (1) Introduce a large language model to preprocess the general knowledge graph. Use the large language model to generate entity and relationship description information for the general knowledge graph, and process attribute triples to unify their data formats, enabling it to better integrate with the domain knowledge graph generated based on RAG. This method successfully solves the problem of inconsistent graph structures and provides a basis for subsequent entity alignment and graph fusion.

[0052] (2) Propose a method for calculating entity similarity by combining a large language model with existing entity alignment algorithms. On the basis of structural similarity, introduce entity description similarity and relationship description similarity, and through weighted fusion, comprehensively consider multiple aspects of entity features such as structure, description, and relationship. This multi-information fusion calculation method significantly improves the accuracy of entity alignment, thereby enhancing the quality of graph fusion.

[0053] (3) Design a complete knowledge graph fusion process, starting from the input graph and alignment seeds, to extracting relationship triple sets and entity sets, performing similarity calculations, entity alignment and relationship merging, processing unaligned entities and relationships, and finally saving and generating a new graph. This process covers multiple steps, and the steps cooperate closely, enabling effective knowledge graph fusion, with high operability and practicality.

[0054] The additional aspects and advantages of the present application will be partially given in the following description, partially become obvious from the following description, or be understood through the practice of the present application. Description of the Drawings

[0055] The above and / or additional aspects and advantages of the present application will become obvious and easy to understand from the following description of the embodiments in conjunction with the drawings, where:

[0056] Figure 1 is a schematic diagram of a simplified process of an entity alignment and graph fusion method based on a large language model provided by an embodiment of the present application;

[0057] Figure 2 is a schematic diagram of a detailed process of an entity alignment and graph fusion method based on a large language model provided by an embodiment of the present application;

[0058] Figure 3 is a schematic diagram of the structure of an entity alignment and graph fusion device based on a large language model provided by an embodiment of the present application. Detailed implementation manners

[0059] The embodiments of the present application will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements with the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to explain the present application, and should not be construed as a limitation on the present application.

[0060] Regarding the fusion problem of the domain knowledge graph generated based on RAG, the embodiments of the present application provide a method for entity alignment and graph fusion based on a large language model. Figure 1 and Figure 2 is a schematic flowchart of a method for entity alignment and graph fusion based on a large language model provided by an embodiment of the present application. As Figure 1 and Figure 2 shown, the method includes the following steps:

[0061] Step 101: Use a large language model to process the triple data of the general knowledge graph to make its format consistent with that of the domain knowledge graph to be fused, and extract the entity set and relationship triple set of the general knowledge graph and the domain knowledge graph respectively.

[0062] In the embodiments of the present application, step 101 details how to preprocess the general knowledge graph using a large language model to ensure that its format is consistent with that of the domain knowledge graph to be fused, thereby laying a foundation for subsequent entity alignment and graph fusion. Specifically, step 101 includes the following important operations:

[0063] First, input the general knowledge graph. By inputting the general knowledge graph, the entity information and relationship triples therein can be accessed, which provides a data source for subsequent processing.

[0064] Next, call the large language model to generate entity description information based on the entity attribute triples in the general knowledge graph. Attribute triples usually include entities, attributes, and values, and this information helps to construct a description for each entity. In this process, if an entity has multiple attribute triples, the embodiments of the present application will merge the entity description information in these attribute triples to form a complete description of the entity. For example, if a movie entity has multiple attribute triples, respectively representing the name, director, release year, etc. of the movie, the embodiments of the present application will integrate this information to finally generate a comprehensive description information of the movie.

[0065] In a possible embodiment, if the movie "The Blonde in the Blue" has the following property triples: (The Blonde in the Blue, IMDb ID, tt0067946); (The Blonde in the Blue, publication date, 1971).

[0066] This application will merge these property triples to generate merged property description information (The film “The Blonde in the Blue” was published in 1971 and its Internet Movie Database identifier is tt0067946). This merging process can provide a complete background description for each entity, facilitating subsequent graph fusion.

[0067] Once the entity description information is generated, the embodiment of this application will further delete the property triples of these entities from the general knowledge graph. This operation aims to simplify the graph structure, making it more refined, and only retaining the core description and relationship information related to the entities. This not only helps reduce redundant information but also provides a more concise structure for the subsequent knowledge graph fusion process.

[0068] Subsequently, this application generates corresponding relationship description information based on the relationship triples in the general knowledge graph by calling a large language model. Each relationship triple contains two entities and the relationship between them, usually represented in the format of "the relationship C between entity A and entity B". If there are multiple relationships between two entities, the large language model will automatically identify these relationships and merge them into one relationship, thus generating a merged relationship description information.

[0069] For example, if there are the following relationship triples between the movie "The Blonde in the Blue" and the director Steno: (The Blonde in the Blue, instance of, film); (The Blonde in the Blue, director, Steno).

[0070] The embodiment of this application will merge these relationship triples to generate merged relationship description information (The director of the film "The Blonde in the Blue" is Steno.). This merging can effectively reduce redundant information and simplify the graph structure, making the graph representation more intuitive and clear.

[0071] Finally, this application uses a complex network analysis library to save the generated entity description information and relationship description information, and finally obtains a general knowledge graph in XML format. The knowledge graph in XML format is convenient for subsequent data storage and processing, and also helps to dock with the data format of the domain knowledge graph, preparing for graph fusion.

[0072] In one possible embodiment, an example of the XML format is as follows:

[0073]

[0074]

[0075] Through this series of processing steps, this application not only improves the expression ability of the graph in the generation of entity description information and relationship description information, but also enables the general knowledge graph to be more efficiently fused with the domain knowledge graph by standardizing and unifying the data format. This preprocessing method provides a solid foundation for subsequent graph fusion and supports the further application of the knowledge graph in application scenarios such as intelligent question answering and semantic search.

[0076] After completing the graph preprocessing, this application further extracts the entity set and the relationship triple set from the two graphs to be fused respectively.

[0077] Step 102: Use an existing entity alignment model, combine the extracted relationship triple set with the alignment seeds, and calculate the structural similarity between entities; extract the entity description information in the entity set, call a large language model to generate the entity description similarity; extract the relationship description information in the relationship triple set, and use a large language model to generate the relationship description similarity.

[0078] In the embodiment of this application, step 102 details how to use an existing entity alignment model in combination with a large language model to calculate the structural similarity, entity description similarity, and relationship description similarity between entities, so as to provide a more accurate basis for graph fusion. Specifically, step 102 includes the following operations:

[0079] (1) Calculate the structural similarity between entities.

[0080] In this step, the alignment seeds are input first. The alignment seeds contain the basic information of the entities to be aligned and serve as a reference for the subsequent entity alignment process. In practical applications, the alignment seeds are usually known entity pairs or entity pairs that provide preliminary alignment clues. This application does not make specific limitations and only gives examples for illustration.

[0081] Next, take the extracted set of relational triples and alignment seeds as input, and through existing entity alignment algorithms, convert the structural information of the general knowledge graph and the domain knowledge graph into structural embedding vectors. The structural embedding vectors are feature representations generated by a graph neural network or other entity alignment models using the graph structure information of the knowledge graph. Specifically, the set of relational triples contains entities and their mutual relationships, and the alignment seeds help identify known alignment relationships, which provide constraints for the model.

[0082] Subsequently, calculate the similarity of the structural embedding vectors between each pair of entities. This process obtains a structural similarity matrix by calculating the similarity between the embedding vectors (usually using metrics such as cosine similarity). Each element in the matrix represents the structural similarity between two entities (denoted as Sim str ). For example, when the connection patterns of two entities in the graph are similar, their structural similarity will be relatively high, indicating that they may be entities of the same type or have similar functions.

[0083] Through this method, the embodiments of the present application can evaluate the similarity between different entities based on the graph structure information and generate a structural similarity matrix, providing basic data for subsequent entity alignment.

[0084] (2) Generate entity description similarity.

[0085] In this step, the embodiments of the present application will extract the description information of each entity from the entity set. These description information are obtained from the general knowledge graph and usually contain detailed attribute information of the entity, such as text descriptions, category information, etc. These description information are crucial for distinguishing the semantic features of different entities.

[0086] Next, the embodiments of the present application will input the entity description information into a large language model for processing. Large language models (such as GPT, etc.) have powerful semantic understanding and generation capabilities, can understand the meaning of entity descriptions, and convert them into a vector representation.

[0087] Finally, the large language model will calculate the similarity between each pair of entity description information, thereby obtaining the entity description similarity of each pair of entities (denoted as Sim ent ). This process can evaluate the semantic similarity between entities. Especially in the case of similar names or attributes, it can help identify entities with similar semantics. If the description information is highly consistent, it indicates that these two entities may be of the same type or have similar semantics.

[0088] (3) Calculate relationship description similarity.

[0089] In this part, the embodiments of the present application first obtain all adjacent entities of the entities to be aligned according to the relational triple set. The relational triple set contains the relational information between entities, and the adjacent entities are determined by these triples. For example, if there is a "director" relationship between movie entity A and director B, then B is an adjacent entity of A.

[0090] Subsequently, the present application uses alignment seeds to determine whether the entities to be aligned have the same adjacent entities as other entities. Through the indication of the alignment seeds, entity pairs with the same relationship can be identified, and the relational information between these entities can be extracted. For example, if both movie A and movie B have the same director C as an adjacent entity, the present application will regard the relationship of director C as an important feature of the entities to be aligned.

[0091] Next, extract the relationship description information. For example, "director C has a director relationship with movie A", "director C has a director relationship with movie B". These relationship description information are processed by the large language model to calculate the similarity between the relationship description information, and the relationship description similarity (denoted as Sim rel ) is obtained. This process helps the embodiments of the present application evaluate whether the relationships between two entities are consistent, especially when they share the same adjacent entities.

[0092] For example, if two movie entities are both associated with the same director entity, the embodiments of the present application will judge whether these movie entities should be aligned by calculating the similarity of the relationship descriptions between them and the director. If the relationship description similarity between these two movie entities is relatively high, then they may belong to the same category or have the same type of association.

[0093] Through the above steps, the embodiments of the present application not only use the graph structure information to calculate the structural similarity between entities, but also calculate the semantic description similarity and relationship description similarity of entities through the large language model. This multi-dimensional similarity calculation method makes entity alignment more accurate and can effectively identify the same entities in two knowledge graphs. By integrating these similarity information, the embodiments of the present application can provide a reliable entity alignment basis for subsequent graph fusion, thereby improving the fusion effect and constructing a more comprehensive and accurate fused knowledge graph.

[0094] Step 103, perform weighted fusion on the structural similarity, entity description similarity, and relationship description similarity, calculate the entity similarity. For entities that meet the alignment conditions, extract and merge their entity description information and relationship description information, directly add the unaligned entities and their relationships to the new graph, and retain their description information.

[0095] In the embodiments of the present application, step 103 details how to perform weighted fusion on the structural similarity, entity description similarity, and relationship description similarity, so as to calculate the entity similarity, and determine whether the entity meets the alignment condition through a similarity threshold. Specifically, step 103 includes the following detailed operations:

[0096] First, perform weighted fusion on the structural similarity Sim str , entity description similarity Sim ent , and relationship description similarity Sim rel to calculate the entity similarity.

[0097] It can be understood that each similarity dimension (structure, entity description, relationship description) has different contribution weights, and these weights reflect the influence degree of each dimension on entity alignment. Through this weighted fusion, the embodiments of the present application comprehensively consider the graph structure similarity, semantic description similarity, and relationship similarity between entities.

[0098] Specifically, the present application calculates these three similarities through weighting to obtain a final entity similarity Sim. The formula for weighted fusion can be expressed as:

[0099] Sim = ω1Sim str + ω2Sim ent + ω3Sim rel

[0100] Among them, ω1, ω2, and ω3 are preset weight values, representing the importance degrees of the structural similarity, entity description similarity, and relationship description similarity respectively.

[0101] After calculating the similarity of each pair of entities, the present application will determine whether the calculated entity similarity exceeds the set threshold according to the similarity threshold: if the entity similarity exceeds the threshold, it is considered that the entity pair belongs to the aligned entities and meets the alignment condition; if the similarity of the entity pair is low and does not exceed the similarity threshold, it will not be regarded as an aligned entity, and the embodiments of the present application will regard it as an unaligned entity.

[0102] For the entities that meet the alignment condition, the embodiments of the present application will extract their merged entity description information and relationship description information. After being merged, these description information can provide detailed and accurate semantic descriptions for each aligned entity. The extracted entity and relationship description information will be added to the new graph, so as to realize the fusion and expansion of graph data.

[0103] For unaligned entities and the relationships between them, the embodiments of the present application do not discard this information. Instead, these unaligned entities and their relationships are directly added to the new knowledge graph. At the same time, the present application will retain the original description information of these unaligned entities and relationships to ensure that the new knowledge graph contains as much original information as possible and avoid information loss.

[0104] The core of step 103 is to calculate the entity similarity through the weighted fusion of structural similarity, entity description similarity, and relationship description similarity, and determine which entity pairs can be aligned according to the similarity threshold. In the process of aligning entities, the embodiments of the present application not only extract and merge the description information of entities and relationships, but also retain the original descriptions of unaligned entities and their relationships to ensure the integrity and accuracy of knowledge graph fusion. In this way, the present application can effectively process the entities and relationships in the two knowledge graphs and generate a richer and more accurate new knowledge graph, providing strong support for the practical application of the knowledge graph.

[0105] Step 104, use a complex network analysis library to save the fused entity relationships and related description information to obtain the fused new knowledge graph.

[0106] In the aforementioned step 103, the embodiments of the present application have completed the entity alignment and relationship merging work. For entities and their relationships that meet the alignment conditions, the embodiments of the present application have extracted and merged the description information and added these aligned entities and relationships to the new knowledge graph; for unaligned entities and their relationships, the embodiments of the present application have also retained their original description information and added it to the new knowledge graph. At this time, the new knowledge graph already contains all relevant information from the general knowledge graph and the domain knowledge graph.

[0107] Next, the present application needs to save these fused entity relationships. For this purpose, the embodiments of the present application use a complex network analysis library to store all entities and their corresponding relationships. The complex network analysis library can efficiently process graph-structured data and store entities and relationships in an appropriate form (such as nodes and edges) to ensure data integrity and query efficiency.

[0108] In addition to entities and relationships, the embodiments of the present application will also save the description information related to entities and relationships. These description information usually includes attribute descriptions of entities, semantic descriptions of relationships, etc., which can provide more semantic support for subsequent knowledge graph analysis and applications. Using the complex network analysis library, the present application stores this description information together with the structural data of entities and relationships, so that the new knowledge graph not only contains structural information, but also has rich semantic information, and the structure of the fused new knowledge graph is consistent with the input domain knowledge graph.

[0109] In step 104, the fused entity relationships and their description information are saved by using a complex network analysis library, and finally a new fused graph is obtained. This graph not only retains all entity and relationship information in the general knowledge graph and the domain knowledge graph, but also enhances the semantic expression ability of the graph by merging the description information. Through this process, this application ensures the efficiency and accuracy of the knowledge graph in multi-source data fusion, laying a foundation for further knowledge graph applications and analysis.

[0110] Through the above innovations, this application has significant advantages in solving the deficiencies in the prior art, improving the accuracy of entity alignment and the quality of graph fusion. When compared with the prior art, the main advantages are as follows:

[0111] On the one hand, existing entity alignment algorithms are usually trained based on general knowledge graph datasets. However, when faced with the fusion of domain knowledge graphs generated based on RAG and general knowledge graphs, due to the differences in graph structures, traditional methods can only utilize the shared structural information of the graphs, resulting in low alignment accuracy and poor fusion effects. This application preprocesses the general knowledge graph to make its data format consistent with that of the domain knowledge graph, effectively solving the problems brought by graph structure differences.

[0112] On the other hand, when calculating entity similarity in the prior art, it is difficult to fully utilize the rich semantic description information. This application introduces entity and relationship description similarity based on large language models, and performs weighted fusion with the structural similarity calculated by the entity alignment algorithm based on graph neural networks. This multi-information fusion method greatly improves the accuracy of entity alignment, and thus improves the graph fusion effect.

[0113] Based on the above advantages, the knowledge graph fusion process constructed by this application can comprehensively integrate the information in the two graphs. During the fusion process, not only the aligned entities and relationships can be accurately merged, but also the unaligned entities and relationships can be reasonably added to the new graph, thereby generating a richer and more accurate knowledge graph. This new graph has higher application value in knowledge-driven tasks such as intelligent question answering, semantic search, and recommendation systems, greatly improving the effect of knowledge graph fusion.

[0114] To implement the above embodiments, this application also proposes an entity alignment and graph fusion device based on large language models. Figure 3 The structural schematic diagram of an entity alignment and graph fusion device based on large language models provided for the embodiments of this application is as Figure 3 shown. The device includes:

[0115] The general knowledge graph preprocessing and entity extraction module 100 is used to process the triple data of the general knowledge graph using a large language model to make it consistent with the format of the domain knowledge graph to be fused, and extract the entity sets and relationship triple sets of the general knowledge graph and the domain knowledge graph respectively;

[0116] The calculation and generation module 200 is used to use an existing entity alignment model, combine the extracted relationship triple set with the alignment seeds, and calculate the structural similarity between entities; extract the entity description information in the entity set, call the large language model to generate the entity description similarity; extract the relationship description information in the relationship triple set, and use the large language model to generate the relationship description similarity;

[0117] The similarity fusion and graph merging module 300 is used to perform weighted fusion on the structural similarity, entity description similarity, and relationship description similarity, calculate the entity similarity, for entities that meet the alignment conditions, extract and merge their entity description information and relationship description information, directly add the unaligned entities and their relationships to the new graph, and retain their description information;

[0118] The graph saving and output module 400 is used to use a complex network analysis library to save the fused entity relationships and related description information to obtain a new fused graph.

[0119] Regarding the device in the above embodiments, the specific ways in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0120] To implement the above embodiments, the present application also proposes an electronic device, including: a processor, and a memory communicatively connected to the processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement the method provided in the foregoing embodiments.

[0121] To implement the above embodiments, the present application also proposes a computer-readable storage medium, in which computer execution instructions are stored, and when the computer execution instructions are executed by a processor, they are used to implement the method provided in the foregoing embodiments.

[0122] To implement the above embodiments, the present application also proposes a computer program product, including a computer program, which when executed by a processor implements the method provided in the foregoing embodiments.

[0123] The collection, storage, use, processing, transmission, provision, and disclosure of the user's personal information involved in the present application and other processes all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.

[0124] It should be noted that personal information from users should be collected for legal and reasonable purposes and should not be shared or sold outside of such legal uses. In addition, such collection / sharing should be carried out after obtaining the informed consent of the user, including but not limited to notifying the user to read the user agreement / user notice and sign an agreement / authorization including authorizing relevant user information before the user uses the function. In addition, any necessary steps should be taken to safeguard and protect access to such personal information data and ensure that others with access to the personal information data comply with their privacy policies and procedures.

[0125] This application is expected to provide an implementation for users to selectively block the use or access of personal information data. That is, the present disclosure is expected to provide hardware and / or software to prevent or block access to such personal information data. Once the personal information data is no longer needed, the risk can be minimized by restricting data collection and deleting the data. In addition, when applicable, personal identifiers are removed from such personal information to protect the privacy of the user.

[0126] In the description of the foregoing embodiments, the descriptions referring to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0127] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" can explicitly or implicitly include at least one of the features. In the description of the present application, "a plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.

[0128] Any process or method description shown in the flowchart or described in other ways herein can be understood as representing a module, segment, or part of code including one or more executable instructions for implementing a customized logic function or process, and the scope of the preferred implementation of the present application includes additional implementations, where the functions can be executed not in the order shown or discussed, including in a substantially simultaneous manner or in the reverse order according to the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.

[0129] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definable list of executable instructions for implementing logical functions, which can be embodied specifically in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in conjunction with these instruction execution systems, apparatus, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection part with one or more wirings (electronic device), a portable computer disk cartridge (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or otherwise processing as appropriate, and then storing it in a computer memory.

[0130] It should be understood that various parts of the present application can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits with logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits with suitable combinational logic gate circuits, programmable gate arrays (PGA), field-programmable gate arrays (FPGA), etc.

[0131] Those of ordinary skill in the art of this technology can understand that all or part of the steps carried by the method of the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.

[0132] In addition, in each embodiment of the present application, each functional unit can be integrated into a processing module, or each unit can exist physically alone, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0133] The above-mentioned storage medium can be a read-only memory, a magnetic disk or an optical disc, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present application. Those of ordinary skill in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present application.

[0134] It should be understood that various forms of the processes shown above can be used, with steps reordered, added or deleted. For example, the steps described in the present application can be executed in parallel, sequentially or in a different order, as long as the desired results of the technical solution of the present application can be achieved. No limitation is imposed herein.

[0135] The above specific implementation manners do not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present application shall be included within the protection scope of the present application.

Claims

1. A method for entity alignment and graph fusion based on large language models, characterized in that, Including the following steps: Using a large language model to process the triple data of the general knowledge graph to make it consistent with the format of the domain knowledge graph to be fused, and separately extracting the entity set and the relationship triple set of the general knowledge graph and the domain knowledge graph; Using an existing entity alignment model, combining the extracted relationship triple set with the alignment seeds, and calculating the structural similarity between entities; extracting the entity description information in the entity set, calling the large language model to generate the entity description similarity; extracting the relationship description information in the relationship triple set, and using the large language model to generate the relationship description similarity; Performing weighted fusion on the structural similarity, entity description similarity, and relationship description similarity, calculating the entity similarity, for entities that meet the alignment conditions, extracting and merging their entity description information and relationship description information, directly adding the unaligned entities and their relationships to the new graph, and retaining their description information; Using a complex network analysis library to save the fused entity relationships and related description information to obtain a fused new graph.

2. The method according to claim 1, wherein The using of the large language model to process the general knowledge graph includes: Inputting the general knowledge graph; Calling the large language model to generate entity description information based on the entity attribute triples in the general knowledge graph. Among them, if there are multiple attribute triples, the entity description information of each attribute triple is merged to form a complete description of the entity; After generating the entity description information, deleting the entity attribute triples from the general knowledge graph; Calling the large language model to generate corresponding relationship description information based on the relationship triples in the general knowledge graph. Among them, if there are multiple relationships between two entities, these relationships are merged into one, and the merged relationship description information is generated; Using a complex network analysis library to save the processed entity description information and relationship description information to obtain a general knowledge graph in XML format.

3. The method according to claim 2, wherein The using of the existing entity alignment model, combining the extracted relationship triple set with the alignment seeds, and calculating the structural similarity between entities includes: Inputting the alignment seeds; Taking the relationship triple set and the alignment seeds as inputs, and using the existing entity alignment algorithm to convert the structural information of the general knowledge graph and the domain knowledge graph into structural embedding vectors; By calculating the similarity of the structural embedding vectors between each pair of entities, a structural similarity matrix of the two graphs is obtained, and the matrix elements are the structural similarities Sim between entity pairs str 。 4. The method according to claim 3, wherein The extracting of the entity description information in the entity set, calling the large language model to generate the entity description similarity includes: Obtaining the description information of each entity from the entity set and inputting it into the large language model for processing; Calculate the similarity between entity description information using a large language model to obtain the entity description similarity Sim for each pair of entities ent .

5. The method according to claim 4, wherein The extracting of the relationship description information in the relationship triple set, and using the large language model to generate the relationship description similarity includes: According to the relationship triple set, obtaining all adjacent entities of the entity to be aligned; Using the alignment seeds to judge whether the entity to be aligned has the same adjacent entities and extracting the relationship description information; Use a large language model to calculate the similarity between relationship description information, and obtain the relationship description similarity Sim rel .

6. The method according to claim 5, characterized in that Perform weighted fusion on the structural similarity, entity description similarity, and relationship description similarity to calculate the entity similarity. For entities that meet the alignment conditions, extract and merge their entity description information and relationship description information, directly add the unaligned entities and their relationships to the new knowledge graph, and retain their description information, including: The structural similarity Sim str , the entity description similarity Sim ent , and the relationship description similarity Sim rel are weighted and fused to calculate the entity similarity; Set a similarity threshold. If the calculated entity similarity exceeds the similarity threshold, then consider this entity pair as aligned entities that meet the alignment conditions; For entities that meet the alignment conditions, extract their merged entity description information and relationship description information, and add them to the new knowledge graph; For unaligned entities and their relationships, directly add the entities and their relationships to the new knowledge graph, and retain the original description information of the entities and their relationships.

7. An entity alignment and graph fusion device based on a large language model, characterized in that, Including: A knowledge graph preprocessing and entity extraction module, which is used to process the triple data of the general knowledge graph using a large language model to make it consistent with the format of the domain knowledge graph to be fused, and respectively extract the entity sets and relationship triple sets of the general knowledge graph and the domain knowledge graph; A calculation and generation module, which is used to use an existing entity alignment model, combine the extracted relationship triple set with the alignment seeds to calculate the structural similarity between entities; extract the entity description information in the entity set, call the large language model to generate the entity description similarity; extract the relationship description information in the relationship triple set, and use the large language model to generate the relationship description similarity; A similarity fusion and knowledge graph merging module, which is used to perform weighted fusion on the structural similarity, entity description similarity, and relationship description similarity to calculate the entity similarity. For entities that meet the alignment conditions, extract and merge their entity description information and relationship description information, directly add the unaligned entities and their relationships to the new knowledge graph, and retain their description information; A knowledge graph saving and output module, which is used to use a complex network analysis library to save the fused entity relationships and related description information to obtain the fused new knowledge graph.

8. An electronic device, characterized in that, Including: A processor and a memory communicatively connected to the processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory to implement the method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by the processor, they are used to implement the method according to any one of claims 1-6.

10. A computer program product, characterized in that, Including a computer program, which when executed by the processor implements the method according to any one of claims 1-6.

Citation Information

Cited By

  • Multi-modal entity alignment pseudo seed generation method, medium, equipment and product

    CN120892833A

  • Task execution method and device, equipment, computer storage medium and product

    CN122116886A