An automatic meta-path mining method for person relationship networks

SchemaWalk addresses the inefficiencies of existing meta-path mining methods by using neural reinforcement learning to model meta-path discovery as a Markov decision process, enabling efficient and accurate mining of high-quality meta-paths in complex person relationship networks.

CN114722212BActive Publication Date: 2024-12-17NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210193141.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-28
Publication Date
2024-12-17
Estimated Expiration
2042-02-28

AI Technical Summary

Technical Problem

Existing meta-path mining methods for complex person relationship networks are computationally expensive and lack the ability to summarize partial observations into general rules, making them inefficient for large-scale knowledge bases with numerous entity and relationship types.

Method used

An automatic meta-path mining method using neural reinforcement learning (SchemaWalk) that models meta-path discovery as a Markov decision process on a pattern graph, enabling efficient mining of high-quality meta-paths directly on the pattern network without relying on local observations.

Benefits of technology

SchemaWalk effectively discovers meta-paths with high coverage and confidence, outperforming other algorithms in link prediction tasks on large-scale knowledge graphs, demonstrating improved efficiency and accuracy in analyzing complex patterns.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114722212B_ABST
    Figure CN114722212B_ABST
Patent Text Reader

Abstract

The present invention discloses an automatic meta-path mining method for a person relationship network, which obtains a pattern graph and an instance graph of a person relationship network; divides entity pairs into a training set / test set; uses an agent to mine meta-paths through a Markov decision process, uses a policy network for iterative training, and obtains the identified meta-paths and their coverage and confidence; the filtered test set is used as a positive sample, and for each sample, the confidences of all meta-paths connecting the sample are added, and the sum of the confidences is the similarity; obtains fact triplets in the test set, and uses a linear regression model to predict the relationship between entities. The present invention models the meta-path search problem as an MDP process on a pattern network, uses a reinforcement learning agent with a complex strategy, and the strategy is parameterized by a long short-term memory network, and can find meta-paths with high coverage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence technology, and in particular relates to an automatic meta-path mining method for a task relationship network. Background Art

[0002] Heterogeneous information networks (HINs) such as DBPedia, Amazon product maps, and protein databases have developed rapidly in recent years, providing valuable resources for many real-world applications such as personal relationships, academic activities, business activities, and drug-target interaction relationships. Figure 1 The heterogeneous information network shown is a person-relationship network that distinguishes between entity types and relationship types in the network. In order to better describe the complex structure of person-relationships, we simultaneously characterize person-relationships from two perspectives, namely: (1) a pattern graph that provides a meta-level description of the network and (2) an instance graph that provides an instance-level description of specific entities. In order to capture the rich structural information in person-relationships, the concept of meta-path has been proposed by scholars to provide a meta-level description of person-relationships. Given two specific entities, the meta-path is a sequence of entity types and relationship types that connect them, which is a meta-level description of the path in the person-relationship. For example, in Figure 1 , the entity pairs Planck and Germany can be connected by the following meta-path:

[0003] These meta-paths, despite their different intermediate entity types and lengths, all illustrate to some extent that Planck is a citizen of Germany. Since meta-paths provide good interpretability while predicting missing links in person relationships, many works use meta-paths for person relationship link prediction tasks. In addition, since meta-paths describe concepts at the pattern level, they also have strong knowledge transfer capabilities in inferential experiments. Traditionally, meta-path-based work is mainly oriented towards person relationships with simple patterns (such as literature networks with only a few entity types), and the meta-paths therein are usually customized by experts based on expert knowledge. There are few works that use meta-paths for person relationships with complex patterns (such as knowledge bases (KBs) with hundreds of entity and relationship types), because it is NP-hard to enumerate all possible meta-paths of fixed length on person relationships with complex patterns.

[0004] Despite the significant advantages of meta-paths, obtaining them in practice is often laborious. Most existing meta-path-based studies only use simple person relationships (e.g., DBLP with only 4 entity types) to demonstrate the performance of similarity functions under meta-paths. In these works, some artificially define meta-paths based on domain knowledge, while others enumerate all possible meta-paths and select meta-paths according to their needs. However, there are also a wide range of complex person relationships in the real world (e.g., knowledge bases), covering a large number of entity types and relationship types. For example, NELL contains 285 entity types and 827 relationships. The number of all possible meta-paths grows exponentially with the length of the meta-path, which makes mining high-quality meta-paths for various tasks computationally very expensive, and is the main reason why meta-paths are not as popular in knowledge bases as in simple person relationships.

[0005] Some recent works have made pioneering attempts in meta-path mining in complex character relationships in patterns. However, most of them learn meta-paths at the instance level. They rely on greedy strategies or reinforcement learning to learn path instances between two entities for link prediction. Although they have achieved good performance in knowledge graph completion tasks, they lack the ability to summarize these partial observations of path instances into general rules at the pattern level. Other methods perform breadth-first search or A* algorithm at the pattern level to generate meta-paths, but they all lack suitable signals from instance-level networks.

[0006] After Sun et al. proposed the concept of meta-paths that carry semantic information and measure entity relevance, more and more papers have verified their applicability and performance in various tasks, among which the typical application is link prediction. The most critical step of meta-path-based reasoning methods is to discover meta-paths. The simplest discovery method is to enumerate fixed-length meta-paths, but the computational cost is very high for complex HINs. Lao and Cohen generate meta-paths within a fixed length l and propose a learnable proximity metric based on these meta-paths, but the algorithm performance is heavily dependent on l, and the appropriate l varies greatly between datasets. Shi and Weninger proposed a general framework for mining meta-paths from complex HINs, using classical knowledge discovery methods and discussing the impact of type granularity on similarity. Meng et al. proposed a greedy algorithm FSPG that can consider user input and derive the most relevant subset of meta-paths for the selected entity pair. Yang et al. combined deep embedding and continuous reinforcement learning to learn implicit meta-paths and calculated the similarity score as the empirical probability of reaching the target entity. However, their model requires pre-specification of the source and target types (the source and target types are usually also required to be consistent) and can only handle simple meta-paths. It is worth noting that Wan et al. first proposed a reinforcement learning framework MPDRL that considers type context, generating path instances and then abstracting them into meta-paths. However, MPDRL is easily limited by the performance of its pathfinding component, and its overall performance depends on partial observations (generated path instances). Summary of the invention

[0007] In view of this, the present invention proposes an automatic meta-path mining method for character relationship networks, which is based on the framework of neural reinforcement learning SchemaWalk: the intelligent agent learns to walk directly on the pattern graph and establishes an ideal meta-path with the query relationship as the target. Compared with the meta-path mining method learned on the instance graph, SchemaWalk is more effective. Because it obtains high-quality meta-paths directly on the pattern network without summarizing from local observations. Compared with other graph traversal methods on the pattern graph, SchemaWalk is more efficient, thanks to the good performance of reinforcement learning methods guided by appropriate reward signals in ultra-large search spaces. Extensive experiments on two large knowledge graphs have demonstrated the excellent performance of SchemaWalk in analyzing HIN with complex patterns. This result also emphasizes the significant importance of high-quality meta-paths for knowledge graphs.

[0008] The present invention discloses an automatic meta-path mining method for a person relationship network, comprising the following steps:

[0009] Obtain the pattern diagram and instance diagram of the character relationship network;

[0010] Based on breadth-first search, remove the query relationship r in the pattern graph and instance graph q Remove r from all connected entity pairs q After that, there are instance paths within a certain number of hops, and the remaining entity pairs are divided into training sets and test sets;

[0011] Check the training set and r q For all relevant entity pairs, use an agent to mine meta-paths through a Markov decision process, and the agent's reward is obtained by the coverage of the meta-path in the instance graph;

[0012] Iterative training is performed using a policy network. During the training process, type node embedding is used to represent type nodes in the pattern graph to speed up the search for meta-paths. After the training, the identified meta-paths and their coverage and confidence are obtained.

[0013] For each sample in the filtered test set, add up the confidences of all meta-paths connecting the sample, and the sum of the confidences is the similarity;

[0014] Get the fact triples in the test set, where the entity to be predicted has appeared in the training set, and use the linear regression model to predict whether there is a certain relationship between the given two entities;

[0015] Output the predicted relationship between two entities.

[0016] Furthermore, the schema diagram includes entity type T, relationship R, type mapping τ and relationship mapping φ; for query relationship r q , the agent randomly selects from the pattern graph by r q The connected entity type pair (t src , t tgt ) in the header type t src Start by maximizing the reward corresponding to the meta-path by walking it using the Markov decision process.

[0017] Furthermore, the Markov decision process uses the tuple The description is as follows:

[0018] At step i, state S i By (t i ,t src ,r q ,t tgt ) indicates that t i Represents the current entity type, t src and t tgt For the pattern diagram, r q Pairs of connected entity types, state space Contains all valid combinations of T×T×R×T;

[0019] action Given a state S i =(t i ,t src ,r q ,t tgt ), action space It is a pattern diagram T G Medium type node t i All outgoing edges of plus an operation that remains unchanged, that is From the entity type node t src Initially, the agent iteratively selects l-1 most preferred actions based on the embedded representation of edge r and tail entity type node t, forming a meta-path of length l or staying at t tgt , once the agent reaches t before the maximum number of steps tgt ;

[0020] The environmental mechanism is determined by the state transition probability describe, That is, the current state of the agent is adjusted according to the type of node t connected by the selected r. is the state space, for action;

[0021] award The quality of the currently discovered meta-path is evaluated and continuously guided for training.

[0022] Furthermore, the reward is calculated as follows:

[0023]

[0024] in is the coverage of the meta-path M in the instance graph, I arrival (M)∈{0,1} is the reaching index, λ is the weighted combination coefficient, and the reward is normalized in the interval [0,1];

[0025] The coverage of the meta-path M in the instance graph is given by the query relation r q The entity pair connected to M is connected to the network Zhongyour q The ratio of all connected entity pairs is calculated as follows:

[0026]

[0027] Among them, Con M (v i , v j ) represents the entity pair (v i , v j ) are connected by a meta-path M;

[0028] The arrival index is calculated as follows:

[0029]

[0030] Where & represents the logical AND operator, where I{t l =t tgt} is used to check the terminal position t of the agent l Whether to reach the target type node t tgt , Used to prevent the agent from staying at the starting node t src .

[0031] Furthermore, the policy network includes an encoder and a decoder, wherein the encoder is parameterized by a two-layer long short-term memory network, which transforms the state S of time step i into i Encoded as a vector representation S i , and S i With entity type t i , query relation r q And by r q The target type node t in the connected entity type pair tgt and r q The difference items are spliced ​​together to form the code enc i ;

[0032] The decoder is parameterized by a two-layer multilayer perceptron network with rectified linear units. i Decoding, multiply the decoded output by the decision feature matrix D i , and calculate the action probability distribution through a softmax layer

[0033] P = softmax(D i (W2(ReLU(W1enc i +b1))+b2)

[0034] Among them, W1 and W2 are the weights of the two-layer perception network, b1 and b2 are the biases of the two-layer perception network;

[0035] Based on the action probability distribution P, the agent takes an action and moves to the next type node.

[0036] Furthermore, the decision feature matrix D i is obtained by the following method:

[0037] Through the candidate relationship r c and type node t cConcatenate to represent an edge, and stack the vector representations of all edges to obtain the decision feature matrix D i ,

[0038]

[0039] in, represents the stacking operator, the candidate relation r c and type node t c Determined by the outgoing edges of the current type of node, For the action space.

[0040] Furthermore, the reinforcement learning objectives of the policy network are:

[0041]

[0042] Among them, π θ(M) is a network that follows the strategy π θ The generated meta-path distribution of length l, θ is the parameter in LSTM and MLP, for the said reward.

[0043] Furthermore, the training objective is optimized along the following directions:

[0044]

[0045]

[0046] To estimate the gradient in the above formula, randomly Sample K entity type pairs (t src , t tgt ) and run N trajectories in parallel for each sample. The trajectory obtained by this sampling method is approximated by the following formula:

[0047]

[0048] Furthermore, to represent the type nodes in the pattern graph, the average pooling of the embedding vectors of the same type of entities in the instance graph is used as initialization, and the mathematical calculation is as follows:

[0049]

[0050] where v i is the embedding vector of entities of the same type, and τ is the action trajectory sampled based on the current strategy.

[0051] Furthermore, the person-oriented relationship network is a heterogeneous information network with complex patterns, composed of multiple types of nodes and edges, where nodes represent people or organizations and their characteristics, edges represent relationships between people or organizations, and meta-paths are sequences of entity types and relationship types connecting two given specific entities, which are meta-level descriptions of paths in person relationships; the person-oriented relationship network includes Yago and NELL knowledge graphs, where Yago is a knowledge graph based on facts automatically extracted from Wikipedia and WordNet, and NELL is a knowledge graph constructed by extracting structured information from unstructured web pages.

[0052] The beneficial effects of the present invention are as follows:

[0053] For the first time, we explored the automatic meta-path discovery method at the pattern level for person-to-person relationship networks, and modeled the meta-path finding problem as a deterministic Markov decision process (MDP) on the pattern network. The agent's reward is obtained by the coverage of the meta-path in the instance graph.

[0054] We design a reinforcement learning agent with a complex policy parameterized by a long short-term memory network that is able to find meta-paths with high coverage.

[0055] Extensive experiments were conducted on two large-scale real-world person relationship networks, demonstrating that the proposed method outperforms other advanced baseline algorithms and indicates that meta-path is also very effective in analyzing HINs with complex patterns (such as knowledge graphs). BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 Example diagrams of two perspectives of the person relationship network, where each entity in the instance diagram is associated with an entity type in the pattern diagram;

[0057] Figure 2 Schematic diagram of the metapath mining environment formalized as a deterministic Markov process in the present invention;

[0058] Figure 3 The policy network of the present invention is based on the encoder-decoder architecture. DETAILED DESCRIPTION

[0059] The present invention is further described below in conjunction with the accompanying drawings, but the present invention is not limited in any way. Any changes or substitutions made based on the teachings of the present invention belong to the protection scope of the present invention.

[0060] The present invention first defines heterogeneous information networks, network patterns, meta-paths, coverage and confidence, and then formalizes the meta-path finding problem into a Markov decision process. Based on this, the SchemaWalk model (including the policy network architecture and type node representation) and the reinforcement learning training method are first introduced.

[0061] Definition 1 (Heterogeneous Information Network, HIN) Heterogeneous Information Network is a directed graph G = (V, E, τ, φ), where V represents the set of entities in the graph, Represents the set of edges connecting V. The type mapping is τ: V→2 T Represented as, where T represents the set of entity types; the relationship mapping is φ: E→2 R , where R represents the relationship set.

[0062] Example 1: Figure 1 An example micro HIN graph is shown, where T = {person, scientist, university, city, country} and R = {is a citizen of ..., was born in, works in, graduated from, is located in}. The relationship between Planck and Germany is φ(Planck, Germany) = {is a citizen of ...}, and Planck's type is τ(Planck) = {person, scientist}.

[0063] Definition 2 (Network Mode) Network Mode T G =(T, R, τ, φ) is A meta template defined on entity type T and relationship R, which includes type mapping τ and relationship mapping φ. In the present invention, a network pattern is also referred to as a pattern graph, and G=(V, E, τ, φ) is referred to as an instance graph.

[0064] Definition 3 (Meta-path): Each meta-path M is a pattern graph T G A path of length l is defined as where t i ∈T represents the entity type, r i ∈R represents a relationship. Path The metapath M is satisfied if and only if t i ∈τ(υ i )and e i ∈φ(υ i , i +1; in this case, the entity pair (v1, v l ) are connected by M.

[0065] Example 2: Figure 1 In the path satisfy

[0066] Definition 4 (Coverage) In identifying the query relation r q When the coverage of the meta-path M is given by r q The entity pair connected to M is Zhongyour q The ratio of all entity pairs connected,

[0067]

[0068] Among them, Con M (v i , v j ) represents the entity pair (v i , v j ) are connected by a meta-path M.

[0069] Definition 5 (Confidence) In identifying the query relation r q When The confidence of a given fact in is similar to formula (1). The denominator here is the number of all entity pairs connected by M:

[0070]

[0071] Example 3: Consider a micro-HIN with 250 people graduating from German universities, 150 of whom are German citizens and 100 are international students, for a total of 200 German citizens. In this case, For the query relationship is... the coverage rate of citizens is The confidence level is

[0072] Figure 2 and Figure 3 This is the overall architecture of the SchemaWalk of the present invention. Figure 2 The meta-path mining environment is formalized as an MDP. The thick arrows in the pattern diagram represent the paths taken by the agent, and the dashed arrows represent the connection between the two layers of the HIN. The dotted line represents the inverse relationship. Figure 3 This is the policy network based on the encoder-decoder architecture in SchemaWalk. In this figure, the vector arrows represent the vector representation of the variables.

[0073] The meta-path mining problem on the pattern graph is modeled as a Markov decision process (MDP). q , the agent randomly selects from the pattern graph by r q The connected entity type pair (t src , t tgt ) in the header type t src, and adaptively adjusts its strategy and walks through appropriate exploration and exploitation to maximize the reward corresponding to the meta-path. This MDP can be represented by the tuple The description is as follows:

[0074] state At step i, state S i By (t i , t src , r q , t tgt ) is expressed as follows. i Represents the current entity type. State Space Contains all valid combinations of T×T×R×T.

[0075] action Given a state S i =(t i , t src , r q , t tgt ), action space It is a pattern diagram T G Medium type node t i All outgoing edges of plus an operation that remains unchanged, that is From type node t src Initially, the agent iteratively selects l-1 most preferred actions based on the embedding representation of the edge r and the tail entity type node t, forming a meta-path of length l or staying at t tgt , once it is reached before the maximum number of steps.

[0076] State Transfer The environmental mechanism is determined by the state transition probability Description. Given S i =(t i , t src , r q , t tgt ) and A=(t i , r, t), That is, the current state of the agent is adjusted according to the type of node t connected to the selected r.

[0077] award The reward signal evaluates the quality of the currently discovered meta-path and continuously guides the training. It consists of two parts: the coverage in the instance graph (Formula (1)) and the reach indicator I defined as follows arrival (M)∈{0,1}:

[0078]

[0079] Where & represents the logical AND operator. The arrival indicator is used to check the terminal position of the agent.l Whether to reach the target type node t tgt (first item), and prevent the agent from staying at the starting node t src (Second term). The second logic is essential when reasoning about connections of the same type, e.g. , the agent may mistakenly believe that it has reached the target type (team) at the beginning and never move from beginning to end, and fail to generate a meta-path. The two rewards are weighted by λ and normalized in the [0, 1] interval:

[0080]

[0081] Based on experimental results, λ=2 is set in this embodiment.

[0082] This section introduces in detail the embedding representation method of the policy network and type nodes based on the encoder-decoder architecture in SchemaWalk.

[0083] Policy Network: To efficiently search for meta-paths in HINs with complex patterns, we design a policy network based on an encoder-decoder architecture. Figure 3 As shown, its encoder is parameterized by a two-layer long short-term memory network (LSTM), which converts the state S at time step i into i Encoded as a vector representation S i Specifically, LSTM converts the relationship and type nodes The concatenation of the vector representations of i and the updated history vector h i . S i Further with t i , r q and t tgt and r q The difference items are spliced ​​together to form the code enc i The difference term is used to help the agent find the head entity type adjacent to the query target type. [·||·] represents the concatenation operator.

[0084] h i , S i =LSTM(h i ,[r i-1 ||t i ])

[0085] enc i =[S i ||t i ||r q ||(t tgt-r q )] (5)

[0086] The decoder consists of a two-layer multilayer perceptron (MLP) network with rectified linear units (ReLU) (the hidden layer dimension is d h ) parameterized. All candidate relations r c and type node t c Determined by the outgoing edges of the current type of node. We use r c and t c The concatenation of represents an edge, and all vector representations are stacked to obtain the decision feature matrix D i . i After being passed into the MLP, its output is multiplied by D i And calculate the action probability distribution through a softmax layer

[0087]

[0088] in, represents the stacking operator. The entire policy network is represented by π θ , θ is the parameter in LSTM and MLP. Based on the action probability distribution P, the agent takes action and moves to the next type node according to the environment mechanism.

[0089] The embedding representation of type nodes indicates that if we only focus on the network connectivity of the pattern graph, the agent's ability to understand type nodes will be reduced, hindering the meta-path mining process. To represent the type nodes in the pattern graph, this embodiment uses the average pooling of the embedding vectors of the same type of entities in the instance graph as initialization (Formula (7)). Adaptive adjustment can be selected during training. The instance node embedding is obtained by TransE (TransE is common knowledge in the art and will not be repeated here).

[0090]

[0091] Training method: Due to the complexity of the meta-path mining problem in complex network patterns, this embodiment uses reinforcement learning to train the strategy network π of the SchemaWalk agent. θ , and perform I t training iterations to maximize formula (4). The training objective is,

[0092]

[0093] Among them, π θ(M) is to follow the strategy π θ The generated meta-path distribution of length l. According to the REINFORCE algorithm, formula (8) can be optimized along the following directions:

[0094]

[0095]

[0096] To estimate the gradient in formula (9), randomly Sample K entity type pairs (t src ,t tgt ) and runs N trajectories in parallel for each sample. The gradient is approximated by the trajectory obtained in this sampling manner,

[0097]

[0098] in, is the jth action, is the jth state.

[0099] This example uses a moving average baseline to reduce variance to stabilize the training process. The baseline is calculated by averaging the cumulative discounted rewards. Although the Actor-Critic algorithm with a parameterized baseline is popular in the field of reinforcement learning, we did not observe any performance improvement when using this algorithm. Nevertheless, to encourage SchemaWalk's exploration behavior to perform differentiated meta-path discovery, we added an additional entropy regularization term weighted by β to the loss function. Finally, the ADAM optimizer is used to minimize the loss at a rate of α.

[0100] This section illustrates the effectiveness of the SchemaWalk model through link prediction experiments on two representative real-world complex HINs.

[0101] We compare SchemaWalk with six existing state-of-the-art relational reasoning methods, which can be classified as meta-path-based, embedding-based, or multi-hop-based methods. These baselines include:

[0102] MPDRL summarizes instance paths into meta-paths after the reinforcement learning agent discovers them. We use the code implementation and parameters reported in the paper by Wan et al.

[0103] PCRW mines meta-paths based on random walks. You can use the Python code published on Github.

[0104] Autopath combines reinforcement learning and deep content embedding, and models the similarity between instance pairs as the empirical probability of the head entity reaching the tail entity using the trained model. We input the training set and generated samples into the model and report the best results after tuning the parameters.

[0105] RotatE learns vector embeddings to represent entities and relations in the knowledge graph. We adopt the hyperparameters reported in the paper on the Yago dataset and extend them to NELL.

[0106] TransE builds the embedding of triples by making the sum of the head entity / relation vectors close to the tail entity vector. We use the Pytorch code implementation of Han et al. For RotatE and T-ansE, we calculate the Hadamard product of the head / tail entity embeddings and use SVM classifiers for link prediction.

[0107] MINERVA is a method for automated reasoning based on neural reinforcement learning multi-hop. Similar to their evaluation method on NELL using the prediction scores (logits) of head / tail entity pairs, we calculate the prediction scores of all positive and negative samples and obtain the similarity by performing a softmax operation on these scores, which is better than using the raw scores. The statistics of the dataset are summarized in Table 1.

[0108] Table 1: Statistics of the dataset

[0109]

[0110] The type links in Table 1 are links that map entities in the instance graph to entity types in the pattern graph.

[0111] Advances in information extraction techniques have driven the generation of real-world knowledge graphs, which we can view as HINs with complex patterns.

[0112] Yago26K-906 Yago is a knowledge graph based on facts automatically extracted from Wikipedia and WordNet. The original Yago imposes restrictions on the semantic relationships between entity types. Therefore, the present invention uses the semantically rich core Yago data preprocessed by Hao et al.

[0113] NELL NELL is a knowledge graph built through an ongoing effort to extract structured information from 500 million unstructured web pages. The present invention utilizes the preprocessed 1115th part of NELL, where facts connected by redundant relation generalizations are removed.

[0114] Consider three relations in each dataset: {is a citizen of, died in, graduated from} for Yago, {works at, competes with, plays with} for NELL. q When mining a fixed-length meta-path, this embodiment first checks the relationship r based on breadth-first search. qWhether to remove r from all connected entity pairs q After that, there is an instance path within l-1 hops. Entity pairs that fail in this way are filtered out, and the remaining entity pairs are divided into training / testing sets with a ratio of 8:2.

[0115] Before training, facts in the test set are removed from the instance graph, and meta-path coverage and confidence are calculated based on the removed instance graph. It is worth noting that relations on NELL can connect many entity types (for example, the relation with competes with... connects 1488 entity types). If we equally mine meta-paths that are not equally useful for mining these types, this embodiment will ignore a large number of valid meta-paths. To avoid this, this embodiment checks the meta-paths in the training set that are related to r. q All entity pairs related to the model are selected, and the meta-path is mined for the minimum type pairs that meet a certain ratio of instance pairs (set to 80%). After training, the identified meta-paths are stored in a file with their coverage and confidence. The settings of the hyperparameters can be referred to in Table 2.

[0116] Table 2: Hyperparameter settings

[0117]

[0118] In the link prediction experiment, the filtered test set constitutes the positive samples. Following the approach of Wan et al., the tail entities in the instance graph samples are replaced with fake entities of the same type to generate negative samples. The ratio of positive / negative samples is 2:1. For each sample, the confidences of all meta-paths connecting the sample are added together, and the sum of the confidences is the similarity. A linear regression model with L1 regularization is used for link prediction, and SchemaWalk is compared with other baseline algorithms.

[0119] For SchemaWalk and all baseline methods, two metrics are used for comparison, namely the area under the ROC curve (ROC-AUC) and the average precision (AP). For each method, 5 independent runs are performed, and each metric shows the average performance in the format of (mean ± variance).

[0120] This example is experimented on a desktop computer with a 10-core CPU, 32GB memory, and a 12GB RTX-2080Ti GPU. Even using a sparse matrix to calculate the coverage and confidence of all potential meta-paths is time-consuming. Therefore, during training, the coverage and confidence of the explored meta-paths are temporarily stored in memory to reduce unnecessary calculations.

[0121] This section reports the ROC-AUC and AP results of SchemaWalk and other baselines for link prediction tasks for six relationships, as shown in Table 3. The link prediction task implements the fact graph (Yago and NELL, which come from Wikipedia or Internet crawlers and contain many fact triples, such as (Germany, Capital, Berlin), etc.), predicting whether there is a certain relationship between two given entities, where the entities to be predicted have appeared during training.

[0122] Table 3: ROC-AUC and AP results for link prediction. The best result in each relation is marked in bold, and the second best result is underlined.

[0123]

[0124]

[0125] As shown in Table 3, SchemaWalk performs well in predicting all relations in Yago and NELL, and only lags behind the embedding-based methods in predicting relations in NELL and in the competition with... Even in its worst case, SchemaWalk in Yago still exceeds the average performance of other baselines. In the NELL dataset, SchemaWalk also shows stable performance.

[0126] Among the meta-path-based baselines, MPDRL achieves relatively satisfactory results with its reinforcement learning-based path exploration strategy. Autopath also performs relatively well, but its ability is limited by the number of meta-paths it discovers, especially when the query relation involves a huge meta-path space. PCRW is the worst model among them because it is based on randomness. MINERVA based on multi-hop reasoning performs well when reasoning about the two relations "citizens" and "workers", but performs poorly when reasoning about the other four relations. We notice that MINERVA has a very low proportion of tail entities reached during training for these four relations (while the arrival rate for the first two relations is much higher), which affects the calculation of similarity.

[0127] It can be observed that embedding-based methods (especially RotatE) perform well in reasoning about two relations in NELL. Upon closer inspection, it is noted that the two relations, Matches with and Competes with, connect thousands of concept pairs, forming a huge sub-schema graph with more than 10 million meta-paths. These meta-paths are often of low relevance and each applies to only a few instance pairs, thus causing great trouble for meta-path-based methods. Even if all meta-paths are enumerated, the typical problem of knowledge graphs - missing links will hinder the reasoning process. In contrast, embedding-based methods break through the structural constraints by measuring the distance between entities through vector representations. However, in inference experiments without pre-existing entities in the training set, embedding-based methods can only randomly initialize embeddings for reasoning and get poor results equivalent to blind guessing. SchemaWalk is much less sensitive in inference experiments.

[0128] This section conducts ablation experiments to analyze the contribution of each component to the performance of the SchemaWalk model. We select the Yago dataset, change the entity type representation method and meta-path similarity function in turn, and conduct experiments.

[0129] Table 4: Comparison of model performance using different instance entity embeddings. The best and second best results in ROC-AUC / AP are marked in bold and underlined, respectively.

[0130]

[0131] In the present invention, the type node embedding representation is obtained by mean pooling after obtaining the instance node embedding using T-ansE, and the type node embedding representation is not adjusted during the training process. The present invention studies the impact of adjustable embeddings on the experiment during training. In addition, since RotatE can often produce better representation embeddings than TransE, the present invention also compares it. Because the network topology of SchemaWalk only accepts entity / relationship embeddings of the same dimension, the variant pRotatE proposed together with RotatE is adopted. The present invention also considers random initialization with / without adjustment as an alternative embedding scheme.

[0132] As shown in Table 4, TransE, which is chosen without adjustment, has the best overall performance, with good prediction performance and search efficiency. The random initialization scheme brings relatively better results at the expense of computation time (almost twice as many meta-paths are explored as with TransE). In contrast, pRotatE delays the meta-path mining process because its mechanism for modeling entity and relationship embeddings does not conform to SchemaWalk's distance metric. On the other hand, although adjusting the embeddings can improve SchemaWalk's search efficiency to a certain extent, it only improves it when the initial embeddings are not suitable. If SchemaWalk has already used embeddings that are suitable for its model (such as TransE), adjusting the embeddings will constantly oscillate its type representation, thereby interfering with the mining process.

[0133] The meta-path similarity function refers to how to calculate the similarity of two entities given a meta-path. The similarity adopted by the present invention is the sum of the confidences of all meta-paths connecting two entities (confidence sum), which we compare with the number of meta-paths, confidence features and connectivity features. The number of meta-paths is the total number of meta-paths passing through an entity pair. The connectivity feature is a one-dimensional vector whose elements represent the connectivity of each meta-path on an entity pair. The confidence feature replaces the elements with a connectivity feature of 1 with their confidence. When the latter two functions are used, the LASSO linear regression model can automatically select features, calculate weights and return similarity.

[0134] As shown in Table 5, the performance of confidence and meta-path number is better than that of meta-path number, considering that different meta-paths have different confidences. Using confidence and meta-path number is better than confidence feature and connectivity feature, because in these two cases, no regression model is required to select and determine the weight of features.

[0135] Table 5: Comparison of model performance using different meta-path similarity functions. Bold indicates the best results.

[0136]

[0137]

[0138] This paper studies how to automatically discover valid meta-paths in large-scale HINs with complex patterns. A reinforcement learning agent SchemaWalk is designed, which walks on the network pattern and is guided by rewards defined on the instance graph. After training, the agent can mine valid meta-paths based on query relations. Link prediction experiments fully verify the efficient performance of SchemaWalk in mining meta-paths. This result also emphasizes the importance of meta-paths in HINs with complex architectures (such as knowledge graphs), and is expected to replace the current mainstream embedding-based methods. Once high-quality meta-paths are mined for HINs with complex patterns, better and explainable performance can be obtained.

[0139] Table 6: Examples of meta-paths found by SchemaWalk and their coverage and confidence

[0140]

[0141]

[0142] From the discovered meta-paths, meta-paths with higher coverage or confidence are selected for display, as shown in Table 6. The present invention can mine meta-paths not only for the high-level entity type "person", but also for sub-entity types such as "scientist". The coverage and confidence of each meta-path are globally evaluated under the corresponding knowledge graph. We observed that 24.6% of people with information of being a citizen of... have information of their graduate schools, while 13.4% of people who meet this meta-path have information of being a citizen of... This strange phenomenon is caused by the lack of links in the knowledge graph: if we examine the entity pairs that satisfy these meta-paths, we can intuitively infer the citizenship connection. However, because links are often missing in the knowledge base world, the numerator in formula (2) is often smaller than the numerator in our perceived real world. Similarly, because there are only a few link annotations "living" in the knowledge base, The present invention also observes some interesting facts about politicians, scientists and coaches through the mined meta-paths, such as 12.5% ​​of scientists graduate from the same university where their scientist spouse works.

[0143] The beneficial effects of the present invention are as follows:

[0144] For the first time, we explored the automatic meta-path discovery method at the pattern level for person-to-person relationship networks, and modeled the meta-path finding problem as a deterministic Markov decision process (MDP) on the pattern network. The agent's reward is obtained by the coverage of the meta-path in the instance graph.

[0145] We design a reinforcement learning agent with a complex policy parameterized by a long short-term memory network that is able to find meta-paths with high coverage.

[0146] Extensive experiments were conducted on two large-scale real-world person relationship networks, demonstrating that the proposed method outperforms other advanced baseline algorithms and indicates that meta-paths are very effective in analyzing HINs with complex patterns (such as knowledge graphs).

[0147] As used herein, the word "preferred" is intended to be used as an example, instance, or illustration. Any aspect or design described herein as "preferred" is not necessarily to be construed as being more advantageous than other aspects or designs. On the contrary, the use of the word "preferred" is intended to present concepts in a specific way. The term "or" as used in this application is intended to mean an inclusive "or" rather than an exclusive "or". That is, unless otherwise specified or clear from the context, "X uses A or B" means any one of the naturally included permutations. That is, if X uses A; X uses B; or X uses both A and B, then "X uses A or B" is satisfied in any of the foregoing examples.

[0148] Moreover, although the present disclosure has been shown and described with respect to one or implementations, those skilled in the art will think of equivalent variations and modifications based on the reading and understanding of this specification and the accompanying drawings. The present disclosure includes all such modifications and variations, and is limited only by the scope of the appended claims. In particular, with respect to the various functions performed by the above-mentioned components (such as elements, etc.), the terms used to describe such components are intended to correspond to any component (unless otherwise indicated) that performs the specified function of the component (such as it is functionally equivalent), even if the structure is not equivalent to the disclosed structure of the function in the exemplary implementation of the present disclosure shown herein. In addition, although the specific features of the present disclosure have been disclosed with respect to only one of several implementations, such features can be combined with one or other features of other implementations that may be desired and advantageous for a given or specific application. Moreover, insofar as the terms "including", "having", "containing" or their variations are used in specific embodiments or claims, such terms are intended to be included in a manner similar to the term "comprising".

[0149] The functional units in the embodiments of the present invention may be integrated into a processing module, or each unit may exist physically separately, or multiple or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc. The above-mentioned devices or systems may execute the storage method in the corresponding method embodiment.

[0150] To sum up, the above embodiment is an implementation mode of the present invention, but the implementation mode of the present invention is not limited by the embodiment. Any other changes, modifications, substitutions, combinations, and simplifications that deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. An automatic meta-path mining method for person relationship networks, characterized in that: The following steps are involved: Obtain the pattern diagram and instance diagram of the character relationship network; The schema diagram includes entity type T, relationship R, type mapping and relation mapping φ; for query relation r q , the agent randomly selects from the pattern graph by r q The connected entity type pair (t src , t tgt ) in the header type t src Start and use the Markov decision process to maximize the reward corresponding to the meta-path by walking; Based on breadth-first search, remove the query relationship r in the pattern graph and instance graph q Remove r from all connected entity pairs q After that, there are instance paths within a certain number of hops, and the remaining entity pairs are divided into training sets and test sets; Check the training set and r q For all relevant entity pairs, use an agent to mine meta-paths through a Markov decision process, and the agent's reward is obtained by the coverage of the meta-path in the instance graph; The Markov decision process uses the tuple The description is as follows: At step i, state S i By (t i ,t src ,r q ,t tgt ) indicates that t i Represents the current entity type, t src and t tgt For the pattern diagram, r q Pairs of connected entity types, state space Contains all valid combinations of T×T×R×T; action Given state S i =(t i ,t src ,r q ,t tgt ), action space It is a pattern diagram T G Medium type node t i All outgoing edges of plus an operation that remains unchanged, that is From the entity type node t src Initially, the agent iteratively selects l-1 most preferred actions based on the embedded representation of edge r and tail entity type node t, forming a meta-path of length l or staying at t tgt , once the agent reaches t before the maximum number of steps tgt ; The environmental mechanism is determined by the state transition probability describe, That is, the current state of the agent is adjusted according to the type of node t connected by the selected r. is the state space, for action; award Evaluate the quality of the currently discovered meta-path and continuously guide training; The reward is calculated as follows: in is the coverage of the meta-path M in the instance graph, I arrival (M)∈{0,1} is the reaching index, λ is the weighted combination coefficient, and the reward is normalized in the interval [0,1]; The coverage of the meta-path M in the instance graph is given by the query relation r q The entity pair connected to M is connected to the network Zhongyour q The ratio of all connected entity pairs is calculated as follows: Among them, Con M (v i , v j ) represents the entity pair (v i , v j ) are connected by a meta-path M; The arrival index is calculated as follows: Where & represents the logical AND operator, where I{t l =t tgt } is used to check the terminal position t of the agent l Whether to reach the target type node t tgt , Used to prevent the agent from staying at the starting node t src ; Iterative training is performed using a policy network. During the training process, type node embedding is used to represent type nodes in the pattern graph to speed up the search for meta-paths. After the training, the identified meta-paths and their coverage and confidence are obtained. For each sample in the filtered test set, add the confidences of all meta-paths connecting the sample, and the sum of the confidences is the similarity; Get the fact triples in the test set, where the entity to be predicted has appeared in the training set, and use the linear regression model to predict whether there is a certain relationship between the given two entities; Output the predicted relationship between two entities.

2. The automatic meta-path mining method for person relationship network according to claim 1 is characterized in that: The policy network includes an encoder and a decoder. The encoder is parameterized by a two-layer long short-term memory network. i Encoded as a vector representation S i , and S i With entity type t i , query relation r q And by r q The target type node t in the connected entity type pair tgt and r q The difference items are spliced ​​together to form the code enc i ; The decoder is parameterized by a two-layer multilayer perceptron network with rectified linear units. i Decoding, multiply the decoded output by the decision feature matrix D i , and calculate the action probability distribution through a softmax layer P=softmax(D i (W2(ReLU(W1enc i +b1))+b2) Among them, W1 and W2 are the weights of the two-layer perception network, b1 and b2 are the biases of the two-layer perception network; Based on the action probability distribution P, the agent takes action and moves to the next type node.

3. The automatic meta-path mining method for person relationship network according to claim 2 is characterized in that: The decision feature matrix D i is obtained by the following method: Through the candidate relationship r c and type node t c Concatenate to represent an edge, and stack the vector representations of all edges to obtain the decision feature matrix D i , in, represents the stacking operator, the candidate relation r c and type node t c Determined by the outgoing edges of the current type of node, For the action space.

4. The automatic meta-path mining method for person relationship network according to claim 3 is characterized in that: The reinforcement learning objectives of the policy network are: Among them, π θ (M) is the network π that follows the strategy θ The generated meta-path distribution of length l, θ is the parameter in LSTM and MLP, for the said reward.

5. The automatic meta-path mining method for person relationship network according to claim 4 is characterized in that: The training objective is optimized along the following directions: To estimate the gradient in the above formula, randomly Sample K entity type pairs (t src ,t tgt ) and run N trajectories in parallel for each sample. The trajectory obtained by this sampling method is approximated by the following formula:

6. The automatic meta-path mining method for person relationship network according to claim 1 is characterized in that: To represent the type node in the pattern graph, the average pooling of the embedding vectors of the same type of entities in the instance graph is used as initialization. The mathematical calculation is as follows: where v i is the embedding vector of entities of the same type, is the action trajectory sampled based on the current strategy.

7. The automatic meta-path mining method for person relationship network according to claim 1 is characterized in that: The character-oriented relationship network is a heterogeneous information network with complex patterns, which is composed of multiple types of nodes and edges. The nodes represent characters or organizations and their characteristics, and the edges represent the relationships between characters or organizations. The meta-path is a sequence of entity types and relationship types connecting two given specific entities, and is a meta-level description of the path in the character relationship. The character-oriented relationship network includes Yago and NELL knowledge graphs. Yago is a knowledge graph based on facts automatically extracted from Wikipedia and WordNet, and NELL is a knowledge graph constructed by extracting structured information from unstructured web pages.