A knowledge base learning method, a completion system, and a product recommendation system

By learning semantic information between roles and entities in multi-tuples and assigning sub-relations to each role-entity pair, the problem of ignoring multi-tuple relationship interactions in existing technologies is solved, enabling more refined knowledge base completion and link prediction.

CN117151213BActive Publication Date: 2026-04-03INST OF COMPUTING TECH CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-24
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing knowledge base embedding learning methods neglect the interactions between multiple relations, roles, and entities in a tuple when dealing with multivariate relation facts. They fail to effectively utilize the fine-grained interactions between role-entity pairs and multiple relations in a tuple, resulting in insufficient support for link prediction and multivariate relation reasoning.

Method used

By acquiring the initial embedding representation of the tuple and performing multiple rounds of iterative learning using a pre-defined loss function, combined with pre-defined rules and function transformations, the semantic information between roles and entities in the tuple is learned, sub-relationships are assigned to each role-entity pair, and the potential interactions between tuple relations and role-entity pairs are captured.

Benefits of technology

It enables more refined mining of potential semantic information in the knowledge base, improves the ability to predict links and reason about multiple relationships, and can better complete tuples of missing items.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117151213B_ABST
    Figure CN117151213B_ABST
Patent Text Reader

Abstract

This invention provides a knowledge base learning method, comprising: S1, acquiring an existing knowledge base and initializing it to obtain learning data and its corresponding initial embedding representation, wherein the learning data includes multiple tuples, each tuple including a tuple relation and one or more role-entity pairs corresponding to the tuple relation, and each role-entity pair being assigned a sub-relation; S2, using a preset loss function as the learning objective, performing multiple rounds of iterative learning on the learning data according to a preset iterative method to obtain its corresponding target embedding representation. This invention captures the compatibility relationships between roles and entities by learning the semantic information between roles and entities in tuples, thereby exploring the potential interactions between roles and entities, and assigning sub-relations to each role-entity pair in the tuples and learning the semantic information between entities and sub-relations, thus achieving a more refined mining of the potential semantic information of the knowledge base.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of representation learning, specifically to knowledge base embedding technology in the field of representation learning, and more specifically, to a knowledge base learning method, a completion system, and a product recommendation system. Background Technology

[0002] Knowledge graphs are structured semantic knowledge bases used to describe concepts and their relationships in the real world in symbolic form. Through knowledge graphs, information, data, and links obtained from the real world can be aggregated into knowledge, making information resources easier to compute, understand, and evaluate, and enabling rapid response and reasoning of knowledge.

[0003] Over the past few decades, with the emergence and development of numerous knowledge graphs, a series of downstream tasks related to knowledge graphs, such as question answering, semantic search, and recommendation systems, have been widely and successfully applied. However, with the continuous growth of data, existing knowledge graphs are often incomplete, which limits the development and application of knowledge graphs in related downstream tasks (question answering, semantic search, etc.). To address this issue, researchers have proposed a knowledge base embedding learning method. This method learns low-dimensional vector representations (embedding representations) of entities and relations by embedding them into a continuous vector space in the knowledge base. Then, based on the learned embedding representations of entities and relations, it predicts missing links in the knowledge base.

[0004] In existing technologies, most knowledge base embedding learning methods focus on binary relation knowledge bases. These methods model binary relation facts as triplets (head entity, relation, tail entity) to learn low-dimensional vector representations of entities and relations, and predict missing links in the knowledge base based on the learned entity and relation embedding representations. However, existing knowledge base embedding learning methods mainly focus on binary relation facts, that is, they pay more attention to learning individual representations of entities and relations, while ignoring multivariate relation facts. In fact, multivariate relation facts should not be ignored, because most real-world knowledge bases cover both binary and multivariate relation facts. For example, in the existing knowledge base Freebase, more than one-third of the entities participate in multivariate relation facts. A multivariate relation fact in a knowledge base can be defined as a tuple, and a tuple can be represented as: relation(role1:entity1,…,role). n :entity nIn this context, "relation" represents a multivariate relation, "role" represents a role, and "entity" represents an entity. "role:entity" represents a role-entity pair. Compared to binary relation facts (triples), multivariate relation facts (tuples) can provide fine-grained knowledge in a concise manner. To learn from multivariate relation facts in a knowledge base, researchers have attempted to transform them into binary relation facts. However, in practice, this has proven infeasible. Firstly, the computational complexity of this transformation is high. Secondly, it results in the loss of structural information from the multivariate relation facts, leading to data sparsity.

[0005] In recent years, some researchers have proposed knowledge base embedding learning methods for multivariate relation facts. These methods mainly fall into two categories: relation-driven and role-driven methods. Relation-driven methods focus on learning individual representations of multivariate relations and entities within a tuple, neglecting the interactions between relations, roles, and entities. This leads to deficiencies in exploring potential relationships between entities and hinders link prediction. Role-driven methods, on the other hand, emphasize important roles in the multivariate relation knowledge base and leverage these roles to facilitate the representation of entities and multivariate relations. However, these methods merely project all role-entity pairs in the tuple onto a unified relation space, failing to utilize the fine-grained interactions between role-entity pairs and multivariate relations. This results in a lack of support for some fundamental reasoning patterns (symmetry, inversion, and composition) in multivariate relation reasoning.

[0006] Although some researchers have proposed knowledge base embedding learning methods for multi-relation facts, these methods have at least one of the following limitations: (1) they ignore the interactions between multi-relations, roles and entities in the multi-relation set, resulting in a deficiency in exploring potential relationships between entities and hindering link prediction; (2) they cannot take advantage of the fine-grained interactions between role-entity pairs and multi-relations in the multi-relation set, resulting in a lack of support for some basic reasoning patterns (symmetry, inversion and combination) in multi-relation reasoning and hindering link prediction. Summary of the Invention

[0007] Therefore, the purpose of this invention is to overcome the shortcomings of the prior art and provide a knowledge base learning method, a knowledge base completion system, and a product recommendation method.

[0008] The objective of this invention is achieved through the following technical solutions.

[0009] According to a first aspect of the present invention, a knowledge base learning method is provided, the method comprising: S1, acquiring an existing knowledge base and initializing it to obtain learning data and its corresponding initial embedding representation, wherein the learning data includes multiple tuples, each tuple including a tuple relation and one or more role-entity pairs corresponding to the tuple relation, and each role-entity pair being assigned a sub-relation; S2, using a preset loss function as the learning objective, performing multiple rounds of iterative learning on the learning data according to a preset iterative method to obtain its corresponding target embedding representation.

[0010] In some embodiments of the present invention, the initial embedding representation includes: the initial embedding representation of each multivariate relation in all tuples, the initial embedding representation of each role under different multivariate relations, the initial embedding representation of each entity under different roles, and the initial embedding representation of the sub-relation corresponding to each role-entity pair.

[0011] In some embodiments of the present invention, the learning data includes a plurality of positive samples and a set of negative samples corresponding to each positive sample, each set of negative samples including one or more negative samples, each positive sample and each negative sample being a tuple, wherein the positive samples are correct tuples and the negative samples are incorrect tuples.

[0012] In some embodiments of the present invention, in step S2, the preset iteration method is to perform each round of iterative learning according to the following steps: S21, based on the embedding representation corresponding to the learning data obtained after the previous round of iterative learning, perform entity transformation according to preset rules to obtain the embedding representation corresponding to the entity transformation in the current round; S22, based on the embedding representation corresponding to the entity transformation in the current round, score each tuple according to a preset scoring function; S23, based on the score of each tuple obtained in step S22, calculate the current round of iterative learning loss according to a preset loss function, and update the embedding representation corresponding to the learning data obtained after the previous round of iterative learning based on the iterative learning loss to obtain the embedding representation corresponding to the learning data after the current round of iterative learning; wherein, in the first round of iterative learning, iterative learning is performed based on the initial embedding representation corresponding to the learning data obtained in step S1.

[0013] In some embodiments of the present invention, in step S21, the preset rule is to perform entity transformation according to the following steps: S211, based on the embedding representation of each role in each tuple obtained after the previous round of iterative learning, calculate the current round embedding representation of each role in each tuple according to the first embedding function; S212, based on the current round embedding representation of each role in each tuple obtained in step S211 and the embedding representation of each entity under different roles obtained after the previous round of iterative learning, calculate the current round first embedding representation of each entity in each tuple according to the second embedding function; S213, based on the sub-relation embedding representation of each role-entity pair in each tuple obtained after the previous round of iterative learning, perform sub-relation transformation on the current round first embedding representation of each entity in each tuple obtained in step S212 according to the third embedding function to obtain the current round second embedding representation of each entity in each tuple; S214, perform geometric transformation on the current round second embedding representation of each entity in each tuple obtained in step S213 to obtain the current round third embedding representation of each entity in each tuple.

[0014] In some embodiments of the present invention, the first embedding function is:

[0015]

[0016]

[0017] in, This represents the current-round embedding representation of the j-th role under the multivariate relation r corresponding to the tuple, where r represents the multivariate relation corresponding to the tuple, and λ represents the attention vectors corresponding to all roles in the tuple obtained after the previous iteration. T This represents the transpose of λ. Let λ represent the embedding representation of the role at position i in the tuple obtained after the previous iteration of learning, under the multivariate relation r. i Let n represent the attention vector corresponding to the role at position i in the tuple obtained after the previous iteration of learning, where n represents the n positions in the tuple, and Softmax(·) represents the normalization exponential function.

[0018] The second embedding function is:

[0019]

[0020] Among them, E k This represents the first embedding representation of the k-th entity in the current round corresponding to the tuple. Let m represent the embedding representation of the k-th entity in the j-th role of the tuple obtained after the previous iteration of learning, and m represent the number of roles in the tuple.

[0021] The third embedding function is:

[0022]

[0023] Among them, E′ k This represents the second embedding representation of the k-th entity corresponding to the tuple in the current round. This represents the embedding representation of the sub-relationship between the k-th entity and its corresponding role under the multivariate relation r corresponding to the tuple obtained after the previous iteration of learning.

[0024] In some embodiments of the present invention, the preset scoring function is:

[0025]

[0026] Where φ(·) represents the scoring function, w1,…,w k ,…,w K E″ represents a learnable weighted paradigm. k Let E1′,…,E be the current round third embedding representation of the k-th entity corresponding to the tuple. K ′ represents the current round second embedding representation of the first entity to the Kth entity corresponding to the tuple.

[0027] In some embodiments of the present invention, the preset loss function is:

[0028]

[0029] Where x represents a positive sample, Let represent a tuple, and y represent negative samples of x. Let represent the set of negative samples corresponding to a positive sample x, φ(x) represent the rating of the positive sample, φ(y) represent the rating of the negative sample, and e φ(x) This represents an exponential function with base e and exponent φ(x), where e φ(y) This represents an exponential function with base e and exponent φ(y).

[0030] According to a second aspect of the present invention, a knowledge base completion system is provided for completing missing items in a missing item tuple, wherein the missing item tuple includes a multivariate relation and one or more role-entity pairs corresponding to the multivariate relation, and the missing item tuple includes one or more missing items. The system includes: a learning module for processing learning data according to the method described in the first aspect of the present invention to obtain its corresponding target embedding representation; a role-entity semantic module for obtaining the embedding representation of each role and the embedding representation of each entity in the missing item tuple based on the target embedding representation of the learning data learned by the learning module; and an entity-relation semantic module for performing sub-relations on the embedding representation of each entity learned by the role-entity semantic module. The system employs transformation and geometric transformation to obtain the transformed embedding representation of each entity in the missing item tuple; a scoring module is used to complete each missing item in the missing item tuple using candidate options to obtain multiple candidate completed tuples, and to score each candidate completed tuple based on the embedding representation of each entity obtained by the role-entity semantic module and the transformed embedding representation of each entity obtained by the entity-relation semantic module, wherein the candidate options are all entities or role-entity pairs in the missing item tuple; a completion module is used to sort the scores output by the scoring module in descending order, select the candidate completed tuples corresponding to the top-ranked scores as prediction tuples, and select the candidate option corresponding to each missing item in each prediction tuple as its prediction candidate option.

[0031] According to a third aspect of the present invention, a product recommendation method is provided, the method comprising: T1, obtaining historical search records of a target object for products, and using the historical search records as a knowledge base; T2, using a knowledge base completion system as described in the second aspect of the present invention to complete the knowledge base obtained in step T1, and using the completion result as product recommendation information to recommend products to the target object.

[0032] Compared with the prior art, the advantages of the present invention are: (1) organically combining the roles, entities and multi-relationships in the multi-group to learn the semantic information between roles and entities, and the semantic information between entities and multi-relationships; (2) assigning sub-relationships to each role-entity pair in the multi-group and learning the semantic information between entities and sub-relationships, thereby capturing the potential interaction between multi-relationships and role-entity pairs on the basis of taking into account various semantic relationships in the multi-group, and realizing the mining of potential semantic information of the knowledge base in a more refined way. Attached Figure Description

[0033] The embodiments of the present invention will be further described below with reference to the accompanying drawings, wherein:

[0034] Figure 1This is a schematic diagram of the knowledge base learning method according to an embodiment of the present invention;

[0035] Figure 2 This is a schematic diagram of the knowledge base completion system according to an embodiment of the present invention. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of this invention clearer, the invention is further described in detail below through specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0037] As described in the background art, although researchers have proposed knowledge base embedding learning methods for multivariate relation facts, these methods have at least one of the following limitations: (1) they ignore the interactions between multivariate relations, roles and entities in the multivariate set, resulting in a deficiency in exploring potential relationships between entities and hindering link prediction; (2) they cannot take advantage of the fine-grained interactions between role-entity pairs and multivariate relations in the multivariate set, resulting in a lack of support for some basic reasoning patterns (symmetry, inversion and combination) in multivariate relation reasoning and hindering link prediction.

[0038] To address the problems existing in the prior art, the inventors proposed a knowledge base learning scheme capable of learning complex interactions between multi-relationships and role-entity pairs in tuples. This invention captures the compatibility relationships between roles and entities by learning the semantic information between roles and entities in tuples, thereby exploring the potential interactions between roles and entities. Furthermore, it assigns sub-relationships to each role-entity pair in the tuple and learns the semantic information between entities and sub-relationships. Thus, while taking into account various semantic relationships in the tuple, it further captures the potential interactions between multi-relationships and role-entity pairs, achieving a more refined way of mining the potential semantic information of the knowledge base.

[0039] To better understand the present invention, the proposed solution will be described in detail below with reference to the accompanying drawings and embodiments.

[0040] According to one embodiment of the present invention, such as Figure 1 As shown, a knowledge base learning method is provided. The method includes: S1, acquiring an existing knowledge base and initializing it to obtain learning data and its corresponding initial embedding representation, wherein the learning data includes multiple tuples, each tuple includes a multivariate relation and one or more role-entity pairs corresponding to the multivariate relation, and each role-entity pair is assigned a sub-relation; S2, using a preset loss function as the learning target, performing multiple rounds of iterative learning on the learning data according to a preset iterative method to obtain its corresponding target embedding representation. The data initialization process in step S1 and the iterative learning process in step S2 are described in detail below.

[0041] I. Data Initialization

[0042] The purpose of data initialization is to obtain the initial embedding representation of the learning data, so that the initial embedding representation of the learning data can be iteratively learned according to the preset iterative learning method to obtain the target embedding representation corresponding to the learning data.

[0043] In step S1, an existing knowledge base is acquired and initialized to obtain learning data and its corresponding initial embedding representation. The learning data includes multiple tuples, each tuple comprising a tuple relation and one or more role-entity pairs corresponding to that tuple relation, with each role-entity pair assigned a sub-relation. It should be noted that a tuple is represented as `relation(role1:entity1,…,role)`. n :entity n In this context, relation represents a multivariate relationship, role represents a role, and entity represents an entity. A role:entity pair represents a role-entity pair. Multivariates can be used to describe concepts and their relationships in the real world. For example, Zhang San defeating Li Si in a city boxing match can be represented as "defeat (participant: Zhang San, participant: Li Si, event: city boxing match)". Here, the multivariate relationship is "defeat", the entities are "Zhang San", "Li Si", and "city boxing match", and the roles of "Zhang San" and "Li Si" are participants, while the role of "city boxing match" is an event.

[0044] According to one embodiment of the present invention, the learning data includes multiple positive samples and a set of negative samples corresponding to each positive sample. Each set of negative samples includes one or more negative samples. Each positive sample and each negative sample is a tuple, wherein the positive samples are correct tuples and the negative samples are incorrect tuples. It should be noted that the set of negative samples is constructed from the positive samples. Specifically, one or more original entities in a positive sample are replaced with other entities to obtain the corresponding negative sample, and the multiple constructed negative samples form the set of negative samples, as specifically shown below:

[0045]

[0046] in, Let r represent the set of negative samples, e1, ..., e2 represent the multivariate relation. s e′ represents the first to the s-th original entities in the tuple. i Indicates the replaced entity. Let represent a tuple, and ε represent an entity. To better understand the construction process of negative samples, according to an example of the present invention, a negative sample is constructed using the positive sample "Defeat (competitor: Zhang San, competitor: Li Si, event: city boxing match)" as an example. The "Li Si" in the positive sample is replaced with "Wang Wu" to obtain the negative sample "Defeat (competitor: Zhang San, competitor: Wang Wu, event: city boxing match)".

[0047] To accommodate various semantic relationships within tuples, and to fully consider the interrelationships between roles, entities, and tuple relations when obtaining the initial embedding representation corresponding to the learning data, according to one embodiment of the present invention, the initial embedding representation includes: the initial embedding representation of each tuple relation, the initial embedding representation of each role under different tuple relations, the initial embedding representation of each entity under different roles, and the initial embedding representation of the sub-relation corresponding to each role-entity pair. It should be noted that the initial embedding representation corresponding to the learning data is obtained through random initialization.

[0048] II. Iterative Learning

[0049] After obtaining the initial embedding representation corresponding to the learning data, it is subjected to multiple rounds of iterative learning to obtain the target embedding representation corresponding to the learning data. In each round of iterative learning, the semantic information between roles and entities in the tuple is learned to capture the compatibility relationship between roles and entities. Sub-relationships are assigned to each role-entity pair in the tuple to learn the semantic information between entities and sub-relationships.

[0050] In step S2, the learning data is iterated multiple times according to a preset loss function as the learning target to obtain its corresponding target embedding representation.

[0051] According to one embodiment of the present invention, the preset iteration method is to perform each round of iterative learning according to steps S21-S23. Steps S21-S23 will be described in detail below.

[0052] In step S21, based on the embedding representation corresponding to the learning data obtained after the previous round of iterative learning, entity transformation is performed according to preset rules to obtain the embedding representation corresponding to the entity transformation in the current round. According to an embodiment of the present invention, in step S21, the preset rules are to perform entity transformation according to steps S211-S214, and each step is described below.

[0053] In step S211, based on the embedding representation of each role in each tuple obtained after the previous round of iterative learning, the current round embedding representation of each role in each tuple is calculated according to the first embedding function, wherein the first embedding function is:

[0054]

[0055]

[0056] in, This represents the current-round embedding representation of the j-th role under the multivariate relation r corresponding to the tuple, where r represents the multivariate relation corresponding to the tuple, and λ represents the attention vectors corresponding to all roles in the tuple obtained after the previous iteration. T This represents the transpose of λ. Let λ represent the embedding representation of the role at position i in the tuple obtained after the previous iteration of learning, under the multivariate relation r. i Let represent the attention vector corresponding to the role at position i in the tuple obtained after the previous iteration of learning, where n represents the n positions in the tuple, and Softmax(·) represents the normalization exponential function. It should be noted that the embeddings of the same role are different under different tuple relations; therefore, it is necessary to distinguish the embedding representation of each role under different tuple relations in order to learn the potential interactions between roles and tuple relations.

[0057] In step S212, based on the current round embedding representation of each role in each tuple obtained in step S211 and the embedding representation of each entity under different roles obtained after the previous round of iterative learning, the current round first embedding representation of each entity in each tuple is calculated according to the second embedding function, wherein the second embedding function is:

[0058]

[0059] Among them, E k This represents the first embedding representation of the k-th entity in the current round corresponding to the tuple. Let represent the embedding representation of the k-th entity under the j-th role in the tuple obtained after the previous iteration of learning, and m represent the number of roles in the tuple. Entities often have multiple semantics, meaning that an entity may play multiple roles. In order to fully capture the interaction between entities and roles, we construct the final embedding representation of the entity under each role, thereby establishing the association between different roles and entities, which helps to mine the semantic information between entities and different roles.

[0060] In step S213, based on the sub-relation embedding representation of each role-entity pair in each tuple obtained after the previous round of iterative learning, the first embedding representation of each entity in each tuple obtained in step S212 is subjected to sub-relation transformation according to the third embedding function to obtain the second embedding representation of each entity in each tuple. The third embedding function is:

[0061]

[0062] Among them, E′ k This represents the second embedding representation of the k-th entity corresponding to the tuple in the current round. This represents the embedding representation of the sub-relation between the k-th entity and its corresponding role under the multivariate relation r corresponding to the tuple obtained after the previous iteration of learning. As mentioned in the background art, some existing knowledge base embedding learning methods cannot utilize the fine-grained interactions between role-entity pairs and multivariate relations in the tuple, resulting in a lack of support for some basic reasoning patterns (symmetry, inversion, and combination) in multivariate relation reasoning. To address this problem, this invention assigns a sub-relation to each role-entity pair in the tuple and performs sub-relation transformation based on its embedding representation of the entity, so as to explore the interaction between multivariate relations and role-entity pairs in a finer-grained manner, thereby improving the representational power of the entity embedding representation.

[0063] In step S214, a geometric transformation is performed on the current round second embedding representation of each entity in each tuple obtained in step S213 to obtain the current round third embedding representation of each entity in each tuple. According to an embodiment of the present invention, the geometric transformation includes orthogonal transformation, translation transformation, projection transformation, and global scaling transformation. Performing a geometric transformation on the current round second embedding representation of each entity after the sub-relation transformation is beneficial for mining the semantic information between entities and relations.

[0064] In step S22, each tuple is scored according to a preset scoring function based on the embedded representation corresponding to the entity transformation of the current round. According to one embodiment of the present invention, the preset scoring function is:

[0065]

[0066] Where φ(·) represents the scoring function, w1,…,w k ,…,w K E″ represents a learnable weighted paradigm. k Let E1′,…,E be the current round third embedding representation of the k-th entity corresponding to the tuple. K '' represents the current round second embedding representation of the first entity to the Kth entity in the tuple. In the scoring function, sub-relational transformation and geometric transformation are performed on each entity in turn, which not only takes into account each entity in the tuple, but also allows for fine-grained mining of the relationships between different entities.

[0067] In step S23, based on the score of each tuple obtained in step S22, the current round of iterative learning loss is calculated according to a preset loss function, and the embedding representation corresponding to the learning data obtained after the previous round of iterative learning is updated based on the iterative learning loss to obtain the embedding representation corresponding to the learning data after the current round of iterative learning; wherein, in the first round of iterative learning, iterative learning is performed based on the initial embedding representation corresponding to the learning data obtained in step S1. According to an embodiment of the present invention, the preset loss function is:

[0068]

[0069] Where x represents a positive sample, Let represent a tuple, and y represent negative samples of x. Let represent the set of negative samples corresponding to a positive sample x, φ(x) represent the rating of the positive sample, φ(y) represent the rating of the negative sample, and e φ(x) This represents an exponential function with base e and exponent φ(x), where e φ(y) This represents an exponential function with base e and exponent φ(y). It should be noted that in each iteration of learning, the loss corresponding to each positive sample and its corresponding set of negative samples needs to be calculated. The embedding representation of each positive sample after the previous iteration is then updated based on the obtained loss, resulting in the embedding representation of each positive sample after the current iteration.

[0070] The target embedding representation obtained based on the learning data obtained in the foregoing embodiments can complete missing tuples with missing items, according to an embodiment of the present invention, such as Figure 2As shown, a knowledge base completion system is provided for completing missing items in a missing item tuple. The missing item tuple includes a multivariate relation and one or more role-entity pairs corresponding to the multivariate relation, and the missing item tuple includes one or more missing items. The system includes: a learning module for processing learning data according to the method described in the foregoing embodiments to obtain its corresponding target embedding representation; a role-entity semantic module for obtaining the embedding representation of each role and each entity in the missing item tuple based on the target embedding representation of the learning data learned by the learning module; and an entity-relation semantic module for performing sub-relation transformation and geometric transformation on the embedding representation of each entity learned by the role-entity semantic module. The system is configured to: 1) Obtain the transformed embedding representation of each entity in the missing item tuple; 2) Use a scoring module to complete each missing item in the missing item tuple using candidate options to obtain multiple candidate completed tuples, and score each candidate completed tuple based on the embedding representation of each entity obtained by the role-entity semantic module and the transformed embedding representation of each entity obtained by the entity-relation semantic module, wherein the candidate options are all entities or role-entity pairs in the missing item tuple; 3) Use a completion module to sort the scores output by the scoring module in descending order, select the candidate completed tuples corresponding to the top-ranked scores as prediction tuples, and use the candidate option corresponding to each missing item in each prediction tuple as its prediction candidate option.

[0071] Based on the knowledge base completion system proposed in the foregoing embodiments, it can be applied to downstream tasks related to the knowledge base, such as product recommendation, knowledge question answering, and keyword retrieval. According to one embodiment of the present invention, a product recommendation method is provided, the method comprising: T1, obtaining the historical search records of a target object for products, and using the historical search records as a knowledge base; T2, using the knowledge base completion system as described in the foregoing embodiments to complete the knowledge base obtained in step T1, and using the completion result as product recommendation information to recommend products to the target object. It should be noted that the processing methods for other downstream tasks related to the knowledge base are in the same principle as the product recommendation method described in the embodiments of the present invention, and will not be repeated here.

[0072] The beneficial effects of the present invention are as follows: (1) It organically combines the roles, entities and multi-relationships in the multi-tuple to learn the semantic information between the roles and entities, and the semantic information between the entities and multi-relationships; (2) It assigns sub-relationships to each role-entity pair in the multi-tuple and learns the semantic information between the entities and sub-relationships, thereby capturing the potential interaction between multi-relationships and role-entity pairs on the basis of taking into account various semantic relationships in the multi-tuple, and realizing the mining of potential semantic information of the knowledge base in a more refined way.

[0073] It should be noted that although the steps are described in a specific order above, it does not mean that the steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently, or even in a different order, as long as the required function can be achieved.

[0074] This invention can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the invention.

[0075] Computer-readable storage media can be tangible devices that hold and store instructions for use by an instruction execution device. Computer-readable storage media can be, for example, including but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof.

[0076] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A knowledge base learning method, characterized in that, The method includes: S1. Obtain the target object's historical search records for the product, and use the historical search records as an existing knowledge base, and initialize the existing knowledge base to obtain learning data and its corresponding initial embedding representation, wherein the learning data includes multiple tuples, each tuple includes a tuple relation and one or more role-entity pairs corresponding to the tuple relation, and each role-entity pair is assigned a sub-relation. S2. Using a preset loss function as the learning target, perform multiple rounds of iterative learning on the learning data according to a preset iterative method to obtain its corresponding target embedding representation. The preset iterative method involves executing each round of iterative learning according to the following steps: S21. Based on the embedding representation corresponding to the learning data obtained after the previous round of iterative learning, perform entity transformation according to preset rules to obtain the embedding representation corresponding to the entity transformation in the current round, wherein the preset rules are to perform entity transformation according to the following steps: S211. Based on the embedding representation of each role in each tuple obtained after the previous round of iterative learning, calculate the current round embedding representation of each role in each tuple according to the first embedding function; S212. Based on the current round embedding representation of each role in each tuple obtained in step S211 and the embedding representation of each entity under different roles obtained after the previous round of iterative learning, calculate the current round first embedding representation of each entity in each tuple according to the second embedding function. S213. Based on the sub-relation embedding representation of each role-entity pair in each tuple obtained after the previous round of iterative learning, perform sub-relation transformation on the current round first embedding representation of each entity in each tuple obtained in step S212 according to the third embedding function to obtain the current round second embedding representation of each entity in each tuple. S214. Perform a geometric transformation on the current round second embedding representation of each entity in each tuple obtained in step S213 to obtain the current round third embedding representation of each entity in each tuple. S22. Based on the embedded representation corresponding to the entity transformation in the current round, score each tuple according to the preset scoring function; S23. Based on the score of each tuple obtained in step S22, calculate the current round of iterative learning loss according to the preset loss function, and update the embedding representation corresponding to the learning data obtained after the previous round of iterative learning based on the iterative learning loss, so as to obtain the embedding representation corresponding to the learning data after the current round of iterative learning. In the first round of iterative learning, iterative learning is performed based on the initial embedding representation corresponding to the learning data obtained in step S1.

2. The method according to claim 1, characterized in that, The initial embedding representation includes: the initial embedding representation of each multivariate relation in all tuples, the initial embedding representation of each role under different multivariate relations, the initial embedding representation of each entity under different roles, and the initial embedding representation of the sub-relation corresponding to each role-entity pair.

3. The method according to claim 2, characterized in that, The learning data includes multiple positive samples and a set of negative samples corresponding to each positive sample. Each set of negative samples includes one or more negative samples. Each positive sample and negative sample is a tuple, wherein the positive samples are correct tuples and the negative samples are incorrect tuples.

4. The method according to claim 3, characterized in that, The first embedding function is: in, This indicates the multivariate relation corresponding to the tuple. The next The current round embedding representation of each role, This indicates the multivariate relation corresponding to a tuple. This represents the attention vectors corresponding to all roles in the tuple obtained after the previous iteration of learning. express transpose, This represents the tuple obtained after the previous iteration of learning. The role of each position in multiple relationships Embedded representation below, This represents the tuple obtained after the previous iteration of learning. Attention vectors corresponding to roles at each position Indicating tuples One location, This represents the normalized exponential function; The second embedding function is: in, Represents the first tuple corresponding to the tuple The first embedded representation of the current round of each entity, This represents the tuple corresponding to the first iteration of learning. The entity in the first Embedded representation under each role Indicates the number of roles in a tuple; The third embedding function is: in, Represents the first tuple corresponding to the tuple The current round of the second embedding representation of each entity, This represents the multivariate relation corresponding to the tuple obtained after the previous iteration of learning. Next An embedded representation of the sub-relationships between an entity and its corresponding role.

5. The method according to claim 4, characterized in that, The preset scoring function is: in, Represents the scoring function. This represents a learnable weighted paradigm. Represents the first tuple corresponding to the tuple The current round of the third embedding representation of an entity, This represents the first entity in the tuple up to the [number]th tuple. The current round of the second embedded representation of an entity.

6. The method according to claim 5, characterized in that, The preset loss function is: in, Indicates a positive sample. Represents a plural group. express negative samples, Indicates positive samples The corresponding set of negative samples, This represents the score of the positive sample. This represents the score for the negative sample. Indicates For the base, It is an exponential function of the exponent. Indicates For the base, It is an exponential function of an exponent.

7. A knowledge base completion system for completing missing items in a missing item tuple, wherein, The missing item tuple includes a tuple relation and one or more role-entity pairs corresponding to the tuple relation, and the missing item tuple includes one or more missing items. The system comprises: A learning module is configured to process the learning data according to any one of claims 1-6 to obtain its corresponding target embedding representation; The role-entity semantic module is used to obtain the embedding representation of each role and the embedding representation of each entity in the missing tuple based on the target embedding representation corresponding to the learning data learned by the learning module. The entity-relation semantic module is used to perform sub-relation transformation and geometric transformation on the embedding representation of each entity learned by the role-entity semantic module to obtain the transformed embedding representation of each entity in the missing tuple; The scoring module is used to fill in each missing item in the missing item tuple with candidate options to obtain multiple candidate completed tuples, and to score each candidate completed tuple based on the embedding representation of each entity obtained by the role-entity semantic module and the transformed embedding representation of each entity obtained by the entity-relation semantic module, wherein the candidate options are all entities or role-entity pairs in the missing item tuple; The completion module is used to sort the scores output by the scoring module in descending order, select the candidate completion tuples corresponding to the top-ranked scores as prediction tuples, and select the candidate option corresponding to each missing item in each prediction tuple as its prediction candidate option.

8. A product recommendation method, characterized in that, The method includes: T1. Obtain the target object's historical search records for products, and use the historical search records as a knowledge base; T2. The knowledge base obtained in step T1 is completed using the knowledge base completion system as described in claim 7, and the completion result is used as product recommendation information to recommend products to the target object.

9. A computer-readable storage medium, characterized in that, It stores a computer program that can be executed by a processor to implement the steps of the method according to any one of claims 1-6, 8.

10. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the electronic device to perform the steps of the method as described in any one of claims 1-6, 8.

Citation Information

Patent Citations

  • Multivariate relationship knowledge base construction method and system

    CN111506742A

  • Knowledge hypergraph link prediction method based on embedded learning

    CN114580640A