Query term recommendation method based on double-class multi-relation heterogeneous graph neural network

Through the feature fusion and aggregation module of the dual-class multi-relational heterogeneous graph neural network, the complex semantic information processing problem of multi-relational heterogeneous graph is solved, more accurate query word recommendations are achieved, and the user experience of the e-commerce platform is improved.

CN120508699APending Publication Date: 2025-08-19TANGSHAN NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510418286.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-03
Publication Date
2025-08-19

AI Technical Summary

Technical Problem

The existing heterogeneous graph neural network cannot effectively process multi-relational heterogeneous graphs, resulting in inaccurate results of query word recommendations.

Method used

The query word recommendation method based on dual-class multi-relational heterogeneous graph neural network is adopted. Through the feature fusion module, inter-type semantic feature aggregation module and in-type relationship feature aggregation module, rich feature embeddings are generated to capture multiple edge relationships and complex semantic information.

Benefits of technology

It improves the accuracy and performance of query word recommendations, can better meet user habits, and improves the search efficiency and shopping experience of e-commerce platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120508699A_ABST
    Figure CN120508699A_ABST
Patent Text Reader

Abstract

The invention discloses a query word recommendation method based on a double-class multi-relation heterogeneous graph neural network, and relates to the technical field of e-commerce, and the method comprises the steps: obtaining a target shopping heterogeneous graph for any user, and processing the target shopping heterogeneous graph through the double-class multi-relation heterogeneous graph neural network to obtain a query word recommendation result of the user; the target shopping heterogeneous graph takes the user as a central node, takes different types of commodities purchased by the user as type nodes, and takes a weight between any two type nodes as an edge for connecting the two type nodes; the double-class multi-relation heterogeneous graph neural network comprises a feature fusion module, an inter-type semantic feature aggregation module and an intra-type relation feature aggregation module. Compared with an existing baseline method, the SF-BMHG has higher performance advantages in different tasks, and query terms conforming to user habits can be recommended more accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of e-commerce technology, and in particular to a query term recommendation method based on a dual-class multi-relationship heterogeneous graph neural network. Background Art

[0002] Traditional heterogeneous graph (HG) data, such as BMHG, not only contains multiple edge relationships between nodes of different types, but also connections between nodes of the same type, increasing modeling complexity. However, existing heterogeneous graph neural networks (HGNNs) are primarily designed for HGs with single relationships and are ineffective for BMHGs. Furthermore, these methods often capture node features based on meta-paths, resulting in the loss of intermediate nodes. Consequently, it is impossible to accurately generate targeted query term recommendations based on heterogeneous graph data from different users. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to address the deficiencies of the existing technology and specifically provide a query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network, which is as follows:

[0004] 1) In the first aspect, the present invention provides a query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network. The specific technical solution is as follows:

[0005] Obtaining a target shopping heterogeneous graph for any user, processing the target shopping heterogeneous graph through the dual-class multi-relation heterogeneous graph neural network, and obtaining a query word recommendation result for the user;

[0006] The target shopping heterogeneous graph takes the user as the central node, the different types of goods purchased by the user as type nodes, and the weight between any two type nodes as the edge connecting the two type nodes;

[0007] The dual-class multi-relationship heterogeneous graph neural network includes: a feature fusion module, an inter-class semantic feature aggregation module, and an intra-class relationship feature aggregation module.

[0008] The beneficial effects of the query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network provided by the present invention are as follows:

[0009] This solution aims to address the challenges of processing multiple edge relationships and complex semantic information between nodes in two-class multi-relation heterogeneous graphs (BMHGs). SF-BMHG first generates new features with intermediate nodes through a feature fusion module to avoid information loss. It then uses these new node features and meta-relation paths to capture semantic information in the BMHG. It then integrates features from different semantic paths using an inter-class semantic feature aggregation module. Furthermore, it employs relational convolution to capture relational features within different classes, and fuses these features through a relation-level attention mechanism. Finally, SF-BMHG generates rich feature embeddings based on the intra-class relational feature aggregation module, combining intra-class relational features with inter-class semantic features. Experimental results on real-world datasets demonstrate that SF-BMHG achieves superior performance across various tasks compared to existing baseline methods, further enabling more accurate recommendation of query terms that align with user preferences.

[0010] Based on the above solution, the present invention can also be improved as follows.

[0011] Furthermore, the feature fusion module is specifically:

[0012]

[0013] in, S i is the selected heterogeneous neighbor set, Random(·) is the selection function responsible for selecting the neighbor from the given set In the random selection of t neighbor nodes, inter represents the inter-type neighbor nodes, σ is the activation function tanh, and p is the attention vector used to calculate the attention value τ v,u , x u is a node Node features, x′ v is node n v The generated new feature embedding containing neighbor features, x v is node n v The generated feature embedding, x s is S∈S v Node features.

[0014] Furthermore, the inter-type semantic feature aggregation module is specifically:

[0015]

[0016] in, M R ∈R d*d and b R ∈R d*1 is a learnable parameter, is the semantic feature attention vector, is node n v On path R i The feature embedding under is the semantic feature attention coefficient, and the path R is obtained through softmax i Attention value is the semantic feature embedding of the fused neighbor nodes, is the set of feature embedding matrices under different meta-relation paths, is the regularized meta-relation path R i ∈R adjacency matrix, X′∈R n*d is the target node feature matrix with neighbor features, and b R ∈R d*1 is a learnable parameter vector, v is a node set, is a learnable parameter vector.

[0017] Furthermore, the intra-type relationship feature aggregation module is specifically:

[0018]

[0019] in, It is an edge relation∈ i The adjacency matrix under ∈∈, D is The degree matrix of X is the original feature without capturing the intermediate nodes. and is a learnable parameter, is an intra-type relation ∈ i The attention coefficient, is the attention vector of the relation feature, M ∈ is a learnable parameter vector, Yes, node n v In the edge relation ∈ i The feature embedding under b ∈ is a learnable parameter vector, is the relational feature embedding within the type, It is a relation ∈ i The attention value, μ c is the relation-level attention coefficient, X ∈ It is a set of node feature matrices captured under different relationships within a class.

[0020] 2) In a second aspect, the present invention further provides a query term recommendation system based on a dual-class multi-relation heterogeneous graph neural network. The specific technical solution is as follows:

[0021] The recommendation unit is used to: obtain a target shopping heterogeneous graph for any user, process the target shopping heterogeneous graph through the dual-class multi-relation heterogeneous graph neural network, and obtain a query word recommendation result for the user;

[0022] The target shopping heterogeneous graph takes the user as the central node, the different types of goods purchased by the user as type nodes, and the weight between any two type nodes as the edge connecting the two type nodes;

[0023] The dual-class multi-relationship heterogeneous graph neural network includes: a feature fusion module, an inter-class semantic feature aggregation module, and an intra-class relationship feature aggregation module.

[0024] Based on the above solution, the present invention can also be improved as follows.

[0025] Furthermore, the feature fusion module is specifically:

[0026]

[0027] in, S i is the selected heterogeneous neighbor set, Random(·) is the selection function responsible for selecting the neighbor from the given set In the random selection of t neighbor nodes, inter represents the inter-type neighbor nodes, σ is the activation function tanh, and p is the attention vector used to calculate the attention value τ v,u , x u is a node Node features, x′ v is node n v The generated new feature embedding containing neighbor features, x v is node n v The generated feature embedding, x s is S∈S v Node features.

[0028] Furthermore, the inter-type semantic feature aggregation module is specifically:

[0029]

[0030] in, M R ∈R d*d and b R ∈R d*1 is a learnable parameter, is the semantic feature attention vector, is node n v On path R i The feature embedding under is the semantic feature attention coefficient, and the path R is obtained through softmax i Attention value is the semantic feature embedding of the fused neighbor nodes, is the set of feature embedding matrices under different meta-relation paths, is the regularized meta-relation path R i ∈R adjacency matrix, X′∈R n*d is the target node feature matrix with neighbor features, and b R ∈R d*1 is a learnable parameter vector, v is a node set, is a learnable parameter vector.

[0031] Furthermore, the intra-type relationship feature aggregation module is specifically:

[0032]

[0033] in, It is an edge relation∈ i The adjacency matrix under ∈∈, D is The degree matrix of X is the original feature without capturing the intermediate nodes. and is a learnable parameter, is an intra-type relation ∈ i The attention coefficient, is the attention vector of the relation feature, M ∈ is a learnable parameter vector, Yes, node n v In the edge relation ∈ i The feature embedding under b ∈ is a learnable parameter vector, is the relational feature embedding within the type, It is a relation ∈ i The attention value, μ c is the relation-level attention coefficient, X ∈ It is a set of node feature matrices captured under different relationships within a class.

[0034] 3) In a third aspect, the present invention further provides an electronic device, comprising a processor, wherein the processor is coupled to a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor so that the electronic device implements any of the above methods.

[0035] 4) In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor to enable a computer to implement any of the above methods.

[0036] It should be noted that the beneficial effects achieved by the technical solutions of the second to fourth aspects of the present invention and the corresponding possible implementation methods can be found in the above-mentioned technical effects of the first aspect and its corresponding possible implementation methods, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0038] Figure 1 Schematic diagram of a flow chart of a query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network according to an embodiment of the present invention;

[0039] Figure 2 Schematic diagram of the model architecture of a query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network according to an embodiment of the present invention;

[0040] Figure 3 Schematic diagram of classification experiment results of different models of a query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network according to an embodiment of the present invention;

[0041] Figure 4 Schematic diagram of clustering experiment results of a query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network according to an embodiment of the present invention;

[0042] Figure 5 This is a schematic diagram of visualization results of a GAT model of a query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network according to an embodiment of the present invention on the TM_BMHG dataset;

[0043] Figure 6 This is a schematic diagram of visualization results of an HPN model of a query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network according to an embodiment of the present invention on the TM_BMHG dataset;

[0044] Figure 7 This is a schematic diagram of visualization results of the SF-BMHG model of a query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network according to an embodiment of the present invention on the TM_BMHG dataset;

[0045] Figure 8This is a schematic diagram of visualization results of the HAN model of a query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network according to an embodiment of the present invention on the TM_BMHG dataset;

[0046] Figure 9 This is a schematic diagram of the visualization results of the ie-HGCN model of a query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network according to an embodiment of the present invention on the TM_BMHG dataset;

[0047] Figure 10 This is a schematic diagram of visualization results of an OSGNN model of a query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network according to an embodiment of the present invention on the TM_BMHG dataset;

[0048] Figure 11 This is a schematic diagram showing the impact of different modules on model performance in a query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network according to an embodiment of the present invention;

[0049] Figure 12 Schematic diagram of the change in model performance under the AL-BMHG embedding dimension of a query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network according to an embodiment of the present invention;

[0050] Figure 13 Schematic diagram of the change in model performance under the TM-BMHG embedding dimension of a query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network according to an embodiment of the present invention;

[0051] Figure 14 This is a structural framework diagram of an electronic device of the present invention. DETAILED DESCRIPTION

[0052] To make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.

[0053] like Figure 1 As shown, a query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network according to an embodiment of the present invention includes the following steps:

[0054] S1, obtaining a target shopping heterogeneous graph for any user, processing the target shopping heterogeneous graph through the dual-class multi-relation heterogeneous graph neural network, and obtaining a query word recommendation result for the user;

[0055] The target shopping heterogeneous graph takes the user as the central node, the different types of goods purchased by the user as type nodes, and the weight between any two type nodes as the edge connecting the two type nodes;

[0056] The dual-class multi-relationship heterogeneous graph neural network includes: a feature fusion module, an inter-class semantic feature aggregation module, and an intra-class relationship feature aggregation module.

[0057] The beneficial effects of the query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network provided by the present invention are as follows:

[0058] This solution aims to address the challenges of processing multiple edge relationships and complex semantic information between nodes in two-class multi-relation heterogeneous graphs (BMHGs). SF-BMHG first generates new features with intermediate nodes through a feature fusion module to avoid information loss. It then uses the new node features and meta-relation paths to capture semantic information in the BMHG. It then integrates features from different semantic paths using an inter-class semantic feature aggregation module. Simultaneously, relational convolution is employed to capture relational features within different classes, and these features are fused using a relation-level attention mechanism. Finally, SF-BMHG generates rich feature embeddings based on the intra-class relational feature aggregation module, combining intra-class relational features with inter-class semantic features. Experimental results on real-world datasets demonstrate that SF-BMHG achieves superior performance across various tasks compared to existing baseline methods.

[0059] For ease of understanding, the technical terms and technical principles involved in this solution are explained below:

[0060] 1. Graph Neural Networks

[0061] Graph Neural Networks is a deep learning model for graph data. Thomas N. Kipf et al. first proposed the Graph Convolutional Network (GCN), which uses the computational method of Convolutional Neural Networks (CNN) to process the topological structure of the graph and define the convolution operation of the graph data. In addition, Petar et al. proposed the Graph Attention Network (GAT), which uses a self-attention mechanism to enhance the ability to aggregate node information in a graph. William L. Hamilton et al. proposed the Graph Isomorphism Network (GIN), which uses a multi-layer ensemble learning method to analyze the local connectivity of nodes and the structural characteristics of the graph. MixHop improves representational capabilities by combining information from multiple layers, while ChebNet utilizes Chebyshev polynomials to process graphs. However, GNNs primarily work on homogeneous graphs and are unable to handle heterogeneous graphs with different node types.

[0062] 2. Heterogeneous Graph Neural Networks

[0063] Zhang et al. proposed an unsupervised heterogeneous graph neural network algorithm, HetGNN, which consists of three parts: content aggregation, neighbor aggregation, and type aggregation. It aims to preserve the heterogeneity of graph structure and node features. Wang et al. proposed HAN, a semi-supervised algorithm that uses a hierarchical attention mechanism to capture node and semantic information. Fu et al. developed MAGNN, which learns node importance through meta-path aggregation and designs a corresponding attention mechanism. Wang et al. proposed HeCo, which introduces contrastive learning and combines node type and semantic information to enhance feature robustness. Lv et al. constructed a heterogeneous graph benchmark, HGB, and proposed Simple-HGN, an improved graph attention network (GAT) to adapt to heterogeneous graphs. Jin et al. proposed HGNN-AC, which fills missing attributes by weighted aggregation of neighbor nodes. Meanwhile, algorithms such as Schlichtkrull et al.'s RGCN, Yun et al.'s GTN, Zhu et al.'s RSHE, and Hu et al.'s heterogeneous graph transformer all aim to capture the complex relationships and information of heterogeneous graphs, thereby improving the performance of node embedding. HPN uses a new propagation mechanism to alleviate the semantic confusion problem in HGNN. ie-HGCN mathematically proves that random walks and meta-path-based aggregation are essentially similar, and uses this theory to improve the interpretability of the model. SR-HGN uses node-level and type-level aggregation to capture semantic and relational information in HG. HGNN-GAMS avoids the loss of edge features in meta-paths by generating edge features in paths. HGNN-BRFE attempts to conduct more comprehensive feature learning from the perspective of regional aggregation. However, these works mainly focus on heterogeneous graphs with single relations and cannot capture the diverse relational interactions between nodes.

[0064] It should be noted that semantic recommendation technology based on heterogeneous graphs supports basic services such as Taobao Mobile's query term recommendations. By constructing a heterogeneous graph containing multiple types of nodes and edges such as users, products, and query terms, and using heterogeneous graph neural networks to mine the complex relationships between them, it provides users with more accurate query term recommendations, improving search efficiency and shopping experience.

[0065] In other words, the results of query term recommendations are usually a set of recommended terms related to the user's current query term or search intent. These recommended terms are designed to help users find the information they need more efficiently or guide users to discover more content that may be of interest.

[0066] The result of query word recommendation is usually a list containing several words related to the user's current query. These words can be:

[0067] Synonyms or near synonyms: words that have similar meanings to the query terms entered by the user.

[0068] Related terms: Terms that are semantically or thematically related to the user's query.

[0069] Expanded vocabulary: further refinement or expansion of user query terms.

[0070] Hot words: currently popular words related to user query terms.

[0071] In order to more conveniently distinguish the difference between BMHG and HG, this section gives the definitions of HG and BMHG respectively.

[0072] Definition 1 Heterogeneous Graph (HG)

[10] : A HIN can be represented as By object collection and edge set E and object type set Combined with edge type Composition, of which

[0073] The difference between heterogeneous graphs and homogeneous graphs is that heterogeneous graphs contain multiple types of nodes, while homogeneous graphs only have one type of node. A clear example is Figure 1 shown.

[0074] Definition 2: Bi-class multi-relation heterogeneous graph (BMHG): Bi-class multi-relation heterogeneous graph is defined as represents the set of nodes, E represents the set of edges, Represents a set of node types, represents a set of edge types, where and Represent the node intra-class relationship and node inter-class relationship respectively. BMHG has multiple relationships, namely

[0075] The difference between HG and BMHG is that in BMHG, there may be multiple types of relationships between the same node pair, while in HG, there is only one type of relationship between the same node pair.

[0076] like Figure 2 As shown in the figure, the model framework diagram of the dual-class multi-relation heterogeneous graph neural network in this scheme is shown. Since different types of nodes are mostly distributed in different feature spaces, SF-BMHG first uses a linear layer to map different nodes to the same feature space:

[0077] X T =H T W T #(1) Among them, X T is the feature matrix of T-type nodes after feature transformation, H∈Rn*d′ is the original feature matrix of node type T, n is the number of nodes of type T, W T ∈R d′*d is the dimensional transformation matrix for T-type nodes, d′ is the original embedding dimension of T-type nodes, and d is the feature dimension after projection. After the above operation, all nodes are projected into the same dimensional space.

[0078] The dual-class multi-relation heterogeneous graph neural network consists of three parts: a feature fusion module, an inter-class semantic feature aggregation module, and an intra-class relation feature aggregation module. Specifically:

[0079] 1. Feature fusion module

[0080] In order to avoid the problem of feature loss of intermediate nodes, SF-BMHG starts from the target node n according to the topological structure of the graph. v Select t heterogeneous neighbor nodes under the direct neighbor node of for aggregation.

[0081]

[0082] Among them S i is the selected heterogeneous neighbor set, Random(·) is the selection function responsible for selecting the neighbor from the given set Randomly select t neighbor nodes from , where inter represents the inter-type neighbor nodes. Then Random(·) executes the selection strategy without replacement, otherwise it executes the repeated selection strategy with replacement.

[0083] For the selected neighbor nodes, SF-BMHG uses the attention mechanism to compare them with the target node n. v To perform fusion and avoid the loss of its own features, SF-BMHG retains its own node features in the form of residuals:

[0084]

[0085] Where σ is the activation function tanh, and p is the attention vector used to calculate the attention value τ v,u , x u is a node Node features, x′ v is node n v The generated new feature embedding contains neighbor features.

[0086] 2. Inter-type semantic feature aggregation module

[0087] After obtaining node n vFeatures x′ with neighbor information v Finally, SF-BMHG captures the semantic information in BMHG according to the predefined meta-relation paths. For a given meta-relation path set R = R1, R2, ..., R k}:

[0088]

[0089] in, is the regularized meta-relation path R i ∈R adjacency matrix, X′∈R n*d is the target node feature matrix with neighbor features, W attr ∈R d*d and b R ∈R d*1 is a learnable parameter vector.

[0090] According to formula (5), the feature embedding matrix set under different meta-relation paths can be obtained For feature embedding under different paths, SF-BMHG uses semantic-level attention to fuse different features to generate node features with multi-semantics.

[0091]

[0092] Among them, M R ∈R d*d and b R ∈R d*1 is a learnable parameter, is the attention vector, is node n v On path R i The feature embedding under is the attention coefficient, and the path R is obtained through softmax i Attention value

[0093] 3. Intra-type relational feature aggregation module

[0094] Since there are direct edges between nodes of the same type in BMHG, and this edge relationship reflects the same attributes or important interactions between nodes of the same type, it is of great significance to capture the relevant features.

[0095] For target type node n v With n u The set of possible edge relationship types SF-BMHG uses graph convolution to capture node features with direct connections. i The following connection relationships are:

[0096]

[0097] in It is an edge relation∈ i The adjacency matrix under ∈∈, D is The degree matrix of , X is the feature matrix after transformation by formula (1). It should be noted that the original features without capturing the intermediate nodes are used here. and is a learnable parameter.

[0098] For the node feature matrix set captured under different relationships within the class SF-BMHG uses relation-level attention to fuse different features:

[0099]

[0100] After the above process, SF-BMHG obtains the semantic feature embedding of the fused neighbor nodes and intra-type relational feature embeddings In order to fully preserve the feature information from different perspectives, SF-BMHG fuses the two to generate the final feature embedding:

[0101]

[0102] Finally, this paper projects the nodes into the task space through a fully connected layer and trains the model using the following loss function:

[0103] Z=Linear(X)#(14)

[0104]

[0105] where Linear(·) is a fully connected layer, C is a projection matrix that projects node embeddings into node label vectors, and y L is the set of labeled nodes, Y l and Z l are the label vector and embedding of labeled node l, respectively.

[0106] Furthermore, the feature fusion module is specifically:

[0107]

[0108] in, S iis the selected heterogeneous neighbor set, Random(·) is the selection function responsible for selecting the neighbor from the given set In the random selection of t neighbor nodes, inter represents the inter-type neighbor nodes, σ is the activation function tanh, and p is the attention vector used to calculate the attention value τ v,u , x u is a node Node features, x′ v is node n v The generated new feature embedding containing neighbor features, x v is node n v The generated feature embedding, x s is S∈S v Node features.

[0109] Furthermore, the inter-type semantic feature aggregation module is specifically:

[0110]

[0111] in, M R ∈R d*d and b R ∈R d*1 is a learnable parameter, is the semantic feature attention vector, is node n v On path R i The feature embedding under is the semantic feature attention coefficient, and the path R is obtained through softmax i Attention value is the semantic feature embedding of the fused neighbor nodes, is the set of feature embedding matrices under different meta-relation paths, is the regularized meta-relation path R i ∈R adjacency matrix, X′∈R n*d is the target node feature matrix with neighbor features, and b R ∈R d*1 is a learnable parameter vector, v is a node set, is a learnable parameter vector.

[0112] Furthermore, the intra-type relationship feature aggregation module is specifically:

[0113]

[0114] in, It is an edge relation∈ i The adjacency matrix under ∈∈, D is The degree matrix of X is the original feature without capturing the intermediate nodes. and is a learnable parameter, is an intra-type relation ∈ i The attention coefficient, is the attention vector of the relation feature, M ∈ is a learnable parameter vector, Yes, node n v In the edge relation ∈ i The feature embedding under b ∈ is a learnable parameter vector, is the relational feature embedding within the type, It is a relation ∈ i The attention value, μ c is the relation-level attention coefficient, X ∈ It is a set of node feature matrices captured under different relationships within a class.

[0115] Example 1,

[0116] A. Dataset

[0117] This paper uses two real-world BMHGs: the Alibaba online mall user-product transaction network and the DBLP author-paper network. The dataset details are as follows:

[0118] AL_BMHG: It consists of users (U) and products (P). There are 7520 user nodes and 9089 product nodes. Products are the target type nodes in the dataset, and there are three types in total. There are four types of edge relationships between users and products: buy, cart, favorite, and browse. There are three types of edge relationships between users: same age, same purchasing power, and same gender. There are two types of edge relationships between users and products: same store and same brand. For AL_BMHG, the meta-relationship paths set in this article are: PUP:buy, PUP:cart, PUP:favorite, PUP:browse.

[0119] TM_BMHG: This dataset is a real-world dataset from Tmall. It consists of users (U) and items (I). There are 14,199 user nodes and 12,895 item nodes. Items are the target type of nodes in the dataset, with a total of six categories. The edge relationship information in this dataset is the same as that in AL_BMHG.

[0120] B. Baseline and Experimental Setup

[0121] To verify the effectiveness of the model proposed in this paper, this paper compares it with a variety of existing classic models, including GCN, GAT, HPN, HAN, OSGNN, ie-HGCN and SR-HGN. Among them, GCN is a graph neural network that performs representation learning by aggregating information of neighboring nodes; GAT improves expressiveness and flexibility by assigning different attention weights to each neighboring node. HPN uses path information in heterogeneous graphs for node representation, while HAN implements attention mechanisms at the node level and semantic level to capture the complex relationships between different types of nodes and edges. OSGNN constructs node representation by splitting heterogeneous graphs into weighted combined subgraphs and combining first-order and high-order information. ie-HGCN adopts a hierarchical aggregation architecture to automatically extract meta-paths to achieve efficient and interpretable node representation.

[0122] This paper divides the ratio of training set, validation set, and test set into 1 / 10, 1 / 10, and 4 / 5 respectively. The learning rate of all models is set to 0.005, the hidden layer size is set to 64, the number of neighbors t is set to 7, and the training is carried out for 500 rounds. To reduce consumption, the early stopping strategy is adopted in the training process, and the patience value is set to 10. For other settings of the baseline model, refer to the paper.

[0123] C. Classification Experiment

[0124] This paper uses SVM as the classifier and uses Macro-F1 (Ma-F1) and Micro-F1 (Mi-F1) as evaluation indicators to compare the performance of different models on two datasets. The results are as follows Figure 3 shown.

[0125] Figure 3 The SF-BMHG method performed exceptionally well on the AL_BMHG dataset, achieving state-of-the-art results across all metrics. In contrast, HPN and HAN, while performing well, failed to surpass SF-BMHG. On the TM_BMHG dataset, SF-BMHG maintained its lead, achieving Ma-F1 and Mi-F1 scores of 90.05 and 89.79, respectively, demonstrating its stability and adaptability. While some traditional methods, such as GAT and HPN, are competitive on specific metrics, these methods are limited in their ability to achieve superior results on BMHGs with multiple relationships, as they are designed for either homogeneous graphs or heterogeneous graphs with a single relationship.

[0126] like Figure 4As shown in the figure, the K-Means algorithm was used to cluster node embeddings, with NMI and ARI used as evaluation metrics. In clustering experiments, the SF-BMHG method performed well on the AL_BMHG dataset, achieving an NMI and ARI of 0.7818 and 0.8403, respectively, significantly outperforming other methods. On the TM_BMHG dataset, SF-BMHG achieved an NMI of 0.6735 and an ARI of 0.5199, still outperforming most models. This is because SF-BMHG can directly aggregate features of nodes of the same type through intra-class relationship feature aggregation, resulting in a stronger clustering effect.

[0127] like Figures 5 to 10 As shown in the figure, t-SNE was used on the TM_BMHG dataset to reduce the node representation to two-dimensional space and color the nodes by label to visualize the experimental results of different models. The four models, GAT, HPN, HAN, and ie-HGCN, have strong aggregation capabilities between the same nodes, but the boundaries between types are not clear. In contrast, OSGNN and SF-BMHG have clearer boundaries between different types of nodes, but SF-BMHG performs better in terms of node distinguishability.

[0128] like Figure 11 As shown in Figure 2, several model variants are used to see the impact of different modules on model performance. The specific settings are as follows:

[0129] -w / oT: Remove the intra-class relationship aggregation module and only perform inter-class semantic feature aggregation.

[0130] -w / oS: Removes the inter-class semantic feature aggregation module and performs only intra-class relational aggregation. Since the new features after feature fusion are primarily used in the semantic aggregation module, the feature fusion module is no longer effective in this case and is therefore removed as well. Model performance significantly decreased after removing the semantic fusion layer, indicating that the semantic feature aggregation module plays a significant role in model performance. Model performance also decreased somewhat after removing intra-class relational feature aggregation, indicating that intra-class feature aggregation also has a positive impact on improving model performance.

[0131] like Figures 12 to 13 As shown, in the classification tasks on the AL_BMHG and TM_BMHG datasets, both Macro-F1 and Micro-F1 metrics increase with increasing dimensionality, due to the enhanced learnability of the model. Clustering performance metrics NMI and ARI also performed well on the TM_BMHG dataset, reaching 0.85 and 0.8, respectively, especially at dimensions of 128 and 256. Clustering performance on the TM_BMHG dataset fluctuated significantly, indicating a significant impact of model dimension on TM_BMHG.

[0132] In the above embodiments, although the steps are numbered S1, S2, etc., these are only specific embodiments given by the present invention. Those skilled in the art may adjust the execution order of S1, S2, etc. according to actual conditions, which is also within the scope of protection of the present invention. It can be understood that in some embodiments, some or all of the above embodiments may be included.

[0133] The present invention also provides a query term recommendation system based on a dual-class multi-relation heterogeneous graph neural network. The specific technical solution is as follows:

[0134] The recommendation unit is used to: obtain a target shopping heterogeneous graph for any user, process the target shopping heterogeneous graph through the dual-class multi-relation heterogeneous graph neural network, and obtain a query word recommendation result for the user;

[0135] The target shopping heterogeneous graph takes the user as the central node, the different types of goods purchased by the user as type nodes, and the weight between any two type nodes as the edge connecting the two type nodes;

[0136] The dual-class multi-relationship heterogeneous graph neural network includes: a feature fusion module, an inter-class semantic feature aggregation module, and an intra-class relationship feature aggregation module.

[0137] It should be noted that the beneficial effects of the query term recommendation system based on a dual-class multi-relationship heterogeneous graph neural network provided by the above embodiment are the same as the beneficial effects of the query term recommendation method based on a dual-class multi-relationship heterogeneous graph neural network, which will not be repeated here. In addition, when the system provided by the above embodiment realizes its functions, it only uses the division of the above-mentioned functional modules as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the system can be divided into different functional modules according to actual conditions to complete all or part of the functions described above. In addition, the system and method embodiments provided by the above embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0138] like Figure 14 As shown, an electronic device 300 according to an embodiment of the present invention includes a processor 320, which is coupled to a memory 310. The memory 310 stores at least one computer program 330. The at least one computer program 330 is loaded and executed by the processor 320 to enable the electronic device 300 to implement any of the above methods. Specifically:

[0139] The electronic device 300 may have relatively large differences due to different configurations or performances, and may include one or more processors 320 (Central Processing Units, CPU) and one or more memories 310, wherein the one or more memories 310 store at least one computer program 330, and the at least one computer program 330 is loaded and executed by the one or more processors 320 to enable the electronic device 300 to implement a query term recommendation method based on a dual-class multi-relationship heterogeneous graph neural network provided in the above embodiment. Of course, the electronic device 300 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The electronic device 300 may also include other components for implementing device functions, which will not be described in detail here.

[0140] A computer-readable storage medium according to an embodiment of the present invention stores at least one computer program, and the at least one computer program is loaded and executed by a processor to enable a computer to implement any of the above methods.

[0141] Alternatively, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, or the like.

[0142] In an exemplary embodiment, a computer program product or computer program is also provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform any of the above methods.

[0143] It should be noted that the terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects and to define a specific order or precedence. Where appropriate, the order used for similar objects may be interchanged, such that the embodiments of the present application described herein can be implemented in an order other than the order shown or described.

[0144] Those skilled in the art will appreciate that the present invention may be implemented as a system, method, or computer program product. Therefore, the present disclosure may be implemented in the following forms: entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or in a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, the present invention may be implemented in the form of a computer program product embodied in one or more computer-readable media containing computer-readable program code.

[0145] Any combination of one or more computer-readable media can be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device.

[0146] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. A query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network, characterized in that: include: Obtaining a target shopping heterogeneous graph for any user, processing the target shopping heterogeneous graph through the dual-class multi-relation heterogeneous graph neural network, and obtaining a query word recommendation result for the user; The target shopping heterogeneous graph takes the user as the central node, the different types of goods purchased by the user as type nodes, and the weight between any two type nodes as the edge connecting the two type nodes; The dual-class multi-relationship heterogeneous graph neural network includes: a feature fusion module, an inter-class semantic feature aggregation module, and an intra-class relationship feature aggregation module.

2. The query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network according to claim 1, characterized in that: The feature fusion module is specifically: in, S i is the selected heterogeneous neighbor set, Random(·) is the selection function responsible for selecting the neighbor from the given set In the random selection of t neighbor nodes, inter represents the inter-type neighbor nodes, σ is the activation function tanh, and p is the attention vector used to calculate the attention value τ v,u , x u is a node Node features, x′ v is node n v The generated new feature embedding containing neighbor features, x v is node n v The generated feature embedding, x s is S∈S v Node features.

3. The query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network according to claim 1, characterized in that: The inter-type semantic feature aggregation module is specifically: in, M R ∈R d*d and b R ∈R d*1 are learnable parameters, is the semantic feature attention vector, is node n v On path R i The feature embedding under is the semantic feature attention coefficient, and the path R is obtained through softmax i Attention value is the semantic feature embedding of the fused neighbor nodes, is the set of feature embedding matrices under different meta-relation paths, is the regularized meta-relation path R i ∈R adjacency matrix, X′∈R n*d is the target node feature matrix with neighbor features, and b R ∈R d*1 is a learnable parameter vector, v is a node set, is a learnable parameter vector.

4. The query term recommendation method based on a dual-class multi-relation heterogeneous graph neural network according to claim 1, characterized in that: The intra-type relationship feature aggregation module is specifically: in, It is an edge relation∈ i The adjacency matrix under ∈∈, D is The degree matrix of X is the original feature without capturing the intermediate nodes. and is a learnable parameter, is an intra-type relation ∈ i The attention coefficient, is the attention vector of the relation feature, M ∈ is a learnable parameter vector, Yes, node n v In the edge relation ∈ i The feature embedding under b ∈ is a learnable parameter vector, is the relational feature embedding within the type, It is a relation ∈ i The attention value, μ c is the relation-level attention coefficient, X ∈ It is a set of node feature matrices captured under different relationships within a class.

5. A query term recommendation system based on a dual-class multi-relation heterogeneous graph neural network, characterized by: include: The recommendation unit is used to: obtain a target shopping heterogeneous graph for any user, process the target shopping heterogeneous graph through the dual-class multi-relation heterogeneous graph neural network, and obtain a query word recommendation result for the user; The target shopping heterogeneous graph takes the user as the central node, the different types of goods purchased by the user as type nodes, and the weight between any two type nodes as the edge connecting the two type nodes; The dual-class multi-relationship heterogeneous graph neural network includes: a feature fusion module, an inter-class semantic feature aggregation module, and an intra-class relationship feature aggregation module.

6. The query term recommendation system based on a dual-class multi-relation heterogeneous graph neural network according to claim 5, characterized in that: The feature fusion module is specifically: in, S i is the selected heterogeneous neighbor set, Random(·) is the selection function responsible for selecting the neighbor from the given set In the random selection of t neighbor nodes, inter represents the inter-type neighbor nodes, σ is the activation function tanh, and p is the attention vector used to calculate the attention value τ v,u , x u is a node Node features, x′ v is node n v The generated new feature embedding containing neighbor features, x v is node n v The generated feature embedding, x s is S∈S v Node features.

7. The query term recommendation system based on a dual-class multi-relation heterogeneous graph neural network according to claim 5, characterized in that: The inter-type semantic feature aggregation module is specifically: in, M R ∈R d*d and b R ∈R d*1 is a learnable parameter, is the semantic feature attention vector, is node n v On path R i The feature embedding under is the semantic feature attention coefficient, and the path R is obtained through softmax i Attention value is the semantic feature embedding of the fused neighbor nodes, is the set of feature embedding matrices under different meta-relation paths, is the regularized meta-relation path R i ∈R adjacency matrix, X′∈R n*d is the target node feature matrix with neighbor features, and b R ∈R d*1 is a learnable parameter vector, v is a node set, is a learnable parameter vector.

8. The query term recommendation system based on a dual-class multi-relation heterogeneous graph neural network according to claim 5, characterized in that: The intra-type relationship feature aggregation module is specifically: in, It is an edge relation∈ i The adjacency matrix under ∈∈, D is The degree matrix of X is the original feature without capturing the intermediate nodes. and is a learnable parameter, is an intra-type relation ∈ i The attention coefficient, is the attention vector of the relation feature, M ∈ is a learnable parameter vector, Yes, node n v In the edge relation ∈ i The feature embedding under b ∈ is a learnable parameter vector, is the relational feature embedding within the type, It is a relation ∈ i The attention value, μ c is the relation-level attention coefficient, X ∈ It is a set of node feature matrices captured under different relationships within a class.

9. An electronic device, characterized in that: The electronic device includes a processor coupled to a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor so that the electronic device implements the method according to any one of claims 1 to 4.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to enable a computer to implement the method according to any one of claims 1 to 4.