Large-scale knowledge graph entity alignment method and device and electronic equipment
By encoding knowledge graph entities into semantic vectors and utilizing near nearest neighbor indexes and node degree filtering, combined with large language model inference, efficient entity alignment without alignment seeds is achieved, solving the problems of high computational complexity and storage overhead in existing technologies, and improving alignment accuracy and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING JIAOTONG UNIV
- Filing Date
- 2026-02-04
- Publication Date
- 2026-06-12
Smart Images

Figure CN122198087A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data mining and knowledge graph fusion technology, specifically to a method and apparatus for large-scale knowledge graph entity alignment in unsupervised scenarios. Background Technology
[0002] Entity alignment aims to find entities representing the same real-world object from two different knowledge graphs, thereby enabling the fusion of diverse knowledge graphs. This includes merging entities from encyclopedias, enterprise knowledge bases, open data platforms, industry databases, etc., removing duplicates and supplementing attributes / relationships to form a more complete graph. Entity alignment has numerous applications in e-commerce platforms, intelligent customer service and enterprise Q&A, and financial risk control. Typically, entity alignment involves two stages: a training stage for learning the graph representation structure and an inference stage for similarity search.
[0003] As the scale of real-world knowledge graphs grows, the complexity of training and inference in entity alignment tasks increases dramatically, leading to low computational efficiency and high resource consumption in the practical application of entity alignment algorithms.
[0004] To address the challenges of large-scale training and inference, subgraph partitioning has become a mainstream approach. These methods divide the source and target graphs into multiple subgraphs, then use these subgraph pairs as input to train single or multiple entity alignment models. ClusterE generates subgraph pairs using structure-based and mapping-based clustering samplers, calculates local similarity within each pair, and finally fuses it with a sparse global similarity matrix to obtain the final matching matrix. LargeGNN merges and then partitions the source and target graphs, selecting "landmark nodes" as bridges to establish connections between subgraphs; during inference, LargeGNN also constructs a complete matching matrix and uses bidirectional nearest neighbor retrieval to search for matching pairs. LIME proposes a seed-oriented bidirectional graph partitioning strategy and performs bidirectional preference modeling during inference to reduce one-to-many mismatches. Building on this, SPEA connects “graph partitioning - graph representation learning - graph pseudo-pairing - cross-graph repartitioning” into a closed loop, enabling the quality of graph partitioning and the quality of graph representation learning to promote each other. It improves the accuracy of entity alignment through iterative loops. S3GA, on the other hand, achieves high performance by first segmenting the knowledge graph and then using optimal transport modeling for entity alignment on the segmented knowledge graph.
[0005] In summary, existing solutions for large-scale entity alignment primarily rely on graph partitioning techniques, and during the partitioning process, they typically require the use of known aligned nodes to guide the partitioning of the subgraph. However, they cannot address situations where known matching entities are difficult to obtain in real-world scenarios. Furthermore, most existing methods require storing a... The matching matrix, while the computational complexity of existing deep learning models is often in the range of... or Neither the space complexity nor the computational complexity can meet the requirements for large-scale entity alignment methods.
[0006] Therefore, there is a need for a large-scale entity alignment method that does not require pre-aligned node pairs (alignment seeds) and has low computational complexity and low storage overhead. Summary of the Invention
[0007] As mentioned above, in real-world scenarios, it is difficult to obtain alignment seeds for knowledge graph entity alignment, meaning it is difficult to know the correspondence between nodes in advance. Existing large-scale knowledge graph entity alignment methods require alignment seeds to guide graph partitioning, and the high computational and storage complexity cannot meet the actual application requirements.
[0008] To address the issues of reliance on alignment seed data and high computational and storage overhead in existing technologies, the present disclosure aims to provide a method and apparatus for large-scale knowledge graph entity alignment that is computationally efficient and consumes little memory, without requiring alignment seeds.
[0009] To achieve one or more of the above objectives, a first aspect of this disclosure provides a large-scale knowledge graph entity alignment method, comprising the following steps: converting the names and attribute information of entities in the source knowledge graph and the target knowledge graph into text descriptions, and encoding the text descriptions into fixed-dimensional semantic vectors using a pre-trained semantic encoding model (e.g., LaBSE); constructing an approximate nearest neighbor index on the set of semantic vectors of target entities in the target knowledge graph; for each source entity in the source knowledge graph, retrieving its semantic vector in the approximate nearest neighbor index, and recalling the top K most similar target entities as an initial candidate set, where K is an integer greater than or equal to 1; calculating the node degree of the source entity and each target entity in the initial candidate set, and filtering the initial candidate set based on the distribution of node degree to obtain a high-confidence candidate subset; and for each source entity and its high-confidence candidate subset, extracting the attribute and relation information of the target entities in their respective knowledge graphs, constructing prompt words and inputting them into a large language model, and determining the aligned target entities from the high-confidence candidate subset through reasoning of the large language model.
[0010] In an exemplary embodiment, converting the names and attribute information of entities in the source knowledge graph and the target knowledge graph into text descriptions includes: obtaining the name of the entity; obtaining all attribute information of the entity in their respective knowledge graphs, the attribute information including attribute name and attribute value; sorting all attribute information according to the frequency of their attribute names in their respective knowledge graphs from high to low; concatenating each sorted attribute information in the order of attribute name and attribute value into an attribute description string; and concatenating the entity name with the attribute description string to obtain the text description of the entity.
[0011] In an exemplary embodiment, encoding a text description into a fixed-dimensional semantic vector using a pre-trained semantic coding model includes: encoding the text description using the pre-trained semantic coding model to obtain an initial semantic vector; and normalizing the initial semantic vector to make its magnitude a unit length to obtain a fixed-dimensional semantic vector.
[0012] In an exemplary embodiment, the pre-trained semantic encoding model includes a Sentence Transformer model (e.g., LaBSE).
[0013] In an exemplary embodiment, recalling the top K most similar target entities as an initial candidate set includes: constructing an index structure on all semantic vectors of the target knowledge graph using the FAISS library; and for each source entity in the source knowledge graph, using its semantic vector as a query vector, performing an approximate nearest neighbor retrieval using the index structure, and returning the top K most similar target entities as the initial candidate set.
[0014] In an exemplary embodiment, calculating the node degree of the source entity and each target entity in the initial candidate set includes: constructing adjacency matrices for the source knowledge graph and the target knowledge graph respectively, wherein an element value of 1 in the adjacency matrix indicates that there is at least one relation triplet connection between the corresponding two entities, otherwise it is 0; and calculating the sum of the element values in the row or column corresponding to each entity in the source knowledge graph and the target knowledge graph as the node degree based on the adjacency matrix.
[0015] In an exemplary embodiment, the initial candidate set is screened based on the distribution of node degree, including: sorting the node degree values of all target entities in the initial candidate set and dividing them into N intervals, where N is an integer greater than or equal to 1; determining whether the node degree value of the source entity falls into one of the N intervals; if so, retaining all target entities in the interval to form a high-confidence candidate subset; if not, marking the source entity as an entity to be enhanced.
[0016] In an exemplary embodiment, for a source entity marked as an entity to be enhanced, determining the alignment target entity includes: retrieving supplementary information of the entity to be enhanced and each target entity in the initial candidate set from an external knowledge source; fusing the supplementary information with attribute and relation information extracted from their respective knowledge graphs to construct enhancement prompt words; and inputting the enhancement prompt words into a large language model for reasoning to determine the alignment target entity.
[0017] A second aspect of this disclosure provides a large-scale knowledge graph entity alignment apparatus, comprising: a semantic encoding module configured to convert the names and attribute information of entities in a source knowledge graph and a target knowledge graph into text descriptions, and to encode the text descriptions into fixed-dimensional semantic vectors using a pre-trained semantic encoding model; and an approximate retrieval module configured to construct an approximate nearest neighbor index on the set of semantic vectors of target entities in the target knowledge graph, and for each source entity in the source knowledge graph, to retrieve its semantic vector from the approximate nearest neighbor index, recalling the top K most similar target entities as initial... The candidate set, where K is an integer greater than or equal to 1; the structure filtering module, configured to calculate the node degree of each target entity in the source entity and its initial candidate set, and filter the initial candidate set based on the distribution of node degree to obtain a high-confidence candidate subset; and the inference alignment module, configured to extract the attribute and relationship information of the target entities in the source entity and its high-confidence candidate subset in their respective knowledge graphs for each source entity and its high-confidence candidate subset, construct prompt words and input them into the large language model, and determine the aligned target entity from the high-confidence candidate subset through inference of the large language model.
[0018] A third aspect of this disclosure provides an electronic device including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the methods described above.
[0019] The large-scale knowledge graph entity alignment method, apparatus, and electronic device disclosed herein can achieve the following technical effects: This disclosure can be directly applied to real-world scenarios where labeled data is scarce or expensive to obtain, thereby reducing or eliminating the reliance on known seed-aligned entity pairs. Based on the semantic and structural information of the knowledge graph itself and the capabilities of general pre-trained models, this disclosure expands the applicability of entity alignment techniques without requiring additional supervised training. By introducing an approximate nearest neighbor index (such as an HNSW or IVF-PQ index built based on the FAISS library) for candidate entity recall, this disclosure reduces the computational complexity from O(n^2) to O(n^2). 2 This reduces the time complexity to O(nlogn). Furthermore, this disclosure reduces the storage complexity from O(n... 2The computation time is reduced to O(n·d) (where d is the vector dimension), thus lowering the system memory resource requirements. This disclosure improves the quality of the candidate set by filtering based on node degree, eliminating semantically similar but structurally mismatched noisy candidates. For special entities with sparse information or abnormal structures, a retrieval enhancement generation mechanism is introduced to supplement the latest external knowledge and improve the alignment accuracy.
[0020] The above-disclosed technical solutions only need to achieve one of the aforementioned effects, and it is not required that each technical solution achieve all of the aforementioned technical effects.
[0021] Furthermore, the effects of this disclosure include not only those set forth herein, but also other effects that will be apparent to those skilled in the art upon reference to the claims, the specification, and the accompanying drawings. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a large-scale knowledge graph entity alignment architecture diagram according to embodiments of the present disclosure.
[0024] Figure 2 This is a flowchart of a large-scale knowledge graph entity alignment method according to embodiments of the present disclosure.
[0025] Figure 3 This is a schematic diagram of the fusion of large models and retrieval enhancement generation according to embodiments of the present disclosure.
[0026] Figure 4 This is a block diagram of a large-scale knowledge graph entity alignment model according to embodiments of the present disclosure. Detailed Implementation
[0027] The technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this disclosure can also be combined with each other.
[0028] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0029] The embodiments of this disclosure will now be described with reference to the accompanying drawings.
[0030] Figure 1 This is a diagram of a large-scale knowledge graph entity alignment architecture according to embodiments of this disclosure. Figure 1 As shown, firstly, a source knowledge graph and a target knowledge graph to be aligned are input. Then, for each entity in the source and target knowledge graphs, semantic encoding and vectorization are performed. Specifically, the name and related attribute information of each entity are extracted, which are transformed into a structured text description. Then, a pre-trained semantic encoding model (such as the SentenceTransformer model) is used to convert the text description into a fixed-dimensional feature vector.
[0031] Subsequently, an initial candidate set is generated based on vector similarity retrieval. An approximate nearest neighbor index (e.g., an HNSW or IVF-PQ index implemented using the FAISS library) is constructed on the feature vector set of all entities in the target knowledge graph. For each entity in the source knowledge graph, its feature vector is used as the query to retrieve the top K target entities most similar to that source entity in the vector space, forming the initial candidate set for that source entity.
[0032] Next, the initial candidate set is screened based on node degree. The node degree (i.e., the number of directly connected relations) of each target entity in the source entity and its initial candidate set in their respective knowledge graphs is calculated. By analyzing the distribution of node degree of candidate entities and using interval matching for screening, those candidates that are consistent with the source entity in terms of structural scale constitute a high-confidence candidate subset, thereby effectively filtering out noisy candidates that are semantically similar but structurally mismatched, and improving the quality of the candidate set.
[0033] Finally, assisted reasoning using a fusion-based large language model is employed. For each source entity and its corresponding high-confidence candidate subset, detailed attributes and relational information of these entities are extracted from the knowledge graph, and prompt words are constructed. These prompt words are then input into the large language model, leveraging its powerful semantic understanding, knowledge association, and logical reasoning capabilities to analyze and discriminate the candidate subset, thereby identifying the precise alignment target entity from multiple high-confidence candidates. For particularly difficult entities identified during structure screening, retrieval enhancement generation techniques can be combined to incorporate external knowledge, further improving the accuracy of reasoning.
[0034] This method mainly consists of two stages. The first stage obtains a candidate set for alignment through vector similarity retrieval. The second stage, based on the candidate set with high confidence, utilizes a degree-based selection criterion and combines it with the powerful inference capabilities of a large model to perform alignment calibration. Ultimately, this achieves an efficient alignment method and system (or device) design with low memory dependency in unsupervised scenarios. The average time complexity of this method is [insert time complexity here]. Storage complexity ,in For the number of entities, For vector dimensions.
[0035] Figure 2 This is a flowchart of a large-scale knowledge graph entity alignment method according to embodiments of the present disclosure.
[0036] like Figure 2 As shown, the first aspect of this disclosure provides a large-scale knowledge graph entity alignment method, including the following steps: Step S1, converting the names and attribute information of entities in the source knowledge graph and the target knowledge graph into text descriptions, and using a pre-trained semantic encoding model to encode the text descriptions into fixed-dimensional semantic vectors; Step S3, constructing an approximate nearest neighbor index on the set of semantic vectors of target entities in the target knowledge graph, and for each source entity in the source knowledge graph, retrieving its semantic vector in the approximate nearest neighbor index, recalling the top K most similar target entities as an initial candidate set, where K is an integer greater than or equal to 1; Step S5, calculating the node degree of the source entity and each target entity in the initial candidate set, and filtering the initial candidate set based on the distribution of node degree to obtain a high-confidence candidate subset; and Step S7, for each source entity and its high-confidence candidate subset, extracting the attribute and relationship information of the target entities in their respective knowledge graphs, constructing prompt words and inputting them into a large language model, and determining the aligned target entity from the high-confidence candidate subset through reasoning of the large language model.
[0037] To achieve large-scale knowledge graph entity alignment, the unstructured entity information first needs to be transformed into a structured, computable numerical representation. "Semantic encoding" can refer to uniformly mapping or converting the names and attributes of each entity into a fixed-dimensional semantic vector.
[0038] In an exemplary embodiment, converting the names and attribute information of entities in the source knowledge graph and the target knowledge graph into text descriptions includes: obtaining the name of the entity; obtaining all attribute information of the entity in their respective knowledge graphs, the attribute information including attribute name and attribute value; sorting all attribute information according to the frequency of their attribute names in their respective knowledge graphs from high to low; concatenating each sorted attribute information in the order of attribute name and attribute value into an attribute description string; and concatenating the entity name with the attribute description string to obtain the text description of the entity.
[0039] Given the source knowledge graph as The target knowledge graph is For any entity among them Perform the following processing: entity The name is denoted as , To be with entities A set of related attribute triples. To highlight important attributes and suppress noise, the attribute triples can be sorted in descending order based on the frequency of each attribute name in the entire graph. Then, the sorted attributes are concatenated sequentially in the format of "attribute name - attribute value" to form an attribute description string. Its mathematical expression is:
[0040] The symbol ⊕ represents string concatenation, and ↑freq indicates sorting by frequency in ascending order (actually descending order). For string concatenation. Ultimately, the entity... Full text description It is formed by concatenating its name and attribute description string:
[0041] In an exemplary embodiment, encoding a text description into a fixed-dimensional semantic vector using a pre-trained semantic coding model includes: encoding the text description using the pre-trained semantic coding model to obtain an initial semantic vector; and normalizing the initial semantic vector to make its magnitude a unit length to obtain a fixed-dimensional semantic vector.
[0042] Get text description Then, it can be encoded using a pre-trained Sentence Transformer model (such as the LaBSE model). Input the LaBSE model to obtain an initial vector representation. This initial vector representation is then normalized to a magnitude of 1. This process can be described as follows:
[0043] in d For a vector with fixed dimensions, norm( The ) symbol represents the vector normalization operation. After normalization, the cosine similarity between two vectors can be directly calculated using the dot product, simplifying the subsequent similarity retrieval process.
[0044] In an exemplary embodiment, the pre-trained semantic encoding model includes the Sentence Transformer model.
[0045] To achieve efficient similarity retrieval of source entities among massive target entities, the Approximate Nearest Neighbor (ANN) indexing technique can be used to construct the query structure of the target entity set.
[0046] In an exemplary embodiment, recalling the top K most similar target entities as an initial candidate set includes: constructing an index structure on all semantic vectors of the target knowledge graph using the FAISS library; and for each source entity in the source knowledge graph, using its semantic vector as a query vector, performing an approximate nearest neighbor retrieval using the index structure, and returning the top K most similar target entities as the initial candidate set.
[0047] target entity set The set of embedding representations obtained after semantic encoding is An approximate nearest neighbor (ANN) index is constructed on this set of embeddings using the FAISS (Facebook AI Similarity Search) library. In practice, HNSW, IVF-PQ, etc. can be selected.
[0048] This index can be stored together with the original embedding representation. Its total storage requirement is proportional to the number of entities n and the embedding dimension d, and can be quantified as follows:
[0049] After the index is built, the candidate entity recall phase begins. For the source knowledge graph... Each entity in ∈Es, with its corresponding embedding vector As a query vector, an approximate nearest neighbor search is performed on the target entity index I.
[0050] The specific operation involves calling the query interface provided by FAISS to perform a Top-K nearest neighbor search. This search returns the result relative to the query vector. The K most similar target entities constitute the candidate alignment set for the source entity. That is, for each source-side entity With its embedding In the index A similarity search is performed to obtain a candidate set for the target side:
[0051] Here, K is the preset candidate set size, a constant much smaller than the total number of target entities n. This step quickly narrows down the potential matching targets from a massive number of candidates to a very small, highly relevant subset.
[0052] Thanks to the efficient design of the FAISS index, the average time complexity of a single near nearest neighbor query operation targeting a source entity can be reduced to O(log n). Therefore, the average complexity of each query is... The time complexity of the full recall phase is:
[0053] This complexity is far lower than the O(n) of existing techniques. 2 The storage complexity can be kept to O(n^2). Meanwhile, the storage complexity of the entire retrieval phase (including indexes and vectors) can be maintained at O(n^2). d).
[0054] After initial candidate recall based on vector similarity, a node-degree-based candidate filtering mechanism can be introduced to improve the structural consistency of the candidate set and reduce false matches. This mechanism utilizes the structural features of entities in the knowledge graph—node degree (i.e., the number of relation triples directly connected to the entity)—to filter the initial candidate set. Therefore, for each source entity... After obtaining the Top-K similar entities that match the target entity, a degree-based candidate set filtering mechanism can be constructed.
[0055] In an exemplary embodiment, calculating the node degree of the source entity and each target entity in the initial candidate set includes: constructing adjacency matrices for the source knowledge graph and the target knowledge graph respectively, wherein an element value of 1 in the adjacency matrix indicates that there is at least one relation triplet connection between the corresponding two entities, otherwise it is 0; and calculating the sum of the element values in the row or column corresponding to each entity in the source knowledge graph and the target knowledge graph as the node degree based on the adjacency matrix.
[0056] For source knowledge graph and target knowledge graph Each entity in the source and target knowledge graphs is then constructed with its corresponding adjacency matrix to formally represent the connectivity relationships within the graph. For each entity in both the source and target knowledge graphs, assuming any two entities... There is at least one relation triple connecting them. The value is 1 if the target knowledge graph is not in the source knowledge graph, and 0 otherwise. The final adjacency matrix is obtained from the source and target knowledge graphs. , .
[0057] For source knowledge graph Define its adjacency matrix Let the source entity set be... If it contains m entities, then Given an m×m matrix. Matrix elements. The value is determined based on:
[0058] in Similarly, for the target knowledge graph Construct its adjacency matrix The matrix has dimensions n×n (where n is the number of target entities), and its elements... Definition method and same.
[0059] Based on the adjacency matrix, the node degree of each entity can be calculated. For the source entity... Its node degree Defined as:
[0060] Right now The sum of all elements in the i-th row of the matrix reflects the entity. The number of directly related entities in the source graph. Similarly, for the target entity... Its node degree pass Obtained through matrix calculations.
[0061] By utilizing the structural features of entities in a knowledge graph—namely, the degree of a node (the number of relationships directly connected to that entity)—to perform structured screening of the initial candidate set, mismatches that may result from pure semantic similarity can be reduced.
[0062] In an exemplary embodiment, the initial candidate set is screened based on the distribution of node degree, including: sorting the node degree values of all target entities in the initial candidate set and dividing them into N intervals, where N is an integer greater than or equal to 1; determining whether the node degree value of the source entity falls into one of the N intervals; if so, retaining all target entities in the interval to form a high-confidence candidate subset; if not, marking the source entity as an entity to be enhanced.
[0063] For each source entity In the previous steps, the Top-K similar target entity candidate set has been obtained. This step aims to filter the candidate set using structural information.
[0064] First, obtain the candidate set. The degree of all target entities in the set constitutes the degree value set { |c∈ }. Subsequently, regarding The values in the set are sorted and divided into n equally divided intervals (e.g., n=3). The source entity is then identified. node degree Does it fall within one of the above intervals? If If a candidate entity falls into a certain interval, it is considered that the candidate entity within that interval is more similar to the source entity in terms of structure and size, and these candidate entities are retained to form a high-confidence candidate subset. .like If it does not fall into any range, then this source entity... Mark it as a special processing object (or entity to be enhanced) and add it to the entity set to be further processed. middle.
[0065] In an exemplary embodiment, for a source entity marked as an entity to be enhanced, determining the alignment target entity includes: retrieving supplementary information of the entity to be enhanced and each target entity in the initial candidate set from an external knowledge source; fusing the supplementary information with attribute and relation information extracted from their respective knowledge graphs to construct enhancement prompt words; and inputting the enhancement prompt words into a large language model for reasoning to determine the alignment target entity.
[0066] Through the above steps, a high-quality candidate set is obtained for each source entity. The next step is to consider how to select the target entity that matches the source entity from the candidate set. In the above steps, the construction of a candidate set based on feature similarity and a degree-based candidate set filtering mechanism mainly utilizes information from the source and target knowledge graphs. In the era of large-scale models, because they are usually pre-trained on massive and widely sourced corpora, they demonstrate good reasoning capabilities on many tasks. Therefore, by fusing external knowledge, namely, fusing large language models and retrieval-enhanced generation, the prediction accuracy can be further improved.
[0067] For each entity in the source knowledge graph, This allows us to obtain the attribute triples and relation triples of an entity in the graph as a description of that entity, and simultaneously, the candidate set for that entity. Similarly, we can obtain the attribute triples and relation triples of each entity in the target knowledge graph as descriptive information. This information is then integrated into the prompt word engineering and fed into the large model. Leveraging the powerful reasoning capabilities and rich knowledge of the large model, we can obtain the final output, which serves as the final prediction. .
[0068] Accordingly, for any source entity to be aligned and its filtered high-quality candidate set (The candidate set can contain one or more target entities), and the following operations can be performed to construct the input required for large language model inference: First, from the source knowledge graph Extract entities All relevant descriptive information, including attribute triples and relation triples, is collected. This information is then organized into a structured natural language description to comprehensively characterize the features of the source entity and its context within the graph.
[0069] Secondly, for the candidate set Each target candidate entity in In the same way from their respective target knowledge graphs Extract its attributes and relation triples, and generate the corresponding structured description.
[0070] Finally, by using a carefully designed prompt word template, the source entity description, all candidate target entity descriptions, and explicit task instructions are integrated to construct the final prompt word.
[0071] The constructed prompts are input into the selected large language model. Based on its massive internal parameterized knowledge and the structured graph information provided by the prompts, the large language model performs deep reasoning and analysis, ultimately outputting its judgment result. This result typically indicates the selected target entity in structured or natural language form. This output is the source entity. The final alignment prediction determined .
[0072] When the degree of the source entity and the candidate entity are not in the same range, although the true result may be in the candidate set, due to the lack of information (the degree is relatively small and some relationships are missing), directly feeding it to the large model may not yield accurate results. Considering the illusion of the large model and the timeliness of model training, a retrieval-based augmentation generation method can be used to assist the large model in prediction.
[0073] Specifically, in the candidate set filtering stage based on node degree, for those that are marked and assigned to the set... Source entities (i.e., whose node degree values do not fall within any interval of the degree values of their candidate entities) can trigger a retrieval enhancement generation mechanism to perform enhanced prediction. These entities typically imply that the information (relationships or attributes) they record in the graph may be sparse or incomplete (e.g., low degree values), making it insufficient for large language models to make reliable judgments based solely on internal graph information. Simultaneously, to alleviate the potential "illusion" problem of large language models and the timeliness limitations of their training data, up-to-date external information can be introduced. For sets... Each entity in the model and each entity in its candidate set can have its information enhanced by obtaining the latest information from platforms such as Wiki and DBpedia. The latest knowledge obtained, along with the attribute triples and relation triples contained within the knowledge graph, are designed into new prompt words and fed into the large model to obtain more accurate predictions.
[0074] Finally, through three stages of prediction—namely, candidate set construction based on vector similarity retrieval mechanism, candidate set filtering mechanism based on degree, and accurate prediction by fusing large language model and retrieval enhancement generation mechanism—accurate prediction is achieved for each entity. This allows for the final, accurate prediction. , .
[0075] For sets Each source entity to be processed and its corresponding candidate set The system accesses authoritative external knowledge bases (such as Wikipedia and DBpedia) and retrieves the latest and most comprehensive descriptive text, attribute information, and relevant facts about an entity by querying its name and key attributes. The retrieved external knowledge is then effectively fused and deduplicated with the internal attribute triples and relation triples extracted from the entity's original knowledge graph. Based on this fused multi-source information, enhanced prompts are reconstructed. These enhanced prompts are then input into a large language model. The large language model, by integrating internal structured knowledge with the latest external unstructured information, performs inference, enabling it to more accurately identify truly aligned entities from the candidate set and effectively overcome problems such as missing information and outdated knowledge.
[0076] Of the three steps, the one with the highest computational complexity is the vector similarity-based retrieval stage, with a computational complexity of O(log n). Meanwhile, the storage complexity is Here, n represents the number of entities in the knowledge graph, and d is the dimension of the feature vector. Both the computational and storage complexity are much smaller than existing methods. The larger n is, the more obvious the advantages of the method disclosed in this paper become.
[0077] Figure 3 This is a schematic diagram of the fusion large model and retrieval enhancement generation according to an embodiment of the present disclosure, illustrating how to perform differentiated processing on different types of entity sets after candidate set screening based on node degree in order to complete the final entity alignment prediction.
[0078] like Figure 3 As shown, after completing the "candidate set filtering based on node degree" step, the source entities are divided into two sets, and the corresponding inference processes are executed for each set: The first category consists of entity sets that satisfy the consistency principle. For source entities that pass the node consistency test, reasoning will be performed directly based on the internal information of the knowledge graph. Specifically, the attribute triples and relation triples of each target entity in the source entity and its high-confidence candidate subset are extracted from their respective knowledge graphs. This structured internal knowledge is organized and integrated into the prompt word engineering, forming instructions that include entity descriptions and comparison tasks. These prompt words are then input into the large language model. Leveraging its powerful semantic understanding, knowledge association, and logical reasoning capabilities, the large language model analyzes the candidate entities and identifies the aligned target entities that are most likely to refer to the same real-world object as the source entity.
[0079] The second category: Entity sets that do not satisfy the degree consistency principle. For source entities that fail the node degree consistency test (i.e., their node degree values do not fall within any distribution range of the node degrees of their candidate entities), it is determined that their internal graph information may be insufficient to support the large language model in making an accurate judgment. For such entities, a retrieval enhancement generation mechanism can be initiated. First, the latest and most comprehensive supplementary information about the source entity and its candidate entities is retrieved from authoritative external knowledge sources (such as Wikipedia, DBpedia, etc.). Then, the retrieved external enhanced information is effectively fused and deduplicated with the internal attribute and relation information extracted from the knowledge graph. Based on this fused multi-source knowledge, a more information-rich enhanced prompt word is reconstructed. Finally, this enhanced prompt word is input into the large language model. The large language model performs reasoning in an enhanced context that simultaneously possesses internal structured knowledge and the latest external unstructured description, thus enabling it to more accurately and reliably identify the true aligned entities from the candidate set.
[0080] Figure 4 This is a block diagram of a large-scale knowledge graph entity alignment model according to embodiments of the present disclosure. Figure 4As shown, the second aspect of this disclosure provides a large-scale knowledge graph entity alignment device, comprising: a semantic encoding module configured to convert the names and attribute information of entities in the source knowledge graph and the target knowledge graph into text descriptions, and to encode the text descriptions into fixed-dimensional semantic vectors using a pre-trained semantic encoding model; and an approximate retrieval module configured to construct an approximate nearest neighbor index on the set of semantic vectors of target entities in the target knowledge graph, and for each source entity in the source knowledge graph, to retrieve the top K most similar target entities as initial... The initial candidate set, where K is an integer greater than or equal to 1; the structure filtering module, configured to calculate the node degree of each target entity in the source entity and its initial candidate set, and filter the initial candidate set based on the distribution of node degree to obtain a high-confidence candidate subset; and the inference alignment module, configured to extract the attribute and relationship information of the target entities in the source entity and its high-confidence candidate subset in their respective knowledge graphs for each source entity and its high-confidence candidate subset, construct prompt words and input them into the large language model, and determine the aligned target entity from the high-confidence candidate subset through inference of the large language model.
[0081] The semantic encoding module receives input source and target knowledge graphs and is responsible for providing unified semantic representations of entities in both graphs. Specifically, the semantic encoding module first extracts the name and related attribute information of each entity, transforming this information into a structured text description. Then, it calls a pre-trained semantic encoding model (such as the SentenceTransformer model) to convert the text description into fixed-dimensional semantic vectors, and performs normalization on the generated vectors to ensure uniform magnitude, facilitating subsequent similarity calculations. The output of this module is a set of vectorized representations of the source and target entities.
[0082] The approximate retrieval module takes the set of semantic vectors of target entities as input and builds an efficient approximate nearest neighbor index on top of it, such as the HNSW or IVF-PQ index structure implemented using the FAISS library. For each source entity, this module uses its semantic vector as a query, performs a fast similarity retrieval in the index, and recalls the top K target entities most similar to the source entity, forming an initial candidate set. This module reduces the O(n²) complexity of traditional methods to [missing information]. .
[0083] The structure filtering module receives the initial candidate set output by the approximate retrieval module and incorporates graph structure information for filtering. The module first calculates the node degree of the source entity and each candidate entity in their respective graphs; then, based on the distribution of candidate entity node degrees, it performs interval partitioning and matching judgments, filtering out candidates whose node degrees are in the same interval as the source entity, forming a high-confidence candidate subset. This module improves the quality of the candidate set by filtering semantically similar but structurally mismatched noisy candidates through structural consistency checks.
[0084] The inference alignment module is responsible for alignment determination. For each source entity and its high-confidence candidate subset that passes the structure filter, this module extracts detailed attribute and relation triple information of these entities in their respective graphs to construct structured cue words. For entities that fail to match node degree, this module further combines the retrieval enhancement generation mechanism to obtain supplementary information from external knowledge sources and incorporate it into the cue words. The cue words are then input into the large language model, which utilizes its semantic understanding and inference capabilities to determine the alignment target entity from the candidate subset.
[0085] A third aspect of this disclosure provides an electronic device including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the methods described above.
[0086] The memory can be one or more of ROM, RAM, solid-state drive, hard disk, or other non-volatile or volatile storage media, used to store various types of data such as computer programs, knowledge graph data, intermediate vectors, index structures, candidate sets, node degree information, prompt word text, large language model parameters, and final alignment results.
[0087] The processor may be a central processing unit, a graphics processing unit, a tensor processor, a dedicated artificial intelligence chip, or a combination thereof, used to load and execute computer program instructions stored in memory. When the processor executes the computer program, it is configured to perform the following steps: convert the names and attribute information of entities in the source and target knowledge graphs into text descriptions, and encode the text descriptions into fixed-dimensional semantic vectors using a pre-trained semantic encoding model; construct an approximate nearest neighbor index on the set of semantic vectors of target entities in the target knowledge graph, and for each source entity in the source knowledge graph, retrieve the top K most similar target entities as an initial candidate set using their semantic vectors in the approximate nearest neighbor index, where K is an integer greater than or equal to 1; calculate the node degree of each target entity in the source entity and its initial candidate set, and filter the initial candidate set based on the distribution of node degree to obtain a high-confidence candidate subset; for each source entity and its high-confidence candidate subset, extract the attribute and relationship information of the target entities in their respective knowledge graphs, construct prompt words and input them into a large language model, and determine the aligned target entities from the high-confidence candidate subset through reasoning of the large language model.
[0088] Electronic devices can be servers, workstations, personal computers, mobile terminals, or cloud computing nodes. They can implement entity alignment methods in the form of software, hardware, or a combination of both, providing reliable basic alignment capabilities for upper-layer applications such as knowledge graph fusion, intelligent question answering, recommendation systems, and risk control analysis.
[0089] The entity alignment candidate set construction method based on vector similarity retrieval according to embodiments of this disclosure unifies the names and attribute information of entities in the knowledge graph into text descriptions, and uses a pre-trained semantic encoding model to encode the text descriptions into fixed-dimensional semantic vectors. Based on this, an approximate nearest neighbor indexing technique is used to construct a fast-querying index structure on the target entity vector set. For each source entity, its semantic vector is used to perform similarity retrieval in the index, recalling the top K most similar target entities as the initial candidate set. Compared with existing methods that require constructing and storing an n×n global similarity matrix and performing pairwise comparisons, the candidate set construction method proposed in this disclosure reduces the computational complexity from O(n²) to... This reduces the storage complexity from O(n²) to O(n·d), where n is the number of entities and d is the vector dimension. This provides an efficient solution for large-scale knowledge graph entity alignment.
[0090] According to the node-degree-based candidate set selection mechanism disclosed herein, the node degree of the source entity and each target entity in the initial candidate set is first calculated, and the initial candidate set is selected based on the distribution characteristics of the node degree. Specifically, by sorting the node degree values of the candidate entities and dividing them into N intervals, it is determined whether the node degree value of the source entity falls within a certain interval, thereby dividing the candidate entities into two sets: those that satisfy the degree consistency principle and those that do not. For entities that satisfy the degree consistency principle, prompt words are directly constructed based on the internal information of the knowledge graph and input into the large language model for inference; for entities that do not satisfy the degree consistency principle, retrieval enhancement generation technology is adopted to obtain supplementary information from external knowledge sources before inference by the large language model. On the one hand, the structural consistency quality of the candidate set is improved by node degree selection, reducing the number of noisy candidates that the large language model needs to process; on the other hand, the differentiated processing strategy avoids external retrieval and token consumption for all entities, and only enables retrieval enhancement for entities with abnormal structures or sparse information, significantly reducing the computational cost while ensuring alignment accuracy.
[0091] Since this invention provides a general method for large-scale knowledge graph entity alignment, the range of models and parameters involved is relatively broad. The pre-trained semantic encoding model introduced in this paper can be a general pre-trained model (e.g., LaBSE). When using a large language model to assist in reasoning, a general large language model (e.g., Tongyi Qianwen) can be used. When setting the candidate set, the parameter K can be set between [5, 15], and when filtering based on degree consistency, the parameter n can be set between [3, 8]. During large model reasoning, in order to reduce token consumption, the large model can only output the alignment results, such as designing a prompt to directly feed to the large model, and the large model outputs the aligned entity pairs (source entity ID, target entity ID). Since the timeliness of large model training and the scale of parameters are different, a model with a larger number of parameters and the latest technology can be used when resources are sufficient.
[0092] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles used, and is not intended to limit the scope of the claimed disclosure, but only to illustrate preferred embodiments of this disclosure. Those skilled in the art should understand that the scope of the invention involved in this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalent features without departing from the inventive concept. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.
Claims
1. A method for aligning entities in a large-scale knowledge graph, characterized in that, Includes the following steps: The names and attribute information of entities in the source knowledge graph and the target knowledge graph are converted into text descriptions, and the text descriptions are encoded into fixed-dimensional semantic vectors using a pre-trained semantic encoding model. An approximate nearest neighbor index is constructed on the set of semantic vectors of the target entities in the target knowledge graph. For each source entity in the source knowledge graph, its semantic vector is searched in the approximate nearest neighbor index, and the top K most similar target entities are recalled as the initial candidate set, where K is an integer greater than or equal to 1. Calculate the node degree of the source entity and each target entity in its initial candidate set; based on the distribution of node degrees, filter the initial candidate set to obtain a high-confidence candidate subset; and For each source entity and its high-confidence candidate subset, the attribute and relationship information of the target entity in their respective knowledge graphs are extracted. Prompt words are constructed and input into a large language model. Through the reasoning of the large language model, the aligned target entity is determined from the high-confidence candidate subset.
2. The method according to claim 1, characterized in that, Converting the names and attribute information of entities in the source and target knowledge graphs into text descriptions includes: Get the name of the entity; Obtain all attribute information of the entity in its respective knowledge graph, the attribute information including attribute name and attribute value; Sort all attribute information in descending order of the frequency of their attribute names in their respective knowledge graphs; Each sorted attribute information is concatenated into an attribute description string by combining the attribute name and attribute value in that order. The entity's name is concatenated with the attribute description string to obtain the entity's text description.
3. The method according to claim 1 or 2, characterized in that, Encoding the text description into a fixed-dimensional semantic vector using a pre-trained semantic encoding model includes: The text description is encoded using a pre-trained semantic encoding model to obtain an initial semantic vector; and The initial semantic vector is normalized so that its magnitude is changed to a unit length, thus obtaining the fixed-dimensional semantic vector.
4. The method according to claim 3, characterized in that, The pre-trained semantic encoding model includes the SentenceTransformer model.
5. The method according to claim 1, characterized in that, The K most similar target entities selected before recall as the initial candidate set include: Use the FAISS library to build an index structure on all semantic vectors of the target knowledge graph; and For each source entity in the source knowledge graph, its semantic vector is used as the query vector. The index structure is used to perform an approximate nearest neighbor retrieval, and the top K target entities with the highest similarity are returned as the initial candidate set.
6. The method according to claim 1, characterized in that, The calculation of the node degree of the source entity and each target entity in its initial candidate set includes: For the source knowledge graph and the target knowledge graph, their adjacency matrices are constructed respectively. The element value of the adjacency matrix is 1, which means that there is at least one relation triplet connection between the corresponding two entities, and 0 otherwise. Based on the adjacency matrix, the sum of the element values in the row or column corresponding to each entity in the source knowledge graph and the target knowledge graph is calculated as the node degree.
7. The method according to claim 6, characterized in that, The initial candidate set is filtered based on the distribution of node degree, including: Sort the node degree values of all target entities in the initial candidate set and divide them into N intervals, where N is an integer greater than or equal to 1; Determine whether the node degree value of the source entity falls into one of the N intervals; If so, all target entities within the interval are retained to form the high-confidence candidate subset; If not, then mark the source entity as the entity to be enhanced.
8. The method according to claim 7, characterized in that, For the source entity marked as the entity to be enhanced, determining the alignment target entity includes: Retrieve supplementary information about the entity to be enhanced and each target entity in the initial candidate set from external knowledge sources; The supplementary information is then fused with the attribute and relationship information extracted from their respective knowledge graphs to construct enhanced prompt words; The enhanced prompts are input into a large language model for inference to determine the alignment target entity.
9. A large-scale knowledge graph entity alignment device, characterized in that, include: The semantic encoding module is configured to convert the names and attribute information of entities in the source knowledge graph and the target knowledge graph into text descriptions, and to encode the text descriptions into fixed-dimensional semantic vectors using a pre-trained semantic encoding model. The approximate retrieval module is configured to construct an approximate nearest neighbor index on the set of semantic vectors of target entities in the target knowledge graph. For each source entity in the source knowledge graph, its semantic vector is used to retrieve the top K most similar target entities as an initial candidate set, where K is an integer greater than or equal to 1. A structure filtering module is configured to calculate the node degree of the source entity and each target entity in its initial candidate set, and based on the distribution of node degrees, to filter the initial candidate set to obtain a high-confidence candidate subset; and The inference alignment module is configured to extract the attribute and relationship information of the target entity in the respective knowledge graph for each source entity and its high-confidence candidate subset, construct prompt words and input them into the large language model, and determine the alignment target entity from the high-confidence candidate subset through inference of the large language model.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 8.