Node classification method based on neural symbols and prompt learning

By designing the node classification method for neural symbols and prompt learning, combining the graph neural network and neural probability soft logic, neural symbol prompts at the structural and attribute levels are generated, and first-order logical rules are constructed, which solves the problem of insufficient reasoning ability in the existing methods and achieves more reliable and accurate node classification.

CN120508853APending Publication Date: 2025-08-19JILIN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510617645.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-14
Publication Date
2025-08-19

AI Technical Summary

Technical Problem

The existing graph node classification methods lack effective inference and cognitive ability, and the existing methods have semantic and formal conflicts in the construction rules to guide the model learning process, making it difficult to effectively integrate symbolic reasoning and graph hints.

Method used

A node classification method based on neural symbols and prompt learning is designed. By constructing a general neural symbol inference backbone network, combining graph neural networks and neural probability soft logic, neural symbol prompts at the structure and attribute levels are generated, and first-order logical rules are constructed to assist the symbol inference process. Joint reasoning and optimization adjustment strategies are adopted to realize the coordination between graph neural networks and symbol inference.

Benefits of technology

More reliable node classification prediction is realized, the model's inference ability and generalization performance when processing complex graph data is improved, the model's understanding of graph structure and attributes is enhanced, and the accuracy and generalization ability of node classification are significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120508853A_ABST
    Figure CN120508853A_ABST
Patent Text Reader

Abstract

The invention discloses a node classification method based on neural symbols and prompt learning. Graph node classification is one of classical tasks in graph mining, and is widely explored in many practical application fields. The method aims at overcoming the defects that in the prior art, effective reasoning and cognitive ability is lacked in node classification of graph data, and the learning process guided by rule construction based on prompt learning is still unclear. The method comprises the steps that 1, a graph nerve symbol component module is constructed, according to the method, a general graph neural network is combined with neural probability soft logic; 2, constructing structure-level and attribute-level neural symbol prompts to construct atoms based on the prompts; 3, integrating atoms based on prompts into a first-order rule, so that the first-order rule can assist a symbol reasoning process; 4, providing a joint reasoning and optimization fine tuning strategy so as to obtain a reliable and accurate node classification model; and 5, performing node prediction by using the obtained node classification model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a node classification method for graph data, and more specifically to a node classification method based on neural symbol and prompt learning. Background Art

[0002] Graph node classification is a classic task in graph mining and has been extensively explored in many practical applications. Node classification is primarily used to evaluate a model's ability to learn node representations. This task aims to accurately classify unlabeled nodes in a graph and has broad application value, such as identifying user roles in social networks, detecting spammers, and determining document categories in academic networks. Furthermore, acquiring node representations is not only useful for node classification but also for various graph mining tasks, including node clustering, link prediction, and graph data visualization. In recent years, graph neural networks have demonstrated powerful capabilities in modeling graph-structured data.

[0003] The node classification task has received widespread attention in various application scenarios. Existing node classification methods can be divided into the following five categories: node attribute-based methods, graph structure-based methods, methods that fuse node attributes and graph structure, network representation-based methods, and graph convolutional neural network-based methods. Node attribute-based methods usually use node attribute information to achieve classification. Graph structure-based methods measure similarity by analyzing the neighborhood relationship between nodes to predict the labels of unlabeled nodes. Methods that fuse node attributes and graph structure consider both the attribute characteristics of nodes and the characteristics of the graph structure. Network representation-based methods achieve low-dimensional encoding of the graph structure by mapping nodes into low-dimensional dense vectors while preserving the topological relationship between nodes. Among them, graph convolutional neural networks can more effectively extract topological structure and data feature information than traditional methods, and complete node embedding representation through end-to-end learning, significantly improving the accuracy of node classification.

[0004] Since it is difficult to collect sufficient high-quality labeled data in many real-world application scenarios, many methods utilize a large amount of redundant data for unsupervised pre-training, thereby enabling graph mining models to have good generalization capabilities in downstream tasks. However, due to the difference in objectives between the pre-training task and the downstream task, this gap between tasks can negatively impact the model during fine-tuning of the downstream task. Therefore, some methods design a variety of graph hints to bridge the gap between pre-training and downstream tasks, aiming to effectively induce implicit prior knowledge and transfer it to downstream tasks. Existing node classification methods based on graph neural networks typically follow the "pre-training, hinting, fine-tuning" paradigm, that is, first transferring the general parameters of pre-training, and then designing task-specific hints to guide and adapt the model to the target downstream task. Despite demonstrating efficient learning capabilities in many practical applications and theoretical explorations, existing methods still face some limitations.

[0005] Limitation #1: Existing node classification methods often lack effective reasoning and cognitive capabilities. For example, classic symbolic reasoning models can perform reliable reasoning by building a rule-guided inference engine and possess powerful cognitive intelligence. In contrast, most existing graph mining models are black-box models, making their reliability difficult to guarantee. Therefore, it is necessary to introduce symbolic reasoning into graph mining models.

[0006] Limitation #2: Even if symbolic reasoning techniques are integrated into graph mining models, it remains unclear how to construct rules to guide the model's learning process. On the one hand, the fundamental unit of rules in symbolic reasoning is an atom, typically an explicit and fixed logical expression that represents basic facts and relationships in domain knowledge. On the other hand, graph hints typically consist of substructures constructed from intrinsic graph attributes or learnable vectors. These substructures are more flexible and can capture complex patterns and implicit information in the data. Due to their conflicting semantics and formal structure, it is necessary to build an effective bridge between rules and graph hints. We should convert graph hints into a logical form that symbolic reasoning systems can understand and manipulate, thereby creating a richer and more dynamic knowledge representation. This is necessary to enhance the model's reasoning capabilities and generalization performance when processing complex graph data. Summary of the Invention

[0007] The technical problem to be solved by this invention is to construct a neural symbol and prompt learning framework, aiming to design instructive graph prompts and integrate them into neural symbol rules to guide the node classification process, and propose a node classification method based on neural symbol and graph prompt learning.

[0008] To achieve the above objectives, the present invention is implemented by adopting the following technical solutions:

[0009] The node classification method based on neural symbol and prompt learning includes the following steps:

[0010] (1) Designed a general neural symbolic reasoning backbone network

[0011] The general neural symbolic reasoning backbone network mainly consists of two parts, namely: a general graph embedding component and a graph neural symbolic learning component.

[0012] 1) Build a general graph embedding component f θ (·) is used to extract the embedded representation of the node. The core idea is to propagate information through the graph structure, so that each node not only contains its own features but also aggregates the information of neighboring nodes. Specifically, given a graph G = (V, E), the lth layer of the graph embedding can be formally defined as:

[0013]

[0014] in, Represents node v i Embedding representation at layer l; Represents node v i The neighbor set of θ (l) represents the learnable parameters of layer l; AGG(·) represents aggregation functions such as averaging, weighted summing, or maximum pooling.

[0015] 2) Construct graph neural symbolic learning components and design atomic generator g with shared parameters θ (·)=δ(f θ (·)), where δ(·) is a parameter-free atom-specific operation. The atom generator maps the output of the graph neural network into logical atoms, for example:

[0016] LABEL(v i ,y): represents node v i The category is y;

[0017] SIM(v i ,v j ): represents node v i With v j There are edge connections;

[0018] CLASS(v j ,y): represents node v j can be classified as y.

[0019] 3) Based on the atoms generated in step 2), construct a set of first-order logic rules to express the dependencies between entities. For example:

[0020] LABEL(v i ,y)∧SIM(v i ,v j )→CLASS(vj ,y)

[0021] This rule states: If a node v i The category is y, and it is related to node v j connected, then v j It should also be category y. All rules constitute the rule base R = {r1, r2, ..., r N} and assign a weight to each rule Used to indicate its importance in the learning process.

[0022] 4) Lukasiewicz soft logic is used for probabilistic mapping, converting the above symbolic rules into learnable energy terms for neural symbolic reasoning:

[0023] P∧Q=max(0.0,P+Q-1.0)

[0024] P∨Q=min(1.0,P+Q)

[0025]

[0026] Here, P and Q represent different atoms in the rule.

[0027] 5) Using the probability value output by the atomic generator, Lukasiewicz soft logic is used to calculate the probability of each rule r. i Perform probabilistic logic modeling to form the corresponding potential mapping function Taking the above rule as an example, its potential function form is:

[0028] φ r :LABEL(v i ,y)∧SIM(v i ,v j )→CLASS(v j ,y)

[0029] This function represents the reasoning ability of rule r under the current data graph, combined with the corresponding rule weight ω r Together they reflect the strength of symbolic logic constraints.

[0030] 6) Combine the potential functions and weights of all rules to build a deep hybrid model (DHM):

[0031] DHM={φ,W DHM}

[0032] in, is the set of potential mapping functions for all rules; is the corresponding rule strength set.

[0033] 7) The total energy function of the model is constructed as follows:

[0034]

[0035] in Representation rule r i The potential energy function of , that is, the degree of violation or matching of the rule at the current graph node; Representation rule r i The learning weight is used to control the contribution of the rule to the overall reasoning result;

[0036] (2) Designed neural symbolic cues at the structure and attribute levels

[0037] 1) For each target node v in the original graph G=V,E i ∈V, perform subgraph sampling operations from multiple perspectives to obtain its local neighborhood structure:

[0038]

[0039] in, They represent: first-order neighbor subgraph, r-order self subgraph, and random walk subgraph respectively.

[0040] 2) Using the atomic generator g θ Encode the structure of subgraphs from different perspectives and generate structure hint atoms SP(·,·):

[0041]

[0042] Among them, structural hint atoms are used to express the semantic dependency patterns of target nodes from different structural perspectives.

[0043] 3) On the original graph G, perform attribute feature clustering on the nodes to obtain the attribute representative points of each category (rather than simple average) to enhance robustness. Generate the attribute prompt prototype set as follows:

[0044]

[0045] Among them, Clust(G) represents the clustering operation, and Readout(·) extracts the cluster centers as prototype representations.

[0046] 4) Using the atomic generator g θ , the cluster center With the corresponding label Enter together to construct the attribute prompt atom:

[0047]

[0048] Among them, the attribute hint atom represents: cluster center Belong to category Can be used to guide the model to focus on class attributes.

[0049] (3) Integrate structural and attribute-level neural symbolic cues into rules to guide reasoning models

[0050] 1) For the target node v in the graph i , through the atomic generator g θ Generate the following atoms:

[0051] Input atom: Input(v i )

[0052] Figure neural atoms: GNN (v i ,y), represents the neural network's response to v i The predicted probability under label y

[0053] Classification atom: CLASS(v i ,y), indicating v i Classification target

[0054] Similarity Atom: SIM(v i ,P c ), indicating v i With attribute prompt P c The semantic similarity of

[0055] Attribute Tip Atom: AP(P c ,y), indicating the attribute prototype P c Mapping relationship with label y

[0056] Structure hint atoms: Indicates v i Local subgraph structure pattern of

[0057] 2) Based on the above atoms, first-order inference rules are constructed to assist neural reasoning, specifically including the following four types of rules:

[0058] Naive graph learning rule, that is, GNN directly predicts the target node v i The rules for labels are as follows:

[0059] Input(v i )∧GNN(v i ,y)→CLASS(v i ,y)

[0060] Structural hint injection rule, that is, node v i is the input node, for v i itself or its local structural subgraph If the prediction is label y, then v can be inferred iThe classification result of y is as follows:

[0061]

[0062] Attribute hint injection rule, that is, node v i Is an input node, and it is related to the attribute prototype P c There is a high semantic similarity, and P c Can represent label y, then v can be inferred i The classification result of y is as follows:

[0063] Input(v i )∧AP(P c ,y)∧SIM(v i ,P c )→CLASS(v i ,y)

[0064] Joint prompt atomic injection rule, that is, the target node v i Is an input node, and the local structure subgraph it is in It has clear structural hint information and there is an attribute prototype P c Can represent the label y, then as long as v i The graph itself or its structure hint subgraph has a high semantic similarity with the attribute prototype (satisfying SIM(v i ,P c )or ), we can infer v i The rules for label y are as follows:

[0065]

[0066] 3) Based on the potential function of the rules defined in (1), the above four types of rules are used to construct a deep hybrid model (DHM):

[0067] DHM={Φ,W DHM}

[0068] in, is the set of potential mapping functions for all rules; is the corresponding rule strength set.

[0069] 4) The total energy function of the model is constructed as follows:

[0070]

[0071] in Representation rule r i The potential energy function of , that is, the degree of violation or matching of the rule at the current graph node; Representation rule r i The learning weight is used to control the contribution of the rule to the overall reasoning result;

[0072] (4) Designed joint reasoning and optimization adjustment strategies

[0073] 1) Randomly sample multiple subgraphs from the input graph G and construct the original subgraph and its perturbation version as positive and negative sample pairs for contrastive learning. Use SimGRACE as the pre-training framework, use subgraph similarity as a self-supervisory signal, and optimize the graph representation learning model f θ , to obtain the pre-trained model f θ* The core loss function is contrast loss, which is specifically expressed as:

[0074]

[0075] Among them, h i is the representation of the i-th original subgraph, h' i Its perturbation representation τ is the temperature parameter.

[0076] 2) Then we design the optimization target to learn and obtain the pre-trained model. The optimization target is:

[0077]

[0078] Where M is the number of subgraphs and Δ represents the perturbation operation.

[0079] 3) Pre-trained model The parameters of are transferred to the downstream model as the initial parameters of the model. Then, for the target node v i , let the inference result be:

[0080]

[0081] Where l(·) is the similarity function, P c is the category prototype vector, is the node neighbor subgraph.

[0082] 4) Then define the potential function according to the inference goal as:

[0083]

[0084] Where CE represents the cross entropy loss, For control The regularization term is in the range [0,1].

[0085] 5) Then the energy function is introduced as the joint optimization objective, that is, minimizing the energy function:

[0086]

[0087] Where N is the number of rules, is the rule strength, is the potential function corresponding to the rule.

[0088] Compared with the prior art, the present invention has the following beneficial effects:

[0089] The node classification method based on neural symbolic and prompt learning, described in this paper, achieves more reliable predictions by integrating graph neural networks with symbolic reasoning. We designed a universal neural symbolic reasoning framework that combines graph neural networks with neural probabilistic soft logic, integrating neural networks into first-order rules and effectively assisting the symbolic reasoning process. This method not only retains the efficient learning and perception capabilities of graph neural networks but also incorporates the cognitive reasoning capabilities of symbolic systems, achieving more reliable predictions.

[0090] The node classification method based on neural symbolic and cue learning, described in this paper, uses structural and attribute-level neural symbolic cues and integrates them into rules to guide the inference process. Structural-level cues capture structural information from each view by sampling and encoding a local subgraph centered on the target node, enhancing the model's perception and understanding of relational patterns within the graph. Attribute-level cues, by introducing class prototypes as cues, integrate feature information from various node types, thereby improving the model's ability to distinguish between different categories and achieving stronger generalization and accuracy.

[0091] In summary, this paper innovatively proposes a framework that designs instructive graph cues and integrates them into neural symbolic rules to mine implicit knowledge in pre-trained models. Furthermore, this paper designs multi-perspective neural symbolic cues and constructs four types of first-order rules to assist in the reasoning process. Finally, this paper conducts extensive experiments to verify the effectiveness of the model, significantly improving the performance of node classification on a benchmark dataset. BRIEF DESCRIPTION OF THE DRAWINGS

[0092] Figure 1 It is a schematic diagram of the functions and connection relationships of the model and each component module for implementing the node classification method based on neural symbols and prompt learning described in the present invention.

[0093] Figure 2 It is a flowchart of the node classification method based on neural symbol and prompt learning described in the present invention.

[0094] Figure 3 This is a flow chart of the graph neural symbol component module in the node classification method based on neural symbol and prompt learning described in the present invention.

[0095] Figure 4It is a flow chart of the symbol prompt module in the node classification method based on neural symbol and prompt learning described in the present invention.

[0096] Figure 5 It is a flowchart of the joint reasoning module in the node classification method based on neural symbol and prompt learning described in the present invention. DETAILED DESCRIPTION

[0097] The present invention will be described in detail below with reference to the accompanying drawings:

[0098] The node classification method based on neural symbolic and hint learning described in this paper integrates general graph neural networks with neural probabilistic soft logic, introducing structural and attribute-level neural symbolic hints to construct hint-based atoms. This method captures complementary information in the data and enhances the model's perception of implicit knowledge. These hint-based atoms are then integrated into first-order rules to better incorporate historical prior knowledge and effectively assist the symbolic reasoning process. Finally, a joint reasoning and parameter optimization strategy is proposed to guide the neural symbolic reasoning process, thereby constructing a more reliable and accurate graph mining model.

[0099] See Figure 1 and Figure 2 To achieve the goal of a node-based approach based on neural symbolic and prompt learning, we propose a model that consists of three functional modules: a graph neural symbolic component module, a symbolic prompt module, and a joint reasoning module. The functions of each module are as follows:

[0100] 1. Graph Neural Symbolic Component Module

[0101] The graph neural symbolic component module includes the construction of a general graph embedding component, a graph neural symbolic learning component, an atom generator, and a logic rule hybrid model. First, the graph embedding backbone network that follows this mechanism is designed, and then the neural network is combined with symbolic logic reasoning to construct a graph neural symbolic learning component, which integrates the output of the deep learning model to achieve symbolic reasoning. The atom generator is used to convert the graph embedding representation into an atom set, and a first-order rule base is constructed based on the atom set. A weight is assigned to each rule, and each rule is regarded as a potential mapping function. The mapping functions and weights of all rules are combined to construct a deep hybrid model.

[0102] 2.Symbol prompt module

[0103] The symbolic hint module, built on the foundation of the graph neural symbolic component module, is responsible for constructing atomic, instructive graph hints based on hints and integrating them into neural symbolic rules. Structural-level hints capture structural information across views by sampling and encoding local subgraphs centered around the target node. Attribute-level hints, by introducing class prototypes as hints, integrate feature information from various node types, thereby improving the model's ability to distinguish between different categories and achieving stronger generalization and accuracy.

[0104] 3. Joint Reasoning Module

[0105] The joint reasoning module is responsible for integrating the learning of graph neural networks and symbolic logic reasoning. The module first uses the learning of the pre-trained model to obtain the pre-trained model; the parameters of the pre-trained model are transferred to the downstream model as the initial parameters of the model, and then the reasoning results are calculated in combination with the symbolic rules. The consistency between the reasoning output and the rule expectation is measured by defining the potential function, and finally the synergy between graph neural networks and symbolic reasoning is achieved through a joint optimization framework driven by the energy function.

[0106] (1) See Figure 3 The steps of the graph neural symbol component module of the node method based on neural symbol and prompt learning of the present invention are as follows:

[0107] 1) Build a general graph embedding component f θ (·). Its main purpose is to extract the embedded representation of nodes. Specifically, given a graph G = (V, E), the lth layer of graph embedding can be formally defined as:

[0108]

[0109] in, Represents node v i Embedding representation at layer l; Represents node v i The neighbor set of θ (l) represents the learnable parameters of layer l; AGG(·) represents aggregation functions such as averaging, weighted summing, or maximum pooling.

[0110] 2) Design and use the atomic generator g θ (·)=δ(f θ (·)) generates atoms. Where δ(·) is a parameter-free atom-specific operation. The atom generator maps the output of the graph neural network to logical atoms, for example:

[0111] LABEL(v i ,y): represents node v i The category is y;

[0112] SIM(vi ,v j ): represents node v i With v j There are edge connections;

[0113] CLASS(v j ,y): represents node v j can be classified as y.

[0114] 3) Use atoms to build a set of first-order logic rules. Build a set of first-order logic rules to express the dependencies between entities. For example:

[0115] LABEL(v i ,y)∧SIM(v i ,v j )→CLASS(v j ,y)

[0116] This rule states: If a node v i The category is y, and it is related to node v j connected, then v j It should also be category y. All rules constitute the rule base R = {r1, r2, ..., r N} and assign a weight to each rule , used to indicate its importance in the learning process.

[0117] 4) Use Lukasiewicz soft logic to map the rules into potential functions. Convert the above symbolic rules into learnable energy terms for neural symbolic reasoning:

[0118] P∧Q=max(0.0,P+Q-1.0)

[0119] P∨Q=min(1.0,P+Q)

[0120]

[0121] Here, P and Q represent different atoms in the rule.

[0122] Each rule r i Perform probabilistic logic modeling to form the corresponding potential mapping function Taking the above rule as an example, its potential function form is:

[0123] φ r :LABEL(v i ,y)∧SIM(v i ,v j )→CLASS(v j ,y)

[0124] This function represents the reasoning ability of rule r under the current data graph, combined with the corresponding rule weight ω r Together they reflect the strength of symbolic logic constraints.

[0125] 5) Build a deep hybrid model based on the mapped potential function. Combine the potential functions and weights of all rules to build a deep hybrid model (DHM):

[0126] DHM={Φ,W DHM}

[0127] in, is the set of potential mapping functions for all rules; is the corresponding rule strength set.

[0128] 6) Minimize the energy function. The total energy function for constructing this model is as follows:

[0129]

[0130] in Representation rule r i The potential energy function of , that is, the degree of violation or matching of the rule at the current graph node; Representation rule r i The learning weight is used to control the contribution of the rule to the overall reasoning result;

[0131] (2) See Figure 4 After the graph neural symbol component module is implemented, the graph neural symbol component is obtained according to step (1), and the steps of constructing prompt rules with guiding significance are implemented by the symbol prompt module as follows:

[0132] 1) Multi-view structure subgraph Sampling embedding. For each target node v in the original graph G=V,E i ∈V, perform subgraph sampling operations from multiple perspectives to obtain its local neighborhood structure:

[0133]

[0134] in, They represent: first-order neighbor subgraph, r-order self subgraph, and random walk subgraph respectively.

[0135] 2) Using g θ Generate structure hint atoms SP(·,·). Using the atom generator g θ Encode the structure of subgraphs from different perspectives and generate structure hint atoms SP(·,·):

[0136]

[0137] Among them, structural hint atoms are used to express the semantic dependency patterns of target nodes from different structural perspectives.

[0138] 3) Attribute prompt prototype Embedding acquisition. On the original graph G, perform attribute feature clustering on the nodes to obtain the attribute representative points of each category (rather than simple average) to enhance robustness. Generate the attribute prompt prototype set as follows:

[0139]

[0140] Among them, Clust(G) represents the clustering operation, and Readout(·) extracts the cluster centers as prototype representations.

[0141] 4) Using g θ Generate attribute hint atoms AP(·,·). Using the atom generator g θ , the cluster center With the corresponding label Enter together to construct the attribute prompt atom:

[0142]

[0143] Among them, the attribute hint atom represents: cluster center Belong to category Can be used to guide the model to focus on class attributes.

[0144] 5) Using g θ Get all atoms. Based on the symbolic hint atoms constructed in steps 2) and 4), for the target node v in the graph i , through the atom generator g of the graph neural symbolic component module θ Generate the following atoms:

[0145] Input atom: Input(v i )

[0146] Figure neural atoms: GNN (v i ,y), represents the neural network's response to v i The predicted probability under label y

[0147] Classification atom: CLASS(v i ,y), indicating v i Classification target

[0148] Similarity Atom: SIM(v i ,Pc), indicating v i With attribute prompt P c The semantic similarity of

[0149] Attribute Tip Atom: AP(P c ,y), indicating the attribute prototype P c Mapping relationship with label y

[0150] Structure hint atoms: Indicates v i Local subgraph structure pattern of

[0151] 6) Using atoms to construct four types of first-order rules. Based on the above atoms, first-order reasoning rules are constructed to assist neural reasoning. Specifically, the following four types of rules are included:

[0152] Naive graph learning rule, that is, GNN directly predicts the target node v i The rules for labels are as follows:

[0153] Input(v i )∧GNN(v i ,y)→CLASS(v i ,y)

[0154] Structural hint injection rule, that is, node v i is the input node, for v i itself or its local structural subgraph If the prediction is label y, then v can be inferred i The classification result of y is as follows:

[0155]

[0156] Attribute hint injection rule, that is, node v i Is an input node, and it is related to the attribute prototype P c There is a high semantic similarity, and P c Can represent label y, then v can be inferred i The classification result of y is as follows:

[0157] Input(v i )∧AP(P c ,y)∧SIM(v i ,P c )→CLASS(v i ,y)

[0158] Joint prompt atomic injection rule, that is, the target node v i Is an input node, and the local structure subgraph it is in It has clear structural hint information and there is an attribute prototype P c Can represent the label y, then as long as v i The graph itself or its structure hint subgraph has a high semantic similarity with the attribute prototype (satisfying SIM(vi ,P c )or ), we can infer v i The rules for label y are as follows:

[0159]

[0160] (3) See Figure 5 , according to the deep hybrid model of the node method based on neural symbols and prompt learning defined in step (2), the collaborative reasoning node classification of graph neural network and symbolic reasoning is realized as follows:

[0161] 1) Define the graph embedding component loss function f θ Randomly sample multiple subgraphs from the input graph G and construct the original subgraph and its perturbation version as positive and negative sample pairs for contrastive learning. Use SimGRACE method as pre-training framework, use subgraph similarity as self-supervisory signal, and optimize graph representation learning model f θ , to obtain the pre-trained model Its core loss function is contrast loss, which is specifically expressed as:

[0162]

[0163] Among them, h i is the representation of the i-th original subgraph, h' i Its perturbation representation τ is the temperature parameter.

[0164] 2) Optimize the acquisition of graph embedding component f θ Then we design the optimization target to learn and obtain the pre-training model. The optimization target is:

[0165]

[0166] Where M is the number of subgraphs and Δ represents the perturbation operation.

[0167] 3) Define the target node inference result. The parameters of are transferred to the downstream model as the initial parameters of the model. Then, for the target node v i , suppose the inference result is:

[0168]

[0169] Where l(·) is the similarity function, P c is the category prototype vector, is the node neighbor subgraph.

[0170] 4) Map the inference target function to a potential function. The potential function is defined according to the inference target as:

[0171]

[0172] Where CE represents the cross entropy loss, For control The regularization term is in the range [0,1].

[0173] 5) Joint optimization to minimize the energy function E DHM Then the energy function is introduced as the joint optimization objective, that is, to minimize the energy function:

[0174]

[0175] Where N is the number of rules, is the rule strength, is the potential function corresponding to the rule.

[0176] 6) Get prediction results Finally, the model completes joint reasoning on the integrated graph neural network and symbolic reasoning and outputs the prediction results As the classification label of the node, that is:

[0177]

[0178] in, Represents node v i The predicted probability of belonging to the kth class, label(v i ) is the final predicted node category label.

Claims

1. A node classification method based on neural symbol and prompt learning, characterized by: The steps include: (1) Design a general neural symbolic reasoning backbone network The general neural symbolic reasoning backbone network mainly consists of two parts: a general graph embedding component and a graph neural symbolic learning component as follows: 1) Build a general graph embedding component f θ (·) is used to extract the embedded representation of the node. Its core idea is to propagate information through the graph structure, so that each node not only contains its own features but also aggregates the information of neighboring nodes. Specifically, given a graph G = (V, E), the lth layer of graph embedding can be formally defined as: in, Represents node v i Embedding representation at layer l; Represents node v i The neighbor set of θ (l) represents the learnable parameters of layer l; AGG(·) represents the aggregation function including averaging, weighted summing or maximum pooling; 2) Construct graph neural symbolic learning components and design atomic generator g with shared parameters θ (·)=δ(f θ (·)), where δ(·) is a parameter-free atom-specific operation. The atom generator maps the output of the graph neural network into logical atoms: LABEL(v i ,y): represents node v i The category is y; SIM(v i ,v j ): represents node v i With v j There are edge connections; CLASS(v j ,y): represents node v j can be classified as y; 3) Based on the atoms generated in step 2), a set of first-order logic rules is constructed to express the dependencies between entities: LABEL(v i ,y)∧SIM(v i ,v j )→CLASS(v j ,y) This rule states: If a node v i The category is y, and it is related to node v j connected, then v j It should also be category y; all rules constitute the rule base R = {r1, r2, ..., r N } and assign a weight to each rule Used to indicate its importance in the learning process; 4) Lukasiewicz soft logic is used for probabilistic mapping, converting the above symbolic rules into learnable energy terms for neural symbolic reasoning: P∧Q=max(0.0,P+Q-1.0) P∨Q=min(1.0,P+Q) Here, P and Q represent different atoms in the rule; 5) Using the probability value output by the atomic generator, Lukasiewicz soft logic is used to calculate the probability of each rule r. i Perform probabilistic logic modeling to form the corresponding potential mapping function Its potential function form is: φ r :LABEL(v i ,y)∧SIM(v i ,v j )→CLASS(v j ,y) This function represents the reasoning ability of rule r under the current data graph, combined with the corresponding rule weight ω r Together they reflect the strength of symbolic logic constraints; 6) Combine the potential functions and weights of all rules to build a deep hybrid model (DHM): DHM={Φ,W DHM } in, is the set of potential mapping functions for all rules; is the corresponding rule strength set; 7) The total energy function of the model is constructed as follows: in Representation rule r i The potential energy function of , that is, the degree of violation or matching of the rule at the current graph node; Representation rule r i The learning weight is used to control the contribution of the rule to the overall reasoning result; (2) Designing Neural Symbolic Hints at the Structure and Attribute Levels 1) For each target node v in the original graph G=V,E i ∈V, perform subgraph sampling operations from multiple perspectives to obtain its local neighborhood structure: in, Respectively represent: first-order neighbor subgraph, r-order self subgraph, random walk subgraph; 2) Using the atomic generator g θ Encode the structure of subgraphs from different perspectives and generate structure hint atoms SP(·,·): Among them, the structural hint atom is used to express the semantic dependency pattern of the target node under different structural perspectives; 3) On the original graph G, perform attribute feature clustering on the nodes to obtain the attribute representative points of each category to enhance robustness; generate the attribute prompt prototype set as follows: Among them, Clust(G) represents the clustering operation, and Readout(·) extracts the cluster center as the prototype representation; 4) Using the atomic generator g θ , the cluster center With the corresponding label Enter together to construct the attribute prompt atom: Among them, the attribute hint atom represents: cluster center Belong to category Used to guide the model to focus on class attributes; (3) Integrate structural and attribute-level neural symbolic cues into rules to guide reasoning models 1) For the target node v in the graph i , through the atomic generator g θ Generate the following atoms: Input atom: Input(v i ) Figure neural atoms: GNN (v i ,y), represents the neural network's response to v i The predicted probability under label y Classification atom: CLASS(v i ,y), indicating v i Classification target Similarity Atom: SIM(v i ,P c ), indicating v i With attribute prompt P c The semantic similarity of Attribute Tip Atom: AP(P c ,y), indicating the attribute prototype P c Mapping relationship with label y Structure hint atoms: Indicates v i Local subgraph structure pattern of 2) Based on the above atoms, first-order inference rules are constructed to assist neural reasoning, specifically including the following four types of rules: Naive graph learning rule, that is, GNN directly predicts the target node v i The rules for labels are as follows: Input(v i )∧GNN(v i ,y)→CLASS(v i ,y) Structural hint injection rule, that is, node v i is the input node, for v i itself or its local structural subgraph If the prediction is label y, then infer v i The classification result of y is as follows: Attribute hint injection rule, that is, node v i Is an input node, and it is related to the attribute prototype P c There is a high semantic similarity, and P c Represents the label y, then infer v i The classification result of y is as follows: Input(v i )∧AP(P c ,y)∧SIM(v i ,P c )→CLASS(v i ,y) Joint prompt atomic injection rule, that is, the target node v i Is an input node, and the local structure subgraph it is in It has clear structural hint information and there is an attribute prototype P c Can represent the label y, then as long as v i The graph itself or its structure hint subgraph has a high semantic similarity with the attribute prototype (satisfying SIM(v i ,P c )or ), that is, to infer v i The rules for label y are as follows: 3) Based on the potential function of the rules defined in (1), the above four types of rules are used to construct a deep hybrid model (DHM): DHM={Φ,W DHM } in, is the set of potential mapping functions for all rules; is the corresponding rule strength set; 4) The total energy function (Energy Function) of the model is constructed as follows: in Representation rule r i The potential energy function of , that is, the degree of violation or matching of the rule at the current graph node; Representation rule r i The learning weight is used to control the contribution of the rule to the overall reasoning result; (4) Design joint reasoning and optimization adjustment strategies 1) Randomly sample multiple subgraphs from the input graph G and construct the original subgraph and its perturbation version as positive and negative sample pairs for contrastive learning; use the SimGRACE method as a pre-training framework, use subgraph similarity as a self-supervisory signal, and optimize the graph representation learning model f θ , to obtain the pre-trained model Its core loss function is contrast loss, which is specifically expressed as: Among them, h i is the representation of the i-th original subgraph, h' i Its perturbation representation τ is the temperature parameter; 2) Then design the optimization target to learn and obtain the pre-training model. The optimization target is: Where M is the number of subgraphs, Δ represents the perturbation operation; 3) Pre-trained model The parameters of are transferred to the downstream model as the initial parameters of the model; then, for the target node v i , let the inference result be: Where l(·) is the similarity function, P c is the category prototype vector, is the node neighbor subgraph; 4) Then define the potential function according to the inference goal as: Where CE represents the cross entropy loss, For control Regularization term in the range [0,1]; 5) Then the energy function is introduced as the joint optimization objective, that is, minimizing the energy function: Where N is the number of rules, is the rule strength, is the potential function corresponding to the rule; 6) Get prediction results Finally, the model completes joint reasoning on the integrated graph neural network and symbolic reasoning and outputs the prediction results As the classification label of the node, that is: in, Represents node v i The predicted probability of belonging to the kth class, label(v i ) is the final predicted node category label.