Model training method, entity alignment method, device, equipment, medium and product

By obtaining the entity pre-aligned annotation samples of the knowledge graph, generating and training the entity alignment model, it solves the problem in the existing technology that entity alignment requires a large number of annotated samples, and improves the accuracy and efficiency of entity alignment.

CN118690845APending Publication Date: 2024-09-24JINGDONG CITY BEIJING DIGITS TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411161921.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

Existing technologies require a large number of high-quality annotated samples for entity alignment, resulting in high sample costs, and the inability to achieve precise matching and fusion of entities between knowledge graphs from different sources, resulting in low accuracy of entity alignment.

Method used

By obtaining pre-aligned annotation samples for entities of at least two knowledge graphs, generating an initial entity alignment model and loss information, performing model training to generate a redistribution label set, and then training a second initial entity alignment model to achieve accurate training of the model. Reduce dependence on labeled samples.

Benefits of technology

Generate a more accurate entity alignment model with fewer samples, improve the accuracy of entity alignment, reduce sample costs, and achieve accurate matching and fusion of entities between knowledge graphs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690845A
    Figure CN118690845A
Patent Text Reader

Abstract

The embodiment of the invention discloses a model training method and device, an entity alignment method and device, equipment, a medium and a product. One specific embodiment of the method comprises the following steps: acquiring at least one labeling sample which aims at at least two knowledge maps and is subjected to entity pre-alignment; generating first loss information and first entity alignment information for the first initial entity alignment model according to the at least one labeling sample; according to the first entity alignment information, generating a redistribution label set, and generating second loss information for a second initial entity alignment model; and performing model training for the first initial entity alignment model and the second initial entity alignment model according to the first loss information and the second loss information to generate a first entity alignment model and a second entity alignment model. The implementation mode is related to artificial intelligence, and the first entity alignment model and the second entity alignment model which are more accurate in entity alignment can be generated under the condition that the number of samples is small.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to a model training method, an entity alignment method, an apparatus, a device, a medium, and a product. Background Art

[0002] Entity alignment is a crucial core technology within the broader field of knowledge graphs (KGs). Its core mission is to identify and integrate different entries representing the same real-world entity across knowledge graphs from multiple sources. Entity alignment across multi-source knowledge graphs is typically achieved using an embedding representation method based on the TransE (Translating Embedding) model.

[0003] However, the inventors have discovered that when using the above method to achieve entity alignment, the following technical problems often arise: A large number of high-quality annotated samples are required for model training, which results in high sample costs. In addition, entities cannot be accurately matched and fused between knowledge graphs from different sources, resulting in low entity alignment accuracy.

[0004] The above information disclosed in this Background section is only for enhancement of understanding of the background of the inventive concept and therefore it may contain information that does not form the prior art that is already known in this country to a person of ordinary skill in the art. Summary of the Invention

[0005] The content of this disclosure is used to briefly introduce concepts that will be described in detail in the detailed description section below. The content of this disclosure is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0006] Some embodiments of the present disclosure propose model training methods, entity alignment methods, devices, equipment, media and products to solve the technical problems mentioned in the above background technology section.

[0007] In a first aspect, some embodiments of the present disclosure provide a model training method, including: obtaining at least one labeled sample of entity pre-alignment for at least two knowledge graphs, wherein the knowledge graphs among the at least two knowledge graphs are knowledge graphs to be entity aligned; generating first loss information and first entity alignment information for a first initial entity alignment model based on the at least one labeled sample; generating a reallocated label set based on the first entity alignment information; generating second loss information for a second initial entity alignment model based on the reallocated label set; performing model training for the first initial entity alignment model and the second initial entity alignment model based on the first loss information and the second loss information to generate a first entity alignment model and a second entity alignment model.

[0008] Optionally, the above-mentioned generating first loss information and first entity alignment information for the first initial entity alignment model based on the above-mentioned at least one labeled sample includes: vectorizing each entity and entity relationship in the above-mentioned at least two knowledge graphs to generate entity vectors and entity relationship vectors, and obtaining entity vector sets and entity relationship vector sets; inputting the above-mentioned entity vector sets and the above-mentioned entity relationship vector sets into the above-mentioned first initial entity alignment model to generate the above-mentioned first entity alignment information; generating the above-mentioned first loss information based on the above-mentioned at least one labeled sample and the above-mentioned first entity alignment information.

[0009] Optionally, the above-mentioned first initial entity alignment model includes: an initial coding layer and an initial alignment reasoning layer; and the above-mentioned entity vector set and the above-mentioned entity relationship vector set are input into the above-mentioned first initial entity alignment model to generate the above-mentioned first entity alignment information, and also includes: obtaining at least one graph anchor point position corresponding to the above-mentioned at least one labeled sample; inputting the above-mentioned at least one graph anchor point position, the above-mentioned entity vector set and the above-mentioned entity relationship vector set into the above-mentioned initial coding layer to generate a graph fusion matrix; inputting the above-mentioned graph fusion matrix into the above-mentioned initial alignment reasoning layer to generate the above-mentioned alignment matrix as the above-mentioned first entity alignment information.

[0010] Optionally, the above-mentioned initial coding layer includes: an initial position coding layer and an initial attention mechanism model; and the above-mentioned at least one graph anchor position, the above-mentioned entity vector set and the above-mentioned entity relationship vector set are input into the above-mentioned initial coding layer to generate a graph fusion matrix, including: using the above-mentioned initial position coding layer to position encode the above-mentioned at least one graph anchor position to generate at least one anchor position coding information; based on the above-mentioned at least one anchor position coding information, using the above-mentioned initial attention mechanism model to generate at least one initial attention mechanism vector; based on the above-mentioned at least one initial attention mechanism vector, the above-mentioned entity vector set and the above-mentioned entity relationship vector set, generate the above-mentioned graph fusion matrix.

[0011] Optionally, the above-mentioned graph fusion matrix is ​​input into the above-mentioned initial alignment reasoning layer to generate the above-mentioned alignment matrix, including: using the above-mentioned initial alignment reasoning layer to generate a similarity matrix corresponding to the above-mentioned graph fusion matrix; and aligning the above-mentioned similarity matrix to generate the above-mentioned alignment matrix.

[0012] Optionally, the above-mentioned generating second loss information for the second initial entity alignment model based on the above-mentioned reallocated label set includes: performing model training on the above-mentioned second initial entity alignment model according to the above-mentioned reallocated label set to generate a second entity alignment model after preliminary training; using the above-mentioned second entity alignment model after preliminary training to generate second entity alignment information for the above-mentioned at least two knowledge graphs; generating entity alignment probability information based on the above-mentioned second entity alignment information; generating a pseudo label set based on the above-mentioned entity alignment probability information; and generating the above-mentioned second loss information for the above-mentioned second entity alignment information based on the above-mentioned pseudo label set and the above-mentioned reallocated label set.

[0013] Optionally, the above-mentioned generating a pseudo label set based on the above-mentioned entity alignment probability information includes: performing entity consistency evaluation on the above-mentioned entity alignment probability information to generate consistency evaluation information; adjusting the above-mentioned entity alignment probability information based on the above-mentioned consistency evaluation information to generate adjusted entity alignment probability information; generating the above-mentioned pseudo label set based on the above-mentioned entity alignment probability information.

[0014] Optionally, generating the pseudo label set according to the entity alignment probability information includes: performing label optimization adjustment on an initial pseudo label set corresponding to the entity alignment probability information according to dependency relationships between entities to generate the pseudo label set.

[0015] In a second aspect, some embodiments of the present disclosure provide a model training device, comprising: a first acquisition unit, configured to acquire at least one labeled sample of entity pre-alignment for at least two knowledge graphs, wherein the knowledge graphs in the at least two knowledge graphs are knowledge graphs to be entity aligned; a first generation unit, configured to generate first loss information and first entity alignment information for a first initial entity alignment model based on the at least one labeled sample; a second generation unit, configured to generate a reallocated label set based on the first entity alignment information; a third generation unit, configured to generate second loss information for a second initial entity alignment model based on the reallocated label set; a training unit, configured to perform model training for the first initial entity alignment model and the second initial entity alignment model based on the first loss information and the second loss information to generate a first entity alignment model and a second entity alignment model.

[0016] Optionally, the first generation unit can be configured to: vectorize each entity and entity relationship in the above-mentioned at least two knowledge graphs to generate entity vectors and entity relationship vectors, and obtain entity vector sets and entity relationship vector sets; input the above-mentioned entity vector sets and the above-mentioned entity relationship vector sets into the above-mentioned first initial entity alignment model to generate the above-mentioned first entity alignment information; generate the above-mentioned first loss information based on the above-mentioned at least one labeled sample and the above-mentioned first entity alignment information.

[0017] Optionally, the above-mentioned first initial entity alignment model includes: an initial coding layer and an initial alignment reasoning layer; and the first generation unit can be configured to: obtain at least one graph anchor point position corresponding to the above-mentioned at least one labeled sample; input the above-mentioned at least one graph anchor point position, the above-mentioned entity vector set and the above-mentioned entity relationship vector set into the above-mentioned initial coding layer to generate a graph fusion matrix; input the above-mentioned graph fusion matrix into the above-mentioned initial alignment reasoning layer to generate an alignment matrix as the above-mentioned first entity alignment information.

[0018] Optionally, the above-mentioned initial encoding layer includes: an initial position encoding layer and an initial attention mechanism model; and the first generation unit can be configured to: use the above-mentioned initial position encoding layer to position encode the above-mentioned at least one graph anchor point position to generate at least one anchor point position encoding information; based on the above-mentioned at least one anchor point position encoding information, use the above-mentioned initial attention mechanism model to generate at least one initial attention mechanism vector; based on the above-mentioned at least one initial attention mechanism vector, the above-mentioned entity vector set and the above-mentioned entity relationship vector set, generate the above-mentioned graph fusion matrix.

[0019] Optionally, the first generation unit may be configured to: generate a similarity matrix corresponding to the graph fusion matrix using the initial alignment inference layer; and perform alignment processing on the similarity matrix to generate the alignment matrix.

[0020] Optionally, the third generation unit can be configured to: perform model training on the above-mentioned second initial entity alignment model according to the above-mentioned reallocated label set to generate a second entity alignment model after preliminary training; use the above-mentioned second entity alignment model after preliminary training to generate second entity alignment information for the above-mentioned at least two knowledge graphs; generate entity alignment probability information based on the above-mentioned second entity alignment information; generate a pseudo label set based on the above-mentioned entity alignment probability information; generate the above-mentioned second loss information for the above-mentioned second entity alignment information based on the above-mentioned pseudo label set and the above-mentioned reallocated label set.

[0021] Optionally, the third generation unit can be configured to: perform entity consistency evaluation on the above-mentioned entity alignment probability information to generate consistency evaluation information; adjust the above-mentioned entity alignment probability information based on the above-mentioned consistency evaluation information to generate adjusted entity alignment probability information; and generate the above-mentioned pseudo label set based on the above-mentioned entity alignment probability information.

[0022] Optionally, the third generating unit may be configured to: perform label optimization adjustment on the initial pseudo label set corresponding to the entity alignment probability information according to the dependency relationship between entities, so as to generate the pseudo label set.

[0023] In a third aspect, some embodiments of the present disclosure provide an entity alignment method, including: obtaining at least two target knowledge graphs; using a pre-trained first entity alignment model and a second entity alignment model to perform entity alignment on the at least two target knowledge graphs to obtain an entity alignment result, wherein the first entity alignment model and the second entity alignment model are generated based on a model training method.

[0024] In a fourth aspect, some embodiments of the present disclosure provide an entity alignment device, comprising: a second acquisition unit, configured to acquire at least two target knowledge graphs; an entity alignment unit, configured to use a pre-trained first entity alignment model and a second entity alignment model to perform entity alignment on the at least two target knowledge graphs to obtain an entity alignment result, wherein the first entity alignment model and the second entity alignment model are generated based on a model training method.

[0025] In a fifth aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any one of the implementation methods in the first and third aspects.

[0026] In a sixth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any one of the implementation modes of the first and third aspects is implemented.

[0027] In a seventh aspect, some embodiments of the present disclosure provide a computer program product, including a computer program, which implements the method described in any implementation manner in the above-mentioned first aspect when executed by a processor.

[0028] The above-described embodiments of the present disclosure have the following beneficial effects: The model training methods of some embodiments of the present disclosure can generate a first entity alignment model and a second entity alignment model with more accurate entity alignment using fewer samples. Specifically, the low accuracy of related entity alignment methods is due to the high sample cost of requiring a large number of high-quality annotated samples for model training. Furthermore, entities cannot be accurately matched and fused between knowledge graphs from different sources, resulting in low entity alignment accuracy. Based on this, the model training methods of some embodiments of the present disclosure first obtain at least one annotated sample for entity pre-alignment for at least two knowledge graphs. One of the knowledge graphs in the at least two knowledge graphs is the knowledge graph to be entity aligned. The at least one annotated sample is used as a training label set for a first initial entity alignment model to facilitate subsequent preliminary training of the first initial entity alignment model. Then, based on the at least one annotated sample, first loss information and first entity alignment information are generated for the first initial entity alignment model. The first entity alignment information can be used to subsequently generate a reallocated label set. The first loss information is used for subsequent training of the first and second initial entity alignment models. Then, based on the above-mentioned first entity alignment information, a reallocated label set can be accurately generated. Here, by generating a reallocated label set, the label set of the subsequent second initial entity alignment model is used so that the second initial entity alignment model does not need to be annotated with an additional label set to achieve accurate training of the model. Furthermore, based on the above-mentioned reallocated label set, second loss information for the second initial entity alignment model is generated for the subsequent training of the first initial entity model and the second initial entity alignment model. Finally, based on the above-mentioned first loss information and the above-mentioned second loss information, model training for the above-mentioned first initial entity alignment model and the above-mentioned second initial entity alignment model is performed to accurately generate the first entity alignment model and the second entity alignment model. In summary, based on at least one labeled sample, weakly supervised learning of the first initial entity alignment model and self-supervised learning of the second initial alignment model can be achieved to generate the first entity alignment model and the second entity alignment model with more accurate entity alignment using a small number of samples. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0030] Figure 1 is a schematic diagram of an application scenario of the model training method according to some embodiments of the present disclosure; Figure 2 is a flowchart of some embodiments of the model training method according to the present disclosure; Figure 3 is a schematic diagram of at least one labeled sample in some embodiments of the model training method according to the present disclosure; Figure 4 is a flowchart of other embodiments of the model training method according to the present disclosure; Figure 5 is a flow chart of some embodiments of the entity alignment method according to the present disclosure; Figure 6 is a schematic structural diagram of some embodiments of the model training device according to the present disclosure; Figure 7 is a schematic structural diagram of some embodiments of the entity alignment device according to the present disclosure; Figure 8 It is a structural diagram of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0031] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0032] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other.

[0033] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0034] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0035] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0036] With regard to the collection, storage, and use of user personal information (e.g., knowledge graphs) involved in this disclosure, before performing the corresponding operations, the relevant organizations or individuals shall fulfill their obligations, including conducting personal information security impact assessments, fulfilling the obligation to inform the personal information subjects, and obtaining the authorization and consent of the personal information subjects in advance.

[0037] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0038] Figure 1 It is a schematic diagram of an application scenario of the model training method according to some embodiments of the present disclosure.

[0039] exist Figure 1 In the application scenario, first, the electronic device 101 can obtain at least one labeled sample 103 for entity pre-alignment of at least two knowledge graphs 102. Among them, the knowledge graphs in the at least two knowledge graphs 102 are knowledge graphs to be entity aligned. In this application scenario, the at least two knowledge graphs 102 include: knowledge graph KG1 and knowledge graph KG2. Then, the electronic device 101 can generate first loss information 104 and first entity alignment information 111 for the first initial entity alignment model 106 based on the at least one labeled sample 103. Next, the electronic device 101 can generate a reallocated label set 105 based on the first entity alignment information 111. Furthermore, the electronic device 101 can generate second loss information 107 for the second initial entity alignment model 108 based on the first loss information 104 and the reallocated label set 105. Finally, the electronic device 101 may perform model training on the first initial entity alignment model 106 and the second initial entity alignment model 108 according to the first loss information 104 and the second loss information 107 to generate a first entity alignment model 109 and a second entity alignment model 110 .

[0040] It should be noted that the electronic device 101 can be hardware or software. When the electronic device is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or it can be implemented as a single server or a single terminal device. When the electronic device is embodied as software, it can be installed in the hardware devices listed above. It can be implemented as multiple software or software modules for providing distributed services, for example, or it can be implemented as a single software or software module. No specific limitation is made here.

[0041] It should be understood that Figure 1 The number of electronic devices in the embodiment is merely illustrative. Any number of electronic devices may be provided according to implementation requirements.

[0042] Continue to refer Figure 2, shows a process 200 of some embodiments of the model training method according to the present disclosure. The model training method includes the following steps: Step 201: Obtain at least one labeled sample of entity pre-alignment for at least two knowledge graphs.

[0043] In some embodiments, the execution entity of the above model training method (for example Figure 1 The electronic device 101 shown can obtain at least one pre-entity-aligned annotated sample for at least two knowledge graphs via a wired or wireless connection. The at least two knowledge graphs can be sourced from multiple sources. One of the at least two knowledge graphs is the knowledge graph to be entity aligned. Entity alignment significantly improves data integration capabilities. By identifying identical real-world entities across sources, it resolves information silos and promotes data interoperability and consistency. This process not only enhances the breadth and depth of knowledge graph coverage but also improves the decision-making accuracy of services and applications, such as intelligent recommendations and semantic search, further advancing the understanding and responsiveness of artificial intelligence systems. Entity alignment also serves as the foundation for multi-source knowledge fusion, providing an effective mechanism for the dynamic expansion and updating of knowledge graphs, ensuring the continuous optimization and value-added of knowledge resources. The annotated sample can be a sample of aligned entity groups from the at least two knowledge graphs. The entities in the entity group have a one-to-one correspondence with the knowledge graphs in the at least two knowledge graphs.

[0044] See also Figure 3 , showing a schematic diagram of at least one labeled sample. At least two knowledge graphs include: knowledge graph KG1 and knowledge graph KG2. The "Tongzhou" entity in knowledge graph KG1 is pre-aligned with the "Tongzhou District" entity in knowledge graph KG2. The corresponding generated labeled sample can be "Tongzhou, Tongzhou District". The "Majuqiao" entity in knowledge graph KG1 is pre-aligned with the "Majuqiao Town" entity in knowledge graph KG2. The corresponding generated labeled sample can be "Majuqiao, Majuqiao Town". The "Fuli Community" entity in knowledge graph KG1 is not aligned with the "Fuli Shangyueju" entity in knowledge graph KG2.

[0045] Step 202: Generate first loss information and first entity alignment information for a first initial entity alignment model based on the at least one labeled sample.

[0046] In some embodiments, the execution entity may generate first loss information and a reallocated label set for a first initial entity alignment model based on the at least one labeled sample. The first initial entity alignment model may be a first entity alignment model that has not yet been trained. The first entity alignment model may be a neural network model that aligns entities between knowledge graphs. The first entity alignment model may be a weakly supervised model. In practice, the first entity alignment model may be a Generative Adversarial Networks (GAN) model. The first loss information may be a loss value output by a loss function corresponding to the first initial entity alignment model. The first entity alignment information may be information that characterizes the alignment of entities corresponding to at least two knowledge graphs. In practice, the first entity alignment information may be information in the form of a matrix.

[0047] As an example, first, the execution entity may encode entities and entity relationships of at least two knowledge graphs to generate an entity vector set and an entity relationship vector set. Then, based on the entity vector set, the entity relationship vector set and the at least one annotated sample, the initial entity alignment model is initially trained to generate a first initial entity alignment model after initial training. Next, the entity vector set and the entity relationship vector set are input into the first initial entity alignment model after initial training to generate the first entity alignment information. Finally, based on the alignment result corresponding to the first entity alignment information and at least one annotated sample, the cross entropy loss function is used to generate the first loss information.

[0048] Step 203: Generate a reallocated label set based on the first entity alignment information.

[0049] In some embodiments, the execution entity may generate a reallocated label set based on the first entity alignment information, wherein the reallocated label set may be a label set that is reselected based on the first entity alignment information and represents entity alignments with a higher probability.

[0050] As an example, first, the execution entity may filter out elements whose corresponding element values ​​are greater than a target probability value from the probability matrix corresponding to the first entity alignment information to obtain at least one element. The first entity alignment information may be information in a matrix format in which the corresponding element values ​​are between 0 and 1. The element values ​​represent the entity content matching relationship between the corresponding multiple entities. The larger the element value, the greater the matching between the corresponding entities. Next, at least one entity pair corresponding to the at least one element is determined. Based on the at least one entity pair, a reallocated label set is generated.

[0051] Step 204 : Generate second loss information for the second initial entity alignment model based on the reallocated label set.

[0052] In some embodiments, the execution entity may generate second loss information for a second initial entity alignment model based on the reallocated label set. The second initial entity alignment model may be a second entity alignment model that has not yet been trained. The second entity alignment model may be a self-supervised model. The second entity alignment model may be any of various self-supervised neural network models. For example, the second entity alignment model may be a generative adversarial network model.

[0053] As an example, the execution entity may first input the entity vector set and the entity relationship vector set into the second initial entity alignment model to generate an output result. Then, based on the output result and the reallocated label set, the target loss function is used to generate second loss information.

[0054] In some optional implementations of some embodiments, the execution entity may generate second loss information for the second initial entity alignment model based on the reallocated label set, which may include the following steps: In the first step, the second initial entity alignment model is trained according to the reallocated label set to generate a preliminarily trained second entity alignment model.

[0055] As an example, the execution entity may perform model training on the second initial entity alignment model based on the entity set vectors and entity relationship vector sets corresponding to the reallocated label set and at least two knowledge graphs to generate a preliminarily trained second entity alignment model.

[0056] In the second step, the second entity alignment model, after preliminary training, is used to generate second entity alignment information for the at least two knowledge graphs. The second entity alignment information can represent the entity alignment between the at least two knowledge graphs. In practice, the second entity alignment information can be a similarity matrix composed of matrix elements representing the entity similarities between the at least two knowledge graphs. Similar to the first entity alignment information, the matrix elements can represent the degree of similarity between the entities in the entity pair. The corresponding element values ​​of the matrix elements are numerical values ​​between 0 and 1, with larger numerical values ​​corresponding to higher similarity.

[0057] As an example, the above-mentioned execution entity can input the entity vector set and entity relationship vector set corresponding to at least two knowledge graphs into the second entity alignment model after the above-mentioned preliminary training to generate second entity alignment information for the above-mentioned at least two knowledge graphs.

[0058] In the third step, entity alignment probability information is generated based on the second entity alignment information. The entity alignment probability information can represent the degree of entity similarity between entities in at least two knowledge graphs. The higher the degree of entity similarity between two entities, the closer the two entities are. Specifically, the at least two knowledge graphs include a first knowledge graph and a second knowledge graph. The entity alignment probability information can represent the probability of alignment between each entity in the first knowledge graph and each entity in the second knowledge graph.

[0059] As an example, the execution entity may split the second entity alignment information to generate similarity information between each entity. The obtained similarity information between each entity, the entity vector set, and the entity relationship vector set are then input into a multi-layer fully connected layer to generate entity alignment probability information.

[0060] As another example, at least two knowledge graphs include: a first knowledge graph and a second knowledge graph. The entity set corresponding to the first knowledge graph is a source entity set E. The entity set corresponding to the second knowledge graph is a target entity set E'. The entity in the source entity set E is e. The entity in the target entity set E' is e'.

[0061] The entity alignment probability information is determined by the following formula: .

[0062] in, Represents the target entity With source entity Class labels during alignment. It can be in The target entity With source entity The probability information between them. Is the target entity With source entity The linear change information of entity similarity between them. The target entity set is E' except for the entity entities outside of . is an entity With source entity The linear change information of entity similarity between them.

[0063] in, .

[0064] Represents the similarity between the source entity and the target entity after alignment training (i.e., obtained by querying each element in the second entity alignment information). and is the linear transformation hyperparameter.

[0065] The fourth step is to generate a pseudo label set based on the above entity alignment probability information.

[0066] As an example, first, the execution entity may select at least one entity pair with a probability greater than a preset probability from each alignment probability in the entity alignment probability information, annotate the at least one entity pair with an entity alignment label, and generate at least one pseudo label set.

[0067] In the fifth step, the second loss information for the second entity alignment information is generated based on the pseudo label set and the reallocated label set.

[0068] As an example, the execution entity may first perform label fusion on the pseudo label set and the reallocated label set to generate a fused label set. Then, based on the fused label set, the preliminarily trained second entity alignment model or the second initial entity alignment model is trained to generate second loss information.

[0069] Optionally, the execution entity may generate a pseudo label set according to the entity alignment probability information, which may include the following steps: In the first step, the entity alignment probability information is subjected to entity consistency evaluation to generate consistency evaluation information, wherein the consistency evaluation information can represent the consistency detection status between each entity.

[0070] Specifically, due to the large scale of knowledge graphs, it is difficult to directly evaluate the consistency of entity alignment. To address this difficulty in directly testing the compatibility of a large number of entity mappings, this application uses a graph model-based method to evaluate the consistency of predicted alignment. The specific steps are as follows: (1) Evaluate local consistency: Based on the dependencies between entities and their neighboring entities, check whether each entity to be aligned is compatible with its neighboring entities. For example, if the neighbors of two entities have the same graph structure, then the two entities are likely to be equal.

[0071] (2) Quantifying consistency: By computing the alignment probabilities of a given entity and its neighboring entities, and using these probabilities to evaluate the consistency of the alignment.

[0072] (3) Overall consistency: The local consistency of all entities is aggregated through the graph model to evaluate the consistency of the predicted entity alignment as a whole.

[0073] In the second step, the entity alignment probability information is adjusted according to the consistency evaluation information to generate adjusted entity alignment probability information.

[0074] As an example, the execution entity may adaptively adjust the entity alignment probability information according to information in the consistency evaluation information indicating problems in the corresponding relationship of the evaluation entities, so as to generate adjusted entity alignment probability information.

[0075] The third step is to generate the above pseudo label set based on the above entity alignment probability information.

[0076] As an example, the execution entity may generate the pseudo label set according to the entity alignment probability information by generating a unidirectional pseudo mapping based on a probability threshold, generating a bidirectional pseudo mapping based on a probability threshold, or using both unidirectional and bidirectional pseudo mappings.

[0077] Optionally, the execution entity may perform label optimization adjustment on the initial pseudo label set corresponding to the entity alignment probability information according to the dependency relationship between entities, so as to generate the pseudo label set.

[0078] Specifically, in order to improve the overall alignment consistency to obtain more accurate predictions, this application adopts dependency-aware prediction for prediction. By considering the dependencies between entities, the pseudo labels generated during the self-training process are optimized, thereby improving the accuracy of entity alignment. Specifically, the above-mentioned execution entity can indirectly minimize the KL divergence between the predicted distribution and the overall consistency condition by maximizing the evidence lower bound (ELBO). This process is iterated until the predicted distribution converges, thereby generating more accurate pseudo labels. These pseudo mappings will be used in the subsequent self-training process to improve the accuracy of entity alignment.

[0079] Step 205 : Perform model training on the first initial entity alignment model and the second initial entity alignment model according to the first loss information and the second loss information to generate a first entity alignment model and a second entity alignment model.

[0080] In some embodiments, the execution entity may perform model training on the first initial entity alignment model and the second initial entity alignment model based on the first loss information and the second loss information to generate a first entity alignment model and a second entity alignment model. The first entity alignment model and the second entity alignment model may be entity alignment models that have completed training.

[0081] As an example, first, the execution entity may perform a weighted summation on the first loss information and the second loss information to generate weighted sum loss information. Then, in response to determining that the loss information sequence corresponding to the weighted sum loss information approaches the target value, the first initial entity alignment model is determined as the first entity alignment model, and the second initial entity alignment model is determined as the second entity alignment model. Next, in response to determining that the loss information sequence corresponding to the weighted sum loss information does not approach the target value, the model parameters of the first initial entity alignment model and the second initial alignment model are updated according to the weighted sum loss information to generate an updated first initial entity alignment model and an updated second initial entity alignment model. Finally, at least one labeled sample is reselected, and the updated first initial entity alignment model is used as the first initial entity alignment model, and the updated second initial entity alignment model is used as the second initial entity alignment model, and the model training step (i.e., the training step corresponding to steps 201-205) is continued.

[0082] The above-described embodiments of the present disclosure have the following beneficial effects: The model training methods of some embodiments of the present disclosure can generate a first entity alignment model and a second entity alignment model with more accurate entity alignment using fewer samples. Specifically, the low accuracy of related entity alignment methods is due to the high sample cost of requiring a large number of high-quality annotated samples for model training. Furthermore, entities cannot be accurately matched and fused between knowledge graphs from different sources, resulting in low entity alignment accuracy. Based on this, the model training methods of some embodiments of the present disclosure first obtain at least one annotated sample for entity pre-alignment for at least two knowledge graphs. One of the knowledge graphs in the at least two knowledge graphs is the knowledge graph to be entity aligned. The at least one annotated sample is used as a training label set for a first initial entity alignment model to facilitate subsequent preliminary training of the first initial entity alignment model. Then, based on the at least one annotated sample, first loss information and first entity alignment information are generated for the first initial entity alignment model. The first entity alignment information can be used to subsequently generate a reallocated label set. The first loss information is used for subsequent training of the first and second initial entity alignment models. Then, based on the above-mentioned first entity alignment information, a reallocated label set can be accurately generated. Here, by generating a reallocated label set, the label set of the subsequent second initial entity alignment model is used so that the second initial entity alignment model does not need to be annotated with an additional label set to achieve accurate training of the model. Furthermore, based on the above-mentioned reallocated label set, second loss information for the second initial entity alignment model is generated for the subsequent training of the first initial entity model and the second initial entity alignment model. Finally, based on the above-mentioned first loss information and the above-mentioned second loss information, model training for the above-mentioned first initial entity alignment model and the above-mentioned second initial entity alignment model is performed to accurately generate the first entity alignment model and the second entity alignment model. In summary, based on at least one labeled sample, weakly supervised learning of the first initial entity alignment model and self-supervised learning of the second initial alignment model can be achieved to generate the first entity alignment model and the second entity alignment model with more accurate entity alignment using a small number of samples.

[0083] Further references Figure 4 , shows a process 400 of another embodiment of the model training method according to the present disclosure. The model training method includes the following steps: Step 401: Obtain at least one labeled sample of entity pre-alignment for at least two knowledge graphs.

[0084] Step 402: vectorize each entity and entity relationship in the at least two knowledge graphs to generate entity vectors and entity relationship vectors, and obtain entity vector sets and entity relationship vector sets.

[0085] In some embodiments, the execution entity (e.g. Figure 1 The electronic device 101 shown) can vectorize each entity and entity relationship in the above-mentioned at least two knowledge graphs to generate entity vectors and entity relationship vectors, and obtain entity vector sets and entity relationship vector sets. Among them, the entity relationship can represent the association relationship between two entities in the knowledge graph. For example, the entity relationship can be an entity belonging relationship. There is a one-to-one correspondence between each entity in the at least two knowledge graphs and the entity vector in the entity vector set. There is a one-to-one correspondence between each entity relationship in the at least two knowledge graphs and the entity relationship vector in the entity relationship vector set. The entity vector can represent the entity corresponding feature semantics. The entity relationship vector can represent the entity relationship corresponding feature semantics. For example, see Figure 3 , Figure 3 In the example, "Tongzhou", "Tongzhou District", "Majuqiao", "Fuli Community", "Majuqiao Town", and "Fuli Shangyueju" are all entities. The ownership relationship between "Tongzhou" and "Fuli Community" is an entity relationship.

[0086] As an example, the above-mentioned execution entity can input each entity and entity relationship in at least two knowledge graphs into a pre-trained model PTM (Pre-Trained Model, such as BERT) to generate entity vectors and entity relationship vectors, and obtain entity vector sets and entity relationship vector sets.

[0087] Here, by converting entities and entity relationships into vector form, it is convenient for the input of subsequent models, so that the model can learn the corresponding feature semantics.

[0088] Step 403: Input the entity vector set and the entity relationship vector set into the first initial entity alignment model to generate the first entity alignment information.

[0089] In some embodiments, the execution entity may input the entity vector set and the entity relationship vector set into the first initial entity alignment model to generate the first entity alignment information. The first entity alignment information may be an initial alignment result corresponding to at least two knowledge graphs.

[0090] Step 404: Generate the first loss information based on the at least one labeled sample and the first entity alignment information.

[0091] In some embodiments, the execution entity may generate the first loss information based on the at least one annotated sample and the first entity alignment information, wherein the first loss information may represent the difference between the entity alignment result corresponding to the at least one annotated sample and the entity alignment result corresponding to the first entity alignment information.

[0092] As an example, the execution entity may utilize a target loss function based on at least one labeled sample and the initial entity alignment result to generate first loss information. Specifically, the at least one labeled sample and the initial entity alignment result may be vectorized separately to obtain a first vectorization result and a second vectorization result. Finally, the first vectorization result and the second vectorization result are input into the target loss function to generate the first loss information. The target loss function may be pre-set for the current scenario. For example, the target loss function may be a cross-entropy loss function.

[0093] In some optional implementations of some embodiments, the first initial entity alignment model includes: an initial encoding layer and an initial alignment reasoning layer.

[0094] Optionally, the step of inputting the entity vector set and the entity relationship vector set into the first initial entity alignment model to generate the first entity alignment information includes: The first step is to obtain at least one graph anchor position corresponding to the at least one annotated sample. There is a one-to-one correspondence between the annotated sample in the at least one annotated sample and the graph anchor position in the at least one graph anchor position. The graph anchor position can represent the position of the entity in the annotated sample in the corresponding knowledge graph. Each knowledge graph supports entity numbering for each entity included to indicate the corresponding position of the entity.

[0095] For example, a labeled sample can be "Tongzhou, Tongzhou District". The graph anchor position of "Tongzhou" in the knowledge graph KG1 can be "Entity Number: 001". The graph anchor position of "Tongzhou District" in the knowledge graph KG2 can be "Entity Number: 002".

[0096] The second step is to input the at least one graph anchor point location, the entity vector set, and the entity relationship vector set into the initial coding layer to generate a graph fusion matrix. The initial coding layer is a coding layer that has not yet been trained. The initial coding layer is used to perform feature semantic integration on the at least one graph anchor point location, the entity vector set, and the entity relationship vector set.

[0097] As an example, the execution entity may first utilize the vector conversion model included in the initial coding layer to perform position vector conversion on each at least one image anchor position to generate an anchor position vector, thereby obtaining at least one anchor position vector. Then, utilizing the vector fusion layer included in the initial coding layer, the at least one anchor position vector, the entity vector set, and the entity relationship vector set may be concatenated to generate a concatenation matrix as the atlas fusion matrix.

[0098] In the third step, the graph fusion matrix is ​​input into the initial alignment reasoning layer to generate the alignment matrix as the first entity alignment information. The alignment matrix can represent a matrix of alignment probabilities between entities between at least two knowledge graphs. The initial alignment reasoning layer can be an alignment reasoning layer that has not yet been trained. The alignment reasoning layer is a network layer used to determine the probability of alignment between entities between knowledge graphs based on the feature semantics of each entity, the feature semantics of each entity relationship, and the feature semantics of entities at each anchor position. For example, the alignment reasoning layer can be a fully connected layer. The elements in the alignment matrix can be one of the following: a value of 0, a value of 1. A value of 0 indicates that there is no alignment relationship between entities. A value of 1 indicates that there is an alignment relationship between entities.

[0099] In some optional implementations of some embodiments, the initial encoding layer includes an initial position encoding layer and an initial attention mechanism model. The initial position encoding layer may be a network layer that has not yet been trained and is used to encode positions. The initial attention mechanism model may be a model that has not yet been trained and is used to better capture the impact of anchor point positions on entity alignment. For example, the initial position encoding layer may be a convolutional neural network with multiple layers connected in series. The initial attention mechanism model may be a multi-head attention mechanism model.

[0100] Optionally, inputting the at least one graph anchor point position, the entity vector set, and the entity relationship vector set into the initial coding layer to generate a graph fusion matrix may include the following steps: In the first step, the execution entity may utilize the initial position coding layer to position-code the at least one atlas anchor point position to generate at least one anchor point position coding information.

[0101] As an example, the execution entity may input each of the at least one atlas anchor point position into the initial position encoding layer to generate anchor point position encoding information, thereby obtaining at least one anchor point position encoding information.

[0102] In practice, the execution entity may input at least one atlas anchor point position into the following formula to obtain the corresponding at least one anchor point position encoding information: .

[0103] in, It can be at least one anchor point position encoding information. There can be at least one atlas anchor position. Can be a harmonic weight hyperparameter. Represents the one-hot vector matrix generated according to the anchor position. It can be a matrix obtained by regularizing the adjacency matrix in the graph.

[0104] In the second step, based on the above-mentioned at least one anchor point position encoding information, at least one initial attention mechanism vector is generated using the above-mentioned initial attention mechanism model.

[0105] As an example, the execution entity may input at least one anchor position encoding information and a matrix obtained by regularizing the adjacency matrix in the graph into the initial attention mechanism model to generate at least one initial attention mechanism vector. The adjacency matrix can represent the adjacency relationship between any two vertices, with adjacency being 1 and non-adjacency being 0.

[0106] The third step is to generate the graph fusion matrix based on the at least one initial attention mechanism vector, the entity vector set and the entity relationship vector set.

[0107] As an example, the execution entity may perform vector splicing on the at least one initial attention mechanism vector, the entity vector set, and the entity relationship vector set according to a preset vector splicing method to generate a graph fusion matrix.

[0108] In some optional implementations of some embodiments, inputting the graph fusion matrix into the initial alignment inference layer to generate the alignment matrix may include the following steps: In the first step, the above initial alignment inference layer is used to generate the similarity matrix corresponding to the above graph fusion matrix.

[0109] As an example, the execution entity may first use the initial alignment inference layer to perform matrix transposition on the graph fusion matrix to generate a transposed matrix. Then, the execution entity may use the initial alignment inference layer to perform cosine similarity multiplication on the transposed matrix and the graph fusion matrix to generate a similarity matrix.

[0110] In the second step, the similarity matrix is ​​aligned to generate the alignment matrix.

[0111] As an example, the execution entity may use the Sinkhorn operator to perform alignment transformation on the similarity matrix to generate an alignment matrix.

[0112] Step 405 : Generate second loss information for a second initial entity alignment model based on the first loss information and the reallocated label set.

[0113] Step 406 : Perform model training on the first initial entity alignment model and the second initial entity alignment model according to the first loss information and the second loss information to generate a first entity alignment model and a second entity alignment model.

[0114] from Figure 4 It can be seen that Figure 2 Compared with the description of some corresponding embodiments, Figure 3 The process 400 of the model training method in some corresponding embodiments can accurately and effectively implement weakly supervised learning of the first initial entity alignment model through at least one labeled sample.

[0115] Continue to refer Figure 5 , shows a process 500 of some embodiments of the entity alignment method according to the present disclosure. The entity alignment method includes the following steps: Step 501: Obtain at least two target knowledge graphs.

[0116] In some embodiments, the execution subject (e.g., electronic device) of the entity alignment method can obtain at least two target knowledge graphs via a wired or wireless method. Among them, the knowledge graphs in the at least two target knowledge graphs can be the knowledge graphs to be aligned.

[0117] Step 502: Use the pre-trained first entity alignment model and the second entity alignment model to perform entity alignment on the at least two target knowledge graphs to obtain an entity alignment result.

[0118] In some embodiments, the execution entity may utilize a pre-trained first entity alignment model and a pre-trained second entity alignment model to perform entity alignment on the at least two target knowledge graphs to obtain entity alignment results. The first entity alignment model and the second entity alignment model may be models generated based on a model training method.

[0119] As an example, the above-mentioned execution entity can input at least two target knowledge graphs into a dual-tower model consisting of a first entity alignment model and a second entity alignment model to generate an entity alignment result.

[0120] Optionally, the execution entity may perform graph fusion on the at least two target knowledge graphs according to the entity alignment result to generate a fused knowledge graph.

[0121] The above-mentioned embodiments of the present disclosure have the following beneficial effects: through the entity alignment method of some embodiments of the present disclosure, the first entity alignment model and the second entity alignment model can be used to accurately generate entity alignment results.

[0122] Further references Figure 6 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a model training device. These device embodiments are similar to Figure 2 Corresponding to the method embodiments shown, the model training device can be specifically applied to various electronic devices.

[0123] like Figure 6 As shown, a model training device 600 includes: a first acquisition unit 601, a first generation unit 602, a second generation unit 603, a third generation unit 604, and a training unit 605. The first acquisition unit 601 is configured to acquire at least one labeled sample for entity pre-alignment of at least two knowledge graphs, wherein the knowledge graphs in the at least two knowledge graphs are knowledge graphs to be entity aligned; the first generation unit 802 is configured to generate first loss information and first entity alignment information for a first initial entity alignment model based on the at least one labeled sample; the second generation unit 603 is configured to generate a reallocated label set based on the first entity alignment information; the third generation unit 604 is configured to generate second loss information for a second initial entity alignment model based on the reallocated label set; and the training unit 605 is configured to perform model training on the first initial entity alignment model and the second initial entity alignment model based on the first loss information and the second loss information to generate a first entity alignment model and a second entity alignment model.

[0124] In some optional implementations of some embodiments, the first generation unit 602 can be further configured to: vectorize each entity and entity relationship in the above-mentioned at least two knowledge graphs to generate entity vectors and entity relationship vectors, and obtain entity vector sets and entity relationship vector sets; input the above-mentioned entity vector sets and the above-mentioned entity relationship vector sets into the above-mentioned first initial entity alignment model to generate the above-mentioned first entity alignment information; generate the above-mentioned first loss information based on the above-mentioned at least one labeled sample and the above-mentioned first entity alignment information.

[0125] In some optional implementations of some embodiments, the above-mentioned first initial entity alignment model includes: an initial coding layer and an initial alignment reasoning layer; and the first generation unit 602 can be further configured to: obtain at least one graph anchor point position corresponding to the above-mentioned at least one labeled sample; input the above-mentioned at least one graph anchor point position, the above-mentioned entity vector set and the above-mentioned entity relationship vector set into the above-mentioned initial coding layer to generate a graph fusion matrix; input the above-mentioned graph fusion matrix into the above-mentioned initial alignment reasoning layer to generate the above-mentioned alignment matrix; and generate the above-mentioned reallocated label set according to the above-mentioned alignment matrix as the above-mentioned first entity alignment information.

[0126] In some optional implementations of some embodiments, the above-mentioned initial encoding layer includes: an initial position encoding layer and an initial attention mechanism model; and the first generation unit 602 can be further configured to: use the above-mentioned initial position encoding layer to position encode the above-mentioned at least one graph anchor position to generate at least one anchor position encoding information; based on the above-mentioned at least one anchor position encoding information, use the above-mentioned initial attention mechanism model to generate at least one initial attention mechanism vector; based on the above-mentioned at least one initial attention mechanism vector, the above-mentioned entity vector set and the above-mentioned entity relationship vector set, generate the above-mentioned graph fusion matrix.

[0127] In some optional implementations of some embodiments, the first generation unit 602 can be further configured to: use the above-mentioned initial alignment inference layer to generate a similarity matrix corresponding to the above-mentioned graph fusion matrix; and perform alignment processing on the above-mentioned similarity matrix to generate the above-mentioned alignment matrix.

[0128] In some optional implementations of some embodiments, the third generation unit 604 can be further configured to: perform model training on the above-mentioned second initial entity alignment model according to the above-mentioned reallocated label set to generate a second entity alignment model after preliminary training; use the above-mentioned second entity alignment model after preliminary training to generate second entity alignment information for the above-mentioned at least two knowledge graphs; generate entity alignment probability information based on the above-mentioned second entity alignment information; generate a pseudo label set based on the above-mentioned entity alignment probability information; generate the above-mentioned second loss information for the above-mentioned second entity alignment information based on the above-mentioned pseudo label set and the above-mentioned reallocated label set.

[0129] In some optional implementations of some embodiments, the third generation unit 604 can be further configured to: perform entity consistency evaluation on the above-mentioned entity alignment probability information to generate consistency evaluation information; adjust the above-mentioned entity alignment probability information based on the above-mentioned consistency evaluation information to generate adjusted entity alignment probability information; and generate the above-mentioned pseudo label set based on the above-mentioned entity alignment probability information.

[0130] In some optional implementations of some embodiments, the third generating unit 604 may be further configured to: perform label optimization adjustment on the initial pseudo label set corresponding to the entity alignment probability information according to the dependency relationship between entities to generate the pseudo label set.

[0131] It is understandable that the units recorded in the model training device 600 and the reference Figure 2 The steps in the described method correspond to each other. Therefore, the operations, features and beneficial effects described above for the method are also applicable to the model training device 600 and the units contained therein, and will not be repeated here.

[0132] Further references Figure 7 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a physical alignment device. These device embodiments are similar to Figure 5 Corresponding to the method embodiments shown, the physical alignment device can be specifically applied to various electronic devices.

[0133] like Figure 7 As shown, an entity alignment apparatus 700 includes: a second acquisition unit 701 and an entity alignment unit 702. The second acquisition unit 701 is configured to acquire at least two target knowledge graphs; the entity alignment unit 702 is configured to perform entity alignment on the at least two target knowledge graphs using a pre-trained first entity alignment model and a second entity alignment model to obtain an entity alignment result, wherein the first entity alignment model and the second entity alignment model are generated based on a model training method.

[0134] It is understood that the units described in the physical alignment device 700 are consistent with the reference Figure 5 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the physical alignment device 700 and the units included therein, and will not be repeated here.

[0135] Reference below Figure 8 , which shows an electronic device (e.g. Figure 1 Schematic diagram of the structure of the electronic device 101) 800. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0136] like Figure 8As shown, electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes based on programs stored in a read-only memory 802 or programs loaded from a storage device 808 into a random access memory 803. The random access memory 803 also stores various programs and data required for the operation of electronic device 800. The processing device 801, the read-only memory 802, and the random access memory 803 are connected to each other via a bus 804. An input / output interface 805 is also connected to the bus 804.

[0137] Typically, the following devices may be connected to the input / output interface 805: an input device 806 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 808 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Figure 8 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead. Figure 8 Each block shown in the figure may represent one device, or may represent multiple devices as needed.

[0138] In particular, according to some embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from a network via the communication device 809, or installed from the storage device 808, or installed from the read-only memory 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of some embodiments of the present disclosure are performed.

[0139] It should be noted that in some embodiments of the present disclosure, the computer-readable medium described above may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. Computer-readable storage media may include, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or component. Furthermore, in some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wire, optical cable, RF (radio frequency), or any suitable combination thereof.

[0140] In some embodiments, the client and server can communicate using any currently known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.

[0141] The computer-readable medium may be included in the electronic device, or may exist separately and not incorporated into the electronic device. The computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: obtain at least one labeled sample for entity pre-alignment of at least two knowledge graphs, wherein one of the at least two knowledge graphs is a knowledge graph to be entity aligned; generate first loss information and first entity alignment information for a first initial entity alignment model based on the at least one labeled sample; generate a reallocated label set based on the first entity alignment information; generate second loss information for a second initial entity alignment model based on the reallocated label set; perform model training on the first initial entity alignment model and the second initial entity alignment model based on the first loss information and the second loss information to generate a first entity alignment model and a second entity alignment model; obtain at least two target knowledge graphs; and perform entity alignment on the at least two target knowledge graphs using the pre-trained first entity alignment model and the second entity alignment model to obtain entity alignment results, wherein the first entity alignment model and the second entity alignment model are generated based on a model training method.

[0142] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0143] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0144] The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The described units may also be provided in a processor, for example, they may be described as: a processor comprising a first acquisition unit, a first generation unit, a second generation unit, and a training unit. The names of these units do not, in some cases, constitute a limitation on the units themselves. For example, the first acquisition unit may also be described as a "unit for acquiring at least one labeled sample of entity pre-alignment for at least two knowledge graphs."

[0145] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0146] Some embodiments of the present disclosure also provide a computer program product, including a computer program, which implements any of the above-mentioned model training methods or entity alignment methods when executed by a processor.

[0147] The above descriptions are merely some preferred embodiments of the present disclosure and illustrate the underlying technical principles. Those skilled in the art should understand that the scope of the invention encompassed by the embodiments of the present disclosure is not limited to technical solutions formed by specific combinations of the aforementioned technical features. It also encompasses other technical solutions formed by any combination of the aforementioned technical features or their equivalents, without departing from the aforementioned inventive concept. For example, a technical solution formed by replacing the aforementioned features with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.

Claims

1. A model training method, comprising: Obtain at least one labeled sample of entity pre-alignment for at least two knowledge graphs, wherein the knowledge graphs in the at least two knowledge graphs are knowledge graphs to be entity aligned; Generate first loss information and first entity alignment information for a first initial entity alignment model according to the at least one labeled sample; Generate a reallocated label set according to the first entity alignment information; Generating second loss information for a second initial entity alignment model according to the reallocated label set; Model training is performed on the first initial entity alignment model and the second initial entity alignment model according to the first loss information and the second loss information to generate a first entity alignment model and a second entity alignment model.

2. The method according to claim 1, wherein: The step of generating first loss information and first entity alignment information for a first initial entity alignment model according to the at least one labeled sample includes: Vectorizing each entity and entity relationship in the at least two knowledge graphs to generate entity vectors and entity relationship vectors, and obtaining an entity vector set and an entity relationship vector set; Inputting the entity vector set and the entity relationship vector set into the first initial entity alignment model to generate the first entity alignment information; The first loss information is generated according to the at least one labeled sample and the first entity alignment information.

3. The method according to claim 2, wherein: The first initial entity alignment model includes: an initial encoding layer and an initial alignment reasoning layer; and The step of inputting the entity vector set and the entity relationship vector set into the first initial entity alignment model to generate the first entity alignment information includes: Obtaining at least one atlas anchor point position corresponding to the at least one labeled sample; Inputting the at least one graph anchor point position, the entity vector set and the entity relationship vector set into the initial encoding layer to generate a graph fusion matrix; The graph fusion matrix is ​​input into the initial alignment reasoning layer to generate an alignment matrix as the first entity alignment information.

4. The method according to claim 3, wherein: The initial encoding layer includes: an initial position encoding layer and an initial attention mechanism model; and The step of inputting the at least one graph anchor point position, the entity vector set and the entity relationship vector set into the initial coding layer to generate a graph fusion matrix comprises: Using the initial position coding layer, position coding the at least one atlas anchor point position to generate at least one anchor point position coding information; Generate at least one initial attention mechanism vector using the initial attention mechanism model according to the at least one anchor point position encoding information; The graph fusion matrix is ​​generated according to the at least one initial attention mechanism vector, the entity vector set and the entity relationship vector set.

5. The method according to claim 3, wherein: The step of inputting the graph fusion matrix into the initial alignment reasoning layer to generate an alignment matrix includes: Using the initial alignment inference layer, generating a similarity matrix corresponding to the graph fusion matrix; An alignment process is performed on the similarity matrix to generate the alignment matrix.

6. The method according to claim 1, wherein: Generating second loss information for a second initial entity alignment model according to the reallocated label set includes: According to the reallocated label set, performing model training on the second initial entity alignment model to generate a preliminarily trained second entity alignment model; Generate second entity alignment information for the at least two knowledge graphs using the preliminarily trained second entity alignment model; Generating entity alignment probability information according to the second entity alignment information; Generate a pseudo label set according to the entity alignment probability information; The second loss information for the second entity alignment information is generated according to the pseudo label set and the reallocated label set.

7. The method according to claim 6, wherein: The generating a pseudo label set according to the entity alignment probability information includes: Performing entity consistency evaluation on the entity alignment probability information to generate consistency evaluation information; According to the consistency evaluation information, the entity alignment probability information is adjusted to generate adjusted entity alignment probability information; The pseudo label set is generated according to the entity alignment probability information.

8. The method according to claim 7, wherein: The generating the pseudo label set according to the entity alignment probability information includes: According to the dependency relationship between entities, the initial pseudo label set corresponding to the entity alignment probability information is subjected to label optimization adjustment to generate the pseudo label set.

9. A method for entity alignment, comprising: Obtain at least two target knowledge graphs; Utilizing a pre-trained first entity alignment model and a second entity alignment model, entity alignment is performed on the at least two target knowledge graphs to obtain an entity alignment result, wherein the first entity alignment model and the second entity alignment model are generated based on the method described in one of claims 1-8.

10. A model training device, comprising: A first acquisition unit is configured to acquire at least one labeled sample of entity pre-alignment for at least two knowledge graphs, wherein the knowledge graphs in the at least two knowledge graphs are knowledge graphs to be entity aligned; A first generating unit is configured to generate first loss information and first entity alignment information for a first initial entity alignment model according to the at least one labeled sample; A second generating unit is configured to generate a reallocated label set according to the first entity alignment information; A third generating unit is configured to generate second loss information for a second initial entity alignment model according to the reallocated label set; A training unit is configured to perform model training on the first initial entity alignment model and the second initial entity alignment model according to the first loss information and the second loss information to generate a first entity alignment model and a second entity alignment model.

11. A physical alignment device, comprising: A second acquisition unit is configured to acquire at least two target knowledge graphs; An entity alignment unit is configured to use a pre-trained first entity alignment model and a second entity alignment model to perform entity alignment on the at least two target knowledge graphs to obtain an entity alignment result, wherein the first entity alignment model and the second entity alignment model are generated based on the method described in one of claims 1-8.

12. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 9.

13. A computer readable medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

14. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 9.

Citation Information

Cited By

  • Entity alignment method in time sequence knowledge graph based on adversarial learning and label propagation

    CN119150974A