Dynamic-increment-based gated aggregation knowledge graph recommendation method
Patent Information
- Application Number
- CN202610741400.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-27
- Publication Date
- 2026-08-18
AI Technical Summary
[0006]本发明涉及一种基于动态增量的门控聚合知识图谱推荐方法,主要用于解决现有知识图谱推荐方法中存在的两大技术问题:一是模型无法自动采样邻域信息,导致全采样计算量大、固定采样质量差异大;二是邻域信息扩散时因多次重叠邻域信息,使得噪声问题加重,进而影响推荐精确率
[0019]This invention employs incremental dynamic sampling based on an attention mechanism. The model can automatically filter out high-response neighborhood information based on the correlation between users, item entities, and neighborhood information, avoiding the randomness of fixed sampling and the high time cost of full sampling, reducing the sampling overhead of large-scale knowledge graphs, and reducing noise in the initial graph information.
Smart Images

Figure CN122594582A_ABST
Abstract
Description
Technical Field
[0001] This invention pertains to the research of knowledge graph recommendation technology in the field of recommendation systems, and particularly relates to a gated aggregation knowledge graph recommendation method based on dynamic increment. Background Technology
[0002] With the rapid development of internet technology, the amount of online content accessible to people has increased dramatically, such as news, movies, and music. To alleviate the impact of information overload, recommender systems provide personalized recommendations based on users' interests, reducing the time users spend filtering information. Traditional recommendation techniques utilize Collaborative Filtering (CF), which models users and recommended items based on specific operations, exploring their correlation. However, CF-based methods often suffer from inaccurate recommendations due to the sparsity of user-item interactions. New recommended items also face the cold-start problem, where insufficient user ratings result in few recommendations being presented to users. To mitigate the sparsity and cold-start issues in recommender systems, most research utilizes various forms of indirect information to improve recommendation performance. Among these, Knowledge Graphs (KGs) are directed heterogeneous graphs where nodes typically represent users or recommended items, and edges represent relationships between nodes. The rich semantic relevance between nodes in a Knowledge Graph can help improve recommender system performance; the various relationships within the graph can also help reasonably expand user interests, increasing recommendation diversity; and the interpretability of the various node and edge connections within the graph contributes to the interpretability of the recommender system.
[0003] However, existing knowledge graph recommendation system research uses fixed sampling or full sampling of node adjacency information, and then uses a double diffusion algorithm to perform a convolution-like operation to continuously fuse node adjacency information. This method, due to the randomness of sampling, suffers from problems such as high computational cost (full sampling), large differences in sampling quality (fixed sampling), difficulty in adapting parameters to all graphs, and repeated fusion of noise.
[0004] In recent years, graph neural network-based methods have achieved significant results in the field of knowledge graph reasoning. R-GCN and CompGCN propagate neighborhood information from all nodes, which enhances the ability of nodes to capture neighborhood information, but also makes the model results overly smooth. NBFNet and RED-GNN propagate from the local neighborhood of nodes, achieving stronger reasoning capabilities than R-GCN or CompGCN through selective propagation. However, the local neighborhood information propagated each time remains fixed and cannot be dynamically selected, leading to excessive integration of noise information into the graph nodes. Inspired by the neighborhood considerations in knowledge graph reasoning, this approach automatically calculates the attention score for each neighborhood information based on node, edge, and user information, allowing the model to incrementally and automatically sample the necessary neighborhood information when propagating information on the graph. Because knowledge graphs are complex and large-scale, propagating to all neighborhoods or simply sampling neighborhood information randomly can easily lead to randomness in graph information and enormous computational overhead. Furthermore, the double-diffusion algorithm of traditional graph convolutional neural networks repeatedly adds sampled noise to the node information, resulting in a decrease in recommendation accuracy.
[0005] Therefore, there is an urgent need for a method to address the problems of manual sampling and overlapping double-diffusion noise in existing knowledge graph recommendation methods. Summary of the Invention
[0006] This invention relates to a gated aggregation knowledge graph recommendation method based on dynamic increments, primarily addressing two major technical problems in existing knowledge graph recommendation methods: first, the model cannot automatically sample neighborhood information, resulting in high computational cost for full sampling and significant variations in fixed sampling quality; second, the diffusion of neighborhood information is exacerbated by multiple overlaps, thus affecting recommendation accuracy. To solve these problems, the technical solution adopted by this invention is as follows:
[0007] This method includes core steps such as data preparation, neighborhood information acquisition, dynamic sampling and aggregation, and model training. The specific steps are as follows:
[0008] 1) Data Acquisition and Preprocessing. Due to the sparsity of user rating data and the cold start problem in recommender systems, these systems often need to introduce lateral information as additional learning content for the model to improve recommendation performance. Knowledge graphs, as directed heterogeneous graphs, contain rich node information, relational information, semantic representation, and interpretability. This invention acquires real user rating data as the dataset for the recommender system and constructs a related knowledge graph as the lateral information dataset for the recommender system to improve recommendation performance. This mainly includes the preprocessing of the rating dataset, the construction of the knowledge graph, and the preprocessing of the knowledge graph.
[0009] Furthermore, the acquired user review data is first filtered using a rating threshold to remove reviews with ratings below the threshold, reducing noise in the review data. Then, the actual item names in the review dataset are mapped to unique ID values, and an item name-ID mapping file is created for subsequent knowledge graph construction and preprocessing.
[0010] Furthermore, the real item names in the evaluation data are linked to the large knowledge graph DBpedia to obtain rich link information as the original link graph, with a structure of (head, relation, tail) triples. Relations with low frequency of occurrence in the original link graph are filtered to reduce noise data in the knowledge graph. Based on the item name-ID mapping file, the item names and relation names in the original link graph are mapped to unique ID values, thus initially constructing the knowledge graph.
[0011] Furthermore, data preprocessing is performed on the knowledge graph. Item IDs in the graph are aligned with item IDs in the rating data; any misaligned data is deleted. Item IDs in the rating data are then aligned again with item IDs in the graph to ensure that the ID values in both datasets are consistent and unique, thus forming the final rating dataset and knowledge graph.
[0012] 2) Neighborhood information extraction. A graph-item entity sparse matrix (M) is constructed based on the knowledge graph. sub ), construct an entity-batch sparse matrix (M) based on the current node set. node ), where M sub The row size is the number of rows in the knowledge graph, and the column size is the total number of item entities, M. node The row size is the total number of item entities, and the column size is the batch size.
[0013] Furthermore, regarding M sub With M node Matrix right multiplication can quickly obtain the neighbor information of item IDs in the knowledge graph from batch data, thereby obtaining the neighbor set of the current step node set (Node). t Based on the neighbor set, the set of adjacent edges in the knowledge graph can be obtained. t The information is fed into the embedding layer (embedding layer, embedding dimension is 32) to obtain the neighborhood entity information (Et Node) and neighborhood relationship information (Et Edge), where t represents the current diffusion layer number.
[0014] 3) Dynamic Sampling and Gated Aggregation. The neighborhood entity information Et Node and neighborhood relationship information Et Edge obtained in step 2) are dynamically sampled to obtain corresponding attention scores. The attention scores are then used to filter Et Nodes and Et Edges. Finally, a gating mechanism (GRU) is used to fuse the filtered and aggregated Et Nodes and Et Edges, integrating them into the hidden embedding (Et-1 h) of the previous step to form the current hidden embedding (Et h).
[0015] Furthermore, the neighborhood entity information and neighborhood relationship information are first concatenated to form neighborhood information (Et m), which is then combined with user embedding (E... u The neighborhood information attention score (alpha) is calculated from the embedding of the item to be recommended (E0 s). The alpha input Gumbel_Softmax is sampled, and then the top-K attention score is used as the neighborhood information weight, while the remaining weights are reset to 0. After aggregating Et m with neighborhood information weights, the embeddings are fused through a gating mechanism to form the intermediate hidden layer embedding of the current step.
[0016] Furthermore, after dynamically sampling the neighborhood information, it is necessary to sample the next diffusion nodes. This is achieved by utilizing user-embedded E... u The item to be recommended is embedded into E0s, and the attention score (nodelogit) of the neighboring entity information is calculated for the Et Node. During the training phase, the nodelogit is sampled using the Gumbel_Softmax algorithm (Softmax is used during the prediction phase). The top-K attention scores are selected and directly used as the weights of the neighboring entity information, while the remaining weights are reset to 0. The neighboring entity information is then weighted and aggregated using the neighboring entity information weights and fused with the intermediate hidden layer embeddings of the current step using GRU to form the final hidden layer embedding Eth of the current step. Simultaneously, the neighbors with the top-K attention scores are used as the next step's diffusion node set, while neighbors with low scores are discarded.
[0017] 4) Model Training and Optimization. After the graph information has diffused to a preset number of layers t, the final model embedding (Et final_h) is generated. Et final_h is then compared with E... u The recommended score is obtained by performing a dot product, the loss value is calculated using the binary cross-entropy loss function, and the model parameters are updated by backpropagation through the Adam optimizer.
[0018] The beneficial effects of this invention are as follows:
[0019] This invention employs incremental dynamic sampling based on an attention mechanism. The model can automatically filter out high-response neighborhood information based on the correlation between users, item entities, and neighborhood information, avoiding the randomness of fixed sampling and the high time cost of full sampling, reducing the sampling overhead of large-scale knowledge graphs, and reducing noise in the initial graph information.
[0020] This invention employs a neighbor-by-neighbor gating aggregation mechanism, sampling and diffusing from the initial node one neighbor at a time. The gating mechanism automatically fuses neighborhood information and filters the next diffusion node, reducing noise overlap caused by repeated superposition of neighborhood information in double diffusion and optimizing the time complexity of graph information diffusion. The gating mechanism automatically controls the fusion ratio of new and old information, offering greater accuracy than common methods such as splicing and summation, effectively improving recommendation performance. Attached Figure Description
[0021] Figure 1 This is a schematic diagram of the method flow of the present invention.
[0022] Figure 2 This is a schematic diagram of the dynamic incremental sampling gating aggregation of the present invention. Detailed Implementation
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0024] The main flowchart of the gated aggregation knowledge graph recommendation method based on dynamic increment proposed in this invention is as follows: Figure 1 As shown. The specific implementation process is as follows:
[0025] This invention proposes a gated aggregation knowledge graph recommendation method based on dynamic increments to solve the problems of neighborhood sampling and noise propagation during double diffusion. To achieve the above objectives, the technical solution adopted by this invention is as follows:
[0026] This invention provides a gated aggregation knowledge graph recommendation method based on dynamic increments, which includes the following steps:
[0027] 1) Obtain the knowledge graph recommendation dataset. This includes obtaining user review data and a dataset mapping the IDs of rated items to their actual names. Then, linking the actual names of the rated items to a large knowledge graph, a training item knowledge graph is constructed. Finally, the review dataset and knowledge graph undergo data preprocessing and partitioning to meet the requirements of the practical task.
[0028] 2) In the neighboring information extraction step corresponding to the invention content, M is constructed based on the knowledge graph. sub and M node , for M sub and M node Use right multiplication to quickly obtain the neighborhood entity information Et Node of the item ID to be recommended in the current batch in the knowledge graph. Then use Et Node to index the knowledge graph and obtain the neighborhood relationship information Et Edge.
[0029] 3) In the dynamic sampling and aggregation stage corresponding to the invention content, Et Node and Et Edge are spliced together to obtain E Then, based on the user's embedded E u Items to be recommended are embedded in E0s and E Calculate the attention score, select the Top-K neighborhood information (K is a positive integer from 10 to 200, which can be adjusted according to the number of neighboring nodes) using Gumbel_Softmax, and aggregate it into the previous hidden layer embedding Et-1 h using GRU to form the current step intermediate hidden layer embedding.
[0030] 4) The dynamic sampling and aggregation process corresponding to the invention content utilizes user-embedded E u The attention score of the next diffusion node set is calculated by embedding the items to be recommended into E0s and Et Nodes. (Training phase) or Softmax (testing phase) selects the neighbor information of the Top-K attention scores and uses GRU to aggregate it into the intermediate hidden layer embedding of the current step to obtain the final hidden layer embedding of the current step, Et h.
[0031] 5) In the dynamic sampling and aggregation step corresponding to the invention content, repeat steps 2)-4) on the Top-K high-response neighbor points obtained in the previous step until the preset diffusion layer number t (t is 3-5 layers) is reached, and the final hidden layer embedding Et final_h is generated.
[0032] 6) The hidden layer embedding Et final_h and the user-embedded E u The model obtains a score by performing a dot product, calculates the loss value between the recommended label and the score using the binary cross-entropy loss function (BCE), and then updates and optimizes the model parameters using the Adam optimizer through backpropagation.
[0033] Specifically, in step 1), the user rating dataset is first filtered by a rating threshold to identify user data with low ratings, preventing low-rated data from being used as positive examples by the model and affecting recommendation performance. Then, the dataset mapping rated item IDs to item names is filtered, removing duplicate IDs to prevent errors during subsequent ID mapping. Next, the item names are linked to the large public knowledge graph DBpedia to obtain the original link graph. Then, K-kernel filtering, rating set to graph alignment filtering, graph to rating set alignment filtering, and mapping filtering are performed on the rating dataset and the original link graph to generate the final knowledge graph and user rating dataset. K-kernel filtering primarily targets the relation columns in the original link graph, deleting relation data that appears less than a preset number (5-50 times, adjustable based on the dataset) to reduce data noise, as these relations may be incorrectly collected from DBpedia or irrelevant to the items. Rating set to graph alignment filtering maps item names in the graph to item IDs in the mapping dataset, discarding data where the item IDs in the rating dataset are not in the graph. The graph-to-score-set alignment filter targets the item IDs in the graph, ensuring a correspondence between the score set and the item IDs in the graph, thus preventing noisy data. Finally, a mapping filter converts the item names and relation names in the graph into unique ID values for easier model input. The final knowledge graph contains three columns of data: head entity ID, relation ID, and tail entity ID.
[0034] Specifically, step 2) first constructs a graph-entity sparse matrix M. sub The rows of this sparse matrix represent each row of data in the knowledge graph, and the columns represent the head entity positions of those rows. Based on the ID value of each head entity in the knowledge graph, in M... sub The corresponding position is assigned a value of 1, and other positions are assigned a value of 0. For example, if the head entity ID value of the data in the 9th row of the knowledge graph is 1190, then M sub The value in row 9, column 1189 is 1. When the node information for the current step is input, an entity-batch sparse matrix M is constructed based on the node's ID value and the batch index Batch_id. node The ID row and Batch_id column corresponding to the node will be assigned a value of 1, while other positions will be assigned a value of 0. For M... sub and M node The adjacency information matrix is obtained by right multiplication of the matrix, which contains the ID values of all neighboring nodes of the current node. Using the neighboring node IDs as indices, the relation IDs and tail entity IDs of the corresponding data items can be retrieved from the knowledge graph. Finally, all the retrieved neighboring nodes and adjacency relationships are fed into the embedding layer to obtain the neighborhood entity information Et Node and the neighborhood relationship information Et Edge.
[0035] Specifically, step 3) first concatenates the Et Node and Et Edge obtained in step 2) to obtain Et m as the information to be transmitted in the current step. Because the graph information includes node and edge information, the neighborhood entity information and neighborhood relationship information need to be concatenated when transmitting the graph information. Then, three linear layers are used to transform the embedding of the item to be recommended, E0s, and the user embedding, E... u From Et m, we obtain three independent embedding information alpha_s, alpha_m, and alpha_u, respectively. The details are as follows:
[0036]
[0037]
[0038]
[0039] in, These are all learnable weight parameters, where D is the preset dimension size (16-64, preferably 16). After concatenating alpha_s, alpha_m, and alpha_u and passing them through a ReLU activation function, they are fed into the attention score weight layer. The attention weight score alpha is then calculated using a multilayer perceptron. The details are as follows: These are linear layer parameters:
[0040]
[0041] To prevent gradients from failing to backpropagate when discretely selecting the Top-K scores, it is necessary to use... The function samples a probability distribution from the alpha scores, ensuring that alpha remains differentiable even after discrete selection. Then, the top-K alpha scores are selected, processed by a sigmoid function, and used as neighborhood information aggregation weights. These weights are then used for aggregation, incorporating high-response neighborhood information into the initial node embedding E0 s. Finally, a gating mechanism combines the previous hidden layer embedding Et-1 h with the current step's aggregation information to obtain the current step's intermediate hidden layer embedding.
[0042] Specifically, step 4) is similar to step 3), firstly using user-embedded E u The attention score nodelogit for the next step of diffusing the node set is calculated by embedding the item to be recommended into E0s and the neighboring entity into EtNode, as follows:
[0043]
[0044]
[0045]
[0046]
[0047] in These are learnable linear layer weights, where D is a preset dimension size (16-64), corresponding to the output dimensions of three linear layers. (Select) The process of aggregating information from high-response neighbors is similar to step 3), using Gumbel_Softmax to sample a probability distribution in the nodelogit. The difference is that the sigmoid function is not used to modify the nodelogit; instead, the Top-K nodelogit scores are directly used as the weights for neighborhood entity information, with the remaining weights reset to 0. Furthermore, Gumbel_Softmax is used as the sampling function during training, allowing model parameters to be optimized through gradient backpropagation, while the Softmax function is used directly during testing to accelerate model inference. The Et nodes are aggregated based on the initial node and neighborhood entity information weights, ensuring that neighbor information is ultimately incorporated into the initial node embedding E0s. Finally, the intermediate hidden embeddings from step 3) are fused using GRU to form the final hidden embedding Eth for the current step.
[0048] Specifically, step 5) repeats steps 2)-4) until the diffusion layer number t is reached. During the diffusion process, the neighboring nodes and edges of the current step are obtained, and then the information from the neighboring edges and nodes is dynamically selected and aggregated based on the attention score and the Top-K algorithm. The details are as follows:
[0049]
[0050] Among them, Node t and Edge t Let EtNode and EtEd represent the set of neighbors and edges in the t-th diffusion. EtNode and EtEd represent the embeddings of the neighbors and edges in the t-th step. alphatopk represents the alpha score of the Top-K samples, nodelogittopk represents the nodelogit score after the Top-K samples, Etchosen and Etchosen_n represent the aggregated neighborhood information and neighborhood entity information, respectively. GRU is the gating function. The hidden layer representation Eth generated in the t-th step is the final hidden layer representation Etfinal_h of the initial node after multiple information diffusions.
[0051] Specifically, step 6) will combine the final hidden layer representation Et final_h and the user embedding E uPerforming a dot product operation yields the semantic relevance between items and users. Summing these semantic relevances and applying the result to a sigmoid function gives the semantic relevance score, which represents the probability that a user will rate the item (i.e., the user is interested in the item). Then, the binary cross-entropy loss function (BCE) is used to calculate the cross-entropy loss (Loss), which is then used for backpropagation to update the model parameters.
[0052] This invention addresses the problems of low sampling efficiency, low sampling quality, random sampling results, large differences in computational cost, and noise overlap in double diffusion in traditional graph convolutional neural network recommendation systems. It employs an incremental dynamic sampling method based on an attention mechanism. After sampling a specified number of Top-K samples, the model automatically selects high-response neighborhood information based on the similarity of users, items, and neighborhood information. This allows the model to learn with a small amount of neighborhood information at the beginning of diffusion and then gradually expand the acquisition of neighborhood information, avoiding the randomness of fixed sampling and reducing the high time cost of full sampling. This incremental graph information diffusion method reduces noise in the initial graph information and dynamically increases the transmission of graph information in the later stages, effectively reducing the time cost of sampling on large-scale knowledge graphs. This invention also uses a neighbor-by-neighbor gated aggregation mechanism. It only needs to perform neighbor-by-neighbor sampling diffusion from the initial node, continuously using a gating mechanism to automatically fuse neighborhood information and select the next diffusion node. This effectively reduces the noise overlap problem caused by the repeated superposition of neighborhood information in double diffusion and further optimizes the time complexity of graph information diffusion. Using a gating mechanism can effectively control the fusion of old and new information in each graph diffusion, allowing the model to automatically select the fusion of old and new information, which is more accurate than the common methods of splicing, summing, and averaging.
[0053] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A gated aggregation knowledge graph recommendation method based on dynamic increment, characterized in that: The preset neighborhood selection number K (K is a positive integer between 10 and 200, which can be adjusted according to the number of neighborhood nodes in each step) is included in the following steps: 1) Obtain the knowledge graph recommendation dataset, link the real names of the evaluated items with the large knowledge graph, construct the item knowledge graph for training, and perform data preprocessing and data partitioning on the evaluation dataset and the knowledge graph; 2) Construct a graph-entity sparse matrix (M) based on the knowledge graph and the recommendation dataset. sub ) and entity-batch sparse matrix (M node ), using M sub With M node The right-multiplication calculation quickly obtains the knowledge graph-batch index one-hot matrix, marking whether all entities in the knowledge graph are in the current batch, thereby obtaining the IDs and relation IDs of all neighboring entities in the knowledge graph of the batch entity, and then sending them to the embedding layer to obtain entity information and neighborhood relation information; 3) The neighboring entity information and neighborhood relation information are concatenated to obtain the current step diffusion information, and then the attention score is calculated based on the user embedding, the item to be recommended embedding and the current step diffusion information. The Top-K high-response neighborhood information is selected, and the high-response neighborhood information is weighted and summed with the weighted score (the attention score processed by Sigmoid) to obtain the high-response hidden layer representation (Et). (chosen), and use a bidirectional gated recurrent unit (GRU) based on reset and update gates to adaptively aggregate the selected graph information into the hidden layer embedding of the previous step, forming the intermediate hidden layer embedding of the current step; 4) Calculate the attention score of the next step diffusion node set using user embedding, item to be recommended embedding, and neighborhood entity embedding, select the Top-K high-response neighbor information, and use GRU to aggregate it into the intermediate hidden layer embedding of the current step, forming the final hidden layer embedding of the current step; 5) Repeat steps 2)-4) for the Top-K high-response neighbors obtained in the previous step until the diffusion layer number is reached (diffusion layer number is 3-5 layers), and generate the final hidden layer embedding; 6) Perform a dot product between the final hidden layer embedding and the user embedding to obtain the recommendation score, use the binary cross-entropy loss function to calculate the loss value, and update the model parameters through backpropagation using the Adam optimizer (learning rate 5e-5).
2. The method according to claim 1, characterized in that, The data preprocessing in step 1) includes: 2.1 Filter user rating data using a rating threshold, removing ratings below a preset threshold (an integer ranging from 1 to 3, which can be adjusted for the dataset); 2.2 Filter the dataset mapping the rated items to the actual item names, and remove duplicate mapping data; 2.3 After linking the real item names in the evaluation data to a large knowledge graph, perform kernel filtering on the original link graph to delete relational data that appear less than a preset number of times (the preset number is 5-50 times, which can be adjusted according to the dataset); 2.4 Perform score set to graph alignment filtering and graph to score set alignment filtering to ensure that the item IDs in the recommendation dataset are consistent with the item IDs in the knowledge graph, and map the item and relation names.
3. The method according to claim 1, characterized in that, The neighborhood information extraction in step 2) specifically includes: 3.1 Construct a sparse matrix M of knowledge graph and entity based on the head entities of the knowledge graph. sub Each row corresponds to a row of data in the knowledge graph, and each column corresponds to the position of the head entity in the row of data. The position of the head entity is assigned a value of 1. 3.2 Construct an entity-batch sparse matrix M based on the current step node value and batch index in the recommendation dataset. node The row and column of the sparse matrix correspond to the node index and batch index position, and are assigned the value 1; 3.3 Regarding the M mentioned above sub and M node The right multiplication of the matrix yields the graph-batch matrix, which marks the position of the item ID to be scored in the batch in the knowledge graph. Based on the graph-batch matrix, all neighborhood entity IDs and neighborhood relationship IDs of the item ID to be scored in the batch data in the knowledge graph can be obtained. These are then fed into the embedding layer to obtain neighborhood entity information (Et Node) and neighborhood relationship information (Et Edge).
4. The method according to claim 1, characterized in that, The attention score calculation methods in steps 3) and 4) include: step 3) calculating the attention score for the concatenated neighborhood entity information and neighborhood relationship information, and step 4) calculating the attention score only for the neighborhood entity information. Both steps involve transforming the embedded information of the item to be recommended, the user embedded information, and the corresponding neighborhood information through three linear layers to obtain three independent embedded information. The three independent embedded information are then concatenated and fed into the attention score weighting layer through the ReLU activation function, and the attention weight score is calculated using a multilayer perceptron.
5. The method according to claim 1, characterized in that, Step 3) includes: using the Gumbel_Softmax function to sample the probability distribution in the corresponding attention score, so that the information after discrete selection satisfies differentiability, in order to support the backpropagation optimization of the model.
6. The method according to claim 1, characterized in that, Step 4) includes: when filtering the information of the Top-K high-response neighbor points, the Gumbel_Softmax function is used as the sampling function during the training phase, and the Softmax function is used during the testing phase.
7. The method according to claim 1, characterized in that, The specific GRU aggregation process in steps 3) and 4) includes: utilizing the reset gate (r t The aggregated Et-chosen data is fused with the previous hidden layer representation (Et-1 h) to obtain candidate information; the update gate (z) is then used to... t The weighted sum of candidate information and Et-1 h is controlled to obtain the hidden layer representation (Et h) of the current step.
8. The method according to claim 1, characterized in that, Step 6) includes: using a batch loss calculation method, setting the batch size to 128, calculating the binary cross-entropy loss between the recommended score and the user's actual clicked tags in the batch; and averaging the losses of all batches to obtain the final binary cross-entropy loss value.