A social network entity reasoning method based on hyperbolic geometry knowledge representation
By employing a social network entity reasoning method based on hyperbolic geometric knowledge representation, and utilizing the geometric regions and logical operations of hyperbolic space, this method addresses the problem of decreased recommendation accuracy caused by missing user attributes in social networks, achieving efficient user recommendation and support for complex queries.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIHANG UNIV
- Filing Date
- 2023-08-24
- Publication Date
- 2026-05-08
AI Technical Summary
Existing social network user recommendation technologies suffer from negative impacts on accuracy and recall when user attribute information is missing, and existing methods fail to effectively support the hierarchy and logical operations of complex queries.
We adopt a social network entity reasoning method based on hyperbolic geometric knowledge representation, and design a query representation calculation module and an entity reasoning module. We use geometric regions and logical operations on hyperbolic space to make recommendations by calculating the distance between the query and the entity.
It improves the efficiency and accuracy of user recommendations, supports hierarchical information mining for complex queries, solves the problem of missing user attributes, and supports almost all first-order logical operations.
Smart Images

Figure CN117112924B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of social network technology, and in particular to a social network entity reasoning method based on hyperbolic geometry knowledge representation. Background Technology
[0002] With the rapid development of the mobile internet, especially the emergence of new social networking media such as Twitter, Facebook, and Weibo, a large number of users resonate to varying degrees with topics of interest and shared hobbies when using these social networking platforms. Currently, many social software programs have corresponding social community functions, which can recommend friends of interest to users. However, many existing user recommendation technologies rely on user attribute information. If a large amount of user attribute information is missing, it will negatively impact the accuracy and recall of the recommendations. Knowledge graphs represent facts existing in the real world in a structured form. User graphs constructed using user attribute information can use the relevant characteristics of knowledge graphs to recommend related users. On the one hand, knowledge graphs make the analysis of user data more efficient and can effectively solve the problems of high noise and complete unstructured data in social network user data. On the other hand, reasoning based on knowledge graphs can alleviate the problem of users having a large number of missing attributes and can fully explore the hidden connections between users. Specifically, we transform social network user recommendation into a complex query reasoning problem on a knowledge graph. Existing complex query reasoning methods for knowledge graphs embed queries, entities, and relationships into a unified representation space and complete the reasoning task by optimizing the distance between representation vectors. However, most of these methods do not consider the hierarchical nature of queries due to their deductive nature in complex recommendation scenarios; furthermore, these methods still have problems modeling logical budgets, such as not supporting all logical operations and ignoring semantic patterns of relationships. Therefore, existing technologies still need improvement and development. Summary of the Invention
[0003] To this end, the present invention first proposes a social network entity reasoning method based on hyperbolic geometric knowledge representation, and designs a query representation calculation module and an entity reasoning module. First, the social network graph and the entities to be recommended are obtained. The social network graph and the users to be recommended are input into the query representation calculation module. The query representation and entity representation of the users are input into the entity reasoning module.
[0004] In the query representation calculation module, after the social network graph and the user information to be recommended go through the process of constructing a calculation graph and obtaining anchor entities, they enter the process of calculating the sub-query representation according to the corresponding logical operators. If the calculation of the sub-query representation is not finished, it continues to be executed. If it is finished, the geometric vector representation of the query obtained by the calculation result is input into the entity reasoning module.
[0005] The entity reasoning module takes the geometric vector representation of the query as input, converts it into the final query representation, and uses it together with the entity representation to calculate the distance between the query representation and the entity representation. Then, it extracts the top k user entities to obtain the final reasoning result entity.
[0006] The process of constructing the computational graph and obtaining anchor entities involves receiving the social network graph and the users to be recommended. First, a user graph is constructed from the users and their corresponding user attribute information on the social platform. This is a query process. Based on the recommendation requirements, the attributes of the individuals to be considered and the entities to be recommended are constructed into a query, for example, expressed as:
[0007]
[0008] Where v represents all answer entities, Gradute and Friend represent graduation and friendship relationships, Si and San represent entities respectively, and u represents intermediate entities. For such a complex query, it needs to be transformed into a computation graph, where each node of the computation graph represents a subquery and each edge represents a logical operator.
[0009] The specific process of calculating the subquery representation is as follows:
[0010] The query is represented as follows: Each query actually represents a set of entities on the social network graph. A query is represented as... in These represent the centers in the radial and radian directions, respectively. The center and offset together constitute a region in the Poincaré disk representation space, representing the offset in both the radial and radian directions. The center represents the semantics of the entity set represented by the query, and the offset can intuitively represent the size of the entity set. The representation is defined in tangent space, and the transformation between tangent space and hyperbolic space is achieved through exponential and logarithmic mappings. The exponential and logarithmic mappings in the Poincaré disk space are as follows:
[0011]
[0012]
[0013] Where v is a point in tangent space, u is a point in the Poincaré disk space, and x is the center point of tangent space. It is a conformal factor and It's a Möbius stripe, and the query in tangent space is represented as... Available between the two To convert, 0 represents the tangent space at the center of the circle;
[0014] The entity is represented as, therefore it can be used and To indicate;
[0015] There are four ways to implement logical operations: relational mapping. Intersection operation Union operation Invert operation
[0016] Relationship mapping Use a multilayer perceptron to perform the relation mapping operation:
[0017]
[0018] in It uses relational representation; MLP stands for Multilayer Perceptron. The plus sign represents element-wise multiplication and addition. f is a transformation function designed to make the output of the multilayer perceptron conform to the requirements of the Poincaré disk space. The implementation of f is as follows:
[0019]
[0020] Where σ is the sigmoid function;
[0021] Intersection operation Calculate multiple input queries Find the intersection of the given elements, and then output the query representation corresponding to the intersection. That is, it takes multiple entity sets as input and outputs the intersection of the input entity sets. An attention-based aggregation mechanism is used to calculate the center of the intersection, and a deep ensemble network-based aggregation mechanism is used to calculate the offset of the intersection. The calculation process for the center is as follows:
[0022]
[0023]
[0024] Where α and β are attention parameters. The offset is calculated as follows:
[0025]
[0026]
[0027] DeeSetsNet is a deep set network characterized by permutation invariance, meaning that the order of the inputs does not affect the result.
[0028] Union operation Its function is to calculate multiple input queries. Find the union of the sets, and then output the query representation corresponding to the intersection. That is, take multiple entity sets as input and output the union of the input entity sets, which can be directly expressed using the union of disjunctive queries. Right now Where V' q,i yes The query representation of all subqueries preceding the operator;
[0029] Invert operation Its function is to find the complement of the entity set corresponding to a query; that is, for the input entity set, input its complement relative to the overall user entity set. Specifically,
[0030] The final query representation V is calculated. q Finally, it outputs the entity representation along with the data.
[0031] The input to the entity reasoning module is the query representation V. q and the entity representation The output is the entity representing the reasoning result.
[0032] The specific implementation method of the entity reasoning module is as follows: First, calculate V. q and The distance between them is calculated in both the radial and radian directions. The distance in both directions is divided into internal and external distances. The internal distance refers to the distance from the center to the entity, and the external distance refers to the distance from the region boundary to the entity. The distance in the radial direction is calculated using the Poincaré radius. First, the representation in tangent space needs to be mapped to the Poincaré disk space, and then calculated using the following formula:
[0033]
[0034]
[0035] in and yes At the radial boundary, g(·) is the function for calculating the difference of Poincaré radii, max(·) is the function for finding the maximum value of each element, |·| is the absolute value function, and |·|1 is the L1 norm;
[0036] External distances are measured using a sine function to measure the difference between angles because the Poincaré disk is conformal; therefore, angles on the Poincaré disk have the same definition as in Euclidean space.
[0037]
[0038]
[0039] Where θ min and θ max It is the boundary in the direction of curvature. It is the center of the radian direction represented by the entity, θ c The query represents the center of the radian direction, max(·) is the function to find the maximum value element-wise, |·| is the function to calculate the absolute value, and |·|1 is the L1 norm; the final distance d is calculated as follows:
[0040] d inter =d inter,in +τ·d inter,out ,
[0041] d intra =d intra,in +τ·d intra,out ,
[0042] d=α·d inter +β·d intra ,
[0043] Where τ is the scaling factor, and the overall distance should be small enough as long as the entity is within the region represented by the query; α and β are balance factors.
[0044] Then, sort the entities by distance, and output the top n entities as the result entities:
[0045]
[0046] The two modules mentioned above are combined into a single model for joint learning, with the following loss function:
[0047]
[0048] Where v is a positive example, i.e., the answer entity of the query; v' is a negative example; γ is the boundary hyperparameter that distinguishes between positive and negative examples; and σ is the sigmoid function.
[0049] The technical effects to be achieved by this invention are as follows:
[0050] A geometric vector representation framework on hyperbolic space is constructed, using a geometric region in the hyperbolic representation space to represent complex queries. Drawing inspiration from Venn diagrams, corresponding logical operations such as union, intersection, and complement are designed in the representation space. The final inference result is obtained by the distance between the geometric representation of the query and the entity representation.
[0051] Specifically:
[0052] 1. This invention utilizes complex query reasoning of user graphs to solve the entity reasoning problem in social networks. By optimizing the representation of user graph components, it can effectively address the negative impact of missing user attributes on entity reasoning in social networks. Furthermore, since the computation between vectorized representations can be parallelized, the efficiency of user recommendation can be greatly improved. Finally, the continuously accumulated user graph can provide a structured factual representation, which is convenient for maintenance.
[0053] 2. This invention designs a graph-based complex query reasoning framework based on hyperbolic geometric knowledge representation. It utilizes hyperbolic space to capture the hierarchical information of complex query structures; the logical operators designed on the hyperbolic representation space enable the framework to support almost all complex queries based on first-order logic. Attached Figure Description
[0054] Figure 1 A social network entity reasoning method architecture based on hyperbolic geometry knowledge representation;
[0055] Figure 2 Construction of the user graph;
[0056] Figure 3 Invert operation;
[0057] Figure 4 Calculate the distance between the query representation and the user entity representation; Detailed Implementation
[0058] The following are preferred embodiments of the present invention, which are described in conjunction with the accompanying drawings. However, the present invention is not limited to these embodiments.
[0059] This invention proposes a social network entity reasoning method based on hyperbolic geometry knowledge representation.
[0060] Query representation calculation module:
[0061] The input to this module is users on the social platform and their corresponding user attribute information, as well as the entities that need to be reasoned about. The output is the geometric vector representation of the query.
[0062] The input consists of users on the social platform, their corresponding user attribute information, and the entities to be reasoned about. The output is the geometric vector representation of the query.
[0063] First, a user graph is constructed from the users and their corresponding user attributes on the social platform, and then query processing is performed. Based on the recommendation requirements, a query is constructed by considering the attributes of the individuals to be recommended and the entities to be recommended. For example, if we want to recommend people to Li Si who graduated from the same university and are also friends with Li Si's friend Zhang San, such a recommendation requirement, "people who graduated from the same university as Li Si and are friends with Zhang San," can be expressed as:
[0064]
[0065] Here, v represents all answer entities, Gradute and Friend represent graduation and friendship relationships, Si and San represent Li Si and Zhang San entities respectively, and u represents the intermediate entity. For such a complex query, it needs to be transformed into a computation graph. Each node in the computation graph represents a subquery, and each edge represents a logical operator, including common first-order logical operators ∧, ∨, ... They operate between the entity sets corresponding to the subquery, respectively using Representation. Another special logical operator is relation mapping, using... This indicates that its function is to enable one-on-one reasoning based on specific relationships, such as... This represents the set of entities corresponding to the Gradute result for the Si entity. The computational graph for the above example is shown below. Figure 2 As shown:
[0066] Referring to the computation graph, as long as the implementation forms of query representation, entity representation, and logical operations are specified, the final query representation can be calculated step by step and output. The implementation forms of these parts will be introduced below.
[0067] First, let's consider the representation of the queries. Each query actually represents a set of entities on a person graph. For example, in the above example, the query Graduate(si,u)∧Graduate(u,v) represents the entity set "people who graduated from the same university as Li Si". These entities share some semantic similarity, so they will be in a finite region in the representation space. Therefore, we consider using a region in the representation space to represent a query. On the other hand, since Euclidean space cannot model hierarchical data well, while the subqueries of complex queries have obvious hierarchical structures, we use hyperbolic space as the representation space. Due to its special properties (the curvature of the space is a constant negative number), hyperbolic space is suitable for modeling hierarchical data. Here, we use a typical hyperbolic space, namely the Poincaré disk. Formally speaking, an n-dimensional Poincaré disk is an n-dimensional spherical space.
[0068] Specifically, a query is represented as in These represent the centers in the radial and radian directions, respectively. The center and offset together constitute a region in the Poincaré disk representation space, representing the offset in the radial and radian directions. The center represents the semantics of the entity set represented by the query, and the offset can intuitively represent the size (number of entities) of the entity set. Furthermore, because the gradient calculation method in hyperbolic space differs from that in Euclidean space, common optimizers cannot be directly used to optimize parameters; instead, a Riemann optimizer must be used. This incurs high time costs for model optimization and yields poor optimization results. Defining the query representation in tangent space avoids these problems. Tangent space is the space formed by the tangents of a point in hyperbolic space in all directions. It possesses the properties of Euclidean space, thus allowing the use of common optimizers (such as Adam) for optimization. The conversion between tangent space and hyperbolic space can be achieved through exponential and logarithmic mappings. The exponential and logarithmic mappings in the Poincaré disk space are as follows:
[0069]
[0070]
[0071] Where v is a point in tangent space, u is a point in the Poincaré disk space, and x is the center point of tangent space. It is a conformal factor and It's a Möbius stripe. In summary, the query is represented in the tangent space as... Available between the two To convert, 0 represents the tangent space at the center of the circle.
[0072] Secondly, there's the representation of entities. Since an entity can be viewed as a collection of entities with only one element, it can be represented using... and To express.
[0073] Next is the implementation of logical operations. This invention includes four logical operations: relational mapping. Intersection operation Union operation Invert operation The implementation of these four operations will be introduced below.
[0074] Relationship mapping Its function is to extract a query representation V from relation r. q Get another query representation V' q This refers to mapping relationships from one set of user entities to another. A multilayer perceptron is used here to perform this relational mapping operation.
[0075]
[0076] in It uses relational representation; MLP stands for Multilayer Perceptron. The plus sign represents element-wise multiplication and addition. f is a transformation function designed to make the output of the multilayer perceptron conform to the requirements of the Poincaré disk space. The implementation of f is as follows:
[0077]
[0078] Where σ is the sigmoid function.
[0079] Intersection operation Its function is to calculate multiple input queries. Find the intersection of the given elements, and then output the query representation corresponding to the intersection. This involves taking multiple entity sets as input and outputting the intersection of these sets. Here, an attention-based aggregation mechanism is used to calculate the center of the intersection, and a deep set network (DeepSetsNet)-based aggregation mechanism is used to calculate the offset of the intersection. Specifically, the calculation process for the center is as follows:
[0080]
[0081]
[0082] Where α and β are attention parameters. The offset is calculated as follows:
[0083]
[0084]
[0085] DeeSetsNet is a deep set network characterized by permutation invariance, meaning that the order of the inputs has no effect on the result.
[0086] Union operation Its function is to calculate multiple input queries. Find the union of the sets, and then output the query representation corresponding to the intersection. That is, it takes multiple entity sets as input and outputs the union of the input entity sets. This is because in this invention, all queries are transformed into the disjunctive normal form format, and all... Operators only appear at the end of the computation. Therefore, they can be directly expressed using the union of disjunctive queries. Right now Where V' q,i yes The query representation of all subqueries preceding the operator.
[0087] Invert operation Its function is to find the complement of the entity set corresponding to a query; that is, for the input entity set, find its complement relative to the overall user entity set. Due to the special properties of the Poincaré disk space, It can be directly represented using the spatial complement. Specifically, in like Figure 3 As shown:
[0088] After the above representation and operator preparation, the query representation calculation module calculates the final query representation V. q Finally, it outputs the entity representation along with the data.
[0089] Entity Reasoning Module:
[0090] The input to the entity reasoning module is the query representation V output by the module above. q and entity representation The output is the entity representing the reasoning result.
[0091] First, calculate V q and The distance between them is calculated in both the radial direction (inter-distancing) and the radian direction (intra-distance). Considering V... q This refers to a spatial region; therefore, this invention divides the distance in both directions into in-distance and out-distance. In-distance refers to the distance from the center to the entity, and out-distance refers to the distance from the region boundary to the entity. Figure 4 As shown.
[0092] Formally, the distance in the radial direction is calculated using the Poincaré radius, which is the distance between a point in the Poincaré disk space and the center of the disk. Distances in hyperbolic spaces like the Poincaré disk differ from Euclidean distances; the Poincaré radius increases faster the distance from the center. First, the representation in tangent space needs to be mapped to the Poincaré disk space, and then calculated using the following formula:
[0093]
[0094]
[0095] in and yes At the radial boundary, g(·) is the function for calculating the difference in Poincaré radii, max(·) is the function for finding the maximum value element-wise, |·| is the absolute value function, and |·|1 is the L1 norm. The distance in the radian direction is measured using a sine function to measure the difference between angles. This is because the Poincaré disk is conformal; therefore, angles on the Poincaré disk have the same definition as in Euclidean space.
[0096]
[0097]
[0098] Where θ min and θ max It is the boundary in the direction of curvature. It is the center of the radian direction represented by the entity, θ c The query represents the center of the radian direction, max(·) is the function to find the maximum value element-wise, |·| is the function to calculate the absolute value, and |·|1 is the L1 norm. The final distance d is calculated as follows:
[0099] d inter =d inter,in +τ·d inter,out ,
[0100] d intra =d intra,in +τ·d intra,out ,
[0101] d=α·d inter +β·d intra ,
[0102] Where τ is the scaling factor, and the overall distance should be small enough as long as the entity is within the region represented by the query; α and β are balance factors.
[0103] After obtaining the distance, sort the entities by distance, and output the top n entities as the result entities:
[0104]
[0105] The two modules mentioned above are combined into a single model for joint learning, with the following loss function:
[0106]
[0107] Where v is a positive example, i.e., the answer entity of the query; v' is a negative example; γ is the boundary hyperparameter that distinguishes between positive and negative examples; and σ is the sigmoid function.
[0108] The overall model completes the task of inferring relationships between people in two stages: the training stage and the prediction stage.
[0109] During the training phase: The distance between the entity representation and the query representation is calculated using the two modules mentioned above. Then, the loss function is calculated, and the model parameters are continuously optimized as the model trains, resulting in the trained entity representation and logical operation parameters.
[0110] In the prediction phase: the input graph and the recommended query to be reasoned are used to calculate the corresponding query representation using the trained model, and finally the recommended entity is obtained by the distance between the graph and the entity representation.
Claims
1. A social network entity reasoning method based on hyperbolic geometry knowledge representation, characterized in that: The design includes a query representation calculation module and an entity reasoning module. First, the social network graph and the users to be recommended are obtained. The social network graph and the users to be recommended are input into the query representation calculation module. The query representation and entity representation of the users are input into the entity reasoning module. In the query representation calculation module, after the social network graph and the user information to be recommended go through the process of constructing a calculation graph and obtaining anchor entities, they enter the process of calculating the sub-query representation according to the corresponding logical operators. If the calculation of the sub-query representation is not finished, it continues to be executed. If it is finished, the geometric vector representation of the query obtained by the calculation result is input into the entity reasoning module. The entity reasoning module takes the geometric vector representation of the query as input, converts it into the final query representation, and uses it together with the entity representation to calculate the distance between the query representation and the entity representation. Then, it extracts the top k user entities to obtain the final reasoned user entities. After receiving the social network graph and the users to be recommended, the process of constructing the computation graph and obtaining anchor entities first constructs a user graph by taking the users in the social platform and their corresponding user attribute information. The process is to perform query processing. According to the recommendation requirements, the attributes of the people to be considered and the entities of the people to be recommended are constructed into a query. For each such query, it needs to be transformed into a computation graph. Each node of the computation graph represents a sub-query and each edge represents a logical operator. The specific process of calculating the subquery representation is as follows: The query is represented as follows: Each query actually represents a set of entities on the social graph. A query is represented as a neighborhood of a semantic center in a hyperbolic representation space, in the form of: ,in These represent the centers in the radial and radian directions, respectively. The center and offset together constitute a region in the Poincaré disk representation space, representing the offset in both the radial and radian directions. The center represents the semantics of the entity set represented by the query, and the offset can intuitively represent the size of the entity set. The query representation is defined in the tangent space. The transformation between the tangent space and the hyperbolic space is achieved through exponential and logarithmic mappings. The exponential and logarithmic mappings in the Poincaré disk space are as follows: in It is a point in tangent space. It is a point in the space of the Poincaré disk. It is the center point of the tangent space. It is a conformal factor , and It's a Möbius stripe, and the query in tangent space is represented as... The two can be used To convert, Represents the tangent space at the center of the circle; An entity is represented as a neighborhood with a zero offset, therefore it can be used ,and To indicate; There are four ways to implement logical operations: relational mapping. Intersection operation Union operation Invert operation ; Relationship mapping Use a multilayer perceptron to perform the relation mapping operation: in It is a relational representation. It is a multilayer perceptron. and It involves element-wise multiplication and addition. It is a transformation function whose purpose is to make the output of the multilayer perceptron conform to the requirements of the Poincaré disk space. The implementation is as follows: in It is the sigmoid function; Intersection operation Calculate multiple input queries Find the intersection of the given elements, and then output the query representation corresponding to the intersection. That is, it takes multiple entity sets as input and outputs the intersection of the input entity sets. An attention-based aggregation mechanism is used to calculate the center of the intersection, and a deep ensemble network-based aggregation mechanism is used to calculate the offset of the intersection. The calculation process for the center is as follows: in and This is the attention parameter, and the calculation of the offset is defined as follows: in It is a deep ensemble network, characterized by permutation invariance, meaning that the order of the inputs has no effect on the result; Union operation Its function is to calculate multiple input queries. Find the union of the sets, and then output the query representation corresponding to the intersection. That is, it takes multiple entity sets as input and outputs the union of the input entity sets, which can be directly expressed as the union of disjunctive queries. ,Right now ,in yes The query representation of all subqueries preceding the operator; Invert operation Its function is to find the complement of the entity set corresponding to a query; that is, for the input entity set, input its complement relative to the overall entity set. Specifically, ; The final query representation is then calculated. Finally, it outputs the entity representation along with the data. .
2. The social network entity reasoning method based on hyperbolic geometry knowledge representation as described in claim 1, characterized in that: The input to the entity reasoning module is the query representation. and the entity representation The output is the entity of the reasoning result.
3. The social network entity reasoning method based on hyperbolic geometry knowledge representation as described in claim 2, characterized in that: The specific implementation method of the entity reasoning module is as follows: First, calculate... and The distance between them is calculated in both the radial and radian directions. The distance in both directions is divided into internal and external distances. The internal distance refers to the distance from the center to the entity, and the external distance refers to the distance from the region boundary to the entity. The distance in the radial direction is calculated using the Poincaré radius. First, the representation in tangent space needs to be mapped to the Poincaré disk space, and then calculated using the following formula: in and yes At the radial boundary, It is a function for calculating the difference in Poincaré radii. It is a function that finds the maximum value among its elements. It is an absolute value function. yes Norm; External distances are measured using a sine function to measure the difference between angles because the Poincaré disk is conformal; therefore, angles on the Poincaré disk have the same definition as in Euclidean space. in and It is the boundary in the direction of curvature. It is the center of the arc direction represented by the entity. It is the center of the radian direction represented by the query. It is a function that finds the maximum value among its elements. It is a function for calculating absolute value. yes Norm; final distance The calculation is as follows: in It is a scaling factor. As long as the entity is already within the area represented by the query, the overall distance should be small enough. and It is the balance coefficient; Then sort the entities by distance, ranking them higher. Each entity is output as a result entity: The two modules mentioned above are combined into a single model for joint learning, with the following loss function: in, It is a positive example, that is, the answer entity of the query; It is a negative example. These are the boundary hyperparameters that distinguish between positive and negative examples. It is the sigmoid function.