Node attribute prediction and model training method, device and storage medium
By constructing a target causal model in a heterogeneous graph and combining multiple metapaths and neighbor node sets, the problem of causal relationship mismatch in traditional graph neural network models is solved, achieving more accurate and interpretable node attribute prediction and stronger generalization ability.
Patent Information
- Application Number
- CN202310404538.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-10
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2043-04-10
AI Technical Summary
Traditional graph neural network models suffer from poor accuracy in node attribute prediction due to the mismatch between fixed reasoning logic and real causal relationships. They also lack interpretability and cross-dataset generalization ability.
By identifying multiple meta-paths of the target node type in the heterogeneous graph, a target causal model is constructed to describe the causal relationship between semantic variables. The attribute values are then predicted by combining the neighbor node set and the target prediction node.
It improves the accuracy and interpretability of node attribute prediction and enhances the generalization ability across datasets.
Smart Images

Figure CN116432741B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to a node attribute prediction and model training method, device and storage medium. BACKGROUND
[0002] Heterogeneous graph neural networks have been widely studied in recent years due to their advantages in conceptualizing complex real-world systems. In a heterogeneous graph, there are different types of nodes and edges, that is, at least one of the nodes and edges has multiple types. This feature makes the application of heterogeneous graphs very extensive. In fact, if we use a graph to describe the relationship between us and the things around us, we will find that the resulting graph is naturally heterogeneous. For example, I watched the movie T today, so there is a "watched" relationship between me as an audience and the movie "T". A heterogeneous graph can be used to describe the set of such interactive relationships. This heterogeneous graph can include "audience" and "movie" nodes and "watched" edges.
[0003] The node attribute prediction task is a common task in the application of heterogeneous graphs. For example, for a certain enterprise node, the operating risk attribute is predicted, and for a certain author node, the research field attribute is predicted.
[0004] Traditionally, when using some graph neural network models to implement the above node attribute prediction task, the basic idea is as follows: based on the fixed reasoning logic in the heterogeneous graph, the vector representation (or also called embedding representation) of the target prediction node is learned, and the prediction of the attribute value to be predicted of the target prediction node is performed based on the vector representation, wherein the target prediction node refers to the node that needs to be predicted. The vector representation of the node learned based on the fixed reasoning logic in the heterogeneous graph may not match the prediction logic of the real node attribute value, resulting in poor prediction accuracy. SUMMARY
[0005] The embodiments of the present application provide a node attribute prediction and model training method, device and storage medium, which improve the accuracy of node attribute prediction.
[0006] In a first aspect, the embodiments of the present application provide a node attribute prediction method, which comprises:
[0007] receiving a node attribute prediction task, the node attribute prediction task including a set graph pattern and a to-be-predicted attribute corresponding to a target node type, the graph pattern being used to describe the edge types connecting different types of nodes;
[0008] determining a plurality of meta-paths starting from the target node type according to the graph pattern, and determining a target heterogeneous graph corresponding to the graph pattern from an initial heterogeneous graph;
[0009] obtain a node attribute prediction model corresponding to the node attribute prediction task, the node attribute prediction model including a target causal model used to describe a causal relationship between a plurality of semantic variables related to the to-be-predicted attribute in the graph pattern;
[0010] In response to an execution operation of the node attribute prediction task triggered by a target prediction node belonging to the target node type in the target heterogeneous graph, determine a plurality of neighbor node sets corresponding to the target prediction node under the plurality of meta-paths in the target heterogeneous graph;
[0011] According to the plurality of neighbor node sets, the target prediction node, and the target causal model, determine a to-be-predicted attribute value of the target prediction node.
[0012] In a second aspect, an embodiment of the present application provides a node attribute prediction device, and the device comprises:
[0013] A receiving module is configured to receive a node attribute prediction task, the node attribute prediction task including a set graph pattern and a to-be-predicted attribute corresponding to a target node type, the graph pattern being used to describe edge types connecting nodes of different types;
[0014] An obtaining module is configured to determine a plurality of meta-paths with the target node type as a starting point according to the graph pattern, and determine a target heterogeneous graph corresponding to the graph pattern from an initial heterogeneous graph; and obtain a node attribute prediction model corresponding to the node attribute prediction task, the node attribute prediction model including a target causal model used to describe a causal relationship between a plurality of semantic variables related to the to-be-predicted attribute in the graph pattern;
[0015] A prediction module is configured to, in response to an execution operation of the node attribute prediction task triggered by a target prediction node belonging to the target node type in the target heterogeneous graph, determine a plurality of neighbor node sets corresponding to the target prediction node under the plurality of meta-paths in the target heterogeneous graph; and according to the plurality of neighbor node sets, the target prediction node, and the target causal model, determine a to-be-predicted attribute value of the target prediction node.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, which comprises a memory, a processor, and a communication interface; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the node attribute prediction method according to the first aspect.
[0017] In a fourth aspect, an embodiment of the present application provides a non-transitory machine readable storage medium, which stores executable code, and when the executable code is executed by a processor of an electronic device, the processor can implement at least the node attribute prediction method in the first aspect.
[0018] In a fifth aspect, an embodiment of the present application provides a node attribute prediction model training method, which comprises:
[0019] receiving a node attribute prediction task, the node attribute prediction task comprising a set graph pattern and a to-be-predicted attribute corresponding to a target node type, the graph pattern being used to describe edge types connecting different types of nodes;
[0020] determining, according to the graph pattern, a plurality of meta-paths with the target node type as a starting point and a training heterogeneous graph corresponding to the graph pattern;
[0021] determining, in the training heterogeneous graph, a target training sample node and an attribute reference value of the target training sample node corresponding to the to-be-predicted attribute, the target training sample node belonging to the target node type;
[0022] determining, in the training heterogeneous graph, a plurality of neighbor node sets corresponding to the target training sample node under the plurality of meta-paths, in response to an execution operation of the node attribute prediction task triggered by the target training sample node;
[0023] training a node attribute prediction model corresponding to the node attribute prediction task by taking the plurality of neighbor node sets, the target training sample node and the to-be-predicted attribute as a plurality of semantic variables, the node attribute prediction model comprising a target causal model, the target causal model being used to describe a causal relationship between the plurality of semantic variables related to the to-be-predicted attribute under the graph pattern, and the attribute reference value being used as supervision information of the node attribute prediction model.
[0024] In a sixth aspect, an embodiment of the present application provides a node attribute prediction model training device, which comprises:
[0025] a receiving module configured to receive a node attribute prediction task, the node attribute prediction task comprising a set graph pattern and a to-be-predicted attribute corresponding to a target node type, the graph pattern being used to describe edge types connecting different types of nodes;
[0026] determining, according to the graph schema, a plurality of meta-paths with the target node type as a starting point and a training heterogeneous graph corresponding to the graph schema; determining a target training sample node in the training heterogeneous graph, and an attribute reference value corresponding to the target training sample node and the to-be-predicted attribute, the target training sample node belonging to the target node type;
[0027] training, in response to an execution operation of the node attribute prediction task triggered on the target training sample node, a plurality of neighbor node sets corresponding to the target training sample node under the plurality of meta-paths in the training heterogeneous graph; training a node attribute prediction model corresponding to the node attribute prediction task by taking the plurality of neighbor node sets, the target training sample node, and the to-be-predicted attribute as a plurality of semantic variables, the node attribute prediction model including a target causal model for describing a causal relationship between the plurality of semantic variables related to the to-be-predicted attribute under the graph schema, and the attribute reference value serving as supervision information of the node attribute prediction model.
[0028] In a seventh aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a communication interface; the memory stores executable code, when the executable code is executed by the processor, the processor executes the node attribute prediction model training method in the fifth aspect.
[0029] In an eighth aspect, an embodiment of the present application provides a non-transitory machine readable storage medium, the non-transitory machine readable storage medium stores executable code, when the executable code is executed by a processor of an electronic device, the processor can at least implement the node attribute prediction model training method in the fifth aspect.
[0030] In a ninth aspect, an embodiment of the present application provides a node attribute prediction method, the method includes:
[0031] receiving a request triggered by a terminal device by calling a set service, the request including a node attribute prediction task and an initial heterogeneous graph, the node attribute prediction task including a to-be-predicted attribute corresponding to a set graph schema and a target node type, the graph schema being used to describe edge types between different types of nodes;
[0032] determining, according to the graph schema, a plurality of meta-paths with the target node type as a starting point and a target heterogeneous graph corresponding to the graph schema from the initial heterogeneous graph;
[0033] obtain a node attribute prediction model corresponding to the node attribute prediction task, the node attribute prediction model comprising a target causal model, the target causal model being used to describe a causal relationship between a plurality of semantic variables related to the to-be-predicted attribute in the graph pattern;
[0034] determine, in the target heterogeneous graph, a plurality of neighbor node sets corresponding to the target prediction node under the plurality of meta-paths in response to an execution operation of the node attribute prediction task triggered on a target prediction node belonging to the target node type in the target heterogeneous graph;
[0035] determine a to-be-predicted attribute value of the target prediction node according to the plurality of neighbor node sets, the target prediction node, and the target causal model;
[0036] feed back the to-be-predicted attribute value of the target prediction node to the terminal device.
[0037] In a tenth aspect, an embodiment of the present application provides a node attribute prediction method applied to an extended reality device, and the method comprises the following steps:
[0038] display an input interface of a node attribute prediction task, the input interface being used to input a graph pattern of a node attribute prediction task, a to-be-predicted attribute corresponding to a target node type, and an initial heterogeneous graph;
[0039] determine a plurality of meta-paths with the target node type as a starting point and a target heterogeneous graph corresponding to the graph pattern determined from the initial heterogeneous graph according to the graph pattern;
[0040] obtain a node attribute prediction model corresponding to the node attribute prediction task, the node attribute prediction model comprising a target causal model, the target causal model being used to describe a causal relationship between a plurality of semantic variables related to the to-be-predicted attribute in the graph pattern;
[0041] determine, in the target heterogeneous graph, a plurality of neighbor node sets corresponding to the target prediction node under the plurality of meta-paths in response to an execution operation of the node attribute prediction task triggered on a target prediction node belonging to the target node type in the target heterogeneous graph;
[0042] determine a to-be-predicted attribute value of the target prediction node according to the plurality of neighbor node sets, the target prediction node, and the target causal model;
[0043] display the to-be-predicted attribute value of the target prediction node.
[0044] In the node attribute prediction scheme provided by the embodiment of the present application, for a node attribute prediction task of a certain graph pattern and a target node type corresponding to a to-be-predicted attribute, a node attribute prediction model corresponding to the node attribute prediction task is trained in advance, and the node attribute prediction model comprises a causal model describing a causal relationship between a plurality of semantic variables related to the to-be-predicted attribute in the graph pattern. Specifically, based on the graph pattern in the node attribute prediction task, a target heterogeneous graph corresponding to the graph pattern can be obtained from a given initial heterogeneous graph, and a plurality of meta-paths starting from the target node type can be determined according to the graph pattern. In the target heterogeneous graph, a node belonging to the target node type can be selected as a target prediction node, and after triggering the prediction operation for the to-be-predicted attribute for the target prediction node, a plurality of neighbor node sets corresponding to the target prediction node in the plurality of meta-paths can be determined in the target heterogeneous graph. In fact, for the target prediction node, the plurality of neighbor node sets and the target prediction node itself are semantic variables related to the to-be-predicted attribute of the target prediction node, so that the to-be-predicted attribute value of the target prediction node can be determined in combination with the plurality of neighbor node sets, the target prediction node and the causal model.
[0045] In the above scheme, by modeling and setting the causal model between the plurality of semantic variables related to the to-be-predicted attribute of the target node type in the graph pattern, the causal model can directly and accurately give whether each semantic variable is the reason for determining the to-be-predicted attribute value and how to affect the to-be-predicted attribute value, and a more accurate to-be-predicted attribute value can be obtained based on the causal model. BRIEF DESCRIPTION OF DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0047] Figure 1 A flowchart of a node attribute prediction method provided by the embodiment of the present application is shown in FIG. 1;
[0048] Figure 2 A schematic diagram of a graph pattern provided by the embodiment of the present application is shown in FIG. 2;
[0049] Figure 3 A schematic diagram of an initial heterogeneous graph and a target heterogeneous graph provided by the embodiment of the present application is shown in FIG. 3;
[0050] Figure 4 A schematic diagram of a causal model provided by the embodiment of the present application is shown in FIG. 4;
[0051] Figure 5 A composition schematic diagram of a node attribute prediction model provided for an embodiment of the present application is provided.
[0052] Figure 6 A flowchart of a node attribute prediction method provided for an embodiment of the present application is provided.
[0053] Figure 7 A flowchart of a node attribute prediction model training method provided for an embodiment of the present application is provided.
[0054] Figure 8 A principle schematic diagram of a node attribute prediction model training process provided for an embodiment of the present application is provided.
[0055] Figure 9 An application schematic diagram of a node attribute prediction method provided for an embodiment of the present application is provided.
[0056] Figure 10 A structure schematic diagram of a node attribute prediction device provided for an embodiment of the present application is provided.
[0057] Figure 11 A structure schematic diagram of a node attribute prediction model training device provided for an embodiment of the present application is provided.
[0058] Figure 12 A structure schematic diagram of an electronic device provided for an embodiment of the present application is provided. DETAILED DESCRIPTION
[0059] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in detail with reference to the accompanying drawings. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application. In addition, the sequence of steps in each of the following method embodiments is only an example, not a strict limitation.
[0060] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.
[0061] First, some concepts involved in the embodiments of the present application are explained.
[0062] Heterogeneous Graph: A graph where there are different types of nodes and edges (at least one of the nodes and edges has multiple types).
[0063] Graph Schema: For a heterogeneous graph, a graph schema defines the types of edges that can exist between the types of nodes in the graph.
[0064] Meta-Path: A sequence of node types and edge types that alternate based on a graph schema.
[0065] Node Property Prediction: Given a specific heterogeneous graph, a node property prediction task is generally defined on a specific node type, which is used to predict certain properties of a node of that type.
[0066] Structural Causal Model (SCM): A model that can describe the causal mechanism of a system. Specifically, assuming that there are no unobserved variables, an SCM composed of k variables is composed of a set of structural assignments, i.e. the value of the i-th variable is determined by the values of other variables in the k variables. It is usually assumed that these structural assignments are acyclic, so a directed acyclic graph can be used to represent the structural assignments of an SCM.
[0067] As described above, when using some graph neural network models to complete the node property prediction task, the graph neural network model learns the vector representation of the target prediction node in the heterogeneous graph that needs to be performed node property prediction based on the fixed inference logic in the heterogeneous graph, and performs prediction on the to-be-predicted attribute value of the target prediction node based on the vector representation.
[0068] For ease of understanding, for example, it is assumed that a heterogeneous graph includes three types of nodes of author, paper, and journal, which are used to describe that an author publishes a paper on a certain journal, and it is assumed that the connection relationship of the three types of nodes is: author-paper-journal. This real connection relationship of the three types of nodes in the heterogeneous graph is regarded as a kind of “fixed reasoning logic”, for example, facing the prediction task of predicting the scientific field to which an author belongs, the processing idea based on the fixed reasoning logic is: when learning the vector representation of the paper node, the vector representation of the connected journal is fused, so that the vector representation of the paper fuses the vector representation of the journal, similarly, when learning the vector representation of the author, the vector representation of the connected paper is fused, finally, the vector representation of the author fuses the vector representation of the paper and the journal connected to the paper. In this way, the vector representation of the author can be input into the classifier to determine the scientific field to which the author belongs (different scientific fields as different categories).
[0069] It can be known from the above example that the prediction result of the scientific field to which the author belongs is a comprehensive consideration of the two factors of the papers published by the author and on which journals the papers are published, especially when the vector representation of the author is determined by the vector representation of the journal with a lower contribution degree due to a farther distance. In fact, the prediction result is more based on the characteristics presented by the papers published by the author, which will lead to unreliable prediction results. For example, if the neural network model finally learns that if the paper contains formulas and mathematical models, the author belongs to the mathematical field, then in fact, if an economist cites some formulas and mathematical models in the papers published by the author to introduce some economic principles or phenomena, the economist will finally be predicted to belong to the mathematical field, which is obviously incorrect.
[0070] In the above example, it can be understood that the more direct reason for actually judging the scientific field to which the author belongs should be to see on which type of journal the author publishes the paper, because in fact, generally speaking, the authors of the papers received by a certain type of journal are consistent with the field to which the journal belongs, for example, the authors publishing papers on computer journals belong to the computer field, and the authors publishing papers on economic journals belong to the economic field.
[0071] It can be seen that the node attribute prediction scheme realized by the traditional fixed reasoning logic in the heterogeneous graph has the problem of inaccurate prediction result because the fixed reasoning logic does not match the real causal relationship structure related to the to-be-predicted attribute of the target prediction node (for example, the causal relationship related to the judgment of the scientific field to which the author belongs in the example is that the type of the journal on which the author publishes a paper determines the scientific field to which the author belongs, that is, the type of the journal is the cause of the scientific field to which the author belongs), and cannot intuitively explain the cause of the prediction result, and has poor explainability.
[0072] Moreover, when the graph neural network model trained based on a data set in the computer field is applied to a data set in the economics field, the accuracy of the prediction result obtained is poorer, that is, the model cannot have generalization across data sets, for example, the situation in the example above occurs: when learning in the data set in the mathematics field that if a paper contains a formula or a mathematical model, the corresponding author belongs to the mathematics field, when applied to the data set in the economics field, an author belonging to the economics field may be identified as belonging to the mathematics field. Here, the data set refers to a heterogeneous graph including nodes of authors, papers, journals and the like in the corresponding scientific field and connection relationships between the nodes.
[0073] In view of this, in the embodiments of the present application, for the prediction task of the to-be-predicted attribute of the node of the target node type, a plurality of factors (referred to as a plurality of semantic variables in combination with the definition of SCM) related to the to-be-predicted attribute and having a semantic that is easy to understand are determined in the heterogeneous graph, the causal relationship between the plurality of semantic variables is modeled to obtain a task-adaptive causal model, and the accurate prediction of the to-be-predicted attribute can be completed in combination with the causal model, and intuitive explainability can be provided, and stronger generalization is obtained. The causal model in this paper can be the SCM described above.
[0074] The execution process of the node attribute prediction method and the node attribute prediction model training method provided by the embodiments of the present application will be introduced below.
[0075] Figure 1 A schematic diagram of a node attribute prediction method provided by the embodiments of the present application is shown in FIG. 1. Figure 1 As shown in the figure, the method includes the following steps:
[0076] 101, receiving a node attribute prediction task, the node attribute prediction task including a set graph pattern and a to-be-predicted attribute corresponding to a target node type, the graph pattern being used to describe the edge type of the connection between nodes of different types.
[0077] 102, determining a plurality of meta-paths with the target node type as the starting point according to the graph pattern, and determining a target heterogeneous graph corresponding to the graph pattern from an initial heterogeneous graph.
[0078] 103、obtain a node attribute prediction model corresponding to the node attribute prediction task, the node attribute prediction model comprising a target causal model, the target causal model being used to describe a causal relationship between a plurality of semantic variables related to the to-be-predicted attribute in the graph schema.
[0079] 104、in response to an execution operation of the node attribute prediction task triggered by a target prediction node belonging to the target node type in the target heterogeneous graph, determine a plurality of neighbor node sets corresponding to the target prediction node under a plurality of meta-paths in the target heterogeneous graph.
[0080] 105、determine the to-be-predicted attribute value of the target prediction node according to the plurality of neighbor node sets, the target prediction node, and the target causal model.
[0081] The node attribute prediction task is a common task in a heterogeneous graph application. In the embodiment, a node attribute prediction task comprises the following key factors: a set graph schema, a target node type, and a to-be-predicted attribute corresponding to the target node type.
[0082] The target node type is used to indicate which type of node in the heterogeneous graph is to be predicted, and the target prediction node is determined from a plurality of nodes belonging to the target node type in the heterogeneous graph.
[0083] The set graph schema is used to constrain the node types and edge types and the connection relationship therebetween in the generated heterogeneous graph, and is also used to define a meta-path.
[0084] Figure 2 A schematic diagram of a graph schema provided by the embodiment of the application is shown in FIG. 1. Figure 2 As shown in FIG. 1, it is assumed that the graph schema comprises four different node types: an author A, a paper P, a journal V, and a citation T. The connection edge between the author A and the paper P is “writing”, indicating that the author A node and the paper P node are in a writing relationship; the connection edge between the journal V and the paper P is “publishing”, indicating that the journal V and the paper P are in a publishing relationship; and the connection edge between the paper P and the citation T is “citation”, indicating that the paper P and the citation T are in a citation relationship.
[0085] For the above node attribute prediction task, in addition to the graph model shown in FIG. 1, the to-be-predicted attribute corresponding to the target node type is also included. For example, in FIG. 2, the target node type is set to the author A, and the to-be-predicted attribute is set to the scientific field Y. The dashed line connection between the author A and the scientific field Y indicates that the scientific field Y is an attribute of the author A, which is used to distinguish the connection relationship (indicated by a solid line) between different nodes. Figure 2 Figure 2
[0086] For ease of explanation, the implementation process of the node attribute prediction method is described in the embodiments of the present invention with the target node type being "Author A" and the attribute to be predicted being "Scientific Field Y".
[0087] In practical applications, before a user (referring to someone with node attribute prediction needs) performs a node attribute prediction task, they need to define the task to be executed, as described above. This includes the defined graph pattern and the predicted attributes corresponding to the target node types. Furthermore, an initial heterogeneous graph is required, containing at least the node types defined in the graph pattern and the connections between nodes. Then, based on the graph pattern, a target heterogeneous graph corresponding to the graph pattern is determined from the initial heterogeneous graph. The target heterogeneous graph is a subset of the initial heterogeneous graph, containing only the node types defined in the graph pattern and the connections between different types of nodes.
[0088] Figure 3 This is a schematic diagram of an initial heterogeneous graph and a target heterogeneous graph provided in an embodiment of the present invention, as shown below. Figure 3 As shown, given the initial heterogeneity diagram and Figure 2 After illustrating the graph pattern, the initial heterogeneous graph is traversed according to this pattern, and subgraphs that conform to the pattern are selected as the target heterogeneous graph. For example... Figure 3 As shown, the target heterogeneous graph and Figure 2 The diagram pattern shown corresponds completely, containing only Figure 2 The graph pattern shown defines the node types and the connections between the nodes. Figure 3 In this context, for example, Ai represents different authors, Pi represents different papers, Vi represents different journals, Ti represents different citations, Yi represents the scientific field of the author node it is connected to, and Ci, Hi, and Zi represent several other different types of nodes.
[0089] Furthermore, under the assumption that the target node type is author A, according to Figure 2 The graph pattern shown identifies multiple meta-paths starting from the target node type "Author A".
[0090] In practical applications, users can define an upper limit for the length of metapaths when determining metapaths. If no upper limit is defined, the default is to determine all possible metapaths originating from the target node type.
[0091] refer to Figure 2 The graph pattern shown, assuming the user has not set a maximum length for meta-paths or has set it to 2, can identify the following multiple meta-paths starting from nodes like author A:
[0092] AP: Author A - Paper P, this meta-path represents: the paper published by the author;
[0093] APA: Author A - Paper P - Author A, this meta-path represents: authors who co-published the same paper;
[0094] APV: Author A - Paper P - Journal V, this meta-path represents: the journal where the author published the paper;
[0095] APT: Author A - Paper P - Citation T, this meta-path represents: the information cited in the paper published by the author.
[0096] In this embodiment, it is assumed that a node attribute prediction model corresponding to the node attribute prediction task including the above graph pattern and the target node type corresponding to the to-be-predicted attribute has been trained in advance, and then the node attribute prediction model is obtained after the user determines the node attribute prediction task.
[0097] In addition, after obtaining the target heterogeneous graph, the user can select a target prediction node as a prediction object from the plurality of nodes corresponding to the target node type in the target heterogeneous graph, so as to trigger the execution operation of the node attribute prediction task for the target prediction node, and then the prediction processing of the to-be-predicted attribute value of the target prediction node can be completed by using the above node attribute prediction model. For example, in the target heterogeneous graph shown in Figure 3 The nodes belonging to the "Author A" node type include A1, A2, and A3, it is assumed that the "scientific field" of the two nodes A2 and A3 is known, which are Y2 and Y3 respectively, and the to-be-predicted attribute value of the "scientific field" of the A1 node is unknown, then the user can use the above node attribute prediction model to predict the attribute value by taking A1 as the target prediction node.
[0098] In the embodiment of the application, the node attribute prediction model corresponding to the above node attribute prediction task includes a target causal model, and the target causal model is used to describe the causal relationship between a plurality of semantic variables related to the to-be-predicted attribute in the graph pattern. The relationship between the graph pattern and the target causal model is that the node attribute prediction model containing the target causal model corresponds to a specific graph pattern and a to-be-predicted attribute of a target node type, and therefore the target causal model also corresponds to the graph pattern and the to-be-predicted attribute of the target node type. Moreover, the target causal model directly reveals what kind of causal relationship exists between the plurality of semantic variables that affect the value of the to-be-predicted attribute of the target node type.
[0099] In order to facilitate understanding of the causal model, an example is illustrated in combination with Figure 4 Figure 4 In the figure, it is assumed that a, b, c, d, e, and f are six semantic variables included in a causal model, the connection relationship between different semantic variables in the figure represents the causal relationship between different semantic variables, and the arrow direction points from the cause to the result. For example, semantic variable a and semantic variable b are both causes of semantic variable d. In addition, the functions g1-g6 on the connection line represent Figure 4 In the figure, it is assumed that semantic variable f represents the to-be-predicted attribute of the target prediction node, and the other five semantic variables are semantic variables that affect the prediction result of the to-be-predicted attribute value. By combining the causal relationship shown in the figure, the values of the other semantic variables and the corresponding assignment functions can be combined to finally determine the value of semantic variable f.
[0100] The above node attribute prediction model including the target causal model can be implemented by using some neural network model, and the training process will be described in detail below. Here, only the use process of the model is described.
[0101] Specifically, by combining Figure 3 , it is assumed that the target prediction node selected by the user is author A1. In the target heterogeneous graph, according to the above multiple meta-paths, a plurality of neighbor node sets corresponding to author A1 under the plurality of meta-paths are determined, and the determination results are as follows:
[0102] Neighbor node set 1 (meta-path AP): P1, P2, P3, and P4
[0103] Neighbor node set 2 (meta-path APA): A1, A2, and A3
[0104] Neighbor node set 3 (meta-path APV): V1, V2, and V3
[0105] Neighbor node set 4 (meta-path APT): T1, T2, T3, and T4
[0106] The above four neighbor node sets are respectively taken as four semantic variables related to the to-be-predicted attribute "scientific field" of author A1, and author A1 and the to-be-predicted attribute are also taken as semantic variables. These semantic variables are input into the target causal model, and the specific causal relationship between these semantic variables can be determined based on the target causal model, that is, it is determined what causes affect the to-be-predicted attribute value and how these causes affect the to-be-predicted attribute value, that is, the assignment function corresponding to each cause.
[0107] In summary, since the target causal model directly reveals the causal relationship between the plurality of semantic variables related to the to-be-predicted attribute of the target node type under a given graph pattern, when performing the prediction processing of the to-be-predicted attribute of the target prediction node belonging to the target node type in the target heterogeneous graph corresponding to the graph pattern, the plurality of neighbor node sets are searched, and the plurality of neighbor node sets searched out are all objects related to the determination of the to-be-predicted attribute value of the target prediction node in the semantic aspect. With the plurality of neighbor node sets corresponding to the target prediction node, the target prediction node and the to-be-predicted attribute as several specific variables, the specific causal relationship between the plurality of neighbor node sets, the target prediction node and the to-be-predicted attribute can be determined by combining the target causal model, so that the to-be-predicted attribute value of the target prediction node can be accurately determined. Moreover, based on the target causal model, it can be directly observed what causes the determination of the to-be-predicted attribute value, and the explainability is strong. Moreover, since the target causal model reveals what the cause variables affecting the to-be-predicted attribute value are, the target causal model will not be disturbed by different data sets, and has better generalization.
[0108] The composition of the node attribute prediction model provided by the embodiment of the application and how to use the node attribute prediction model to complete the determination of the to-be-predicted attribute value of the target prediction node will be introduced below.
[0109] Figure 5 The composition of the node attribute prediction model provided by the embodiment of the application is shown in a schematic diagram as shown in Figure 5 The node attribute prediction model includes the encoding network corresponding to the plurality of meta-paths, the nodes of the target node type and the to-be-predicted attribute, the decoding network corresponding to the to-be-predicted attribute, and the target causal model.
[0110] In combination with the four meta-paths AP, APA, APT and APV exemplified above, in Figure 5 the node attribute prediction model includes six encoding networks corresponding to the four meta-paths, the target node type (author A) and the to-be-predicted attribute (scientific field Y), the six encoding networks are schematically shown as encoder 1-encoder 6, and the decoding network (decoder) corresponding to the scientific field Y.
[0111] In practical applications, the aforementioned encoding networks can be implemented with different or the same model structure. For example, some encoding networks can use Recurrent Neural Networks (RNNs), some can use Long Short-Term Memory (LSTM) networks, and some can use Transform networks, among other model structures. The decoding networks can use model structures such as Multilayer Perceptron (MLP) networks.
[0112] Although the aforementioned encoding networks can be implemented using different model structures, they share a common goal: mapping input information to the same vector space, i.e., a vector representation of uniform length. The decoding network outputs the predicted attribute values for the target prediction nodes.
[0113] like Figure 5 As shown, the target causal model includes an adjacency matrix and multiple fusion networks. The adjacency matrix describes whether causal relationships exist between different semantic variables, and the multiple fusion networks reflect the assignment functions between semantic variables that have causal relationships.
[0114] In this system, multiple fusion networks correspond to multiple meta-paths, nodes of target node types, and attributes to be predicted, such as fusion networks 1 to fusion networks 6 shown in the figure. Similar to the multiple coding networks mentioned above, these fusion networks can also be implemented with different or the same network structure, such as all using LSTM.
[0115] As defined by SCM above, the multiple semantic variables described in the target causal model ultimately need to form a Directed Acyclic Graph (DAG). Therefore, no single semantic variable is the cause of itself. Thus, the diagonal elements in the adjacency matrix can be initialized to 0, while the values of other elements are gradually determined during the training of the node attribute prediction model. The adjacency matrix has an n*n dimension, where n represents the number of semantic variables in the target causal model, and n rows and n columns represent the n semantic variables. In fact, for example, the value of the element in the i-th row and j-th column of the adjacency matrix represents the probability that variable i is the cause of variable j.
[0116] In fact, for a given graph pattern, the target node type, and the attribute to be predicted, the plurality of semantic variables in the adjacency matrix corresponding to the attribute to be predicted actually include the semantic variables corresponding to the plurality of meta-paths determined according to the graph pattern, that is, the neighbor node set of the node belonging to the target node type in each meta-path. The node, the neighbor node set, and the attribute to be predicted are only conceptually defined and are not specific to a specific node, its corresponding neighbor node set, and the attribute to be predicted.
[0117] In combination with the composition of the node attribute prediction model shown in FIG. 6, the process of determining the attribute value to be predicted of the target prediction node using the node attribute prediction model will be described below in combination with FIG. 7. Figure 5 Figure 6
[0118] Figure 6 A flowchart of a node attribute prediction method provided in an embodiment of the present application is shown in FIG. 6. The method includes the following steps: Figure 6
[0119] 601. In response to the execution of the node attribute prediction task triggered by the target prediction node belonging to the target node type in the target heterogeneous graph, a plurality of neighbor node sets corresponding to the target prediction node in a plurality of meta-paths are determined in the target heterogeneous graph.
[0120] 602. A plurality of neighbor node sets and the target prediction node are encoded using the respective encoding networks corresponding to the plurality of neighbor node sets and the target prediction node to determine the first vector representation of the plurality of neighbor node sets and the target prediction node.
[0121] 603. The first vector representation of the plurality of neighbor node sets and the target prediction node and the adjacency matrix are input into the fusion network corresponding to the attribute to be predicted to determine the second vector representation corresponding to the attribute to be predicted.
[0122] 604. The second vector representation corresponding to the attribute to be predicted is decoded using the decoding network to determine the attribute value to be predicted of the target prediction node.
[0123] In this embodiment, it is assumed that the plurality of neighbor node sets of the target prediction node obtained are the neighbor node sets 1-4 corresponding to different meta-paths in the foregoing embodiments, and the process of determining the attribute value to be predicted of the target prediction node is as shown in FIG. 7. Figure 5 In this model, the encoding networks corresponding to the four neighbor node sets are encoding networks 2-5, and it is assumed that the encoding network corresponding to the target prediction node (e.g., author A1) belonging to the target node type is encoding network 1. Multiple neighbor node sets and target prediction nodes are encoded using their respective encoding networks to determine the first vector representation corresponding to each set.
[0124] It is understandable that the known semantic information of each type of node (such as author, paper, etc.) in the target heterogeneous graph contains one or more known attributes. For example, a node of the author type includes known attributes such as author name, number of published papers, and university. Initially, an encoding method can be used to encode the initial vector representation of each node. However, since the attribute information of different types of nodes is different, the encoding results of the initial vector representation of different types of nodes may be inconsistent in length. Moreover, the number of nodes contained in the multiple neighbor node sets obtained based on different meta-paths may also be different, which may lead to inconsistent overall lengths of the initial node vector representations of different neighbor node sets. To facilitate subsequent calculations, it is necessary to map the input information to the same vector space through the above different encoding networks, so that the first vector representation output by each encoding network has the same dimension.
[0125] Additionally, it should be noted that even if a set of neighboring nodes contains multiple nodes, the number of first vector representations output by the corresponding encoding network is also one, meaning that the semantic information of each node in the set of neighboring nodes is integrated into the first vector representation.
[0126] like Figure 5 As shown, after obtaining the first vector representation of the target prediction node and the first vector representation of each of the four neighbor node sets through the encoding network 1-5, the first vector representation of each of the multiple neighbor node sets and the target prediction node, as well as the adjacency matrix, are input into the fusion network 6 corresponding to the attribute to be predicted (such as the scientific field shown in the figure) to obtain the second vector representation of the attribute to be predicted output by the fusion network 6.
[0127] Wherein, since the adjacency matrix describes the neighbor node set obtained based on different meta-paths, the probability of the causal relationship between the target node type and the to-be-predicted attribute, the multiple neighbor node sets corresponding to the target prediction node, and the probability of the causal relationship between the target prediction node and the to-be-predicted attribute of the target prediction node can be known based on the adjacency matrix. For example, if the adjacency matrix indicates that there is a causal relationship between the neighbor node set under the AP meta-path and the to-be-predicted attribute, and the probability is 0.99, it can be determined that there is a causal relationship between the neighbor node set 1 and the to-be-predicted attribute of the target prediction node, and the probability is 0.99. It should be noted that the causal relationship between the neighbor node set, the target prediction node and the to-be-predicted attribute of the target prediction node does not necessarily all reflect the connection relationship between each neighbor node, the target prediction node and the to-be-predicted attribute of the target prediction node, and may present a structure relationship as shown in Figure 4
[0128] The fusion network 6 corresponding to the to-be-predicted attribute is actually used to reconstruct the vector representation corresponding to the to-be-predicted attribute, and the reconstruction result for the target prediction node is the second vector representation corresponding to the to-be-predicted attribute of the target prediction node. The principle of reconstruction is to reconstruct the second vector representation of the to-be-predicted attribute according to the first vector representation of the cause semantic variable corresponding to the to-be-predicted attribute indicated in the adjacency matrix. Assuming that the 4 neighbor node sets corresponding to the target prediction node and the target prediction node are determined according to the adjacency matrix, only 2 of them are the cause semantic variables of the to-be-predicted attribute, then it can be considered that the model parameters of the fusion network 6 indicate the assignment function of the two cause semantic variables to the to-be-predicted attribute, and the final function value is determined as the second vector representation based on the first vector representation of the two cause semantic variables and the corresponding assignment function. Wherein, the weighting coefficient of the assignment function can be determined according to the causal relationship probability of the two cause semantic variables to the to-be-predicted attribute in the adjacency matrix.
[0129] After obtaining the second vector representation of the to-be-predicted attribute of the target prediction node, the second vector representation can be input into the decoding network corresponding to the to-be-predicted attribute. It can be considered that the decoding network and the encoding network corresponding to the to-be-predicted attribute are reciprocal, and the to-be-predicted attribute value of the target prediction node can be obtained through the decoding of the decoding network.
[0130] Therefore, the second vector representation of the to-be-predicted attribute of the target prediction node is actually a reconstructed encoded vector representation based on the first vector representation of the cause semantics variable corresponding to the to-be-predicted attribute, and compared with the first vector representation of the to-be-predicted attribute of the target prediction node before reconstruction, the second vector representation fuses the vector representation of the cause semantics variable that directly affects the prediction result of the to-be-predicted attribute value. The prediction result will be more accurate based on the second vector representation to determine the to-be-predicted attribute value of the target prediction node.
[0131] Figure 7 A flowchart of a node attribute prediction model training method provided by an embodiment of the present application is shown in FIG. 1, which includes the following steps: Figure 7
[0132] 701. Receive a node attribute prediction task, which includes a set graph pattern and a to-be-predicted attribute corresponding to a target node type.
[0133] 702. Determine a plurality of meta-paths with the target node type as a starting point and a training heterogeneous graph corresponding to the graph pattern according to the graph pattern.
[0134] 703. Determine a target training sample node and an attribute reference value corresponding to the to-be-predicted attribute of the target training sample node in the training heterogeneous graph, wherein the target training sample node belongs to the target node type.
[0135] 704. In response to an execution operation of the node attribute prediction task triggered by the target training sample node, determine a plurality of neighbor node sets corresponding to the target training sample node under the plurality of meta-paths in the training heterogeneous graph.
[0136] 705. Take the plurality of neighbor node sets, the target training sample node and the to-be-predicted attribute as a plurality of semantic variables, train a node attribute prediction model corresponding to the node attribute prediction task, wherein the node attribute prediction model includes a target causal model for describing a causal relationship between the plurality of semantic variables related to the to-be-predicted attribute under the graph pattern, and the attribute reference value is used as supervision information of the node attribute prediction model.
[0137] In the embodiment, one or more training heterogeneous graphs matching the set graph pattern can be obtained for training the node attribute prediction model, and these training heterogeneous graphs can come from the same data set or different data sets. Taking the node prediction task of the scientific field to which the authors belong as an example, the data set can be a heterogeneous graph formed in various academic fields and matching the graph pattern. As described above, matching means that the graph pattern needs to include a plurality of node types and connection relationships between different types of nodes.
[0138] The training heterogeneous graph can include a plurality of nodes belonging to a target node type, and each node can be a target training sample node. In this embodiment, only the processing process of any target training sample node is taken as an example for description. For ease of description, it is assumed in this embodiment that the target heterogeneous graph in Figure 3 is taken as a training heterogeneous graph, the graph pattern in the node attribute prediction task is Figure 2 , the target node type is author A, the to-be-predicted attribute is scientific field Y, and it is assumed that the node author A1 in Figure 2 is a target training sample node. Before training, the scientific field to which the author A1 belongs has been labeled and is referred to as an attribute reference value, which is used as supervision information, such as belonging to the mathematical field, denoted as Y=Y1.
[0139] As described above, the plurality of meta-paths corresponding to the graph pattern include AP, APA, APV, and APT. For the node author A1, the neighbor node set corresponding to each of the meta-paths is the neighbor node set 1-neighbor node set 4 described above.
[0140] The plurality of neighbor node sets (neighbor node set 1-neighbor node set 4), the target training sample node (author A1), and the to-be-predicted attribute Y are taken as a plurality of semantic variables, and a node attribute prediction model including a target causal model corresponding to the node attribute prediction task is trained. Finally, the attribute prediction value Yx of the to-be-predicted attribute Y of the author A1 is output by a decoding network corresponding to the to-be-predicted attribute. Optionally, based on the attribute prediction value Yx of the to-be-predicted attribute Y of the author A1 and the attribute reference value Y1, a prediction loss function value can be determined based on a set prediction loss function, a loss gradient is calculated, and then the model parameters of the node attribute prediction model are adjusted through a back propagation process.
[0141] However, in the training process of the node attribute prediction model, the loss function used actually includes not only the prediction loss function described above, but also the DAG loss function and the reconstruction loss function described below.
[0142] An optional training process of a node attribute prediction model is introduced in combination with Figure 8 , the composition structure of the node attribute prediction model shown in Figure 8 is consistent with that in Figure 5 , and thus will not be described again.
[0143] As described above, the plurality of meta-paths corresponding to the graph pattern include AP, APA, APV, and APT. For the node author A1, the neighbor node set corresponding to each of the meta-paths is the neighbor node set 1-neighbor node set 4 described above. Figure 8As shown in the figure, in the training process of the node attribute prediction model, first, a plurality of semantic variables corresponding to the target training sample node (author A1) are obtained: a plurality of neighbor node sets (neighbor node set 1-neighbor node set 4), the target training sample node (author A1), and the attribute to be predicted (scientific field Y). Then, the plurality of semantic variables are respectively encoded by the corresponding encoding network (encoding network 1-6) to obtain the first vector representation (E1-E6) corresponding to each of the plurality of semantic variables.
[0144] Then, for the target semantic variable (such as author A1) in the plurality of semantic variables, the first vector representation (E2-E6) corresponding to each of the other semantic variables except the target semantic variable and the adjacency matrix are input into the fusion network (fusion network 1) corresponding to the target semantic variable to obtain the second vector representation (E1') of the target semantic variable output by the fusion network corresponding to the target semantic variable.
[0145] The above processing is performed for each of the plurality of semantic variables to obtain the second vector representation corresponding to each of the plurality of semantic variables: E1'-E6'.
[0146] Then, the second vector representation (E6') corresponding to the attribute to be predicted (scientific field Y) is input into the decoding network to obtain the attribute prediction value Yx of the target training sample node (author A1) corresponding to the attribute to be predicted.
[0147] As described above, the fusion network 1-6 actually completes the reconstruction of the vector representation of the corresponding semantic variable. Therefore, for the first vector representation and the second vector representation of any semantic variable, the difference between the two can be calculated as the reconstruction loss function value. The purpose of the reconstruction loss function is to make the reconstructed second vector representation consistent with the first vector representation before reconstruction as much as possible.
[0148] In addition, as described above, the adjacency matrix is used to describe the causal relationship between different semantic variables, and this causal relationship essentially forms a DAG. Therefore, the DAG loss function value needs to be determined according to the values of the elements in the adjacency matrix. The larger the loss function value, the lower the probability of forming a DAG. Therefore, the purpose of training is to continuously reduce the DAG loss function value.
[0149] The reconstruction loss function value, the prediction loss function value, and the DAG loss function value corresponding to the target training sample node are added together to form a total loss function value. Based on the total loss function value, the model parameters of the node attribute prediction model are adjusted through the back propagation process, including the parameters of each encoding network, decoding network, fusion network, and the element values in the adjacency matrix.
[0150] When the set number of training sample nodes are all trained, or the node attribute prediction model is trained to convergence, the training process ends.
[0151] In fact, after the training of the node attribute prediction model is completed, the adjacency matrix corresponding to the node attribute prediction task can be output to the user, so that the user can directly observe the adjacency matrix to know what semantic variables really affect the prediction result under the node attribute prediction task.
[0152] Moreover, since the modeling determines the reason variable (root cause mining) that really affects the value of the to-be-predicted attribute, the node attribute prediction model can be widely adapted to various data sets that have a demand for the node attribute prediction task, without loss of accuracy and good generalization.
[0153] The node attribute prediction method provided by the embodiment of the application can be executed in the cloud, and a plurality of computing nodes (cloud servers) can be deployed in the cloud, each computing node having computing, storage and other processing resources. In the cloud, a plurality of computing nodes can be organized to provide a certain service, and of course, one computing node can provide one or more services. The cloud can provide a service interface for the service, and the user can call the service interface to use the corresponding service.
[0154] For the scheme provided by the embodiment of the application, the cloud can provide a service interface for a set service (node attribute prediction service), and the user can call the service interface through a terminal device to trigger a node attribute prediction request to the cloud, the request including a node attribute prediction task and an initial heterogeneous graph, the node attribute prediction task including a set graph pattern and a to-be-predicted attribute corresponding to a target node type, the cloud determines a computing node responding to the request, and uses the processing resources in the computing node to execute the following steps:
[0155] According to the graph pattern, a plurality of meta-paths starting from the target node type are determined, and a target heterogeneous graph corresponding to the graph pattern is determined from the initial heterogeneous graph;
[0156] A node attribute prediction model corresponding to the node attribute prediction task is obtained, the node attribute prediction model including a target causal model, the target causal model being used to describe the causal relationship between a plurality of semantic variables related to the to-be-predicted attribute under the graph pattern;
[0157] In response to an execution operation of the node attribute prediction task triggered on a target prediction node belonging to the target node type in the target heterogeneous graph, a plurality of neighbor node sets corresponding to the target prediction node under the plurality of meta-paths are determined in the target heterogeneous graph;
[0158] According to the plurality of neighbor node sets, the target prediction node and the target causal model, a to-be-predicted attribute value of the target prediction node is determined.
[0159] feedback the to-be-predicted attribute value of the target prediction node to the terminal device.
[0160] The execution process can refer to the related description in the foregoing other embodiments, and will not be described here.
[0161] For the convenience of understanding, the foregoing embodiments are exemplarily described with reference to the accompanying drawings. Figure 9 The user can invoke the node attribute prediction service through the terminal device E1 as shown in the accompanying drawings to predict the to-be-predicted attribute value of the target prediction node. The service interface of the service invoked by the user includes a software development kit (SDK), an application programming interface (API), and the like. Figure 9 The case of the API interface is shown in the accompanying drawings. In the cloud, as shown in the accompanying drawings, it is assumed that the node attribute prediction service is provided by a service cluster E2, and the service cluster E2 includes at least one computing node. After receiving the request, the service cluster E2 performs the steps in the foregoing embodiments to obtain the to-be-predicted attribute value of the target node and feedback to the terminal device E1. Figure 9
[0162] The terminal device E1 displays in the interface based on the received to-be-predicted attribute value.
[0163] The node attribute prediction method provided by the embodiments of the present application can be applied to various application scenarios with heterogeneous graphs, and is used for predicting the attribute value of an unknown attribute of a certain type of node, such as the scientific field to which the author belongs, the business risk of an enterprise, the city in which a movie will obtain a higher box office, and the like.
[0164] The node attribute prediction apparatus of one or more embodiments of the present application will be described in detail below. Those skilled in the art can understand that these apparatuses can be configured by using commercially available hardware components through the steps taught by the present application.
[0165] Figure 10 The structural schematic diagram of a node attribute prediction apparatus provided by the embodiments of the present application is shown in the accompanying drawings, and the apparatus includes a receiving module 11, an obtaining module 12, and a prediction module 13. Figure 10
[0166] The receiving module 11 is configured to receive a node attribute prediction task, and the node attribute prediction task includes a set graph pattern and a to-be-predicted attribute corresponding to a target node type. The graph pattern is used to describe the edge type of the connection between different types of nodes.
[0167] The acquisition module 12 is configured to determine a plurality of meta-paths starting from the target node type according to the graph schema, and determine a target heterogeneous graph corresponding to the graph schema from the initial heterogeneous graph; acquire a node attribute prediction model corresponding to the node attribute prediction task, the node attribute prediction model comprising a target causal model, the target causal model being used to describe a causal relationship between a plurality of semantic variables related to the to-be-predicted attribute under the graph schema.
[0168] The prediction module 13 is configured to, in response to an execution operation of the node attribute prediction task triggered by a target prediction node belonging to the target node type in the target heterogeneous graph, determine a plurality of neighbor node sets corresponding to the target prediction node under the plurality of meta-paths in the target heterogeneous graph; and determine the to-be-predicted attribute value of the target prediction node according to the plurality of neighbor node sets, the target prediction node, and the target causal model.
[0169] Optionally, the prediction module 13 is specifically configured to: encode the plurality of neighbor node sets and the target prediction node to determine a first vector representation corresponding to each of the plurality of neighbor node sets and the target prediction node; input the first vector representation corresponding to each of the plurality of neighbor node sets and the target prediction node into the target causal model to determine a second vector representation corresponding to the to-be-predicted attribute; and decode the second vector representation corresponding to the to-be-predicted attribute to determine the to-be-predicted attribute value of the target prediction node.
[0170] Optionally, the node attribute prediction model comprises an encoding network corresponding to each of the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute, and a decoding network corresponding to the to-be-predicted attribute, and based on this, the prediction module 13 is specifically configured to: encode the plurality of neighbor node sets and the target prediction node by using the encoding network corresponding to each of the plurality of neighbor node sets and the target prediction node; and decode the second vector representation corresponding to the to-be-predicted attribute by using the decoding network.
[0171] Optionally, the target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks correspond to the plurality of meta-paths, the nodes of the target node type, and the to-be-predicted attribute, respectively; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variables, and the plurality of fusion networks reflect assignment functions between the semantic variables having the causal relationship.
[0172] Optionally, the prediction module 13 is further configured to: input the first vector representation corresponding to each of the plurality of neighbor node sets and the target prediction node and the adjacency matrix into the fusion network corresponding to the to-be-predicted attribute to obtain the second vector representation corresponding to the to-be-predicted attribute output by the fusion network corresponding to the to-be-predicted attribute.
[0173] Figure 10The device shown can perform the steps of the node attribute prediction method in the foregoing embodiments. For details of the execution process and technical effects, refer to the descriptions in the foregoing embodiments, which will not be repeated here.
[0174] Figure 11 A structural schematic diagram of a node attribute prediction model training device provided for an embodiment of the present application is shown in FIG. 13. As shown in the figure, the device includes a receiving module 21, a determining module 22, and a training module 23. Figure 11
[0175] The receiving module 21 is configured to receive a node attribute prediction task, which includes a set graph pattern and a target node type corresponding to a to-be-predicted attribute. The graph pattern is used to describe the edge types connecting different types of nodes.
[0176] The determining module 22 is configured to determine, according to the graph pattern, a plurality of meta-paths with the target node type as a starting point and a training heterogeneous graph corresponding to the graph pattern; determine, in the training heterogeneous graph, a target training sample node and an attribute reference value corresponding to the to-be-predicted attribute of the target training sample node, the target training sample node belonging to the target node type.
[0177] The training module 23 is configured to, in response to an execution operation of the node attribute prediction task triggered by the target training sample node, determine, in the training heterogeneous graph, a plurality of neighbor node sets corresponding to the target training sample node under the plurality of meta-paths; take the plurality of neighbor node sets, the target training sample node, and the to-be-predicted attribute as a plurality of semantic variables, train a node attribute prediction model corresponding to the node attribute prediction task, the node attribute prediction model including a target causal model, the target causal model being used to describe a causal relationship between the plurality of semantic variables related to the to-be-predicted attribute under the graph pattern, and the attribute reference value being used as supervision information of the node attribute prediction model.
[0178] Optionally, the node attribute prediction model includes an encoding network corresponding to the plurality of meta-paths, the target node type, and the to-be-predicted attribute respectively and a decoding network corresponding to the to-be-predicted attribute. Based on this, the training module 23 is specifically configured to: perform encoding processing on the plurality of semantic variables by using the plurality of semantic variables from the corresponding encoding network, to obtain a first vector representation corresponding to each of the plurality of semantic variables; input the first vector representation corresponding to each of the plurality of semantic variables into the target causal model, to obtain a second vector representation corresponding to each of the plurality of semantic variables; and input the second vector representation corresponding to the to-be-predicted attribute into the decoding network, to obtain an attribute prediction value corresponding to the to-be-predicted attribute of the target training sample node.
[0179] Optionally, the target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to a plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variables, and the plurality of fusion networks reflect assignment functions between semantic variables having a causal relationship. Based on this, the training module 23 is specifically configured to: for a target semantic variable in the plurality of semantic variables, input the first vector representation of each semantic variable other than the target semantic variable and the adjacency matrix into the fusion network corresponding to the target semantic variable, to obtain a second vector representation of the target semantic variable output by the fusion network corresponding to the target semantic variable.
[0180] Optionally, the training module 23 is further configured to: determine a reconstruction loss function value according to the second vector representation and the first vector representation of each of the plurality of semantic variables; determine a prediction loss function value according to the attribute prediction value and the attribute reference value of the target training sample node corresponding to the to-be-predicted attribute; determine a directed acyclic graph loss function value according to the adjacency matrix; and train the node attribute prediction model according to the reconstruction loss function value, the prediction loss function value, and the directed acyclic graph loss function value.
[0181] Figure 11 The apparatus shown can perform the steps of the node attribute prediction model sequence method in the foregoing embodiments, and the detailed execution process and technical effects are described in the foregoing embodiments, which will not be described here again.
[0182] The embodiment of the present application also provides an electronic device, such as Figure 12 As shown, the electronic device can include a processor 31, a memory 32, and a communication interface 33. The memory 32 stores executable code, which, when executed by the processor 31, causes the processor 31 to implement the node attribute prediction method as described in the foregoing embodiments, or implement the node attribute prediction model training method as described in the foregoing embodiments.
[0183] In an optional embodiment, the electronic device for executing the node attribute prediction method provided by the embodiment of the present application can be any user terminal, such as a mobile phone, a notebook computer, a PC, and can also be an extended reality (Extended Reality, XR) device. XR is a general term for virtual reality, augmented reality, and other forms.
[0184] The process of the XR device executing the node attribute prediction method includes the following steps:
[0185] Display an input interface of a node attribute prediction task, and the input interface is used to input a graph pattern of the node attribute prediction task, a to-be-predicted attribute corresponding to a target node type, and an initial heterogeneous graph;
[0186] According to the graph pattern, a plurality of meta-paths starting from the target node type are determined, and a target heterogeneous graph corresponding to the determination of the graph pattern from the initial heterogeneous graph is determined;
[0187] A node attribute prediction model corresponding to the node attribute prediction task is obtained, and the node attribute prediction model includes a target causal model, and the target causal model is used to describe a causal relationship between a plurality of semantic variables related to the to-be-predicted attribute in the graph pattern;
[0188] In response to an execution operation of the node attribute prediction task triggered by the target prediction node belonging to the target node type in the target heterogeneous graph, a plurality of neighbor node sets corresponding to the target prediction node in the plurality of meta-paths are determined in the target heterogeneous graph;
[0189] According to the plurality of neighbor node sets, the target prediction node, and the target causal model, a to-be-predicted attribute value of the target prediction node is determined.
[0190] The to-be-predicted attribute value of the target prediction node is displayed.
[0191] In addition, an embodiment of the present application provides a non-transitory machine readable storage medium, and the non-transitory machine readable storage medium stores executable codes. When the executable codes are executed by a processor of an electronic device, the processor can at least implement the node attribute prediction method or the node attribute prediction model training method provided in the foregoing embodiments.
[0192] The device embodiments described above are only schematic, and units described as separate components can or can not be physically separate. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments. Those skilled in the art can understand and implement without creative labor.
[0193] From the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be realized by means of a general hardware platform, and of course can also be realized by means of a combination of hardware and software. Based on such understanding, the above technical solutions can be embodied in the form of a computer program product, and the present application can be embodied in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.
[0194] It should be pointed out finally that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit the same; and although the present application has been described in detail with reference to the foregoing embodiments, it should be appreciated by those skilled in the art that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features thereof can be replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method of node attribute prediction, the method comprising: The method comprises: receiving a node attribute prediction task, the node attribute prediction task comprising a set graph pattern and a to-be-predicted attribute corresponding to a target node type, the graph pattern being used to describe edge types connecting different types of nodes, wherein the target node type is an author, and the to-be-predicted attribute is a scientific field; determining a plurality of meta-paths with the target node type as a starting point according to the graph pattern, and determining a target heterogeneous graph corresponding to the graph pattern from an initial heterogeneous graph; obtaining a node attribute prediction model corresponding to the node attribute prediction task, the node attribute prediction model comprising a target causal model used to describe a causal relationship between a plurality of semantic variables related to the to-be-predicted attribute under the graph pattern; in response to an execution operation of the node attribute prediction task triggered by a target prediction node belonging to the target node type in the target heterogeneous graph, determining a plurality of neighbor node sets corresponding to the target prediction node under the plurality of meta-paths in the target heterogeneous graph; taking the plurality of neighbor node sets, the target prediction node, and the to-be-predicted attribute as a plurality of semantic variables, and determining a to-be-predicted attribute value of the target prediction node according to the plurality of neighbor node sets, the target prediction node, and the target causal model.
2. The method of claim 1, wherein, The determination of the to-be-predicted attribute value of the target prediction node according to the plurality of neighbor node sets, the target prediction node, and the target causal model comprises: encoding the plurality of neighbor node sets and the target prediction node to determine respective first vector representations of the plurality of neighbor node sets and the target prediction node; inputting the respective first vector representations of the plurality of neighbor node sets and the target prediction node into the target causal model to determine a second vector representation corresponding to the to-be-predicted attribute; decoding the second vector representation corresponding to the to-be-predicted attribute to determine the to-be-predicted attribute value of the target prediction node.
3. The method of claim 2, wherein, The node attribute prediction model comprises an encoding network corresponding to each of the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute, and a decoding network corresponding to the to-be-predicted attribute; The encoding of the plurality of neighbor node sets and the target prediction node comprises: encoding the plurality of neighbor node sets and the target prediction node using respective encoding networks of the plurality of neighbor node sets and the target prediction node; The decoding of the second vector representation corresponding to the to-be-predicted attribute comprises: decoding the second vector representation corresponding to the to-be-predicted attribute using the decoding network.
4. The method of claim 2, wherein, The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks comprise a fusion network corresponding to the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variables, and the plurality of fusion networks reflect assignment functions between semantic variables having a causal relationship. The first vector representation corresponding to each of the plurality of neighbor node sets and the target prediction node is input into the target causal model to determine a second vector representation corresponding to the to-be-predicted attribute. The first vector representation corresponding to each of the plurality of neighbor node sets and the target prediction node and the adjacency matrix are input into a fusion network corresponding to the to-be-predicted attribute to obtain the second vector representation corresponding to the to-be-predicted attribute output by the fusion network. 5.A method for training a node attribute prediction model, the method comprising: The method comprises: receiving a node attribute prediction task, the node attribute prediction task including a set graph pattern and a to-be-predicted attribute corresponding to a target node type, the graph pattern being used to describe edge types connecting different types of nodes, wherein the target node type is an author, and the to-be-predicted attribute is a scientific field; determining, according to the graph pattern, a plurality of meta-paths starting from the target node type and a training heterogeneous graph corresponding to the graph pattern; determining, in the training heterogeneous graph, a target training sample node and an attribute reference value of the target training sample node corresponding to the to-be-predicted attribute, the target training sample node belonging to the target node type; in response to an execution operation of the node attribute prediction task triggered by the target training sample node, determining, in the training heterogeneous graph, a plurality of neighbor node sets corresponding to the target training sample node under the plurality of meta-paths; training a node attribute prediction model corresponding to the node attribute prediction task by taking the plurality of neighbor node sets, the target training sample node, and the to-be-predicted attribute as a plurality of semantic variables, the node attribute prediction model including a target causal model, the target causal model being used to describe a causal relationship between the plurality of semantic variables related to the to-be-predicted attribute under the graph pattern, and the attribute reference value being used as supervision information of the node attribute prediction model.
6. The method of claim 5, wherein, The node attribute prediction model includes an encoding network corresponding to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute, respectively, and a decoding network corresponding to the to-be-predicted attribute. The training of the node attribute prediction model corresponding to the node attribute prediction task comprises: encoding the plurality of semantic variables by using an encoding network corresponding to each of the plurality of semantic variables to obtain a first vector representation corresponding to each of the plurality of semantic variables; inputting the first vector representation corresponding to each of the plurality of semantic variables into the target causal model to obtain a second vector representation corresponding to each of the plurality of semantic variables; inputting the second vector representation corresponding to the to-be-predicted attribute into the decoding network to obtain an attribute prediction value of the target training sample node corresponding to the to-be-predicted attribute.
7. The method of claim 6, wherein, The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; 8. The method of claim 7, wherein, The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; 9. A method of node attribute prediction, the method comprising: The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; 10. A method of node attribute prediction, the method comprising: The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is a causal relationship between any semantic variable, and the plurality of fusion networks reflect the assignment functions between the semantic variables with the causal relationship; The target causal model comprises an adjacency matrix and a plurality of fusion networks; the plurality of fusion networks respectively correspond to the plurality of meta-paths, nodes of the target node type, and the to-be-predicted attribute; the adjacency matrix is used to describe whether there is An input interface of a node attribute prediction task is displayed, the input interface being used for inputting a graph pattern of the node attribute prediction task, a to-be-predicted attribute corresponding to a target node type, and an initial heterogeneous graph, wherein the target node type is an author, and the to-be-predicted attribute is a scientific field. According to the graph pattern, a plurality of meta-paths starting from the target node type are determined, and a target heterogeneous graph corresponding to the graph pattern determined from the initial heterogeneous graph is determined. A node attribute prediction model corresponding to the node attribute prediction task is obtained, the node attribute prediction model including a target causal model used for describing a causal relationship between a plurality of semantic variables related to the to-be-predicted attribute under the graph pattern. In response to an execution operation of the node attribute prediction task triggered by a target prediction node belonging to the target node type in the target heterogeneous graph, a plurality of neighbor node sets corresponding to the target prediction node under the plurality of meta-paths are determined in the target heterogeneous graph. The plurality of neighbor node sets, the target prediction node, and the to-be-predicted attribute are taken as a plurality of semantic variables, and a to-be-predicted attribute value of the target prediction node is determined according to the plurality of neighbor node sets, the target prediction node, and the target causal model. The to-be-predicted attribute value of the target prediction node is displayed.
11. An electronic device, comprising: Comprise: A memory, a processor, and a communication interface, wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the node attribute prediction method in any one of claims 1 to 4, or executes the node attribute prediction model training method in any one of claims 5 to 8.
12. A non-transitory machine-readable storage medium, comprising: The non-transitory machine-readable storage medium stores executable code, and when the executable code is executed by the processor of the electronic device, the processor executes the node attribute prediction method in any one of claims 1 to 4, or executes the node attribute prediction model training method in any one of claims 5 to 8.
Citation Information
Patent Citations
Gender prediction method and device, storage medium and electronic equipment
CN111209173A
Heterogeneous network attribute completion method based on graph neural network and attention mechanism
CN115130663A