Product recommendation method and apparatus, model training method and apparatus, and device
By using a relational graph convolutional network based on an attention mechanism to process the bipartite graph of users and products, and combining geodesic distance and local topology, the problem of inaccurate product recommendations in existing technologies is solved, and accurate product recommendations are achieved.
Patent Information
- Application Number
- PCT/CN2024/142505
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-08
- Filing Date
- 2024-12-25
- Publication Date
- 2026-01-15
AI Technical Summary
In existing technologies, product recommendations rely solely on historical interactions between users and products, resulting in predicted products that do not match the current user's preferences, thus failing to accurately recommend products to the user.
A relational graph convolutional network based on an attention mechanism is used to perform convolution processing on a bipartite graph representing the interaction relationships between multiple users and multiple products. By combining the geodesic distance between users and products and the local topology, a set of prediction information is generated for product recommendation.
It can accurately predict users' preferences for products and achieve precise product recommendations, solving the problem of inaccurate recommendations in existing technologies.
Smart Images

Figure CN2024142505_15012026_PF_FP_ABST
Abstract
Description
Product recommendation methods, model training methods, devices and equipment
[0001] This application claims priority to Chinese Patent Application No. 202410912062.3, filed on July 8, 2024, entitled "Method for Recommending Goods, Method for Training Models, Apparatus and Device", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of artificial intelligence, and in particular to a product recommendation method, a model training method, an apparatus, and a device. Background Technology
[0003] The rapid development of internet technology has brought massive amounts of product data to users. In order to increase the click-through rate of products, the business platform recommends products that users prefer.
[0004] In existing technologies, historical interaction relationships between users and products are used to predict products that users may be interested in in the future, and then those products are recommended to users.
[0005] However, the above methods rely solely on the historical interaction between users and products for product recommendations. The data dimensions used are relatively limited, resulting in predicted products that do not match the current user's preferences. Consequently, it is impossible to accurately recommend products to users. Summary of the Invention
[0006] This application provides a product recommendation method, model training method, apparatus, and device to solve the technical problem that product recommendations based on the historical interaction relationship between users and products cannot accurately recommend products to users.
[0007] In a first aspect, embodiments of this application provide a product recommendation method, comprising: acquiring a bipartite graph corresponding to at least one user and at least one product, and performing convolution processing on the bipartite graph based on an attention-based relational graph convolutional network to obtain a representation set; wherein the bipartite graph represents the interaction between all users and products; the representation set includes at least one user-product pair representation; the user-product pair representation represents the joint attribute between each user and each product; determining the user-product pair distance corresponding to the user-product pair representation, and determining the structural feature corresponding to the user-product pair representation based on the user-product pair distance and the bipartite graph; wherein the user-product pair distance is the geodesic distance between the user and the product; the structural feature represents the local topological structure between the user and the product in the bipartite graph; generating a prediction information set based on each user-product pair representation and each structural feature; wherein the prediction information set includes prediction data corresponding to each user-product pair representation; the prediction data represents the predicted user's preference for the product; and recommending products to the user based on the prediction information set.
[0008] Secondly, embodiments of this application provide a model training method for product recommendation, comprising: acquiring a bipartite graph corresponding to at least one user to be trained and at least one product to be trained, and performing convolution processing on the bipartite graph based on an initial graph convolutional network to obtain a representation set; wherein the bipartite graph represents the interaction between all users to be trained and products to be trained; the representation set includes at least one user-product pair representation; the user-product pair representation represents the joint attribute between each user to be trained and each product to be trained; determining the user-product pair distance corresponding to the user-product pair representation, and determining the structural feature corresponding to the user-product pair representation based on the user-product pair distance and the bipartite graph; wherein the user-product pair distance is the geodesic distance between the user to be trained and the product to be trained; the structural feature represents the local topological structure between the user to be trained and the product to be trained in the bipartite graph; training the initial graph convolutional network based on each user-product pair representation and each structural feature to obtain an attention-based relational graph convolutional network; wherein the attention-based relational graph convolutional network is used to process the bipartite graph described in the first aspect to recommend products to users.
[0009] Thirdly, embodiments of this application provide a product recommendation device, comprising: a processing module, configured to acquire a bipartite graph corresponding to at least one user and at least one product, and perform convolution processing on the bipartite graph based on an attention-based relational graph convolutional network to obtain a representation set; wherein the bipartite graph represents the interaction between all users and products; the representation set includes at least one user-product pair representation; the user-product pair representation represents the joint attribute between each user and each product; a determining module, configured to determine the user-product pair distance corresponding to the user-product pair representation, and determine the structural feature corresponding to the user-product pair representation based on the user-product pair distance and the bipartite graph; wherein the user-product pair distance is the geodesic distance between the user and the product; the structural feature represents the local topological structure between the user and the product in the bipartite graph; a prediction module, configured to generate a prediction information set based on each user-product pair representation and each structural feature; wherein the prediction information set includes prediction data corresponding to each user-product pair representation; the prediction data represents the predicted user's preference for the product; and a recommendation module, configured to recommend products to the user based on the prediction information set.
[0010] Fourthly, embodiments of this application provide a model training apparatus for product recommendation, comprising: a processing module, configured to acquire a bipartite graph corresponding to at least one user to be trained and at least one product to be trained, and perform convolution processing on the bipartite graph based on an initial graph convolutional network to obtain a representation set; wherein the bipartite graph represents the interaction between all users to be trained and products to be trained; the representation set includes at least one user-product pair representation; the user-product pair representation represents the joint attribute between each user to be trained and each product to be trained; and a determining module, configured to determine the user-product pair corresponding to the user-product pair representation. The distance between the user and the product is used to determine the structural features corresponding to the user-product pair representation based on the distance between the user and the product. The distance between the user and the product is the geodesic distance between the user and the product. The structural features characterize the local topological structure between the user and the product in the bipartite graph. A training module is used to train the initial graph convolutional network based on each user-product pair representation and each structural feature to obtain an attention-based relational graph convolutional network. The attention-based relational graph convolutional network is used to process the bipartite graph described in the third aspect to recommend products to the user.
[0011] Fifthly, embodiments of this application provide a computing device, including: a memory and a processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory, causing the processor to perform the methods of the first aspect and / or the second aspect above.
[0012] In a sixth aspect, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods of the first and / or second aspects described above.
[0013] In a seventh aspect, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the methods of the first and / or second aspects described above.
[0014] The product recommendation method, model training method, apparatus, and device provided in this application embodiment are based on a relational graph convolutional network with an attention mechanism. The convolution process is performed on a bipartite graph representing the interaction relationship between multiple users and multiple products to obtain the joint attributes between each user and each product. By combining the geodesic distance between each user and each product and the local topology between each user and each product obtained from the bipartite graph, the preference of each user for each product can be accurately predicted. Thus, product recommendations can be accurately made to users. Attached Figure Description
[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0016] Figure 1 is a schematic diagram of the overall framework of the IGMC algorithm provided in this application;
[0017] Figure 2 is a schematic diagram of the SyMGNN algorithm framework provided in this application;
[0018] Figure 3 is a schematic diagram of an example of graph automorphism provided in this application;
[0019] Figure 4 is a schematic diagram of an application scenario provided in this application;
[0020] Figure 5 is a flowchart illustrating a product recommendation method provided in an embodiment of this application;
[0021] Figure 6 is a schematic diagram of an example of an explicit feedback collaborative filtering problem provided in an embodiment of this application;
[0022] Figure 7 is a schematic diagram of a user-product bipartite diagram provided in an embodiment of this application;
[0023] Figure 8 is a flowchart illustrating another product recommendation method provided in an embodiment of this application;
[0024] Figure 9 is a schematic diagram of a relational graph convolutional network provided in an embodiment of this application;
[0025] Figure 10 is a schematic diagram of a multi-head attention mechanism in a relational graph convolutional network provided in an embodiment of this application;
[0026] Figure 11 is a schematic diagram of a node label based on distance coding provided in an embodiment of this application;
[0027] Figure 12 is a schematic diagram of a fast MinHash algorithm flow provided in an embodiment of this application;
[0028] Figure 13 is a schematic diagram of a HyperLogLog sketch provided in an embodiment of this application;
[0029] Figure 14 is a flowchart illustrating a model training method for product recommendation provided in an embodiment of this application;
[0030] Figure 15 is a flowchart illustrating another model training method for product recommendation provided in an embodiment of this application;
[0031] Figure 16 is a flowchart illustrating a model training algorithm provided in an embodiment of this application;
[0032] Figure 17 is a schematic diagram of a product recommendation device provided in an embodiment of this application;
[0033] Figure 18 is a schematic diagram of a model training device for product recommendation provided in an embodiment of this application;
[0034] Figure 19 is a schematic diagram of the structure of a computing device provided in an embodiment of this application.
[0035] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0036] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application.
[0037] First, let me explain the terms used in this application:
[0038] Relational Graph Attention Network (RGAT) is a neural network architecture that utilizes attention mechanisms to operate on relational graph structured data.
[0039] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, processing, transmission, provision, disclosure, and application of the relevant data all comply with relevant laws, regulations, and standards, necessary confidentiality measures have been taken, they do not violate public order and good morals, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0040] Furthermore, the technical solution involved in this application, which involves big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.) and the use of artificial intelligence technology for automated decision-making, and makes decisions that have a significant impact on personal rights based on the results of automated decision-making, provides users with corresponding operation entry points for users to choose to agree to or reject the results of automated decision-making; if the user chooses to reject, the process will proceed to the expert decision-making process.
[0041] It should be noted that the product recommendation method, model training method, apparatus and equipment of this application can be used in the field of artificial intelligence, or in any field other than artificial intelligence. The application fields of the product recommendation method, model training method, apparatus and equipment of this application are not limited.
[0042] The rapid development of internet technology has brought massive amounts of product data to users. In order to increase the click-through rate of products, the business platform recommends products that users prefer.
[0043] In existing technologies, historical interaction relationships between users and products are used to predict products that users may be interested in in the future, and then those products are recommended to users.
[0044] However, the above methods rely solely on the historical interaction between users and products for product recommendations. The data dimensions used are relatively limited, resulting in predicted products that do not match the current user's preferences. Consequently, it is impossible to accurately recommend products to users.
[0045] In another example, based on the Inductive Matrix Completion (IMC) algorithm, known information (side information) about users and items is used to assist in the prediction of user preferences. Figure 1 is a schematic diagram of the overall framework of the algorithm IGMC provided in this application. As shown in Figure 1, IGMC, as the first inductive matrix completion algorithm that does not require any known features, proposes to run a graph convolutional network on the closed subgraph around the user-item pair to be predicted, and construct a regression model from local subgraph patterns to ratings. The first step is to extract the enclosing graph from the user-item graph, the second step is to establish node labels based on the enclosing graph, and the third step is to train a graph neural network model to predict ratings from the enclosing graph. The loss function of the model training consists of two parts. The first part is the traditional Mean Squared Error (MSE), which is used to approximate the predicted value with the true value. The second part is Adjacent Rating Regularization (ARR), which encourages adjacent ratings to have similar parameter matrices, thereby preserving the size and order information of the ratings.
[0046] In another example, the end-to-end neural network framework SyMGNN (Meta-graph neural network, MGNN) based on the Sylvester equation is illustrated in Figure 2. Figure 2 shows a schematic diagram of the SyMGNN framework provided in this application. As shown in Figure 2, the SyMGNN framework includes two key modules: 1) a multi-network aggregation learning module; and 2) a priori multi-network association fusion learning module. Given two types of node relationship networks A and node features F, such as... and And two types of partially observed relationships between nodes (multi-network) H, predicting unobserved relationships in H. In the base model, the original node feature vectors are fed into a multilayer perceptron to obtain latent representations U1 and U2; finally, aggregation operations are performed on the latent representations. In the low-rank model, the original node feature vectors are fed into a multilayer perceptron to obtain latent representations. Then, attention-based neural aggregation is performed; subsequently, the results of neural aggregation corresponding to all types of relations are concatenated and fed into a multilayer perceptron to obtain node representations.
[0047] However, among the above methods, the permutation equivariance of the message-passing neural network (MPNN) inherently limits its ability to represent graph structures. A weakness of MPNN is its inability to distinguish self-similar pairs of nodes. Figure 3 illustrates an example of graph self-similarity provided in this application. As shown in Figure 3, this indicates that the IGMC algorithm faces the problem of self-similar nodes when using subgraph neural networks for link prediction. In the user-item bipartite graph, the contributions of items that have historically interacted with the user to the representation of user interests vary, failing to effectively highlight the contributions of high-influence nodes. For the SyMGNN algorithm, it does not utilize known user-item interaction relationships to learn the implicit representations of users and items. The learned node representations belong to two different feature spaces, making it difficult to fully integrate the information of the two types of nodes during the representation extraction stage to improve quality and obtain accurate rating prediction results.
[0048] To address the aforementioned technical problems, this application proposes the following technical concept: A relational graph convolutional network based on an attention mechanism is used to perform convolution processing on a bipartite graph representing the interaction relationships between multiple users and multiple items, obtaining the joint attributes between each user and each item. By combining the geodesic distance between each user and each item with the local topological structure between each user and each item obtained from the bipartite graph, the preference level of each user for each item can be predicted for item recommendation. This solves the problem in existing technologies where item recommendation relies solely on historical interaction relationships between users and items, resulting in inaccurate item recommendations.
[0049] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0050] Figure 4 is a schematic diagram of an application scenario provided by this application. As shown in Figure 4, the specific application scenario of this application includes a computing device 101 and at least one user 102. Each user 102 can browse online web pages through the computing device 101. The computing device 101 can accurately recommend one or more products to each user 102 from the various products contained in the online web page based on the bipartite graph corresponding to the interaction relationship between each user 102 and each product.
[0051] Figure 5 is a flowchart illustrating a product recommendation method provided in an embodiment of this application. As shown in Figure 5, the method includes:
[0052] 201. Obtain a bipartite graph corresponding to at least one user and at least one item, and perform convolution processing on the bipartite graph based on an attention-based relational graph convolutional network to obtain a representation set; wherein, the bipartite graph represents the interaction between all users and items; the representation set includes at least one user-item pair representation; the user-item pair representation represents the joint attribute between each user and each item.
[0053] For example, the execution subject of this embodiment can be a computing device. For ease of description, the computing device is hereinafter referred to as the device. The device can be a physical device or a virtual device that executes the product recommendation method. The device acquires multiple users and multiple products, and constructs a bipartite graph based on the interactions between all users and products. It calls a preset attention mechanism relational graph convolutional network and inputs the obtained bipartite graph into the attention mechanism relational graph convolutional network to perform convolution processing on the bipartite graph. The convolution of each user attribute and each product attribute is converged to obtain a user-product pair representation of each user and each product included in the representation set, so as to represent the joint attributes between each user and each product.
[0054] For example, Figure 6 is a schematic diagram of an example of an explicit feedback collaborative filtering problem provided in an embodiment of this application. As shown in Figure 6, given m users... and n items Their interaction relationships can be constructed as a sparse matrix. Among them, element R ij (>0) indicates that user u i For product i j The rating, Let r1 be the set of all ratings, and let r2 be the set of all ratings, where the ratings satisfy the order relation r1 < r2 < ... < r2. R A higher ranking indicates a higher level of user preference for a particular product; for example, on a movie rating website, users might give five stars to movies they like and one star to movies they don't. It's important to note that R... ij =0 does not mean user u i I will definitely not like the product. j , but only indicates user u i For product i j The user's level of preference is still unclear; therefore, the goal of explicit collaborative filtering is to provide ratings for items that the user has not yet rated. The rating prediction is performed to identify and recommend several products that the user is most likely to give a high rating to. Figure 7 is a schematic diagram of a user-product bipartite graph provided in an embodiment of this application. As shown in Figure 7, from a graph theory perspective, the interaction relationship between the user and the product can be constructed as a bipartite graph. vertex set For all users and products, edge set For all observed rating relationships; explicit collaborative filtering can be viewed as the set of unlinked edges in a user-item bipartite graph. Predict the rating value. Input the bipartite graph into a relational graph convolutional network based on an attention mechanism, and perform convolution processing on the bipartite graph to obtain the user-item pair representation corresponding to each user and each item, so as to represent the joint attribute between each user and each item.
[0055] 202. Determine the user-product pair distance corresponding to the user-product pair representation, and determine the structural features corresponding to the user-product pair representation based on the user-product pair distance and the bipartite graph; wherein, the user-product pair distance is the geodesic distance between the user and the product; the structural features characterize the local topological structure between the user and the product in the bipartite graph.
[0056] For example, in a bipartite graph, each user or each item corresponds to a node. The device calculates the geodesic distance, or shortest path distance, between the node corresponding to the user and the node corresponding to the item, based on each user-item pair. This distance is the user-item pair distance between the user and the item. For example, given a node pair (user u, item v) and other nodes... For any user or product, the node w, d(u,w) is the shortest path distance between node u and node w, also known as geodesic distance. In the formula, Let w be a path from node u to w. It is the set of all possible paths. Representing a path The length or number of edges traversed. Based on the structural feature calculation method, the device calculates the distance of each user-item pair and the bipartite graph to obtain the structural features corresponding to each user-item pair representation, thereby characterizing the local topological structure between the user and the item corresponding to each user-item pair representation in the bipartite graph, and enhancing the distinguishability between the nodes corresponding to the user and the item in the bipartite graph.
[0057] 203. Generate a prediction information set based on the representation of each user's product pair and each structural feature; wherein, the prediction information set includes the prediction data corresponding to each user's product pair representation; the prediction data represents the predicted degree of user preference for the product.
[0058] For example, for each user and product pair representation and each structural feature obtained, the device calculates each user and product pair representation and each corresponding structural feature according to a preset prediction algorithm, so as to obtain the prediction data corresponding to each user and product pair representation, which can accurately predict the user's preference for the product, and thus obtain the prediction information set corresponding to each user and each product.
[0059] 204. Based on the predicted information set, recommend products to users.
[0060] For example, the device sorts each user's preferences for each product from high to low based on the predicted data, and obtains a list of each user's preferences for all products. The device can then display the top one or a few products in the list to the user to make accurate product recommendations to each user.
[0061] This embodiment provides a product recommendation method based on a relational graph convolutional network with an attention mechanism. The method performs convolution processing on a bipartite graph representing the interaction relationships between multiple users and multiple products to obtain the joint attributes between each user and each product. It then combines the geodesic distance between each user and each product with the local topological structure between each user and each product obtained from the bipartite graph. This eliminates the graph isomorphism problem faced by the relational graph convolutional network model, enabling accurate prediction of each user's preference for each product and thus precise product recommendations to users.
[0062] Figure 8 is a flowchart illustrating another product recommendation method provided in an embodiment of this application. As shown in Figure 8, the method includes:
[0063] 301. Obtain a bipartite graph corresponding to at least one user and at least one product.
[0064] For example, this step can be referred to as step 201, which will not be repeated here.
[0065] 302. Initialize the bipartite graph to obtain the initial user representation for each user and the initial product representation for each product; where the initial user representation represents the attributes of the user and the initial product representation represents the attributes of the product.
[0066] For example, to describe users and products, each user and each product in the bipartite graph is usually initialized by extracting their attributes as initial representations, resulting in the initial user representation for each user and the initial product representation for each product. For instance, in a movie recommendation scenario, user attributes are often constructed using browsing history, collection history, and comment history, while movie attributes are constructed using movie genre, director, actors, production company, and theme.
[0067] In one example, step 302 includes the following steps:
[0068] The first step of step 302 is to initialize the bipartite graph to obtain the user feature vector of each user and the product feature vector of each product; wherein, the user feature vector represents the initial attributes of the user; and the product feature vector represents the initial attributes of the product.
[0069] The second step of step 302 involves performing linear transformations on the user feature vector and the product feature vector respectively to obtain the processed user feature vector and the processed product feature vector.
[0070] The third step of step 302 involves activating the processed user feature vector and the processed product feature vector to obtain the initial user representation and the initial product representation.
[0071] For example, to describe users and products, each user and each product in the bipartite graph is typically initialized by extracting their initial attributes, resulting in a user feature vector for each user and a product feature vector for each product. Since feature vectors are often high-dimensional and have different value ranges across dimensions, a feature encoder processes the input features using a linear transformation layer, mapping them to a low-dimensional dense vector as the representation of each node. This yields the processed user feature vector for each user and the processed product feature vector for each product, ready for subsequent processing. An activation function is applied to the output of the fully connected layer to introduce non-linearity, activating the processed user feature vector for each user and the processed product feature vector for each product, thus obtaining the initial user representation for each user and the initial product representation for each product.
[0072] For example, record user u i The user feature vector is Product i j The product feature vector is If initial attributes describing users and products cannot be provided in certain situations, the embedding vectors to be learned can be used to convert the one-hot encoding of users or products into dense representations through a lookup table, resulting in the corresponding feature vectors. Specifically, a parameter matrix is constructed as an embedding lookup table for each user and product: Then, the i-th user u i User feature vector The j-th item i j Product feature vector Specifically, the transformation function of the fully connected layer of the user-side feature encoder is defined as follows: in, Represents the i-th user u obtained after linear transformation. i The processed user feature vector, The weight parameter matrix, Here are the bias parameters. Then, an activation function is applied to the output of the fully connected layer to introduce a nonlinear factor, i.e. This algorithm uses the linear rectified function ReLU, defined as ReLU(x) = max(0,x), i.e. The computation process of the product-side feature encoder is completely consistent with that of the user-side encoder, and will not be repeated here; thus, the feature encoder for the i-th user u is obtained. i The user's initial representation is The j-th item i j The product is initially represented as
[0073] 303. Based on the relational graph convolutional network, feature extraction processing is performed on the bipartite graph, the initial representation of each user, and the initial representation of each product to obtain the user attribute representation of each user and the product attribute representation of each product; wherein, the user attribute representation represents the attribute features of the user, and the product attribute representation represents the attribute features of the product.
[0074] For example, in order to integrate the topological information in the user-product bipartite graph into the attribute features of user and product nodes, the device invokes a pre-defined attention mechanism-based relational graph convolutional network. Figure 9 is a schematic diagram of a relational graph convolutional network provided in an embodiment of this application. As shown in Figure 9, the bipartite graph, each user's initial representation, and each product's initial representation are input into the relational graph convolutional network. Based on the existing interaction relationships between each user and each product in the bipartite graph, the attribute information represented by each user's initial representation and the attribute information represented by each product's initial representation are transformed and aggregated respectively. Thus, the user attribute representation of each user can be obtained to represent the user's attribute features, and the product attribute representation of each product can be obtained to represent the product's attribute features.
[0075] In one example, the relational graph convolutional network includes at least one graph convolutional layer; step 303 includes the following steps:
[0076] The first step of step 303 is to perform feature aggregation processing on the bipartite graph, the initial representation of each user, and the initial representation of each product based on the multi-head attention mechanism of the graph convolutional layer, to obtain multiple user aggregate representations and multiple product aggregate representations for each user; wherein, the user aggregate representation represents the aggregate attribute features of the user, and the product aggregate representation represents the aggregate attribute features of the product.
[0077] The second step of step 303 is to average the multiple user aggregate representations of the user to obtain the user implicit representation; at the same time, to average the multiple product aggregate representations of the product to obtain the product implicit representation; wherein, the user implicit representation represents the implicit attribute features of the user, and the product implicit representation represents the implicit attribute features of the product.
[0078] The third step of step 303 involves performing feature activation processing on the user implicit representation and the product implicit representation respectively, to obtain the processed user implicit representation and the processed product implicit representation.
[0079] The fourth step of step 303 is to generate the user attribute representation based on the user's implicit representation and the processed user implicit representation; at the same time, to generate the product attribute representation based on the product's implicit representation and the processed product implicit representation.
[0080] For example, Figure 10 is a schematic diagram of a multi-head attention mechanism in a relational graph convolutional network provided in an embodiment of this application. As shown in Figure 10, the invoked relational graph convolutional network sets up multiple graph convolutional layers. Each graph convolutional layer deploys a multi-head attention mechanism. Based on the first graph convolutional layer, according to the existing interaction relationship between each user and each item in the bipartite graph, the attribute information represented by the initial representation of each user and the attribute information represented by the initial representation of each item are transformed and aggregated respectively. Thus, multiple aggregated representations of each user output by the first graph convolutional layer can be obtained to represent the aggregated attribute features of the user; at the same time, multiple aggregated representations of each item output by the first graph convolutional layer can be obtained to represent the item's attributes. The aggregation attribute features of products are obtained by transforming and aggregating the user aggregation representations and product aggregation representations of each user and product obtained from the previous graph convolutional layer in each graph convolutional layer, from the second layer to the last layer. This results in multiple user aggregation representations and multiple product aggregation representations output by each graph convolutional layer. Based on each graph convolutional layer, the multiple user aggregation representations of each user obtained from that graph convolutional layer are averaged to obtain the user's latent representation, which represents the latent attribute features of the user. At the same time, the multiple product aggregation representations of each product obtained from that graph convolutional layer are averaged to obtain the product's latent representation, which represents the product's latent attribute features. The device introduces an activation function to perform feature activation processing on each user's implicit representation and each product's implicit representation, resulting in each processed user's implicit representation and each processed product's implicit representation. The device then concatenates each user's implicit representation with its corresponding processed user's implicit representation to obtain the user's attribute representation. Simultaneously, the device concatenates each product's implicit representation with its corresponding processed product's implicit representation to obtain the product's attribute representation.
[0081] For example, taking the user side as an example, formally, we define the node u corresponding to the user. i The transformation formula of the l-th RGAT layer yields the user aggregate representation of the user output by the l-th convolutional layer. in, The weight parameter matrix is the transformation matrix of the node itself. To correspond to the rating relationship The weight parameter matrix, Indicates the rating relationship lower node u i The set of adjacent nodes; attention coefficient The attention weight parameter vector controls the contribution of each dimension to the attention coefficient and is crucial for the implementation of the self-attention mechanism. Furthermore, multi-head attention involves independently running H graph convolutional layers to transform the graphs and averaging their results to output the final hidden representation. in, This represents the attention coefficient calculated by the h-th attention head. and These are the corresponding weight parameter matrices. Additionally, basis decomposition is introduced to regularize the weight parameter matrices in the RGAT layer, with each weight matrix being... That is, regarding the learning coefficient The basis transformation matrix A linear combination; thus, the rating relationship type r is only related to the coefficient. It is related to the basis transformation matrix, but not to the basis decomposition matrix. Therefore, basis decomposition can be seen as a way to share effective weights between different relation types. Different relation types are weighted by different coefficients to obtain different weight matrices, reducing potential information redundancy storage and thus reducing the parameter size of the model. At the same time, basis decomposition can alleviate overfitting of infrequent rating relations because parameter updates are shared between infrequent and frequent relations. After the device receives the "message" aggregated from the RGAT layer, we apply activation functions sequentially, introducing nonlinear factors and improving generalization ability. User node u i The processed user implicit representation obtained from the l-th graph convolutional layer is The activation function is calculated in exactly the same way as in the feature encoder, so it will not be repeated here. For user node u i At the end of the l-th layer attribute feature extraction module, we add the node representation output by the feature encoder to the result calculated in this layer to obtain the user attribute representation output by the graph convolutional layer in the l-th layer attribute feature extraction module. The calculation method on the product side is completely consistent with that on the user side, denoted as product node i. j The product attributes in the attribute feature extraction module at layer l are represented as follows: Repeatedly stacking the above L-layer RGAT, user node u i and product node i j The attributes in the attribute feature extraction module are represented as follows: and
[0082] In one example, the first step of step 303 includes:
[0083] Step 1: Perform path randomization on the bipartite graph to obtain the processed bipartite graph.
[0084] Step 2: Based on the processed bipartite graph, determine at least one adjacent product of a user from among the products, and determine at least one adjacent user of a product from among the users; wherein, an adjacent product is a product that has already interacted with a user; and an adjacent user is a user that has already interacted with a product.
[0085] Step 3: Based on the multi-head attention mechanism of the graph convolutional layer, the user's initial representation and the initial representations of the products in each neighboring product are aggregated to obtain multiple aggregated representations of the user; at the same time, based on the multi-head attention mechanism of the graph convolutional layer, the product's initial representation and the initial representations of the products in each neighboring product are aggregated to obtain multiple aggregated representations of the products.
[0086] Specifically, due to various reasons, there will inevitably be noise in the user-item rating data. For example, a user accidentally gives only one star when rating a movie he is very interested in. To improve the generalization ability of the model, at the beginning of attribute feature extraction, the device needs to perform "DropPath" on the user-item bipartite graph, that is, delete some edges sampled from the random walk on the graph to obtain the processed bipartite graph. The attribute representation module in the device determines, for each user, the items that have interacted with the user from all items, that is, obtains one or more adjacent items of the user, and for each item, determines the users that have interacted with the item from all users, that is, obtains one or more adjacent users of the item. The device aggregates the user initial representation of each user and the item initial representations of each user's neighboring items based on the multi-head attention mechanism of the graph convolutional layer, aggregates the feature information represented by each representation, and obtains multiple user aggregated representations of each user; at the same time, based on the multi-head attention mechanism of the graph convolutional layer, aggregates the item initial representation of each item and the user initial representations of each item's neighboring users, aggregates the feature information represented by each representation, and obtains multiple item aggregated representations of each item.
[0087] For example, a path refers to a sequence of edges that connect a set of adjacent nodes in a graph. DropPath is to delete the edges corresponding to the paths obtained by random walk with as the root node set for l walk steps, that is
[0088] where ε mask represents the set of edges to be deleted. Here, the root node set is sampled from the graph node set following the Bernoulli distribution where 0 < q < 1 represents the sampling probability. A single random walk starts from the root node v0, randomly selects a node v1 from its adjacent nodes as the next hop and moves to v1; then randomly selects a node v2 from the adjacent nodes of v1 as the next hop, and so on. Therefore, the random walk path X0, X1, X2,..., X k ,... can be regarded as a discrete-time random process defined on the state space and the transition probability follows the uniform distribution: This process jumps from the node v at time k i to the node at time k + 1 Furthermore, to further improve the generalization ability of path random inactivation, we can also increase the parameter ζ. walk , indicating from the root node set The number of random walks to be completed at each starting node, and the number of edges to be deleted |ε mask |=ζ walk ×l walk Path-based random deactivation has a wider receptive field than existing edge-based random deactivation, enabling the model to learn more fully the multi-hop connections in graph data and provide accurate predictions even under complex noise and missing association conditions.
[0089] 304. Perform feature refinement processing on the user attribute representation and the product attribute representation to obtain the user-product pair representation.
[0090] For example, attribute representations for users and products are extracted separately. To predict user-product pair ratings, it is natural to fuse these attribute representations. This involves refining the user attribute representation for each user and the product attribute representation for each product to construct the implicit representation of the user-product pair, i.e., the user-product pair representation. This yields more accurate joint attributes between each user and each product, thereby improving the accuracy of predicting user preferences for products.
[0091] In one example, the relational graph convolutional network includes at least one graph convolutional layer; step 303 includes the following steps:
[0092] The first step of step 304 is to perform a concatenation transformation on the user attribute representation and the product attribute representation to obtain the first concatenated representation between the user and the product; wherein, the first concatenated representation represents the implicit joint attribute between the user and the product.
[0093] The second step of step 304 is to perform feature activation processing on the first spliced representation to obtain the user product pair representation.
[0094] For example, based on the attribute feature refinement module, the device first concatenates the user attribute representation of each user and the product attribute representation of each product, and then uses a linear transformation to fully integrate the two types of node representations to form an implicit representation of the user-product pair, namely the first concatenated representation, to characterize the implicit joint attributes between the user and the product. Then, based on the activation function, feature activation processing is performed on each first concatenated representation to obtain the corresponding user-product pair representation.
[0095] For example, for user u i and product i j The attribute representations they obtained in the attribute feature extraction module are respectively and The user's product pair representation can be obtained through formula calculation. The formula is in, and These represent the weight matrix and bias vector, respectively. The calculation method of the activation function is exactly the same as that in the feature encoder, so it will not be repeated here.
[0096] 305. Determine the distance between the corresponding user product pairs.
[0097] For example, this step can be referred to as step 202, which will not be repeated here.
[0098] 306. Perform path randomization on the bipartite graph to obtain the processed bipartite graph.
[0099] For example, because the user-product bipartite graph may contain noise and missing data, the device, like the attribute representation module, needs to perform path random deactivation on the user-product bipartite graph. It should be noted that the structure representation module and the attribute representation module in the device share the same user-product bipartite graph output after path random deactivation.
[0100] 307. Based on the distance between user and product pairs and the processed bipartite graph, determine the edge structure features corresponding to the distance between user and product pairs; wherein, the edge structure features characterize the local edge structure between the user and the product in the bipartite graph.
[0101] For example, to enhance the distinguishability between nodes, the structure representation module in the device defines d(u,w) as the shortest path length between node u and node w, also known as the geodesic distance, for each node pair (u,v) corresponding to each user and each item, in the prediction graph. When defining the link relationship between nodes u and v in a given context, ensure that u and v are linked to other nodes. To distinguish them, a structural feature called distance encoding is introduced, where each node... Encoded as a tuple: z w=(d(u,w),d(v,w)). Figure 11 is a schematic diagram of a node labeling based on distance encoding provided in an embodiment of this application. As shown in Figure 11, the distance encoding is associated with the edge. Analyzing different node pairs will yield completely different distance encodings, making it impossible to perform calculations with nodes as the dimension, as in graph convolution operations. Therefore, for each user-corresponding node and each product-corresponding node in the processed bipartite graph, the device uses a structural feature calculation method to obtain multiple distance encodings corresponding to each user-product pair based on the distance between each user-product pair. It further calculates multiple distance encodings corresponding to each user-product pair and outputs the node-dimensional features, that is, obtains the edge structure features corresponding to the user-product pair, so as to characterize the local edge structure between users and products in the bipartite graph.
[0102] In one example, step 307 includes the following steps:
[0103] The first step of step 307 is to determine the first quantity of the first set corresponding to the distance between user and product pairs based on the processed bipartite graph; wherein, the first quantity is the total number of the first nodes included in the first set; the first node is other users or products whose geodesic distance between them and the user corresponding to the distance between user and product pairs is equal to the distance between user and product pairs, and whose geodesic distance between them and the product corresponding to the distance between user and product pairs is equal to the distance between user and product pairs.
[0104] The second step of step 307 is to determine the second quantity of the second set corresponding to the distance between the user and the product based on the processed bipartite graph; wherein, the second quantity is the total number of the second nodes included in the second set; the second node is other users or products whose geodesic distance between them and the user corresponding to the distance between the user and the product is equal to the distance between the user and the product, and whose geodesic distance between them is greater than a preset threshold.
[0105] The third step of step 307 is to determine the third quantity of the third set corresponding to the distance between the user and the product pair based on the processed bipartite graph; wherein, the third quantity is the total number of third nodes included in the third set; the third node is other users or products whose geodesic distance between them and the product corresponding to the distance between the user and the product pair is equal to the distance between the user and the product pair, and whose geodesic distance between them and the user corresponding to the distance between the user and the product pair is greater than a preset threshold.
[0106] The fourth step of step 307 is to determine the edge structure features corresponding to the distance between user product pairs based on the first quantity, the second quantity, and the third quantity.
[0107] For example, for each user-product pair distance, from the processed bipartite graph, other users or products whose geodesic distance between the users corresponding to the user-product pair distance is equal to the user-product pair distance, and whose geodesic distance between the products corresponding to the user-product pair distance is equal to the user-product pair distance, are identified as the first nodes included in the first set corresponding to the user-product pair distance, and the total number of the first nodes included in the first set is determined, i.e., the first quantity. Based on the sensing field range of the processed bipartite graph, the device sets a preset threshold, i.e., the maximum number of hops. For each user-item pair distance, from the processed bipartite graph, other users or items whose geodesic distance to the user corresponding to that user-item pair distance is equal to that user-item pair distance, and whose geodesic distance to the item corresponding to that user-item pair distance is greater than the preset threshold, are identified as second nodes in the second set corresponding to that user-item pair distance, and the total number of second nodes in the second set is determined, i.e., the second quantity. For each user-item pair distance, from the processed bipartite graph, other users or items whose geodesic distance to the item corresponding to that user-item pair distance is equal to that user-item pair distance, and whose geodesic distance to the user corresponding to that user-item pair distance is greater than the preset threshold, are identified as third nodes in the third set corresponding to that user-item pair distance, and the total number of third nodes in the third set is determined, i.e., the third quantity. Based on a preset calculation method, the device calculates and processes the first quantity, second quantity, and third quantity corresponding to each user-item pair distance to obtain the edge structure features corresponding to each user-item pair distance.
[0108] For example, let The distance encoding for edge (u,v) is labeled (d u ,d v The number of nodes. This value represents the shortest path length to nodes u and v, which are exactly d. u and d v The number of nodes. Definition It is the set of all nodes whose shortest path length to node u is less than or equal to d, i.e., the d-hop neighborhood of u; The distance to node u is less than or equal to d. u And the distance to node v is less than or equal to d. v The set consisting of all nodes. The calculation formula is: Generally, we only need to focus on the local structure information of a few hops near edge (u,v), so we only need to calculate d. u ≤k and d v Within k (where k is the maximum number of hops and represents the receptive field range) The value of . To compensate for the loss of higher-order topological information, we also calculate the number of nodes whose distance to node u is exactly d (1≤d≤k) and whose distance to node v is greater than k. The structural features of edge (u,v) are constructed as follows: Where L represents the number of RGAT layers in the attribute feature extraction module stack. Furthermore, for... The perceptual field range k is also set to L. Therefore, the structural feature z u,v Includes L 2 indivual and 2L Total L 2 +2L-dimensional features.
[0109] In one example, the first step of step 307 includes:
[0110] Step 1: Based on the processed bipartite graph, determine the user hop neighborhood and product hop neighborhood corresponding to the user-product pair distance; wherein, the user hop neighborhood includes other users or products whose geodesic distance to the user corresponding to the user-product pair distance is less than or equal to the user-product pair distance; the product hop neighborhood includes other users or products whose geodesic distance to the product corresponding to the user-product pair distance is less than or equal to the user-product pair distance.
[0111] Step 2: Perform probability approximation calculations on the user jump neighborhood and the product jump neighborhood to determine the first quantity of the first set corresponding to the distance between the user and the product.
[0112] Specifically, based on the processed bipartite graph, for each user-product pair distance, the device identifies other users or products whose geodesic distance to the user corresponding to that user-product pair distance is less than or equal to that user-product pair distance as the user hop neighborhood corresponding to that user-product pair distance; and identifies other users or products whose geodesic distance to the product corresponding to that user-product pair distance is less than or equal to that user-product pair distance as the product hop neighborhood corresponding to that user-product pair distance. Using a preset probabilistic approximation calculation algorithm, such as the MinHash approximation algorithm or the HyperLogLog++ approximation algorithm, the device performs probabilistic approximation calculations on the user hop neighborhood and product hop neighborhood corresponding to that user-product pair distance to obtain the first quantity of the first set corresponding to that user-product pair distance.
[0113] For example, let The distance encoding for edge (u,v) is labeled (d u ,d v The number of nodes in a given number. (Definition) It is the set of all nodes whose shortest path length to node u is less than or equal to d, i.e., the d-hop neighborhood of u; The distance to node u is less than or equal to d. u And the distance to node v is less than or equal to d. v The set consisting of all nodes. Calculate and The key is calculation and The cardinality of graphs. In real-world data, the number of nodes and edges in a graph is very large, making algorithms that strictly adhere to the definition extremely complex and impractical. Definition: For the first multiplier We can use the probabilistic algorithm MinHash to approximate the similarity between two sets; for the second multiplier The cardinality of the union of two sets can then be approximated using the probabilistic algorithm HyperLogLog++. Furthermore, It can also be estimated using the HyperLogLog++ algorithm. Specifically, Figure 12 is a schematic diagram of a fast MinHash algorithm flow provided in an embodiment of this application. As shown in Figure 12, the MinHash algorithm is used for estimation. Since the cardinality of the entire set is often enormous (as shown in the figure, the number of nodes is in the tens of thousands), the MinHash function is defined as: mh(x) = (a·hash(x) + b)mod p, where a∈[1,p) and b∈[0,p) are random integers. Mapping input elements to distinct natural numbers, where p ≥ |U| is any prime number, this function can be abstractly understood as rearranging the elements of the original set; to estimate The value can be maintained as a set of MinHash signatures, approximated by the MinHash algorithm. Let be... The d-hop neighborhood of node u (i.e. The corresponding MinHash signature, based on the merging property of MinHash signatures, It is possible Perform recursive calculations, initial value The MinHash signature is defined by containing only a single node u, which is the result of calling the MinHash signature generation algorithm with a single-element set {u} as input. The value can be used to call the MinHash algorithm to calculate Jaccard similarity, in order to... and This is obtained from the input computation, which allows us to reuse the computational framework of graph convolutional networks. We can use MinHash signatures (node-dimensional) to compute the edge-dimensional structural features of user-item pairs, solving the problem of distance encoding being strongly dependent on edges. Furthermore, Figure 13 is a schematic diagram of a HyperLogLog sketch provided in an embodiment of this application. As shown in Figure 13, when using the HyperLogLog++ algorithm to estimate... and At that time, it is necessary to estimate The value of can be maintained as a set of HyperLogLog sketches, which are approximated using the HyperLogLog++ algorithm. Let be... The d-hop neighborhood of node u (i.e. The corresponding HyperLogLog sketch, based on the merging property of the HyperLogLog sketch, It is possible Perform recursive calculations, initial value This is a sketch of the HyperLogLog containing only a single node u, i.e., taking the single-element set {u} as input and calling HyperLogLog++ to initialize the result returned by the algorithm; therefore, The algorithm for calculating the cardinality from the sketch can be called using HyperLogLog++. As input, it is calculated; as for The merging property of HyperLogLog sketches can be used to obtain: That is, first, the algorithm that merges the sketches of two sets HyperLogLog is called to calculate the sketch of the merged set, and then the algorithm that calculates the cardinality based on the sketch of HyperLogLog++ is called to calculate the cardinality; similar to the MinHash algorithm, here... The iterative computation method and message-passing graph convolution operation are perfectly compatible, allowing us to reuse the computational framework of graph convolutional networks. We can use a HyperLogLog sketch with nodes as the dimension to compute the edge-dimensional structural features of user-item pairs. Thus, using the two algorithms described above, a set of MinHash signatures is maintained for each node. And a set of HyperLogLog sketches This allows for quick calculation of the equations related to edge (u,v). and
[0114] 308. Perform feature refinement on the edge structure features to obtain the structural features.
[0115] For example, based on the device's structural representation module, and using a preset algorithm, the edge structure features corresponding to each user-item pair representation are refined to obtain the structural features corresponding to each user-item pair representation. Furthermore, by using geodesic distance to characterize the local subgraph patterns and topology around the nodes, the limitation of graph convolutional networks based on the message propagation paradigm in distinguishing self-similar nodes is addressed, thus helping to improve the accuracy of rating prediction.
[0116] In one example, step 308 includes the following steps:
[0117] The first step of step 308 is to perform a linear transformation on the edge structure features to obtain the processed edge structure features.
[0118] The second step of step 308 is to perform feature activation processing on the processed edge structure features to obtain the structure features.
[0119] For example, based on the device's structural representation module, a preset linear transformation algorithm is used to perform linear transformation processing on the edge structure features corresponding to each user product pair representation to obtain the processed edge structure features corresponding to each user product pair representation. Based on the activation function, feature activation processing is performed on the processed edge structure features corresponding to each user product pair representation to obtain the structural features corresponding to each user product pair representation.
[0120] For example, for user u i and product i j Their edge structure features are The output after processing by the structural feature refinement module is defined as follows: Obtain the processed edge structure features corresponding to each user's item pair representation. in, and These represent the weight matrix and bias vector, respectively; the calculation method of the activation function is exactly the same as that in the feature encoder, so it will not be repeated here.
[0121] 309. The user-product pair representation and the corresponding structural features are concatenated to obtain a second concatenated representation; wherein, the second concatenated representation represents the final association between the user and the product.
[0122] For example, based on the device's output module, the user item pair representation and the corresponding structural features of the user item pair representation are concatenated, such as the user item pair representation after being processed by the refinement module. i and product i j The attribute features and structural features of the pair are respectively and Based on this, the final representation of the user-product pair is constructed. The second concatenated representation is obtained by splicing the two feature representations to characterize the final association between users and products.
[0123] 310. Perform a fully connected computation on the second concatenated representation to obtain the prediction data corresponding to the user product pair representation.
[0124] For example, the device performs fully connected computation on each second spliced representation based on a preset fully connected network to obtain the predicted data corresponding to the user-item pair representation, such as using a single fully connected network to output the predicted score of the user-item pair: Among them, w out The weight vector is to be learned; then, the degree of each user's preference for each product is accurately predicted, so as to improve the accuracy of product recommendations.
[0125] 311. Recommend products to users based on the predicted information set.
[0126] For example, this step can be referred to step 204, and will not be repeated here.
[0127] In this embodiment, based on the above embodiments, on the one hand, a set of MinHash signatures and HyperLogLog sketches are maintained for each node, and the computational framework of existing graph convolutional networks is reused for computation. This successfully transforms the structural features with edge dimensions into those with node dimensions, thereby quickly calculating the structural features of different node pairs based on the maintained node probability data structure. On the other hand, the relational graph convolutional network based on the multi-head attention mechanism can autonomously learn attention coefficients that describe the degree of contribution of neighboring users or items to the central user or item, and dynamically aggregate neighborhood information according to the weight, thereby highlighting the contribution of highly relevant users or items, suppressing the influence of low-relevant users or items, and improving prediction accuracy.
[0128] Figure 14 is a flowchart illustrating a model training method for product recommendation provided in an embodiment of this application. As shown in Figure 14, the method includes:
[0129] 401. Obtain a bipartite graph corresponding to at least one user to be trained and at least one item to be trained, and perform convolution processing on the bipartite graph based on the initial graph convolutional network to obtain a representation set; wherein, the bipartite graph represents the interaction between all users to be trained and items to be trained; the representation set includes at least one user-item pair representation; the user-item pair representation represents the joint attribute between each user to be trained and each item to be trained.
[0130] For example, the execution subject of this embodiment may be a computing device, hereinafter referred to as the device. The device may be a physical device or a virtual device that executes a model training method applied to product recommendation. The device acquires multiple users to be trained and multiple products to be trained, and constructs a bipartite graph based on the interaction between all users and products to be trained. It then calls the initial relational graph convolutional network and inputs the obtained bipartite graph into the relational graph convolutional network of the attention mechanism to perform convolution processing on the bipartite graph. The convolution of each user attribute and each product attribute is then converged to obtain a user-product pair representation of each user and each product to be trained in the representation set, thereby representing the joint attribute between each user and each product to be trained.
[0131] 402. Determine the user-item pair distance corresponding to the user-item pair representation, and determine the structural features corresponding to the user-item pair representation based on the user-item pair distance and the bipartite graph; wherein, the user-item pair distance is the geodesic distance between the user to be trained and the item to be trained; the structural features characterize the local topological structure between the user to be trained and the item to be trained in the bipartite graph.
[0132] For example, in a bipartite graph, each user or item to be trained corresponds to a node. The device calculates the geodesic distance, or shortest path length, between the node corresponding to the user and the node corresponding to the item, based on the user-item pair representation. This distance is the user-item pair distance between the user and the item. The device then processes the obtained user-item pair distance and the bipartite graph using a structural feature calculation method to obtain the structural features corresponding to each user-item pair representation. This structural feature characterizes the local topological structure between the user and the item corresponding to each user-item pair representation in the bipartite graph, thereby enhancing the distinguishability between the nodes corresponding to the user and the item in the bipartite graph.
[0133] 403. Based on the representation of each user's product pair and the structural features, the initial graph convolutional network is trained to obtain an attention-based relational graph convolutional network; wherein, the attention-based relational graph convolutional network is used to process the bipartite graph in the product recommendation method to recommend products to users.
[0134] For example, the device invokes an initial graph convolutional network, inputs the obtained user-item pair representations and structural features corresponding to each user and item to be trained into the initial graph convolutional network, and trains the initial graph convolutional network to obtain an attention-based relational graph convolutional network. Based on the obtained attention-based relational graph convolutional network, the bipartite graph in the product recommendation method is processed to obtain the prediction data corresponding to each user-item pair representation, which can accurately predict the user's preference for the product and then recommend products to the user.
[0135] This embodiment provides a model training method for product recommendation. Based on an initial attention-based graph convolutional network, a bipartite graph representing the interaction relationships between multiple users and products to be trained is convolved to obtain the joint attributes between each user and each product. Then, combining the geodesic distance between each user and each product and the local topology obtained from the bipartite graph, the initial attention-based graph convolutional network is trained to obtain a graph convolutional network with a better attention mechanism. This allows for accurate prediction of each user's preference for each product, thus enabling precise product recommendations to the user.
[0136] Figure 15 is a flowchart illustrating another model training method for product recommendation provided in an embodiment of this application. As shown in Figure 15, the method includes:
[0137] 501. Obtain a bipartite graph corresponding to at least one user to be trained and at least one item to be trained.
[0138] For example, this step can be referred to as step 401, which will not be repeated here.
[0139] 502. Initialize the bipartite graph to obtain the initial user representation of each user to be trained and the initial product representation of each product to be trained; wherein, the initial user representation represents the attributes of the user to be trained and the initial product representation represents the attributes of the product to be trained.
[0140] For example, Figure 16 is a flowchart of a model training algorithm provided in an embodiment of this application. As shown in Figure 16, the algorithm includes three modules: an attribute representation module, a structure representation module, and an output module. In order to describe the user to be trained and the product to be trained, based on the attribute representation module, each user to be trained and each product to be trained in the bipartite graph is usually initialized, and their attributes are extracted as initial representations to obtain the initial user representation of each user to be trained and the initial product representation of each product to be trained.
[0141] In one example, step 502 includes the following steps:
[0142] The first step of step 502 is to initialize the bipartite graph to obtain the user feature vector of each user to be trained and the product feature vector of each product to be trained; wherein, the user feature vector represents the initial attributes of the user to be trained; and the product feature vector represents the initial attributes of the product to be trained.
[0143] The second step of step 502 involves performing linear transformations on the user feature vector and the product feature vector respectively to obtain the processed user feature vector and the processed product feature vector.
[0144] The third step of step 502 is to perform feature activation processing on the processed user feature vector and the processed product feature vector respectively to obtain the activated user feature vector and the activated product feature vector.
[0145] In the fourth step of step 502, the activated user feature vector and the activated product feature vector are randomly deactivated to obtain the initial user representation of the user to be trained and the initial product representation of the product to be trained.
[0146] For example, referring to Figure 16, based on the attribute representation module, to describe the users and items to be trained, each user and item in the bipartite graph is typically initialized by extracting their initial attributes, thus obtaining the user feature vector for each user and the item feature vector for each item. Since feature vectors often have high dimensionality and different value ranges between dimensions, the feature encoder uses a linear transformation layer to process the input features, mapping them to a low-dimensional dense vector as the representation of the nodes. This yields the processed user feature vector for each user and the processed item feature vector for each item, for subsequent processing by the modules. An activation function is applied to the output of the fully connected layer to introduce a non-linear factor. This activation process is applied to the processed user feature vector for each user to be trained and the processed product feature vector for each product to be trained, resulting in activated user feature vectors and activated product feature vectors. A random deactivation function is then introduced to randomly deactivate the activated user feature vectors for each user to be trained and the activated product feature vectors for each product to be trained, resulting in the initial user representation for each user to be trained and the initial product representation for each product to be trained. For example, taking the user side as an example, the formula for calculating random deactivation is: Initial User Representation... in, r (0) Represents a mask vector. This is the activated user feature vector, where each element is a random variable following a Bernoulli distribution with probability p, indicating that the neuron has a probability p to be retained. The symbol... This represents element-wise multiplication of vectors.
[0147] 503. Based on the initial graph convolutional network, feature extraction processing is performed on the bipartite graph, the initial representation of each user, and the initial representation of each product to obtain the user attribute representation of each user to be trained and the product attribute representation of each product to be trained; wherein, the user attribute representation represents the attribute features of the user to be trained, and the product attribute representation represents the attribute features of the product to be trained.
[0148] For example, referring to Figure 16, in order to integrate the topological information in the bipartite graph into the attribute features of the user and product nodes to be trained, the device calls a pre-defined attention mechanism relational graph convolutional network. The bipartite graph, each user's initial representation, and each product's initial representation are input into the relational graph convolutional network. Based on the existing interaction relationships between each user and each product to be trained in the bipartite graph, the attribute information represented by each user's initial representation and the attribute information represented by each product's initial representation are transformed and aggregated respectively. Thus, the user attribute representation of each user to be trained can be obtained to represent the attribute features of the user to be trained, and the product attribute representation of each product to be trained can be obtained to represent the attribute features of the product to be trained.
[0149] In one example, the initial graph convolutional network includes at least one graph convolutional layer; step 503 includes the following steps:
[0150] The first step of step 503 is to perform feature aggregation processing on the bipartite graph, the initial representation of each user, and the initial representation of each item based on the multi-head attention mechanism of the graph convolutional layer, to obtain multiple user aggregate representations for each user to be trained and multiple item aggregate representations for each item to be trained; wherein, the user aggregate representation represents the aggregate attribute features of the user to be trained, and the item aggregate representation represents the aggregate attribute features of the item to be trained.
[0151] The second step of step 503 is to average the multiple user aggregate representations of the user to be trained to obtain the user latent representation of the user to be trained; at the same time, to average the multiple product aggregate representations of the product to be trained to obtain the product latent representation of the product to be trained; wherein, the user latent representation represents the latent attribute features of the user to be trained, and the product latent representation represents the latent attribute features of the product to be trained.
[0152] The third step of step 503 involves performing feature activation processing on the user implicit representation and the product implicit representation respectively, to obtain the activated user implicit representation and the activated product implicit representation.
[0153] In the fourth step of step 503, the activated user implicit representation and the activated product implicit representation are randomly deactivated to obtain the processed user implicit representation and the processed product implicit representation.
[0154] The fifth step of step 503 is to generate the user attribute representation of the user to be trained based on the user implicit representation and the processed user implicit representation; at the same time, to generate the product attribute representation of the product to be trained based on the product implicit representation and the processed product implicit representation.
[0155] For example, referring to Figure 16, the attribute representation module based on the device sets up multiple graph convolutional layers in the called relational graph convolutional network. Each graph convolutional layer deploys a multi-head attention mechanism. Based on the first graph convolutional layer, according to the existing interaction relationship between each user to be trained and each item to be trained in the bipartite graph, the attribute information of each user's initial representation and the attribute information of each item's initial representation are transformed and aggregated respectively. Thus, multiple user aggregated representations of each user to be trained output by the first graph convolutional layer can be obtained to represent the aggregated attribute features of the user to be trained. At the same time, multiple item aggregated representations of each item to be trained output by the first graph convolutional layer can be obtained to represent the aggregated attribute features of the item to be trained. From the second layer to the last layer... Each graph convolutional layer transforms and aggregates the user aggregate representations and product aggregate representations of each training user and each training item obtained from the previous graph convolutional layer. This results in multiple user aggregate representations and multiple product aggregate representations of each training user and each training item output by each graph convolutional layer. Based on each graph convolutional layer, the multiple user aggregate representations of each training user obtained from the graph convolutional layer are averaged to obtain the latent user representation of the training user, which represents the latent attribute features of the training user. At the same time, the multiple product aggregate representations of each training item obtained from the graph convolutional layer are averaged to obtain the latent product representation of the training item, which represents the latent attribute features of the training item. The device introduces an activation function to perform feature activation processing on each user's latent representation and each item's latent representation, resulting in corresponding activated user and item latent representations. It also introduces a random deactivation function to randomly deactivate each activated user and item latent representation, resulting in processed user and item latent representations. The device then concatenates the user's latent representation and the corresponding processed user latent representation for each user to be trained, obtaining the user attribute representation for that user. Similarly, it concatenates the item's latent representation and the corresponding processed item latent representation for each item to be trained, obtaining the item attribute representation for that item. It's worth noting that the calculation methods for the activation function and random deactivation are completely consistent with those in the feature encoder, and will not be elaborated upon here.
[0156] In one example, the first step of step 503 includes:
[0157] Step 1: Perform path randomization on the bipartite graph to obtain the processed bipartite graph.
[0158] Step 2: Based on the processed bipartite graph, determine at least one adjacent product of the user to be trained from each product to be trained, and determine at least one adjacent user of the product to be trained from each user to be trained; wherein, the adjacent product is the product to be trained that has interacted with the user to be trained; the adjacent user is the user to be trained that has interacted with the product to be trained.
[0159] Step 3: Based on the multi-head attention mechanism of the graph convolutional layer, the initial user representation of the user to be trained and the initial product representations of each neighboring product of the user to be trained are aggregated to obtain multiple aggregated user representations of the user to be trained; at the same time, based on the multi-head attention mechanism of the graph convolutional layer, the initial product representation of the product to be trained and the initial user representations of each neighboring user of the product to be trained are aggregated to obtain multiple aggregated product representations of the product to be trained.
[0160] Specifically, referring to Figure 16, to improve the model's generalization ability, at the beginning of attribute feature extraction, the device needs to perform "path random deactivation" on the user-item bipartite graph, that is, delete some edges sampled based on random walks on the graph, resulting in a processed bipartite graph. Referring to Figure 16, the attribute representation module in the device, based on the processed bipartite graph, for each user to be trained, determines the training items that have interacted with the user from all training items, i.e., obtains one or more adjacent items of the user to be trained, and for each training item, determines the training users that have interacted with the item from all training users, i.e., obtains one or more adjacent users of the item to be trained. The device uses a multi-head attention mechanism based on graph convolutional layers to aggregate the initial user representation of each user to be trained and the initial product representations of each neighboring product of each user to be trained, aggregating the feature information represented by each representation to obtain multiple aggregated user representations for each user to be trained. At the same time, based on the multi-head attention mechanism based on graph convolutional layers, the device also aggregates the initial product representation of each product to be trained and the initial user representations of each neighboring user of each product to be trained, aggregating the feature information represented by each representation to obtain multiple aggregated product representations for each product to be trained.
[0161] 504. Perform feature refinement processing on the user attribute representation of the user to be trained and the product attribute representation of the product to be trained to obtain the user-product pair representation.
[0162] For example, referring to Figure 16, the attribute representation module of the device extracts the attribute representations of the user to be trained and the product to be trained, respectively. To predict the rating of the user-product pair, it is natural to fuse these two attribute representations. That is, feature refinement processing is performed on the user attribute representation of each user to be trained and the product attribute representation of each product to be trained, forming the implicit representation of the user-product pair, i.e., the user-product pair representation. This yields a more accurate joint attribute between each user to be trained and each product to be trained, thereby improving the accuracy of predicting the user's preference for the product to be trained.
[0163] In one example, step 504 includes:
[0164] Step 1: Perform a concatenation transformation on the user attribute representation of the user to be trained and the product attribute representation of the product to be trained to obtain the first concatenated representation between the user to be trained and the product to be trained; wherein, the first concatenated representation represents the implicit joint attribute between the user and the product.
[0165] Step 2: Perform feature activation processing on the first concatenated representation to obtain the activated first concatenated representation.
[0166] Step 3: Randomly deactivate the first concatenation representation to obtain the user's product pair representation.
[0167] For example, referring to Figure 16, the device, based on the attribute representation module, first concatenates the user attribute representation of each user to be trained and the product attribute representation of each product to be trained. Then, through a linear transformation, the two types of node representations are fully integrated to form the implicit representation of the user-product pair, namely the first concatenated representation, to characterize the implicit joint attributes between the user and the product to be trained. Then, based on the activation function, feature activation processing is performed on each first concatenated representation to obtain the corresponding activated first concatenated representation. Finally, a random deactivation function is introduced to randomly deactivate each activated first concatenated representation to obtain the representation of each user-product pair.
[0168] 505. Determine the distance between user-product pairs and their corresponding distances, and perform path randomization deactivation on the bipartite graph to obtain the processed bipartite graph.
[0169] For example, referring to Figure 16, based on the device's structural representation module, the geodesic distance between the user and the product to be trained corresponding to each user-product pair is calculated, i.e., the user-product pair distance. Since the user-product bipartite graph may contain noise and missing data, similar to the attribute representation module, the device performs path random deactivation on the user-product bipartite graph. It should be noted that the structural representation module and the attribute representation module in the device share the same user-product bipartite graph output after path random deactivation.
[0170] 506. Based on the distance between user and product pairs and the processed bipartite graph, determine the edge structure features corresponding to the distance between user and product pairs; wherein, the edge structure features represent the local edge structure between the user to be trained and the product to be trained in the bipartite graph.
[0171] For example, to enhance the distinguishability between nodes, the structure representation module in the device defines d(u,w) as the shortest path length between node u and node w, also known as the geodesic distance, for each node pair (u,v) between a user to be trained and each item to be trained, in the prediction graph. When defining the link relationship between nodes u and v in a given context, ensure that u and v are linked to other nodes. To distinguish them, a structural feature called distance encoding is introduced for each node. Encoded as a tuple: z w =(d(u,w),d(v,w)), where distance encoding is associated with edges. Analyzing different node pairs will yield completely different distance encodings, making it impossible to perform calculations based on nodes as the dimension, as in graph convolution operations. Therefore, for each node corresponding to the user to be trained and each node corresponding to the product to be trained in the processed bipartite graph, the device uses a structural feature calculation method to obtain multiple distance encodings for each user-product pair based on the distance between them. It further calculates these multiple distance encodings and outputs the node-dimensional features, which are the edge structure features corresponding to the user-product pair, to characterize the local edge structure between the user to be trained and the product to be trained in the bipartite graph.
[0172] In one example, step 506 includes the following steps:
[0173] The first step of step 506 is to determine the first quantity of the first set corresponding to the user-product pair distance based on the processed bipartite graph; wherein, the first quantity is the total number of the first nodes included in the first set; the first node is other users or products to be trained whose geodesic distance to the user-product pair distance is equal to the user-product pair distance and whose geodesic distance to the product to be trained is equal to the user-product pair distance.
[0174] The second step of step 506 is to determine the second quantity of the second set corresponding to the user-item pair distance based on the processed bipartite graph; wherein, the second quantity is the total number of second nodes included in the second set; the second node is other users or items to be trained whose geodesic distance to the user to be trained corresponding to the user-item pair distance is equal to the user-item pair distance, and whose geodesic distance to the item to be trained corresponding to the user-item pair distance is greater than a preset threshold.
[0175] The third step of step 506 is to determine the third quantity of the third set corresponding to the distance between user and product pairs based on the processed bipartite graph; wherein, the third quantity is the total number of third nodes included in the third set; the third node is other users or products to be trained whose geodesic distance between them and the training products corresponding to the distance between user and product pairs is equal to the distance between the user and product pairs, and whose geodesic distance between them and the training users corresponding to the distance between user and product pairs is greater than a preset threshold.
[0176] The fourth step of step 506 is to determine the edge structure features corresponding to the distance between user product pairs based on the first quantity, the second quantity, and the third quantity.
[0177] For example, for each user-item pair distance, from the processed bipartite graph, other users or items to be trained whose geodesic distance to the user to be trained corresponding to the user-item pair distance is equal to the user-item pair distance, and whose geodesic distance to the item to be trained corresponding to the user-item pair distance is equal to the user-item pair distance, are determined as the first node included in the first set corresponding to the user-item pair distance, and the total number of the first nodes included in the first set is determined, i.e., the first quantity. Based on the sensing field range in the processed bipartite graph, the device sets a preset threshold, i.e., the maximum number of hops. For each user-item pair distance, from the processed bipartite graph, other users or items to be trained whose geodesic distance to the user corresponding to that user-item pair distance is equal to that user-item pair distance, and whose geodesic distance to the item corresponding to that user-item pair distance is greater than the preset threshold, are identified as second nodes in the second set corresponding to that user-item pair distance. The total number of second nodes in the second set is determined, i.e., the second quantity. For each user-item pair distance, from the processed bipartite graph, other users or items to be trained whose geodesic distance to the item corresponding to that user-item pair distance is equal to that user-item pair distance, and whose geodesic distance to the user corresponding to that user-item pair distance is greater than the preset threshold, are identified as third nodes in the third set corresponding to that user-item pair distance. The total number of third nodes in the third set is determined, i.e., the third quantity. Based on a preset calculation method, the device calculates the first, second, and third quantities corresponding to the distance of each user's product pair, thereby obtaining the edge structure features corresponding to the distance of each user's product pair.
[0178] In one example, the first step of step 506 includes:
[0179] Step 1: Based on the processed bipartite graph, determine the user hop neighborhood and product hop neighborhood corresponding to the user-product pair distance; wherein, the user hop neighborhood includes other users or products to be trained whose geodesic distance to the user to be trained corresponding to the user-product pair distance is less than or equal to the user-product pair distance; the product hop neighborhood includes other users or products to be trained whose geodesic distance to the product to be trained corresponding to the user-product pair distance is less than or equal to the user-product pair distance.
[0180] Step 2: Perform probability approximation calculations on the user jump neighborhood and the product jump neighborhood to determine the first quantity of the first set corresponding to the distance between the user and the product.
[0181] Specifically, based on the processed bipartite graph, for each user-item pair distance, the device identifies other users or items whose geodesic distance to the user corresponding to that user-item pair distance is less than or equal to that user-item pair distance as the user hop neighborhood corresponding to that user-item pair distance; and identifies other users or items whose geodesic distance to the item corresponding to that user-item pair distance is less than or equal to that user-item pair distance as the item hop neighborhood corresponding to that user-item pair distance. Using a preset probabilistic approximation calculation algorithm, such as the MinHash approximation algorithm or the HyperLogLog++ approximation algorithm, the device performs probabilistic approximation calculations on the user hop neighborhood and item hop neighborhood corresponding to that user-item pair distance to obtain the first quantity of the first set corresponding to that user-item pair distance.
[0182] 507. Perform feature refinement on the edge structure features to obtain the structural features.
[0183] For example, referring to Figure 16, the device-based structural representation module, based on a preset algorithm, performs feature refinement processing on the edge structure features corresponding to each user-item pair representation, obtaining the structural features corresponding to each user-item pair representation. Furthermore, by using geodesic distance to characterize the local subgraph patterns and topology around the nodes, it overcomes the limitation of graph convolutional networks based on the message propagation paradigm in their inability to distinguish self-similar nodes, thus helping to improve the accuracy of rating prediction.
[0184] In one example, step 507 includes:
[0185] Step 1: Perform a linear transformation on the edge structure features to obtain the processed edge structure features.
[0186] Step 2: Perform feature activation processing on the processed edge structure features to obtain the activated edge structure features.
[0187] Step 3: Randomly deactivate the activated edge structure features to obtain the structural features.
[0188] Specifically, referring to Figure 16, based on the device's structural representation module, a preset linear transformation algorithm is used to perform linear transformation processing on the edge structure features corresponding to each user product pair representation to obtain the processed edge structure features corresponding to each user product pair representation. Based on the activation function, feature activation processing is performed on the processed edge structure features corresponding to each user product pair representation to obtain the structural features corresponding to each user product pair representation.
[0189] 508. Generate a prediction information set based on the representation of each user's item pair and each structural feature; wherein, the prediction information set includes the prediction data corresponding to each user's item pair representation; the prediction data represents the predicted degree of preference of the user to be trained for the item to be trained.
[0190] For example, referring to Figure 16, based on the output module of the device, for each user-item pair representation and each structural feature corresponding to each user and each item to be trained, the device calculates each user-item pair representation and each corresponding structural feature according to a preset prediction algorithm, so as to obtain the prediction data corresponding to each user-item pair representation. This can accurately predict the degree of preference of the user to be trained for the item to be trained, and thus obtain the prediction information set corresponding to each user and each item to be trained.
[0191] In one example, step 508 includes the following steps:
[0192] The first step of step 508 is to concatenate the user-item pair representation and the structural features corresponding to the user-item pair representation to obtain the second concatenated representation; wherein, the second concatenated representation represents the final association between the user to be trained and the item to be trained.
[0193] The second step of step 508 is to perform a fully connected computation on the second spliced representation to obtain the prediction data corresponding to the user product pair representation.
[0194] For example, referring to Figure 16, based on the device's output module, the user item pair representation and the corresponding structural features of the user item pair representation are concatenated, such as the training user u after being processed by the refinement module. i and the product to be trained i j The attribute features and structural features of the pair are respectively and Based on this, the final representation of the user-product pair is constructed. The second concatenated representation is obtained by concatenating the two feature representations to characterize the final association between the user and the item to be trained. The device performs fully connected computation on each second concatenated representation based on a pre-defined fully connected network to obtain the predicted data corresponding to the user-item pair representation. For example, a single fully connected network can be used to output the predicted score for the user-item pair. Among them, w out The weight vector is to be learned; then, the degree of each user's preference for each product is accurately predicted, so as to improve the accuracy of product recommendations.
[0195] 509. Based on the predicted information set and the actual information set, the initial graph convolutional network is trained to obtain the relational graph convolutional network with attention mechanism; wherein, the actual information set includes the actual data corresponding to each user-item pair; the actual data represents the actual user's preference for the training item.
[0196] For example, the device accesses a set of actual information corresponding to all users and items to be trained. This set includes actual data corresponding to each user-item pair representation, characterizing the actual preference of each user for each item. Based on the actual data and predicted data corresponding to each user-item pair representation, model parameters for optimizing the model are calculated to train the model, resulting in an attention-based graph convolutional network for item recommendation. This improves the accuracy of item recommendations to users.
[0197] In one example, step 509 includes the following steps:
[0198] The first step of step 509 is to generate a first loss function based on the predicted information set and the actual information set.
[0199] The second step of step 509 is to perform adjacency scoring regularization on each weight parameter matrix in the initial graph convolutional network to obtain the second loss function.
[0200] The third step in step 509 is to perform regularization on each parameter to be learned in the initial graph convolutional network to obtain the third loss function.
[0201] The fourth step of step 509 is to determine the joint loss function based on the first loss function, the second loss function, and the third loss function.
[0202] The fifth step of step 509 is to optimize the initial graph convolutional network according to the joint loss function to obtain the attention mechanism relational graph convolutional network.
[0203] For example, the device uses the Mean Squared Error (MSE) loss function, also known as the first loss function, to minimize the difference between the predicted and actual ratings, as calculated by the formula for the first loss function. Among them, R ij and For each user u to be trained i and the product to be trained i j The actual rating and the predicted rating, R ij >0 indicates that only observed user-item pairs on the training dataset are computed. The second part is Adjacent Rating Regularization (ARR), which encourages adjacent ratings in the RGAT layer to have similar parameter matrices, thereby preserving the magnitude and order information of the ratings. The second loss function is calculated using the formula. in, Having a sorting relationship Let H be the weight parameter matrix corresponding to the h-th attention head in the l-th RGAT layer, where H represents the number of attention heads and L represents the number of stacked RGAT layers. The third part is the regularization term for the parameters to be learned in the neural network, denoted by Θ, which represents all the parameters to be learned in the model. The regularization term is defined to obtain the third loss function. Integrating the above three parts, we obtain the final joint loss function. The hyperparameters λ1 and λ2 weigh the importance of the three components. Based on the final joint loss function, the device optimizes the initial graph convolutional network to obtain an attention-based relational graph convolutional network. Furthermore, based on this attention-based relational graph convolutional network, product recommendations can be made, improving the accuracy of product recommendations to users.
[0204] In this embodiment, based on the above embodiments, the multi-head attention mechanism of the initial relational graph convolutional network can autonomously learn attention coefficients that describe the contribution of neighboring users or items to the central user or item, and dynamically aggregate neighborhood information according to the weight, thereby highlighting the contribution of highly relevant users or items and suppressing the influence of low-relevant users or items, resulting in a relational graph convolutional network with a more accurate prediction performance, thus improving prediction accuracy.
[0205] Figure 17 is a schematic diagram of a product recommendation device provided in an embodiment of this application. As shown in Figure 17, the device includes:
[0206] The processing module 601 is used to obtain a bipartite graph corresponding to at least one user and at least one item, and to perform convolution processing on the bipartite graph based on a relational graph convolutional network with an attention mechanism to obtain a representation set; wherein, the bipartite graph represents the interaction between all users and items; the representation set includes at least one user-item pair representation; the user-item pair representation represents the joint attribute between each user and each item;
[0207] The determination module 602 is used to determine the user-item pair distance corresponding to the user-item pair representation, and to determine the structural features corresponding to the user-item pair representation based on the user-item pair distance and the bipartite graph; wherein, the user-item pair distance is the geodesic distance between the user and the item; the structural features characterize the local topological structure between the user and the item in the bipartite graph;
[0208] The prediction module 603 is used to generate a prediction information set based on the product pair representations of each user and various structural features; wherein, the prediction information set includes prediction data corresponding to each product pair representation of each user; the prediction data represents the predicted degree of user preference for the products;
[0209] The recommendation module 604 is used to recommend products to users based on the predicted information set.
[0210] In one example, module 602 is specifically used to: perform path random deactivation processing on the bipartite graph to obtain the processed bipartite graph; determine the edge structure features corresponding to the distance between the user and the product pair based on the distance between the user and the product pair and the processed bipartite graph; wherein, the edge structure features represent the local edge structure between the user and the product in the bipartite graph; and perform feature refinement processing on the edge structure features to obtain the structural features.
[0211] In one example, module 602 is specifically configured to: determine a first quantity of a first set corresponding to a user-product pair distance based on the processed bipartite graph; wherein the first quantity is the total number of first nodes included in the first set; the first node is another user or product whose geodesic distance to the user-product pair distance is equal to the user-product pair distance, and whose geodesic distance to the product corresponding to the user-product pair distance is equal to the user-product pair distance; and determine a second quantity of a second set corresponding to a user-product pair distance based on the processed bipartite graph; wherein the second quantity is the total number of second nodes included in the second set; the second node is another user or product whose geodesic distance to the user-product pair distance is equal to the user-product pair distance. Other users or products whose geodesic distance between two users is equal to the distance between the user and the product corresponding to the distance between the user and the product are greater than a preset threshold; based on the processed bipartite graph, determine the third quantity of the third set corresponding to the distance between the user and the product; wherein, the third quantity is the total number of third nodes included in the third set; the third node is other users or products whose geodesic distance between the user and the product corresponding to the distance between the user and the product is equal to the distance between the user and the product, and whose geodesic distance between the user and the product corresponding to the distance between the user and the product is greater than a preset threshold; based on the first quantity, the second quantity, and the third quantity, determine the edge structure features corresponding to the distance between the user and the product.
[0212] In one example, the determination module 602 is specifically used to: determine the user hop neighborhood and the product hop neighborhood corresponding to the user-product pair distance based on the processed bipartite graph; wherein, the user hop neighborhood includes other users or products whose geodesic distance to the user corresponding to the user-product pair distance is less than or equal to the user-product pair distance; the product hop neighborhood includes other users or products whose geodesic distance to the product corresponding to the user-product pair distance is less than or equal to the user-product pair distance; the determination module 702 is specifically used to: perform probability approximation calculation processing on the user hop neighborhood and the product hop neighborhood to determine the first quantity of the first set corresponding to the user-product pair distance.
[0213] In one example, the determination module 602 is also specifically used for: performing linear transformation on the edge structure features to obtain the processed edge structure features; and performing feature activation on the processed edge structure features to obtain the structure features.
[0214] In one example, processing module 601 is specifically used for: initializing the bipartite graph to obtain initial user representations for each user and initial product representations for each product; wherein the initial user representation represents the user's attributes and the initial product representation represents the product's attributes; performing feature extraction processing on the bipartite graph, the initial user representations, and the initial product representations based on a relational graph convolutional network to obtain user attribute representations for each user and product attribute representations for each product; wherein the user attribute representation represents the user's attribute features and the product attribute representation represents the product's attribute features; and performing feature refinement processing on the user attribute representations and product attribute representations to obtain user-product pair representations.
[0215] In one example, the processing module 601 is further specifically used for: initializing the bipartite graph to obtain user feature vectors for each user and product feature vectors for each product; wherein, the user feature vectors represent the initial attributes of the users; and the product feature vectors represent the initial attributes of the products; performing linear transformations on the user feature vectors and product feature vectors respectively to obtain processed user feature vectors and processed product feature vectors; and performing activation processing on the processed user feature vectors and processed product feature vectors respectively to obtain the initial user representations and the initial product representations of the products.
[0216] In one example, the relational graph convolutional network includes at least one graph convolutional layer; the processing module 601 is further specifically used for: performing feature aggregation processing on the bipartite graph, the initial representations of each user, and the initial representations of each product based on the multi-head attention mechanism of the graph convolutional layer, to obtain multiple user aggregate representations for each user and multiple product aggregate representations for each product; wherein, the user aggregate representation represents the aggregate attribute features of the user, and the product aggregate representation represents the aggregate attribute features of the product; averaging the multiple user aggregate representations of the user to obtain the user's latent representation; simultaneously, averaging the multiple product aggregate representations of the product to obtain the product's latent representation; wherein, the user latent representation represents the latent attribute features of the user, and the product latent representation represents the latent attribute features of the product; performing feature activation processing on the user latent representation and the product latent representation respectively to obtain the processed user latent representation and the processed product latent representation; generating the user's user attribute representation based on the user's user latent representation and the processed user latent representation; simultaneously, generating the product attribute representation of the product based on the product's product latent representation and the processed product latent representation.
[0217] In one example, the processing module 601 is further specifically used for: performing path random deactivation processing on the bipartite graph to obtain a processed bipartite graph; determining at least one adjacent product of a user from each product and at least one adjacent user of a product from each user, wherein the adjacent product is a product that has interacted with the user; the adjacent user is a user that has interacted with the product; and based on the multi-head attention mechanism of the graph convolutional layer, aggregating the user's initial user representation and the initial product representations of each neighboring product of the user to obtain multiple aggregated user representations of the user; and simultaneously, based on the multi-head attention mechanism of the graph convolutional layer, aggregating the initial product representation of the product and the initial user representations of each neighboring user of the product to obtain multiple aggregated product representations of the product.
[0218] In one example, the processing module 601 is further specifically used to: perform concatenation transformation on the user attribute representation of the user and the product attribute representation of the product to obtain a first concatenated representation between the user and the product; wherein the first concatenated representation represents the implicit joint attribute between the user and the product; and perform feature activation processing on the first concatenated representation to obtain a user-product pair representation.
[0219] In one example, prediction module 603 is specifically used to: concatenate the user-item pair representation and the structural features corresponding to the user-item pair representation to obtain a second concatenated representation; wherein the second concatenated representation represents the final association between the user and the item; and perform a fully connected computation on the second concatenated representation to obtain the prediction data corresponding to the user-item pair representation.
[0220] The apparatus in this embodiment can execute the technical solutions in the above method. Its specific implementation process and technical principles are the same, and will not be repeated here.
[0221] Figure 18 is a schematic diagram of a model training device for product recommendation provided in an embodiment of this application. As shown in Figure 18, the device includes:
[0222] The processing module 701 is used to obtain a bipartite graph corresponding to at least one user to be trained and at least one item to be trained, and to perform convolution processing on the bipartite graph based on the initial graph convolutional network to obtain a representation set; wherein, the bipartite graph represents the interaction between all users to be trained and items to be trained; the representation set includes at least one user-item pair representation; the user-item pair representation represents the joint attribute between each user to be trained and each item to be trained;
[0223] The determination module 702 is used to determine the user-item pair distance corresponding to the user-item pair representation, and to determine the structural features corresponding to the user-item pair representation based on the user-item pair distance and the bipartite graph; wherein, the user-item pair distance is the geodesic distance between the user to be trained and the item to be trained; the structural features characterize the local topological structure between the user to be trained and the item to be trained in the bipartite graph;
[0224] Training module 703 is used to train the initial graph convolutional network based on the representation of each user's product pair and each structural feature to obtain an attention-based relational graph convolutional network; wherein, the attention-based relational graph convolutional network is used to process the bipartite graph in the product recommendation device to recommend products to the user.
[0225] In one example, module 702 is specifically used to: perform path random deactivation processing on the bipartite graph to obtain the processed bipartite graph; determine the edge structure features corresponding to the user-item pair distances based on the user-item pair distances and the processed bipartite graph; wherein, the edge structure features characterize the local edge structure between the user to be trained and the item to be trained in the bipartite graph; and perform feature refinement processing on the edge structure features to obtain the structural features.
[0226] In one example, module 702 is specifically configured to: determine a first quantity of a first set corresponding to a user-item pair distance based on the processed bipartite graph; wherein the first quantity is the total number of first nodes included in the first set; the first node is another user or item to be trained whose geodesic distance to the user-item pair distance is equal to the user-item pair distance, and whose geodesic distance to the item to be trained whose geodesic distance is equal to the user-item pair distance; and determine a second quantity of a second set corresponding to a user-item pair distance based on the processed bipartite graph; wherein the second quantity is the total number of second nodes included in the second set; the second node is another user or item to be trained whose geodesic distance to the user-item pair distance is equal to the user-item pair distance. The user-product pair distance and the geodesic distance between the user-product pair distance and the corresponding training product are greater than a preset threshold. Other training users or training products are identified. Based on the processed bipartite graph, a third quantity of the third set corresponding to the user-product pair distance is determined. The third quantity is the total number of third nodes included in the third set. The third node is other training users or training products whose geodesic distance between them and the corresponding training product is equal to the user-product pair distance and whose geodesic distance between them and the corresponding training user is greater than a preset threshold. Based on the first quantity, the second quantity, and the third quantity, the edge structure features corresponding to the user-product pair distance are determined.
[0227] In one example, the determination module 702 is further specifically used to: determine the user hop neighborhood and the product hop neighborhood corresponding to the user-product pair distance based on the processed bipartite graph; wherein, the user hop neighborhood includes other users or products to be trained whose geodesic distance to the user to be trained corresponding to the user-product pair distance is less than or equal to the user-product pair distance; the product hop neighborhood includes other users or products to be trained whose geodesic distance to the product to be trained corresponding to the user-product pair distance is less than or equal to the user-product pair distance; and perform probability approximation calculation on the user hop neighborhood and the product hop neighborhood to determine the first quantity of the first set corresponding to the user-product pair distance.
[0228] In one example, the determination module 702 is also specifically used for: performing linear transformation processing on the edge structure features to obtain the processed edge structure features; performing feature activation processing on the processed edge structure features to obtain the activated edge structure features; and performing random deactivation processing on the activated edge structure features to obtain the structure features.
[0229] In one example, training module 703 is specifically used to: generate a prediction information set based on the representation of each user's item pair and each structural feature; wherein the prediction information set includes prediction data corresponding to each user's item pair representation; the prediction data represents the predicted degree of preference of the user to be trained for the training item; and train the initial graph convolutional network based on the prediction information set and the actual information set to obtain a relational graph convolutional network with an attention mechanism; wherein the actual information set includes actual data corresponding to each user's item pair representation; the actual data represents the actual degree of preference of the user to be trained for the training item.
[0230] In one example, training module 703 is specifically used to: concatenate the user-item pair representation and the structural features corresponding to the user-item pair representation to obtain a second concatenated representation; wherein, the second concatenated representation represents the final association between the user to be trained and the item to be trained; and perform fully connected computation on the second concatenated representation to obtain the prediction data corresponding to the user-item pair representation.
[0231] In one example, the training module 703 is further specifically used to: generate a first loss function based on the predicted information set and the actual information set; perform adjacency scoring regularization on each weight parameter matrix in the initial graph convolutional network to obtain a second loss function; perform regularization on each learnable parameter in the initial graph convolutional network to obtain a third loss function; determine a joint loss function based on the first loss function, the second loss function, and the third loss function; and optimize the initial graph convolutional network based on the joint loss function to obtain a relational graph convolutional network with an attention mechanism.
[0232] In one example, processing module 701 is specifically used for: initializing the bipartite graph to obtain initial user representations for each user to be trained and initial product representations for each product to be trained; wherein the initial user representations represent the attributes of the users to be trained and the initial product representations represent the attributes of the products to be trained; based on the initial graph convolutional network, performing feature extraction processing on the bipartite graph, the initial user representations, and the initial product representations to obtain user attribute representations for each user to be trained and product attribute representations for each product to be trained; wherein the user attribute representations represent the attribute features of the users to be trained and the product attribute representations represent the attribute features of the products to be trained; and performing feature refinement processing on the user attribute representations for the users to be trained and the product attribute representations for the products to be trained to obtain user-product pair representations.
[0233] In one example, processing module 701 is specifically used for: initializing the bipartite graph to obtain user feature vectors for each user to be trained and product feature vectors for each product to be trained; wherein, the user feature vectors represent the initial attributes of the users to be trained and the product feature vectors represent the initial attributes of the products to be trained; performing linear transformations on the user feature vectors and product feature vectors respectively to obtain processed user feature vectors and processed product feature vectors; performing feature activation processing on the processed user feature vectors and processed product feature vectors respectively to obtain activated user feature vectors and activated product feature vectors; and performing random deactivation processing on the activated user feature vectors and activated product feature vectors respectively to obtain the initial user representation for the users to be trained and the initial product representation for the products to be trained.
[0234] In one example, the initial graph convolutional network includes at least one graph convolutional layer; the processing module 701 is specifically used for: performing feature aggregation processing on the bipartite graph, the initial representations of each user, and the initial representations of each item based on the multi-head attention mechanism of the graph convolutional layer, to obtain multiple user aggregate representations for each user to be trained and multiple item aggregate representations for each item to be trained; wherein, the user aggregate representation represents the aggregate attribute features of the user to be trained, and the item aggregate representation represents the aggregate attribute features of the item to be trained; averaging the multiple user aggregate representations of the user to be trained to obtain the user latent representation of the user to be trained; simultaneously, averaging the multiple item aggregate representations of the item to be trained to obtain the item latent representation of the item to be trained. The algorithm consists of two parts: a user latent representation, a product latent representation, and a product latent representation. The user latent representation and the product latent representation are then subjected to feature activation processing to obtain activated user latent representations and activated product latent representations, respectively. These activated user latent representations and activated product latent representations are then subjected to random deactivation processing to obtain processed user latent representations and processed product latent representations. Based on the user latent representation and the processed user latent representation, a user attribute representation for the user to be trained is generated. Simultaneously, based on the product latent representation and the processed product latent representation, a product attribute representation for the product to be trained is generated.
[0235] In one example, processing module 701 is specifically used for: performing path random deactivation processing on the bipartite graph to obtain a processed bipartite graph; determining at least one adjacent item of the user to be trained from each item to be trained, and determining at least one adjacent user of the item to be trained from each user to be trained; wherein, the adjacent item is the item to be trained that has interacted with the user to be trained; the adjacent user is the user to be trained that has interacted with the item to be trained; based on the multi-head attention mechanism of the graph convolutional layer, aggregating the initial user representation of the user to be trained and the initial item representations of each neighboring item of the user to be trained to obtain multiple aggregated user representations of the user to be trained; simultaneously, based on the multi-head attention mechanism of the graph convolutional layer, aggregating the initial item representation of the item to be trained and the initial user representations of each neighboring user of the item to be trained to obtain multiple aggregated item representations of the item to be trained.
[0236] In one example, the processing module 701 is further specifically used to: perform a concatenation transformation on the user attribute representation of the user to be trained and the product attribute representation of the product to be trained to obtain a first concatenated representation corresponding to the user to be trained and the product to be trained; wherein, the first concatenated representation represents the implicit joint attribute between the user and the product; perform feature activation processing on the first concatenated representation to obtain an activated first concatenated representation; and perform random deactivation processing on the first concatenated representation to obtain a user-product pair representation.
[0237] The apparatus in this embodiment can execute the technical solutions in the above method. Its specific implementation process and technical principles are the same, and will not be repeated here.
[0238] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. These modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented in software via processing element calls, while others are implemented in hardware. Each module can be a separate processing element, or it can be integrated into a chip within the device. Alternatively, it can be stored as program code in the device's memory, and its functions can be called and executed by a processing element. Furthermore, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. During implementation, each step of the above method or each of the above modules can be completed through integrated logic circuits in the processor element or through software instructions.
[0239] Figure 19 is a schematic diagram of the structure of a computing device provided in an embodiment of this application. As shown in Figure 19, the computing device includes: a memory 801 and a processor 802; the memory 801 is a memory for storing executable instructions of the processor 802.
[0240] The processor 802 is configured to perform the methods provided in the above embodiments.
[0241] The computing device 800 also includes a receiver 803 and a transmitter 804. The receiver 803 is used to receive instructions and data sent by other devices, and the transmitter 804 is used to send instructions and data to external devices.
[0242] This application also provides a chip for executing instructions, which is used to execute the technical solutions of the processing methods described above.
[0243] This application also provides a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the technical solution of the processing method described in the above embodiments.
[0244] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium, and when the at least one processor executes the computer program, it can implement the technical solution of the processing method in the above embodiments.
[0245] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0246] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0247] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.
[0248] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0249] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
[0250] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A product recommendation method, characterized in that, The method includes: A bipartite graph corresponding to at least one user and at least one item is obtained, and a relational graph convolutional network based on an attention mechanism is used to perform convolution processing on the bipartite graph to obtain a representation set; wherein, the bipartite graph represents the interaction between all users and items; the representation set includes at least one user-item pair representation; the user-item pair representation represents the joint attribute between each user and each item; The user-item pair distance corresponding to the user-item pair representation is determined, and the structural features corresponding to the user-item pair representation are determined based on the user-item pair distance and the bipartite graph; wherein, the user-item pair distance is the geodesic distance between the user and the item; the structural features characterize the local topological structure between the user and the item in the bipartite graph; Based on each user-item pair representation and each structural feature, a prediction information set is generated; wherein, the prediction information set includes prediction data corresponding to each user-item pair representation; the prediction data characterizes the predicted user's preference for the item; Based on the predicted information set, product recommendations are made to the user.
2. The method according to claim 1, characterized in that, Based on the distance between the user and product pairs and the bipartite graph, the structural features corresponding to the user and product pairs are determined, including: The bipartite graph is subjected to path random deactivation processing to obtain the processed bipartite graph; Based on the distance between the user and the product pair and the processed bipartite graph, the edge structure features corresponding to the distance between the user and the product pair are determined; wherein, the edge structure features characterize the local edge structure between the user and the product in the bipartite graph; The edge structure features are refined to obtain the structural features.
3. The method according to claim 2, characterized in that, Based on the distance between the user and product pairs and the processed bipartite graph, determine the edge structure features corresponding to the distance between the user and product pairs, including: Based on the processed bipartite graph, a first quantity of the first set corresponding to the user-product pair distance is determined; wherein, the first quantity is the total number of first nodes included in the first set; the first node is other users or products whose geodesic distance to the user-product pair distance is equal to the user-product pair distance, and whose geodesic distance to the product corresponding to the user-product pair distance is equal to the user-product pair distance; Based on the processed bipartite graph, a second quantity of the second set corresponding to the user-product pair distance is determined; wherein, the second quantity is the total number of second nodes included in the second set; the second node is other users or products whose geodesic distance to the user-product pair distance is equal to the user-product pair distance and whose geodesic distance to the product corresponding to the user-product pair distance is greater than a preset threshold. Based on the processed bipartite graph, determine the third quantity of the third set corresponding to the distance between the user and the product pair; wherein, the third quantity is the total number of third nodes included in the third set; the third node is other users or products whose geodesic distance to the product corresponding to the distance between the user and the product pair is equal to the distance between the user and the product pair, and whose geodesic distance to the user corresponding to the distance between the user and the product pair is greater than the preset threshold. Based on the first quantity, the second quantity, and the third quantity, the edge structure features corresponding to the distance between the user's product pairs are determined.
4. The method according to claim 3, characterized in that, Based on the processed bipartite graph, determine the first quantity of the first set corresponding to the distance of the user's product pair, including: Based on the processed bipartite graph, the user hop neighborhood and product hop neighborhood corresponding to the user-product pair distance are determined; wherein, the user hop neighborhood includes other users or products whose geodesic distance to the user corresponding to the user-product pair distance is less than or equal to the user-product pair distance; the product hop neighborhood includes other users or products whose geodesic distance to the product corresponding to the user-product pair distance is less than or equal to the user-product pair distance; The user hop neighborhood and the product hop neighborhood are subjected to probability approximation calculation to determine the first quantity of the first set corresponding to the distance between the user and the product.
5. The method according to any one of claims 2-4, characterized in that, The edge structure features are refined to obtain the structural features, including: The edge structure features are subjected to a linear transformation to obtain the processed edge structure features; The processed edge structure features are subjected to feature activation processing to obtain the structure features.
6. The method according to any one of claims 1-5, characterized in that, A relational graph convolutional network based on an attention mechanism performs convolution processing on the bipartite graph to obtain a representation set, including: The bipartite graph is initialized to obtain initial user representations for each user and initial product representations for each product; wherein the initial user representation represents the attributes of the user and the initial product representation represents the attributes of the product. Based on the relational graph convolutional network, feature extraction processing is performed on the bipartite graph, each of the initial user representations, and each of the initial product representations to obtain user attribute representations for each user and product attribute representations for each product; wherein, the user attribute representations characterize the attribute features of the user, and the product attribute representations characterize the attribute features of the product. The user attribute representation and the product attribute representation are subjected to feature refinement processing to obtain the user-product pair representation.
7. The method according to claim 6, characterized in that, The bipartite graph is initialized to obtain initial user representations for each user and initial product representations for each product, including: The bipartite graph is initialized to obtain user feature vectors for each user and product feature vectors for each product; wherein, the user feature vectors represent the initial attributes of the users; and the product feature vectors represent the initial attributes of the products. The user feature vector and the product feature vector are subjected to linear transformation processing respectively to obtain the processed user feature vector and the processed product feature vector; The processed user feature vector and the processed product feature vector are activated to obtain the initial user representation and the initial product representation.
8. The method according to claim 6, characterized in that, The relational graph convolutional network includes at least one graph convolutional layer; based on the relational graph convolutional network, feature extraction processing is performed on the bipartite graph, each of the initial user representations, and each of the initial product representations to obtain user attribute representations for each user and product attribute representations for each product, including: Based on the multi-head attention mechanism of the graph convolutional layer, feature aggregation processing is performed on the bipartite graph, each of the initial user representations, and each of the initial product representations to obtain multiple user aggregate representations for each user and multiple product aggregate representations for each product; wherein, the user aggregate representation represents the aggregate attribute features of the user, and the product aggregate representation represents the aggregate attribute features of the product; The user's implicit representation is obtained by averaging multiple aggregated representations of the user; simultaneously, the product's implicit representation is obtained by averaging multiple aggregated representations of the product; wherein, the user implicit representation represents the implicit attribute features of the user, and the product implicit representation represents the implicit attribute features of the product. The user implicit representation and the product implicit representation are subjected to feature activation processing respectively to obtain the processed user implicit representation and the processed product implicit representation; Based on the user's implicit representation and the processed implicit representation, a user attribute representation for the user is generated; simultaneously, based on the product's implicit representation and the processed implicit representation, a product attribute representation for the product is generated.
9. The method according to claim 8, characterized in that, Based on the multi-head attention mechanism of the graph convolutional layer, feature aggregation processing is performed on the bipartite graph, each of the initial user representations, and each of the initial product representations to obtain multiple aggregated user representations and multiple aggregated product representations for each of the products, including: The bipartite graph is subjected to path random deactivation processing to obtain the processed bipartite graph; Based on the processed bipartite graph, at least one adjacent product of the user is determined from each of the products, and at least one adjacent user of the product is determined from each of the users; wherein, the adjacent product is the product that has interacted with the user; and the adjacent user is the user that has interacted with the product. Based on the multi-head attention mechanism of the graph convolutional layer, the user's initial representation and the initial representations of the products in each of the user's neighborhoods are aggregated to obtain multiple aggregated representations of the user; simultaneously, based on the multi-head attention mechanism of the graph convolutional layer, the product's initial representation and the initial representations of the products in each of the product's neighborhoods are aggregated to obtain multiple aggregated representations of the products.
10. The method according to claim 6, characterized in that, The user attribute representation and the product attribute representation are subjected to feature refinement processing to obtain the user-product pair representation, including: The user attribute representation of the user and the product attribute representation of the product are concatenated and transformed to obtain a first concatenated representation between the user and the product; wherein, the first concatenated representation represents the implicit joint attribute between the user and the product; The first concatenated representation is subjected to feature activation processing to obtain the user-item pair representation.
11. The method according to any one of claims 1-10, characterized in that, Based on the user-item pair representations and the structural features described above, a set of prediction information is generated, including: The user-item pair representation and the corresponding structural features are concatenated to obtain a second concatenated representation; wherein, the second concatenated representation represents the final association between the user and the item. Perform a fully connected computation on the second concatenated representation to obtain the prediction data corresponding to the user product pair representation.
12. A model training method for product recommendation, characterized in that, The method includes: Obtain a bipartite graph corresponding to at least one user to be trained and at least one item to be trained, and perform convolution processing on the bipartite graph based on the initial graph convolutional network to obtain a representation set; wherein, the bipartite graph represents the interaction between all users to be trained and items to be trained; the representation set includes at least one user-item pair representation; the user-item pair representation represents the joint attribute between each user to be trained and each item to be trained; The user-item pair distance corresponding to the user-item pair representation is determined, and the structural features corresponding to the user-item pair representation are determined based on the user-item pair distance and the bipartite graph; wherein, the user-item pair distance is the geodesic distance between the user to be trained and the item to be trained; the structural features characterize the local topological structure between the user to be trained and the item to be trained in the bipartite graph; Based on the user-item pair representations and the structural features, the initial graph convolutional network is trained to obtain an attention-based relational graph convolutional network; wherein, the attention-based relational graph convolutional network is used to process the bipartite graph according to any one of claims 1-11 to recommend items to the user.
13. The method according to claim 12, characterized in that, Based on the distance between the user and product pairs and the bipartite graph, the structural features corresponding to the user and product pairs are determined, including: The bipartite graph is subjected to path random deactivation processing to obtain the processed bipartite graph; Based on the distance between the user and the product pair and the processed bipartite graph, the edge structure features corresponding to the distance between the user and the product pair are determined; wherein, the edge structure features characterize the local edge structure between the user to be trained and the product to be trained in the bipartite graph. The edge structure features are refined to obtain the structural features.
14. The method according to claim 13, characterized in that, Based on the distance between the user and product pairs and the processed bipartite graph, determine the edge structure features corresponding to the distance between the user and product pairs, including: Based on the processed bipartite graph, a first quantity of the first set corresponding to the user-item pair distance is determined; wherein, the first quantity is the total number of first nodes included in the first set; the first node is other users or items to be trained whose geodesic distance to the user-item pair distance is equal to the user-item pair distance and whose geodesic distance to the item to be trained is equal to the user-item pair distance. Based on the processed bipartite graph, a second quantity of the second set corresponding to the user-item pair distance is determined; wherein, the second quantity is the total number of second nodes included in the second set; the second node is other users or items to be trained whose geodesic distance to the user to be trained corresponding to the user-item pair distance is equal to the user-item pair distance, and whose geodesic distance to the item to be trained corresponding to the user-item pair distance is greater than a preset threshold. Based on the processed bipartite graph, determine the third quantity of the third set corresponding to the user-item pair distance; wherein, the third quantity is the total number of third nodes included in the third set; the third node is other users or items to be trained whose geodesic distance to the user-item pair distance is equal to the user-item pair distance and whose geodesic distance to the user to be trained is greater than the preset threshold. Based on the first quantity, the second quantity, and the third quantity, the edge structure features corresponding to the distance between the user's product pairs are determined.
15. The method according to claim 14, characterized in that, Based on the processed bipartite graph, determine the first quantity of the first set corresponding to the distance of the user's product pair, including: Based on the processed bipartite graph, the user hop neighborhood and product hop neighborhood corresponding to the user-product pair distance are determined; wherein, the user hop neighborhood includes other users or products to be trained whose geodesic distance to the user to be trained corresponding to the user-product pair distance is less than or equal to the user-product pair distance; the product hop neighborhood includes other users or products to be trained whose geodesic distance to the product to be trained corresponding to the user-product pair distance is less than or equal to the user-product pair distance; The user hop neighborhood and the product hop neighborhood are subjected to probability approximation calculation to determine the first quantity of the first set corresponding to the distance between the user and the product.
16. The method according to any one of claims 13-15, characterized in that, The edge structure features are refined to obtain the structural features, including: The edge structure features are subjected to a linear transformation to obtain the processed edge structure features; The processed edge structure features are subjected to feature activation processing to obtain activated edge structure features; The activated edge structure features are randomly deactivated to obtain the structure features.
17. The method according to any one of claims 12-16, characterized in that, Based on the user-item pair representations and the structural features described, the initial graph convolutional network is trained to obtain an attention-based relational graph convolutional network, including: A prediction information set is generated based on each user-item pair representation and each structural feature; wherein, the prediction information set includes prediction data corresponding to each user-item pair representation; the prediction data represents the predicted degree of preference of the user to be trained for the item to be trained; Based on the predicted information set and the actual information set, the initial graph convolutional network is trained to obtain the relational graph convolutional network of the attention mechanism; wherein, the actual information set includes the actual data corresponding to each user-item pair; the actual data represents the actual user's preference for the training item.
18. The method according to claim 17, characterized in that, Based on the user-item pair representations and the structural features described above, a set of prediction information is generated, including: The user-item pair representation and the corresponding structural features are concatenated to obtain a second concatenated representation; wherein, the second concatenated representation represents the final association between the user to be trained and the item to be trained; Perform a fully connected computation on the second concatenated representation to obtain the prediction data corresponding to the user product pair representation.
19. The method according to claim 17, characterized in that, Based on the predicted information set and the actual information set, the initial graph convolutional network is trained to obtain the relational graph convolutional network with the attention mechanism, including: A first loss function is generated based on the predicted information set and the actual information set; The second loss function is obtained by performing adjacency scoring regularization on each weight parameter matrix in the initial graph convolutional network. The parameters to be learned in the initial graph convolutional network are regularized to obtain the third loss function; Based on the first loss function, the second loss function, and the third loss function, determine the joint loss function; Based on the joint loss function, the initial graph convolutional network is optimized to obtain the relational graph convolutional network with the attention mechanism.
20. The method according to any one of claims 12-19, characterized in that, Based on the initial graph convolutional network, the bipartite graph is convolved to obtain a representation set, including: The bipartite graph is initialized to obtain the initial user representation of each user to be trained and the initial product representation of each product to be trained; wherein the initial user representation represents the attributes of the user to be trained and the initial product representation represents the attributes of the product to be trained. Based on the initial graph convolutional network, feature extraction processing is performed on the bipartite graph, each of the initial user representations, and each of the initial product representations to obtain the user attribute representations of each user to be trained and the product attribute representations of each product to be trained; wherein, the user attribute representations represent the attribute features of the user to be trained, and the product attribute representations represent the attribute features of the product to be trained. The user attribute representation of the user to be trained and the product attribute representation of the product to be trained are subjected to feature refinement processing to obtain the user-product pair representation.
21. The method according to claim 20, characterized in that, The bipartite graph is initialized to obtain the initial user representation for each user to be trained and the initial product representation for each product to be trained, including: The bipartite graph is initialized to obtain the user feature vector of each user to be trained and the product feature vector of each product to be trained; wherein, the user feature vector represents the initial attributes of the user to be trained; and the product feature vector represents the initial attributes of the product to be trained. The user feature vector and the product feature vector are subjected to linear transformation processing respectively to obtain the processed user feature vector and the processed product feature vector; The processed user feature vector and the processed product feature vector are subjected to feature activation processing respectively to obtain activated user feature vector and activated product feature vector; The activated user feature vector and the activated product feature vector are randomly deactivated to obtain the initial user representation of the user to be trained and the initial product representation of the product to be trained.
22. The method according to claim 20, characterized in that, The initial graph convolutional network includes at least one graph convolutional layer; based on the initial graph convolutional network, feature extraction processing is performed on the bipartite graph, each of the initial user representations, and each of the initial product representations to obtain user attribute representations for each user to be trained and product attribute representations for each product to be trained, including: Based on the multi-head attention mechanism of the graph convolutional layer, feature aggregation processing is performed on the bipartite graph, each of the initial user representations, and each of the initial product representations to obtain multiple user aggregate representations for each user to be trained and multiple product aggregate representations for each product to be trained; wherein, the user aggregate representation represents the aggregate attribute features of the user to be trained, and the product aggregate representation represents the aggregate attribute features of the product to be trained. The user implicit representation of the user to be trained is obtained by averaging multiple aggregated representations of the user to be trained; at the same time, the product implicit representation of the product to be trained is obtained by averaging multiple aggregated representations of the product to be trained; wherein, the user implicit representation represents the implicit attribute features of the user to be trained, and the product implicit representation represents the implicit attribute features of the product to be trained. The user implicit representation and the product implicit representation are subjected to feature activation processing respectively to obtain the activated user implicit representation and the activated product implicit representation; The activated user implicit representation and the activated product implicit representation are randomly deactivated to obtain the processed user implicit representation and the processed product implicit representation. Based on the implicit representation of the user to be trained and the processed implicit representation of the user, a user attribute representation of the user to be trained is generated; simultaneously, based on the implicit representation of the product to be trained and the processed implicit representation of the product, a product attribute representation of the product to be trained is generated.
23. The method according to claim 22, characterized in that, Based on the multi-head attention mechanism of the graph convolutional layer, feature aggregation processing is performed on the bipartite graph, each of the initial user representations, and each of the initial product representations to obtain multiple aggregated user representations for each user to be trained and multiple aggregated product representations for each product to be trained, including: The bipartite graph is subjected to path random deactivation processing to obtain the processed bipartite graph; Based on the processed bipartite graph, at least one adjacent product of the user to be trained is determined from each of the products to be trained, and at least one adjacent user of the product to be trained is determined from each of the users to be trained; wherein, the adjacent product is the product to be trained that has interacted with the user to be trained; and the adjacent user is the user to be trained that has interacted with the product to be trained. Based on the multi-head attention mechanism of the graph convolutional layer, the initial user representation of the user to be trained and the initial product representations of each neighboring product of the user to be trained are aggregated to obtain multiple aggregated user representations of the user to be trained; at the same time, based on the multi-head attention mechanism of the graph convolutional layer, the initial product representation of the product to be trained and the initial user representations of each neighboring user of the product to be trained are aggregated to obtain multiple aggregated product representations of the product to be trained.
24. The method according to any one of claims 20-23, characterized in that, The user attribute representation of the user to be trained and the product attribute representation of the product to be trained are subjected to feature refinement processing to obtain the user-product pair representation, including: The user attribute representation of the user to be trained and the product attribute representation of the product to be trained are concatenated and transformed to obtain a first concatenated representation between the user to be trained and the product to be trained; wherein, the first concatenated representation represents the implicit joint attribute between the user and the product; The first concatenated representation is subjected to feature activation processing to obtain the activated first concatenated representation; The first concatenated representation is randomly deactivated to obtain the user-item pair representation.
25. A product recommendation device, characterized in that, include: The processing module is used to obtain a bipartite graph corresponding to at least one user and at least one item, and to perform convolution processing on the bipartite graph based on an attention-based relational graph convolutional network to obtain a representation set; wherein, the bipartite graph represents the interaction between all users and items; the representation set includes at least one user-item pair representation; the user-item pair representation represents the joint attribute between each user and each item; The determination module is used to determine the user-item pair distance corresponding to the user-item pair representation, and to determine the structural features corresponding to the user-item pair representation based on the user-item pair distance and the bipartite graph; wherein, the user-item pair distance is the geodesic distance between the user and the item; and the structural features characterize the local topological structure between the user and the item in the bipartite graph. The prediction module is used to generate a prediction information set based on each user-item pair representation and each structural feature; wherein the prediction information set includes prediction data corresponding to each user-item pair representation; the prediction data represents the predicted user's preference for the item; The recommendation module is used to recommend products to the user based on the predicted information set.
26. A model training device for product recommendation, characterized in that, include: The processing module is used to obtain a bipartite graph corresponding to at least one user to be trained and at least one item to be trained, and to perform convolution processing on the bipartite graph based on the initial graph convolutional network to obtain a representation set; wherein, the bipartite graph represents the interaction between all users to be trained and items to be trained; the representation set includes at least one user-item pair representation; the user-item pair representation represents the joint attribute between each user to be trained and each item to be trained; The determination module is used to determine the user-item pair distance corresponding to the user-item pair representation, and to determine the structural features corresponding to the user-item pair representation based on the user-item pair distance and the bipartite graph; wherein, the user-item pair distance is the geodesic distance between the user to be trained and the item to be trained; the structural features characterize the local topological structure between the user to be trained and the item to be trained in the bipartite graph; The training module is used to train the initial graph convolutional network based on the user-item pair representations and the structural features to obtain an attention-based relational graph convolutional network; wherein the attention-based relational graph convolutional network is used to process the bipartite graph of claim 25 to recommend items to the user.
27. A computing device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-11 or the method as described in any one of claims 12-24.
28. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-11 or the method as described in any one of claims 12-24.
29. A computer program product comprising a computer program that, when executed by a processor, implements the method as claimed in any one of claims 1-11 or the method as claimed in any one of claims 12-24.
Citation Information
Patent Citations
Commodity prediction method fusing commodity association relationship
CN114997476A
E-commerce network commodity recommendation method and system
CN115170227A
User preference prediction method based on pairing method and graph convolutional neural network
CN115271173A
Commodity recommendation method, model training method, device and equipment
CN118279017A
Commodity recommendation method, model training method, device and equipment
CN118691377A