Basket recommendation method and system based on graph contrastive learning and personalized graph prompt

Through LightGCL pre-training and weighted graph hint mechanism, combined with graph convolutional network and singular value decomposition, the robustness and generalization problems of graph contrastive learning in recommendation system are solved, and personalized and efficient shopping cart recommendations are achieved.

CN120146951BActive Publication Date: 2025-10-17SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510216553.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-10-17
Estimated Expiration
2045-02-26

AI Technical Summary

Technical Problem

Existing graph contrastive learning methods are susceptible to noise in recommendation systems, lack robustness and generalization capabilities, and the over-smoothing problem limits the performance of shopping basket recommendations.

Method used

LightGCL is used for pre-training, and a weighted graph prompt mechanism is used to generate embedded representations of the main view and the global view through a graph convolutional network. The global collaborative relationship is extracted by combining singular value decomposition, and a graph prompt vector is constructed by fusing the graph prompt mechanism with a multi-layer perceptron. The gated recursive unit is used to hierarchically obtain the user's dynamic interests.

Benefits of technology

It significantly improves the robustness and generalization ability of the model, enhances the accuracy and transparency of personalized recommendations, reduces the risk of overfitting, and improves the stability and interpretability of the recommendation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120146951B_ABST
    Figure CN120146951B_ABST
Patent Text Reader

Abstract

The application discloses a shopping basket recommendation method and system based on graph contrast learning and personalized graph prompts, pre-trains embedding representations of shopping baskets and commodities through a graph contrast learning framework to capture global collaborative relationships and semantic information. Meanwhile, a graph prompt mechanism is introduced to combine historical interaction data of users with graph structure information to generate multi-level prompt embeddings suitable for personalized recommendation. Through the pre-training of the graph contrast learning and the fusion of the graph prompt, the adaptability and expression ability of the shopping basket-commodity embedding representations are improved, thereby effectively improving the accuracy and robustness of the next shopping basket recommendation.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of personalized recommendation, more particularly, to a shopping basket recommendation method and system based on graph contrastive learning and personalized graph prompt. BACKGROUND

[0002] In the field of recommendation systems, graph contrastive learning (GCL) has been widely applied to capture complex user and item relationships and significantly improve recommendation results. Traditional GCL methods rely on random augmentation (such as node or edge perturbation) or heuristic augmentation (such as user clustering) to generate different contrast views.

[0003] However, these methods often destroy the semantic structure of the graph during the contrast process, leading to the model being easily affected by noise and limiting the robustness and generalization ability of the model. In addition, GNN-based contrast recommendation methods are often limited by the over-smoothing problem, making the learned representation not discriminative enough. Therefore, how to solve the generality and robustness problem of the recommendation system based on graph contrastive learning and improve the performance of the shopping basket recommendation task is a problem that needs to be solved. SUMMARY

[0004] To solve the above technical problems, the present application provides a shopping basket recommendation method and system based on graph contrastive learning and personalized graph prompt, which pre-trains through LightGCL and directly improves the downstream recommendation effect by using a weighted graph prompt mechanism, effectively solving the generality and robustness problem of the recommendation system based on graph contrastive learning, and bringing significant performance improvement for the shopping basket recommendation task.

[0005] The first aspect of the present application provides a shopping basket recommendation method based on graph contrastive learning and personalized graph prompt, comprising:

[0006] Obtain enterprise transaction data, initialize the embedding representation of the shopping basket and the goods after data preprocessing, and construct a shopping basket-goods frequency interaction graph;

[0007] Generate the main view shopping basket-goods embedding representation using a graph convolution network, and extract the global collaborative relationship using singular value decomposition to generate the globally enhanced global view shopping basket-goods embedding representation;

[0008] Construct a graph contrastive learning pre-training framework, and enhance the main view shopping basket-goods embedding representation and the global view shopping basket-goods embedding representation through the graph contrastive learning pre-training framework;

[0009] Encode the user historical interaction data into shopping basket-level and goods-level prompt embeddings using a graph prompt mechanism, and construct a graph prompt vector using a multi-layer perception fusion;

[0010] obtain enhanced embedding of commodity and shopping basket sequence of fusion graph prompt vector, obtain representation of user dynamic interest at commodity and shopping basket level through hierarchical gating recurrent unit, infer appearance probability of commodity in next shopping basket, and obtain recommended commodity in next shopping basket.

[0011] In the scheme, enterprise transaction data is obtained, and after data preprocessing, embedding representations of shopping baskets and commodities are initialized, and a shopping basket-commodity frequency interaction graph is constructed. Specifically,

[0012] The enterprise transaction data is obtained for data cleaning, format conversion and standardization operation, after the data preprocessing is completed, the commodity set is defined as I = {i1, i2, …, i |J|}, |J| represents the total number of commodities, the user set is defined as U = {u1, u2, …, u |U|}, |U| represents the total number of users, and the shopping basket set |K| represents the total number of shopping baskets.

[0013] Initialize all shopping basket embedding representations E (b) and commodity embedding representations E (i) Collect the user's historical interaction data, including the shopping basket set and the commodity set I, and count the number of commodities contained in each shopping basket and the number of appearances of the shopping basket.

[0014] According to the historical interaction data, a shopping basket-commodity frequency interaction graph is constructed, the shopping basket set and the commodity set I are taken as two parts of nodes, the edge structure is set according to the association between the shopping basket and the commodity, and the weight of the edge structure is set by using the number of appearances of the shopping basket in the historical interaction data.

[0015] Based on the constructed shopping basket-commodity frequency interaction graph, a shopping basket-commodity frequency adjacency matrix is constructed, and the frequency adjacency matrix A is normalized to obtain the normalized adjacency matrix R K×J represents a real number space of KxJ, K represents a shopping basket, and J represents a commodity.

[0016] In the scheme, a graph convolution network is used to generate a main view shopping basket-commodity embedding representation, specifically:

[0017] The graph convolution network is used to learn the shopping basket-commodity frequency interaction graph, to obtain initial shopping basket embedding representations E (b) and commodity embedding representations E (i) In the graph convolution network, the neighbor information of each shopping basket k or commodity j is aggregated through matrix multiplication, and the main view embedding representation of the shopping basket at the lth layer is output through an activation function. and the main view embedding representation of the commodity

[0018] The final embedding vector of the shopping basket is generated according to the sum of the embedding vectors of all layers in the graph convolution network and the final embedding vector of the commodity j The final embedding vector of the shopping basket is generated according to the sum of the embedding vectors of all layers in the graph convolution network and the final embedding vector of the commodity j The inner product of the embedding of the shopping basket and the commodity is calculated to obtain the predicted relevance between the shopping basket and the commodity

[0019] In the scheme, the global collaborative relationship is extracted by singular value decomposition to generate a globally enhanced global view shopping basket-commodity embedding representation, specifically:

[0020] The normalized adjacency matrix is decomposed by singular value decomposition to obtain the singular value list of the adjacency matrix The number threshold q is preset, the singular value list is truncated by using the number threshold q, the first q singular values in the singular value list are retained, and the normalized adjacency matrix is reconstructed by using the retained singular values to obtain the reconstructed adjacency matrix

[0021] According to the reconstructed adjacency matrix Message propagation is performed to obtain the global view embedding representation of the shopping basket globally enhanced by singular value decomposition in the lth layer of the graph convolution network and the global view embedding representation of the commodity

[0022] In the scheme, the main view shopping basket-commodity embedding representation and the global view shopping basket-commodity embedding representation are enhanced by the graph contrastive learning pre-training framework, specifically:

[0023] The similarity between the main view shopping basket-commodity embedding representation and the global view shopping basket-commodity embedding representation is constructed by contrastive loss, and a graph contrastive learning pre-training framework for a recommendation task is constructed by combining contrastive loss and a regularization term, and the corresponding loss function L is represented as:

[0024]

[0025] Wherein L con represents the contrastive loss, represents the contrastive loss of the shopping basket node, represents the contrastive loss of the commodity node, represents the regularization term, and λ1 and λ2 represent learnable parameters;

[0026] The contrast loss is calculated based on the predicted relevance between the shopping basket and the commodity, and the predicted score of the commodity in the shopping basket is encouraged to give a high predicted score to the positive item and a low predicted score to the negative item.

[0027] The contrast loss of the shopping basket node and the contrast loss of the commodity node measure the similarity between the main view shopping basket-commodity embedding representation and the global view shopping basket-commodity embedding representation based on the InfoNCE loss function, and compare the similarity with the global view embedding representation of other shopping basket nodes or commodity nodes.

[0028] In the scheme, the shopping basket-commodity frequency interaction graph construction graph prompt module encodes the user historical interaction data into a shopping basket level and commodity level prompt embedding, and constructs a multi-layer perception fusion graph prompt vector, specifically:

[0029] The normalized adjacency matrix of the shopping basket-commodity frequency interaction graph Map to the embedding space of the shopping basket and the commodity through the MLP to construct the shopping basket level prompt vector P B And the commodity level prompt vector P I , expressed as:

[0030]

[0031]

[0032] Where, P I ∈R J×d represents the prompt vector mapped to the commodity level, J represents the number of all commodities, P B ∈R K×d represents the prompt vector mapped to the shopping basket level, K represents the number of all shopping baskets; represents the normalized adjacency matrix of the shopping basket and commodity interaction frequency, And And represents the weight matrix of two linear transformations, d h is the hidden embedding dimension, d represents the target prompt embedding dimension, And And represents the bias term, and σ represents the nonlinear activation function ReLU;

[0033] Define the historical interaction shopping basket sequence of each user u |S u |represents the length of the historical interaction shopping basket sequence of user u, and the commodity expansion sequence is defined as For the commodity expansion sequence S (u ,I) The embedding is expressed as:

[0034]

[0035] wherein E (u,I) represents a set of commodity sequence embedding representations of user historical interactions, represents a commodity embedding representation of a user at time t in a commodity-level interaction sequence, |S (u,I) | represents the number of commodities interacted by the user;

[0036] The commodity extended sequence S (u,I) is embedded to represent E (u,I) After encoding by the gating recurrent unit, the dynamic interest hidden state of the user is generated:

[0037] H (u,I) =GRU(E (u,I) )

[0038] The dynamic interest hidden state of the user extracted by the gating recurrent unit is represented, and the hidden state H (u,I) of the user historical commodity interaction is respectively performed with the inner product operation of the two different level graph information prompt vectors P I and P B to generate the commodity-level prompt embedding S I and the shopping basket-level prompt embedding S B ;

[0039] The commodity-level prompt embedding S I and the shopping basket-level prompt embedding S B are nonlinearly transformed and compressed by a multilayer perception, and finally the graph prompt vector of the user is generated by addition fusion

[0040] In the scheme, the enhanced embedding of the commodity and shopping basket sequence of the fusion graph prompt information is obtained, specifically:

[0041] The commodity-level interaction sequence embedding E (u,I) and the shopping basket-level interaction sequence embedding E (u,B) of the user are defined, the commodity embedding in the commodity-level interaction sequence and the shopping basket embedding in the shopping basket-level interaction sequence are added with the graph prompt vector to obtain the enhanced commodity embedding and the shopping basket embedding After integration, the enhanced embedding of the commodity and shopping basket sequence of the fusion graph prompt vector is generated and

[0042] In the scheme, the dynamic interest of the user at the commodity and basket level is obtained through the gated recurrent unit, the appearance probability of the commodity in the next basket is inferred, and the recommended commodity in the next basket is obtained, specifically:

[0043] The gated recurrent unit is used to encode the basket sequence of the user Step-by-step encoding, for each time step t, the gated recurrent unit encodes the basket sequence level and the user sequence level, and the update representation is:

[0044]

[0045]

[0046] Wherein represents the enhanced embedding representation of the tth basket and the tth commodity, represents the historical interaction information encoding of the tth basket and the tth commodity, represents the historical interaction information encoding of the t+1th basket and the t+1th commodity;

[0047] The final representation s of the basket level is obtained through the recursive encoding of the gated recurrent unit (u,B) And the final representation s of the commodity level (u,I) ;

[0048] The embedding representation e of the commodity i is obtained through the graph contrastive learning pre-training framework i The relevance score of the commodity i at the basket level is calculated using the final representation s of the basket level (u,B) And the embedding representation e of the commodity i i

[0049] The relevance score of the commodity i at the commodity level is calculated using the final representation s of the commodity level (u,I) And the embedding representation e of the commodity i i

[0050] The relevance scores at the basket level and the commodity level are added, and the sigmoid function is used to map them to the probability range of [0, 1], and the probability of the commodity i appearing in the next basket is obtained

[0051] ​​The second part of the application provides a shopping basket recommendation system based on graph contrast learning and personalized graph prompts, which comprises an enterprise transaction data acquisition module, a shopping basket-item frequency interaction graph construction module, a singular value decomposition-pretrained contrast enhanced representation module, a graph prompt construction module, a shopping basket-item embedding representation fusion module, a next shopping basket prediction module and a prediction result output module.

[0052] The enterprise transaction data acquisition module acquires and pre-processes user transaction data.

[0053] The shopping basket-item frequency interaction graph construction module constructs a shopping basket-item frequency interaction graph according to the interaction frequency between the shopping basket and the item read from the user's historical interaction data.

[0054] The singular value decomposition-pretrained contrast enhanced representation module generates a main view shopping basket-item embedding representation through a graph convolution network, and then further enhances and generates a global view shopping basket-item embedding representation by singular value decomposition; the embedding representations of the two different views are compared and learned to enhance the main view shopping basket-item embedding representation and the global view shopping basket-item embedding representation.

[0055] The graph prompt construction module encodes the user's historical interaction data into shopping basket-level and item-level prompt embeddings by using graph prompt generation, and constructs a graph prompt vector by using a multi-layer perceptron fusion.

[0056] The shopping basket-item embedding representation fusion module fuses the graph prompt vector with the pre-trained shopping basket-item embedding representation, performs linear transformation through trainable weights and biases, and applies an activation function for nonlinear processing; the fused representation is further compressed and optimized by a multi-layer perceptron to obtain the shopping basket and item representation embedding of the fused graph prompt vector.

[0057] The next shopping basket prediction module calculates the relevance score of item i at the shopping basket level and the item level according to the shopping basket and item representation embedding of the fused graph prompt vector, fuses the probabilities of the two levels, and obtains the final probability of the occurrence of item i in the next shopping basket.

[0058] The prediction result output module obtains the recommended items in the next shopping basket according to the final probability of the occurrence of the items in the next shopping basket.

[0059] Compared with the prior art, the application has the following beneficial effects:

[0060] (1) The present application significantly enhances the generalization ability and robustness of the model by introducing singular value decomposition (SVD) technology in the graph contrastive learning pre-training stage. SVD technology can effectively capture the global structural relationship of the graph. Compared with the traditional random perturbation method, the present application performs fine processing on the graph structure during the contrastive learning process, avoiding the loss of useful information. This fine processing enables the model to adapt more flexibly and maintain good performance when facing different data sets or user behavior patterns, effectively reducing the risk of overfitting. Therefore, the SVD-based graph contrastive learning pre-training not only improves the learning efficiency of the model, but also significantly enhances the stability and reliability of the model in practical applications.

[0061] (2) The present application innovatively adopts a graph prompting mechanism, which dynamically adjusts the relationship between nodes by constructing a weighted graph, thereby enhancing the model's ability to capture user behavior and resist noisy data. This mechanism not only improves the reliability and accuracy of the recommendation results, but also significantly enhances the model's personalized recommendation ability. Through the shopping basket-item weighted graph, the model can capture the preference relationship of users in the purchase process more meticulously, providing more accurate and personalized recommendation services for users. At the same time, the graph prompting mechanism also improves the model's interpretability, allowing researchers and application developers to more clearly understand the basis for model recommendations through visualized weighted graphs, enhancing users' trust and satisfaction with the recommendation results. This advantage makes the present application have higher transparency and credibility in practical applications, helping to improve user experience and conversion rate. BRIEF DESCRIPTION OF DRAWINGS

[0062] In order to more clearly illustrate the technical solutions in the embodiments or examples of the present application, the following will briefly introduce the drawings needed to be used in the embodiment or example description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.

[0063] Figure 1 A flowchart of a shopping basket recommendation method based on graph contrastive learning and personalized graph prompting is shown;

[0064] Figure 2 A framework flowchart of a shopping basket recommendation method is shown;

[0065] Figure 3 A block diagram of a shopping basket recommendation system based on graph contrastive learning and personalized graph prompting is shown. DETAILED DESCRIPTION

[0066] In order to enable a more clear understanding of the above-mentioned purposes, features and advantages of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0067] In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present application, however, the present application can also be implemented in other manners different from those described herein, and therefore, the protection scope of the present application is not limited by the specific embodiments disclosed below.

[0068] Figure 1 、 2 The flowchart and flow framework of the shopping basket recommendation method based on graph contrast learning and personalized graph prompt are shown.

[0069] As shown in Figure 1 , the embodiment provides a shopping basket recommendation method based on graph contrast learning and personalized graph prompt, comprising:

[0070] S102, acquiring enterprise transaction data, initializing shopping basket and commodity embedding representations after data preprocessing, and constructing a shopping basket-commodity frequency interaction graph;

[0071] S104, generating a main view shopping basket-commodity embedding representation using a graph convolution network, and combining singular value decomposition to extract global collaborative relationships and generate a globally enhanced global view shopping basket-commodity embedding representation;

[0072] S106, constructing a graph contrast learning pre-training framework, and enhancing the main view shopping basket-commodity embedding representation and the global view shopping basket-commodity embedding representation through the graph contrast learning pre-training framework;

[0073] S108, using a graph prompt mechanism to encode user historical interaction data into shopping basket-level and commodity-level prompt embeddings, and using a multi-layer perception mechanism to fuse and construct a graph prompt vector;

[0074] S110, acquiring enhanced embeddings of commodity and shopping basket sequences fused with the graph prompt vector, obtaining representations of user dynamic interest at commodity and shopping basket levels through a gated recurrent unit, inferring the appearance probability of commodities in the next shopping basket, and acquiring recommended commodities in the next shopping basket.

[0075] It is necessary to note that the transaction data of the enterprise is acquired for data cleaning, format conversion and standardization operation to ensure the integrity and consistency of the shopping basket and commodity information. The data cleaning process filters out missing values, illegal data and repeated transaction records. At the same time, we convert all timestamps and text information into a unified format to lay the foundation for subsequent analysis. After data preprocessing is completed, we initialize the embedding representation of the shopping basket and commodity, and prepare for the training of the model. After data preprocessing is completed, define the commodity set as I = {i1, i2, …, i |J|}, |J| represents the total number of commodities, define the user set as U = {u1, u2, …, u |U|}, |U| represents the total number of users, and define the shopping basket set |K| represents the total number of shopping baskets.

[0076] Each shopping basket is composed of commodities interacted by a user within a certain time period, where |b| represents the number of commodities in the shopping basket, and this number can be different for different shopping baskets. The commodities are all from the commodity set I = {i1, i2, …, i |J|}. Define the shopping basket set where |K| represents the total number of shopping baskets. For each user u ∈ U, its historical interaction can be represented as a shopping basket sequence where |S u | represents the length of the shopping basket sequence of user u.

[0077] In the task of the recommendation system, for each user the goal is to infer which commodities will be included in its next shopping basket based on its shopping basket sequence , where the size (i.e., the number of included commodities) is unknown but can be estimated based on historical data or specific rules. Initialize all shopping basket embedding representations E (b) ∈ R K×d and commodity embedding representations E (i) ∈ R J×d , where K represents the number of all shopping baskets, J represents the number of all commodities, and d represents the dimension of the embedding representation.

[0078] Collect the historical interaction data of the user, including the shopping basket set and the commodity set I, count the commodities included in each shopping basket and the number of occurrences of the shopping basket; define the node set where the shopping basket set and the commodity set I are the two parts of the nodes; define the edge set which represents the association relationship between the shopping basket and the commodity. For each shopping basket Traverse all the products i∈I it contains and add an edge (b,i) from the shopping basket node b to the product node i. Build a shopping basket-product frequency interaction graph based on historical interaction data, and combine the shopping basket set The shopping basket and the product set I are used as two nodes. The edge structure is set according to the association between the shopping basket and the product, and the weight of the edge structure is set using the number of appearances of the shopping basket in the historical interaction data, which reflects the strength of the relationship between the shopping basket and the product. Based on the constructed shopping basket-product frequency interaction graph, a shopping basket-product frequency adjacency matrix is ​​constructed. The rows of the matrix represent shopping basket nodes and the columns represent product nodes. The frequency adjacency matrix A is normalized to obtain the normalized adjacency matrix R K×J represents a K × J real number space, where K represents the shopping basket and J represents the product. The purpose of normalization is to eliminate the differences in frequency dimensions between different shopping baskets or products, making the elements in the matrix more comparable.

[0079] It should be noted that the graph convolutional network is used to learn the shopping basket-product frequency interaction graph to obtain the initial shopping basket embedding representation E (b) and product embedding representation E (i) In the graph convolutional network, the neighbor information of each shopping basket k or product j is aggregated through matrix multiplication, and the main view embedding representation of the shopping basket in the lth layer is output through the activation function (identity function) and the main view embedding representation of the product Expressed as:

[0080]

[0081]

[0082] in, represents the kth row of the normalized adjacency matrix, i.e., the association weight between shopping basket k and all products, represents the embedding matrix of all products in the l-1th layer through matrix multiplication, and p(·) represents the function of edge discarding in the adjacency matrix; represents the j-th column of the normalized adjacency matrix, that is, the association weight between product j and all shopping baskets. Represents the embedding matrix of all shopping baskets in the l-1th layer.

[0083] Generate the final embedding vector of shopping basket k based on the sum of embedding vectors of all layers in the graph convolutional network and the final embedding vector of product j Expressed as:

[0084]

[0085] in, representing the main view embedding representation of the basket k, representing the main view embedding representation of the item j, d represents the embedding representation dimension, l = 0 represents the original embedding vector (i.e. E (b) and E (i) ).

[0086] According to the final embedding vector of the basket and the final embedding vector of the item j , the embedding inner product of the basket and the item is calculated to obtain the predicted relevance between the basket and the item The predicted relevance reflects the matching degree of the item and the basket in the embedding space.

[0087] It should be noted that singular value decomposition is a matrix decomposition method, which decomposes a matrix into the product of three matrices: an orthogonal matrix, a diagonal matrix (containing singular values) and the transpose of another orthogonal matrix. The normalized adjacency matrix is decomposed by singular value decomposition, and is expressed as:

[0088]

[0089] where U ∈ R K×K and V ∈ R J×J represent an orthogonal matrix, S ∈ R K×J represents a diagonal matrix containing singular values.

[0090] In order to reduce the computational complexity and storage requirements, the singular value list of the adjacency matrix is obtained, a preset number threshold q is obtained, the singular value list is truncated by using the number threshold q, the first q singular values in the singular value list are retained, and the reconstructed adjacency matrix is obtained by using the retained singular values. is expressed as:

[0091]

[0092]

[0093] where respectively contains the first q columns of U and V, and the diagonal matrix containing the first q largest singular values.

[0094] By using SVD to process the normalized adjacency matrix, important cooperative relationships in the interaction between the basket and the item are extracted, and an SVD enhanced view is constructed according to the reconstructed adjacency matrix Perform message propagation to obtain the global view embedding representation of the singular value decomposition globally enhanced shopping basket in the lth layer graph convolutional network and the global view embedding representation of the commodity is expressed as:

[0095]

[0096]

[0097] wherein represents the updated SVD enhanced view embedding representation of the shopping basket node k in the lth layer graph convolutional network; and σ represents an activation function. represents the kth row of the reconstructed shopping basket-commodity relationship matrix The matrix is obtained by singular value decomposition (SVD) and is used to represent the connection strength between the shopping basket node and the commodity node, represents the set of embedding representations of all commodity nodes in the l-1th layer graph neural network. represents the updated SVD enhanced view embedding representation of the commodity node j in the lth layer graph neural network, which is the jth column of the reconstructed shopping basket-commodity relationship matrix . represents the set of embedding representations of all shopping basket nodes in the l-1th layer graph neural network.

[0098] It should be noted that the contrast loss is constructed by comparing the similarity between the main view shopping basket-commodity embedding representation and the global view shopping basket-commodity embedding representation, the similarity between the main view shopping basket-commodity embedding representation and the global view shopping basket-commodity embedding representation is measured based on the InfoNCE loss function, and the similarity is compared with the global view embedding representation of other shopping basket nodes or commodity nodes, wherein the contrast loss of the shopping basket node is represented as:

[0099]

[0100] wherein s(·) and τ represent cosine similarity and temperature parameter respectively, represents the main view embedding representation of the shopping basket node k in the lth layer graph convolutional network, represents the global view embedding of the shopping basket node k in the lth layer graph convolutional network, K represents the total number of shopping basket nodes, and L represents the total number of layers of the graph convolutional network. Similarly, the contrast loss of the commodity node is constructed

[0101] The contrast loss L con is defined, which encourages the model to give high prediction scores to positive items (commodities in the shopping basket) and low prediction scores to negative items (commodities not in the shopping basket), which is represented as:

[0102]

[0103] wherein denotes the predicted relevance score of positive items (items in the basket) of basket k, denotes the predicted relevance score of negative items (items not in the basket) of basket k, K denotes the number of all baskets, and S denotes the number of positive-negative pairs of each basket.

[0104] Meanwhile, a graph contrastive learning pre-training framework for the recommendation task is constructed by combining the contrastive loss and the regularization term, and the corresponding loss function L is represented as:

[0105]

[0106] wherein L con denotes the contrastive loss, denotes the contrastive loss of the basket node, denotes the contrastive loss of the item node, denotes the regularization term, and λ1 and λ2 denote learnable parameters.

[0107] The main view embedding captures the historical basket-item interaction information of the user, and the global view embedding based on SVD fuses the global structural features of the data. By constructing a contrastive learning objective between the two views, the joint understanding of local and global information by the model is strengthened. The regularization term in the framework further helps to control the model complexity, prevent overfitting, and improve the generalization ability of the embedding representation. Overall, the pre-training framework not only improves the matching accuracy between baskets and items, but also enhances the robustness and interpretability of the model in the recommendation task.

[0108] It should be noted that the adjacency matrix of the normalized basket-item frequency interaction graph is mapped to the embedding space of the basket and the item through the MLP to construct the basket-level prompt vector P B and the item-level prompt vector P I , which is represented as:

[0109]

[0110]

[0111] wherein P I ∈R J×d denotes the prompt vector mapped to the item level, J denotes the number of all items, and P B ∈R K×d denotes the prompt vector mapped to the basket level, and K denotes the number of all baskets. a normalized adjacency matrix representing the shopping basket and item interaction frequency, and and is a weight matrix representing a two-layer linear transformation, d h is a hidden embedding dimension, d represents a target prompt embedding dimension, and and is a bias term, and σ represents a nonlinear activation function ReLU;

[0112] Define the historical interaction shopping basket sequence of each user u |S u | represents the length of the historical interaction shopping basket sequence of user u, and simultaneously define the commodity expansion sequence The commodities in each shopping basket have no strict time sequence, which is different from the sequence in commodity-level recommendation. For convenience of description, it is set that the length of a user's interaction shopping basket sequence is |S u |, and the length of the user's interaction commodity sequence is |S (u,I) |.

[0113] For the commodity expansion sequence S (u,I) of the user, the embedding representation is:

[0114]

[0115] where E (u,I) represents a set of user historical interaction commodity sequence embedding representations, represents the commodity embedding representation of the user at time t in the commodity-level interaction sequence, and |S (u,I) | represents the number of commodities interacted by the user; the embedding representation E (u,I) of the commodity expansion sequence S (u,I) is encoded through a gated recurrent unit to generate the dynamic interest hidden state of the user:

[0116] H (u,I) = GRU(E (u,I) )

[0117] represents the dynamic interest hidden state of the user extracted by the gated recurrent unit.

[0118] In order to fuse the information of shopping basket and commodity interaction frequency, and enhance the graph semantic expression ability of prompt embedding, we designed a prompt generation process based on inner product. The hidden state H (u,I) of the user's historical commodity interaction and the two different level graph information prompt vectors P I and P B are respectively subjected to inner product operation to generate commodity-level prompt embedding S Iand basket-level prompt embedding S B The two-level prompt embeddings not only fuse the user's interaction history, but also contain more semantic information related to the graph structure, represented as:

[0119]

[0120]

[0121] wherein represents the product-level prompt embedding, represents the basket-level embedding, K represents the number of all baskets, J represents the number of all products, and |S (u,I) | represents the length of the user's historical interaction product sequence.

[0122] In the process of constructing the graph prompt vector, the two-level prompt embeddings (product-level prompt and basket-level prompt) need to be reduced in dimension. Through a multi-layer perceptron, the product-level prompt embedding S I and the basket-level prompt embedding S B are nonlinearly transformed and compressed, represented as:

[0123]

[0124]

[0125] wherein represents the reduced product-level prompt embedding, |S (u,I) | represents the number of products in the user's historical interaction product sequence, and represent two layers of weight matrices for product prompt embedding compression, wherein d h represents the hidden layer embedding, d represents the target prompt compressed embedding, and σ(·) represents the ReLU activation function, and represent the bias terms of the product prompt embedding, represents the reduced basket-level prompt embedding, and represent two layers of weight matrices for basket prompt embedding compression, and represent the bias terms of the basket prompt embedding.

[0126] The reduced product-level and basket-level prompt embeddings are added to obtain a new fused prompt embedding, represented as:

[0127]

[0128] wherein, represents the final prompt embedding that combines the item-level and basket-level prompt information. This embedding vector contains both the user's interaction information at the item level and the frequency information at the basket level;

[0129] The row vectors of all prompt embeddings are summed to obtain the graph prompt vector of the user is represented as:

[0130]

[0131] wherein, represents the tthrow vector in the prompt embedding P u Finally, represents the graph prompt vector of the user constructed to capture the dynamic interaction features and semantic information of the user.

[0132] It should be noted that by adding the graph prompt vector to the user's item and basket sequence embedding representation, an enhanced embedding is constructed. This process aims to capture the user's behavior patterns and further improve the understanding of the user's interest. By adding each item embedding that the user has interacted with to the graph prompt information, a new item embedding representation is obtained.

[0133] The item-level interaction sequence embedding E (u,I) and the basket-level interaction sequence embedding E (u,B) of the user are defined and represented as:

[0134]

[0135]

[0136] wherein, represents the embedding vector of the tthitem in the item sequence of the user u, represents the embedding vector of the tthbasket in the basket sequence of the user, and d represents the dimension;

[0137] The item embedding in the item-level interaction sequence and the basket embedding in the basket-level interaction sequence are added to the graph prompt vector respectively to obtain the enhanced item embedding and the basket embedding is represented as:

[0138]

[0139]

[0140] The integrated enhanced embedding of the item and basket sequence of the fusion graph prompt vector is generated and Capturing the user's overall behavior pattern and enhancing the model's understanding of user interests by adding it to the embedding of products and shopping carts.

[0141] It's important to note that a hierarchical prediction scheme is introduced to model historical user interactions for efficient personalized recommendations. This scheme not only captures user interactions at the shopping basket level over different time periods, but also deeply mines item-level information within the shopping basket, thereby comprehensively describing the dynamic evolution of users' interests. The core model employed is the Gated Recurrent Unit (GRU), which encodes information at both the shopping basket and item levels, improving its ability to model complex behavioral sequences.

[0142] Use gated recurrent units to analyze the user's shopping cart sequence Perform step-by-step encoding. For each time step t, the encoding update of the gated recurrent unit at the shopping basket sequence level and the user sequence level is expressed as:

[0143]

[0144]

[0145] in represents the enhanced embedding representation of the t-th shopping basket and the t-th product, Represents the historical interaction information encoding of the t-th shopping basket and the t-th product, represents the historical interaction information encoding of the t+1th shopping basket and the t+1th item, and d represents the dimension of the hidden state of GRU.

[0146] The final representation s at the shopping basket level is obtained through recursive encoding of gated recurrent units (u,B) and the final representation of product level (u,I) , s (u,B) It encodes users’ dynamic interests at the shopping basket level, such as seasonal preferences or shopping habits in a specific time period. (u,I) It encodes users’ fine-grained interests at the item level, such as their detailed preferences for specific items.

[0147] Obtain the embedding representation e of product i through the graph comparison learning pre-training framework i , using the final representation s at the shopping basket level (u,B) and the embedding representation e of product i i , calculate the relevance score of product i at the shopping basket level This score represents the similarity between item i and the user’s historical preferences at the shopping basket level, reflecting the user’s preference for the item based on the user’s dynamic interest in the overall shopping basket;

[0148] Utilizing commodity-level final representation s (u,I) and the embedding representation e i of commodity i, the relevance score of commodity i at commodity level is calculated This score reflects the user's preference at the commodity level, which is calculated by capturing the user's fine-grained interest in specific items;

[0149] The relevance scores at the basket level and the commodity level are added, and the sigmoid function is used to map them to the probability range of [0, 1] to obtain the probability of commodity i appearing in the next shopping basket

[0150] To train the model, a loss function L of a recommendation task is defined rec to optimize the prediction effect of the model. The loss function combines the log-likelihood loss of positive and negative samples, and the definition of the objective function is:

[0151]

[0152] where, denotes the set of commodities in the next shopping basket after S u , and denotes the set of commodities not in the next shopping basket, i.e. as negative samples. In order to avoid the problem of data imbalance, the loss function is normalized for positive and negative samples respectively, is the number of positive samples, is the number of negative samples, and the definition of the label is: for the commodity i in the next shopping basket , its label for the commodity i not in the next shopping basket, its label

[0153] The loss function is a binary cross-entropy loss, which is weighted average for positive and negative samples respectively:

[0154] Positive sample part: for each commodity i in , calculate its predicted probability and the error of the true label

[0155] Negative sample part: for each commodity i not in , calculate its predicted probability and the error of the true label

[0156] By the above hierarchical prediction scheme, the user's shopping basket level interest and the commodity level interest are fully utilized to predict the user's behavior in the next shopping basket. The final loss function L rec Then by optimizing the accuracy of positive and negative samples, it is ensured that the model can effectively recommend items in various scenarios. This scheme not only captures the dynamic interest of the user, but also improves the performance of the recommendation system through a reasonable optimization strategy.

[0157] Figure 3 A flowchart of a shopping basket recommendation system based on graph contrast learning and personalized graph prompt is shown.

[0158] The second embodiment of the application also provides a shopping basket recommendation system based on graph contrast learning and personalized graph prompt, which comprises an enterprise transaction data acquisition module, a shopping basket-commodity frequency interaction graph construction module, a singular value decomposition-pretrained contrast enhanced representation module, a graph prompt construction module, a shopping basket-commodity embedded representation fusion module, a next shopping basket prediction module and a prediction result output module.

[0159] The enterprise transaction data acquisition module: acquires and preprocesses user transaction data. By organizing enterprise transaction data, the shopping basket and commodity information are preprocessed through steps such as cleaning, conversion and formatting, and the embedded representation of the shopping basket and commodity is initialized, laying a foundation for subsequent recommendation tasks.

[0160] The shopping basket-commodity frequency interaction graph construction module: constructs a shopping basket-commodity frequency interaction graph according to the interaction frequency of the shopping basket and the item read from the user's historical interaction data;

[0161] The singular value decomposition-pretrained contrast enhanced representation module: generates a main view shopping basket-item embedded representation through a graph convolution network, and then further enhances and generates a global view shopping basket-item embedded representation by using singular value decomposition; the embedded representations of the two different views are compared and learned to enhance the main view shopping basket-item embedded representation and the global view shopping basket-item embedded representation.

[0162] Under the framework of graph convolution network (GCN), a two-layer GCN structure is used to generate the embedded representation of the shopping basket and the commodity. GCN updates the embedded vector of the shopping basket and the commodity by aggregating the neighbor information of each shopping basket or commodity, so that the embedded representation of the shopping basket and the commodity not only contains its own information, but also incorporates the information of other shopping baskets and commodities associated with it, thereby generating a more comprehensive and informative main view embedded representation. Finally, we use the inner product of these embedded representations to predict the correlation between the shopping basket and the commodity, providing strong support for the subsequent shopping basket recommendation task;

[0163] The SVD (singular value decomposition) is introduced to effectively extract important collaborative signals in the shopping basket and commodity interaction from a global perspective. By performing SVD on the normalized adjacency matrix, the principal components of the graph are identified and emphasized, while maintaining the global collaborative signals. Efficient message propagation is performed on the reconstructed shopping basket-commodity relationship graph at each layer, generating shopping basket-commodity embedding representations based on a global view, which not only improves the efficiency of the model but also enhances the accuracy and robustness of the recommendation system.

[0164] The graph prompt construction module: uses graph prompts to encode user historical interaction data into shopping basket-level and commodity-level prompt embeddings, and uses a multi-layer perception to fuse and construct graph prompt vectors; and through a pre-training contrastive learning framework based on SVD (singular value decomposition) optimization, the embedding representations of the shopping basket and the commodity are enhanced. The SVD enhanced view based on the global collaborative relationship is introduced to strengthen the representation of the main view. The SVD enhanced view not only retains the global collaborative signals, but also effectively reduces the rank of the matrix by truncating the singular value list and reconstructing the normalized adjacency matrix, thereby improving the computational efficiency. Based on the LightGCL framework, the SVD enhanced view embedding is directly compared with the main view embedding in the InfoNCE loss. By calculating the cosine similarity and applying the temperature parameter, the InfoNCE loss of the shopping basket and the commodity is defined, and the InfoNCE loss of the commodity is defined in the same way. In order to further improve the generalization ability of the model, a random node dropout strategy is added in each batch to exclude some nodes from participating in contrastive learning, thereby preventing overfitting.

[0165] The shopping basket-commodity embedding representation fusion module: fuses the graph prompt vector with the pre-trained shopping basket-item embedding representation, performs linear transformation through trainable weights and biases, and applies an activation function for non-linear processing. The fused representation is further compressed and optimized by a multi-layer perceptron to obtain the shopping basket and item representation embedding of the fused graph prompt vector. The user's shopping basket sequence and commodity expansion sequence are defined, and the pre-trained embedding representation is used to encode each user's historical interaction. Then, the dynamic historical interest representation of the user is extracted through a gated recurrent unit (GRU), and an inner product operation is performed with the pre-compressed graph structure information to generate two levels of prompt embeddings, representing the semantic information at the commodity level and the shopping basket level. Subsequently, a multi-layer perceptron (MLP) is used to reduce the dimension of the two levels of prompt embeddings, and finally an integrated graph prompt vector is generated through additive fusion. This graph prompt vector not only captures the overall behavior pattern of the user, but also enhances the understanding of the user's interest, thereby improving the accuracy and effectiveness of the downstream recommendation task.

[0166] After obtaining the personalized prompt, it is fused with the pre-trained shopping basket-item embedding representation. The key information in the personalized prompt is injected into the pre-trained embedding representation, thereby enhancing the representation ability of the representation. Finally, in order to reduce the dimension of the representation and extract key information, a multi-layer perception (MLP) layer is used to compress the shopping basket representation embedding and the item representation embedding fused with the prompt. The compressed representation not only has a lower dimension, but also can retain key information, which is convenient for subsequent downstream shopping basket recommendation tasks.

[0167] The next shopping basket prediction module: according to the shopping basket and item representation embedding of the fusion graph prompt vector, calculate the relevance score of commodity i at the basket level and commodity level, fuse the probability of two levels, and obtain the final probability of commodity i appearing in the next shopping basket.

[0168] The shopping basket sequence is processed in a hierarchical manner, including basket level and item level. Each shopping basket in the shopping basket sequence contains a series of commodities, but these commodities do not have a strict time sequence. In order to capture the dynamic interest of the user, a gated recurrent unit (GRU) is used to encode the historical interaction. At the basket level, the module embeds each shopping basket in the shopping basket sequence into a vector and uses GRU to encode the shopping basket sequence to obtain the representation of the user's dynamic interest at the basket level. Similarly, at the item level, the module embeds the commodities within each shopping basket and uses GRU to encode the commodity sequence to obtain the representation of the user's dynamic interest at the commodity level. Using the representations of the two levels, the module can infer the probability of the items that may be contained in the next shopping basket. In order to consider the probabilities of the two levels comprehensively, the module uses a specific calculation method to combine the probabilities of the basket level and the item level to obtain the final prediction result. Finally, the module uses the defined loss function Lrec to optimize, which calculates the loss according to the difference between the actual contained items in the next shopping basket and the predicted items. By minimizing this loss function, the module can continuously optimize its prediction ability and improve the accuracy of the recommendation.

[0169] The prediction result output module: according to the final probability of the commodity appearing in the next shopping basket, obtain the recommended commodities in the next shopping basket.

[0170] In several embodiments provided in the present application, it should be understood that the disclosed methods can be implemented by other manners. The above-described embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed components can be through some interfaces, indirect coupling or communication connection between the units can be electrical or other forms.

[0171] In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, or each unit can be separately implemented as a unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in the form of hardware or hardware plus software functional unit.

[0172] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware, and the above-mentioned program can be stored in a computer readable storage medium, and the program executes the steps including the above-mentioned method embodiments when executed; and the above-mentioned storage medium includes mobile storage device, read-only memory (ROM), random access memory (RAM), magnetic disc or optical disc and various storage program codes.

[0173] Alternatively, the above-mentioned integrated unit of the present application can be stored in a computer readable storage medium if it is implemented in the form of software functional module and sold or used as an independent product. Based on such understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software product, which is stored in a storage medium and includes a plurality of instructions for making a computer device (which can be a personal computer, a server or a network device) execute all or part of the methods described in the embodiments of the present application. The above-mentioned storage medium includes mobile storage device, ROM, RAM, magnetic disc or optical disc and various storage program codes.

[0174] The above is merely a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A shopping basket recommendation method based on graph comparison learning and personalized graph prompts, characterized in that: The following steps are involved: Obtain enterprise transaction data, initialize the embedded representation of shopping baskets and products after data preprocessing, and construct a shopping basket-product frequency interaction graph; Graph convolutional networks are used to generate a main view shopping basket-product embedding representation, and combined with singular value decomposition to extract global collaborative relationships to generate a globally enhanced global view shopping basket-product embedding representation; Constructing a graph contrast learning pre-training framework, and enhancing the main view shopping basket-product embedding representation and the global view shopping basket-product embedding representation through the graph contrast learning pre-training framework; Utilize the graph prompt mechanism to encode user historical interaction data into shopping basket-level and item-level prompt embeddings, and use multi-layer perceptron fusion to construct the graph prompt vector; Obtain enhanced embeddings of product and shopping basket sequences from the fusion graph prompt vector. Hierarchically obtain representations of user dynamic interests at the product and shopping basket levels through gated recurrent units. Infer the probability of a product appearing in the next shopping basket and obtain recommended products in the next shopping basket.

2. A shopping cart recommendation method based on graph comparison learning and personalized graph prompts according to claim 1, characterized in that: Obtain enterprise transaction data, initialize the embedded representation of shopping baskets and products after data preprocessing, and construct a shopping basket-product frequency interaction graph, specifically: Obtain enterprise transaction data for data cleaning, format conversion and standardization. After data preprocessing is completed, define the product set as I = {i1, i2, ..., i |J| }, |J| represents the total number of commodities, and the user set is defined as U = {u1,u2,…,u |U| }, |U| represents the total number of users, defining the shopping basket set |K| represents the total number of shopping baskets; Initialize all shopping basket embedding representations E (b) and product embedding representation E (i) , collect user historical interaction data, including shopping cart collection And the product set I, count the products contained in each shopping basket and the number of occurrences of the shopping basket; Build a shopping basket-product frequency interaction graph based on historical interaction data, and collect shopping baskets and product set I as two parts of nodes, set the edge structure according to the association between the shopping basket and the product, and use the number of appearances of the shopping basket in the historical interaction data to set the weight of the edge structure; Based on the constructed shopping basket-product frequency interaction graph, a shopping basket-product frequency adjacency matrix is ​​constructed, and the frequency adjacency matrix A is normalized to obtain the normalized adjacency matrix R K×J Represents the real number space of K×J, where K represents the shopping basket and J represents the product.

3. The shopping cart recommendation method based on graph comparison learning and personalized graph prompts according to claim 1, characterized in that: Use graph convolutional networks to generate main view shopping basket-product embedding representations, specifically: Use graph convolutional network to learn the shopping basket-product frequency interaction graph to obtain the initial shopping basket embedding representation E (b) and product embedding representation E (i) In the graph convolutional network, the neighbor information of each shopping basket k or product j is aggregated through matrix multiplication, and the main view embedding representation of the shopping basket in the lth layer is output through the activation function. and the main view embedding representation of the product The final embedding vector of the shopping basket is generated by summing the embedding vectors of all layers in the graph convolutional network. and the final embedding vector of product j According to the final embedding vector of the shopping basket and the final embedding vector of product j Calculate the inner product of the shopping basket and the product embedding to obtain the predicted correlation between the shopping basket and the product 4. The shopping cart recommendation method based on graph comparison learning and personalized graph prompts according to claim 1, characterized in that: Combined with singular value decomposition to extract global collaborative relationships, a globally enhanced global view shopping basket-product embedding representation is generated, specifically: Use singular value decomposition to normalize the adjacency matrix Decompose and obtain the adjacency matrix The singular value list of the predefined number threshold q is used to truncate the singular value list, retain the first q singular values ​​in the singular value list, and reconstruct the normalized adjacency matrix using the retained singular values. Get the reconstructed adjacency matrix According to the reconstructed adjacency matrix Perform message propagation to obtain the global view embedding representation of the shopping basket after global enhancement of the singular value decomposition in the l-th layer graph convolutional network And the global view embedding representation of the product 5. The shopping cart recommendation method based on graph comparison learning and personalized graph prompts according to claim 1, characterized in that: The main view shopping basket-product embedding representation and the global view shopping basket-product embedding representation are enhanced through the graph contrast learning pre-training framework, specifically: By comparing the similarity between the main view shopping basket-product embedding representation and the global view shopping basket-product embedding representation, we construct a contrast loss. At the same time, we combine the contrast loss and the regularization term to construct a graph contrast learning pre-training framework for recommendation tasks. The corresponding loss function L is expressed as: Among them L con represents the contrast loss, represents the contrast loss of the shopping basket node, represents the contrast loss of the commodity node, represents the regularization term, λ1 and λ2 represent learnable parameters; The contrast loss calculates the predicted scores of the items in the shopping basket based on the predicted correlation between the shopping basket and the items, encouraging the model to give high prediction scores for positive items and low prediction scores for negative items; The contrast loss of the shopping basket node and the contrast loss of the product node measure the similarity between the main view shopping basket-product embedding representation and the global view shopping basket-product embedding representation based on the InfoNCE loss function, and compare the similarity with the global view embedding representation of other shopping basket nodes or product nodes.

6. The shopping basket recommendation method based on graph comparison learning and personalized graph prompts according to claim 1, characterized in that: The graph prompt module is constructed by using the shopping basket-product frequency interaction graph, encoding the user's historical interaction data into shopping basket-level and product-level prompt embeddings, and constructing the graph prompt vector using multi-layer perceptron fusion. Specifically, The adjacency matrix after normalizing the shopping basket-product frequency interaction graph Mapping to the embedding space of shopping basket and products through MLP, constructing the shopping basket level prompt vector P B and product-level prompt vector P I , expressed as: Among them, P I ∈R J×d represents the hint vector mapped to the product level, J represents the number of all products, P B ∈R K×d represents the hint vector mapped to the shopping basket level, and K represents the number of all shopping baskets; The normalized adjacency matrix representing the frequency of interaction between the shopping basket and the product, and and Represents the weight matrix of the two-layer linear transformation, d h is the hidden embedding dimension, d represents the target cue embedding dimension, and and represents the bias term, σ represents the nonlinear activation function ReLU; Define the historical interaction shopping basket sequence of each user u |S u | represents the length of the historical interactive shopping basket sequence of user u, each shopping basket For a shopping behavior, define the product expansion sequence at the same time For the user's product expansion sequence S (u,I) , whose embedding is expressed as: Among them E (u,I) The product sequence embedding representation set represented by the user’s historical interaction, represents the item embedding representation of the user's interaction sequence at the item level at time t, |S (u,I) | represents the number of products the user has interacted with; Expand the product sequence S (u,I) The embedding representation E (u,I) After encoding by the gated recurrent unit, the user's dynamic interest hidden state is generated: H (u,I) =GRU(E (u,I) ) H (u,I) ∈R |S(u,I)|×d It represents the hidden state of the user's dynamic interest extracted by the gated recursive unit, and the hidden state H of the user's historical product interaction (u,I) With two different levels of graph information hint vector P I and P B Perform inner product operations respectively to generate product-level hint embedding S I and shopping basket level prompts embedded in S B ; The product-level prompts are embedded into S through a multi-layer perceptron I and shopping basket level prompts embedded in S B Perform nonlinear transformation and compression, and finally generate the user's graph prompt vector through additive fusion 7. A shopping basket recommendation method based on graph comparison learning and personalized graph prompts according to claim 6, characterized in that: Get the enhanced embedding of the product and shopping cart sequence of the fusion graph prompt information, specifically: Define the user's item-level interaction sequence embedding E (u,I) and shopping basket-level interaction sequence embedding E (u,B) , respectively add the product embedding in the product-level interaction sequence and the shopping basket embedding in the shopping basket-level interaction sequence to the graph prompt vector to obtain the enhanced product embedding and shopping cart embed After integration, the fusion map prompt vector is generated Enhanced embedding of product and shopping basket sequences and 8. The shopping basket recommendation method based on graph comparison learning and personalized graph prompts according to claim 7, characterized in that: Through the gated recursive unit, we hierarchically obtain the representation of the user's dynamic interests at the product and shopping basket levels, infer the probability of the product appearing in the next shopping basket, and obtain the recommended products in the next shopping basket. Specifically: Using gated recurrent units to analyze the user's shopping cart sequence Perform step-by-step encoding. For each time step t, the encoding update of the gated recurrent unit at the shopping basket sequence level and the user sequence level is expressed as: in represents the enhanced embedding representation of the t-th shopping basket and the t-th product, Represents the historical interaction information encoding of the t-th shopping basket and the t-th product, Represents the historical interaction information encoding of the t+1th shopping basket and the t+1th product; The final representation s at the shopping basket level is obtained through recursive encoding of gated recurrent units (u,B) and the final representation of product level (u,I) ; Obtain the embedding representation e of product i through the graph comparison learning pre-training framework i , using the final representation s at the shopping basket level (u,B) and the embedding representation e of product i i , calculate the relevance score of product i at the shopping basket level Using the final representation of the product level (u,I) and the embedding representation e of product i i , calculate the relevance score of product i at the product level Add the shopping basket-level and product-level relevance scores and use the sigmoid function to map them to the probability range of [0,1] to obtain the probability of product i appearing in the next shopping basket.

9. A shopping basket recommendation system based on graph comparison learning and personalized graph prompts, characterized by: Implementing the shopping basket recommendation method based on graph contrast learning and personalized graph prompts as described in any one of claims 1 to 8, the system comprises: an enterprise transaction data collection module, a shopping basket-product frequency interaction graph construction module, a singular value decomposition-pretrained contrast enhancement representation module, a graph prompt construction module, a shopping basket-product embedding representation fusion module, a next shopping basket prediction module, and a prediction result output module; The enterprise transaction data collection module collects and pre-processes user transaction data; The shopping basket-item frequency interaction graph construction module reads the interaction frequency between the shopping basket and the item according to the user's historical interaction data to construct the shopping basket-item frequency interaction graph; The singular value decomposition-pretrained contrast enhancement representation module generates a main view shopping basket-product embedding representation through a graph convolutional network, and then further enhances and generates a global view shopping basket-item embedding representation using singular value decomposition; the embedding representations of the two different perspectives are compared and learned to enhance the main view shopping basket-product embedding representation and the global view shopping basket-item embedding representation; The graph prompt construction module: uses graph prompt generation to encode user historical interaction data into shopping basket-level and product-level prompt embeddings, and uses multi-layer perceptron fusion to construct graph prompt vectors; The shopping basket-product embedding representation fusion module: fuses the image prompt vector with the pre-trained shopping basket-item embedding representation, performs linear transformation using trainable weights and biases, and applies activation functions for nonlinear processing. The fused representation is further compressed and optimized through a multi-layer perceptron to obtain the shopping basket and item representation embedding of the fused image prompt vector; The next shopping basket prediction module calculates the relevance score of item i at the shopping basket level and the item level based on the shopping basket and item representation embedding of the fused graph prompt vector, and fuses the probabilities at the two levels to obtain the final probability of item i appearing in the next shopping basket; The prediction result output module obtains the recommended products in the next shopping basket according to the final probability of the products appearing in the next shopping basket.

Citation Information

Patent Citations

  • Cross-hierarchy graph contrast learning bundled commodity recommendation method

    CN116611894A

  • Graph contrast learning recommendation method, system and device based on global collaboration and medium

    CN117350803A