Shopping basket recommendation method and system based on graph convolution and self-attention mechanism

By introducing graph convolution and self-attention mechanisms in the recommendation system, the interactive graph is constructed and the price-aware feature representation is generated, and the problems of insufficient price perception and low recommendation accuracy in the existing recommendation system are solved, and more personalized and Diverse shopping basket recommendations.

CN118820588BActive Publication Date: 2025-02-07SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410830003.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2025-02-07
Estimated Expiration
2044-06-25

AI Technical Summary

Technical Problem

The existing recommendation system ignores price factors in shopping basket recommendations, resulting in the recommendation results that do not match user needs and lack product relevance and diversity.

Method used

Using the method based on graph convolution and self-attention mechanism, an interactive graph of users-shopping basket, shopping basket-product item, product item-price, product item-product item-product type is constructed, and a graph with price perception is generated through graph convolution network. Feature representation, and use the self-attention mechanism to adjust the weight of goods and prices to recommend the shopping basket.

Benefits of technology

It improves the sensitivity of the recommendation system to price changes and adaptability to the market environment, generates more personalized and diverse shopping basket recommendation results, and improves user satisfaction and recommendation accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118820588B_ABST
    Figure CN118820588B_ABST
Patent Text Reader

Abstract

The present invention discloses a shopping basket recommendation method and system based on graph convolution and self-attention mechanism, including: based on graph structure data including multiple types of nodes such as shopping basket, commodity items, commodity types, prices and users, the adjacency information of each node is aggregated through a graph convolution network, so as to more comprehensively capture the intrinsic connection between the node and the graph structure. At the same time, a user's price feature learning module is constructed to accurately express similar price preferences between adjacent users. By introducing an attention mechanism to accurately allocate weights between prices, users, commodities and shopping baskets, the model can combine user preferences to make targeted and personalized recommendations. The present invention optimizes the performance of the recommendation algorithm, improves user satisfaction, and achieves a more accurate match between the recommendation system and user needs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of personalized recommendation technology, and more specifically, to a shopping basket recommendation method and system based on graph convolution and self-attention mechanism. Background Art

[0002] With the rise of modern e-commerce and online shopping, personalized recommendation systems are gaining more and more attention. Current recommendation systems are mainly based on user interests and historical behaviors, ignoring the importance of price factors in user decision-making. Moreover, when recommending shopping carts, recommendation systems often do not fully consider the relevance between products and the user's shopping purpose.

[0003] Current recommendation systems have problems with insufficient price perception and low accuracy of basket recommendations. Traditional recommendation systems ignore users’ sensitivity to price, resulting in a mismatch between the final recommendation results and user needs. In addition, for basket recommendations, existing systems lack effective methods for considering the relevance of products, resulting in a lack of diversity and personalization in recommendation results.

[0004] Therefore, there is an urgent need for a next shopping cart recommendation method and system that combines price perception and feature extraction to solve the problems existing in traditional recommendation systems. The system takes into account factors such as user shopping behavior, preferences, and price perception, and introduces an attention mechanism to dynamically adjust the weight of items and price factors in the recommendation results, so as to better meet user needs. At the same time, by mining the correlation between items, more diversified and personalized recommendations can be achieved. Summary of the invention

[0005] In order to solve the above technical problems, the present invention proposes a shopping basket recommendation method and system based on graph convolution and self-attention mechanism, aiming to solve the problems of insufficient price perception and low shopping basket recommendation accuracy in traditional recommendation systems.

[0006] The first aspect of the present invention provides a shopping basket recommendation method based on graph convolution and self-attention mechanism, comprising:

[0007] Acquire the shopping basket sequence data of the user, pre-process the shopping basket sequence data, and construct a user-shopping basket interaction matrix, a shopping basket-commodity item interaction matrix, a commodity item-price interaction matrix, and a commodity item-commodity type interaction matrix in a matrix form to generate an interaction graph;

[0008] Construct the price range for each product, build the corresponding feature embedding according to the product item, product type, price range, shopping basket, and user, and encode the original price of the products in the shopping basket through the gated recurrent unit to generate the original price feature embedding;

[0009] The interaction graph is represented and learned through graph convolutional networks, and product items, product types, price ranges, shopping carts, and user nodes are aggregated to generate price-aware graph feature representations.

[0010] Attention parameters are determined according to the price-aware graph feature representation and the price range code embedding, a final code embedding is generated using a multi-head self-attention mechanism, the probability of a product being recommended in the next shopping basket is calculated using the final code embedding, and a preset number of products are selected for recommendation after sorting.

[0011] In this solution, the user's historical commodity interaction data is read, the historical commodity interaction data is cleaned, and the shopping basket data purchased by the user in different time periods is filtered according to preset rules to construct the user's shopping basket sequence data;

[0012] Reading data of five categories, namely, user, shopping basket, price, commodity type and commodity item, from the shopping basket sequence data, determining whether there is an interaction relationship between different category data, constructing a user-shopping basket interaction matrix, a shopping basket-commodity item interaction matrix, a commodity item-price interaction matrix and a commodity item-commodity type interaction matrix according to the interaction relationship, and performing normalization processing;

[0013] Generate corresponding interaction graphs based on different interaction matrices, reflect the relationship between user-shopping basket and shopping basket-product through the position value of each matrix, and read the graph structure data.

[0014] In this solution, the original price of the product The lowest price among similar products min and the highest price p max Calculate the price range of the commodity price as the price level p of the commodity i , the calculation formula is:

[0015] Given learnable parameters, feature embedding of product items, product types, price ranges, shopping carts, and user nodes is obtained by random initialization and training using the learnable parameters.

[0016] In this solution, the original prices of the items in the shopping cart are encoded through the gated recurrent unit to generate the original price feature embedding. The calculation formula is:

[0017]

[0018] in They represent the price embeddings of items in user u’s shopping basket b at time t and time t+1, respectively. Represents the original price feature embedding of the items in user u’s shopping basket b.

[0019] In this scheme, the interaction graph is represented and learned through graph convolutional networks, specifically:

[0020] Generate an adjacency matrix associated with nodes according to the interaction graph, initialize the feature embedding of commodity items, commodity types, price ranges, shopping carts, and user nodes for connection, obtain a unified feature vector and the adjacency matrix and input them into the embedding propagation layer;

[0021] The relationship between each node and graph structure data is captured through the message passing and neighbor aggregation mechanism of the graph convolutional network, the feature embedding of each node is updated, and a price-aware graph feature representation is generated.

[0022] In this solution, the attention parameters are determined according to the price-aware graph feature representation and the original price feature embedding, and the final encoding embedding is generated using the multi-head self-attention mechanism, specifically:

[0023] According to the price range of each product in the shopping basket, the encoding is embedded Generate the query vector Q in the self-attention mechanism, expressed as W Q represents a learnable parameter;

[0024] According to the feature embedding of the commodity items with price preferences, shopping carts, and type nodes, the key vector K and value vector V in the self-attention mechanism are generated, which can be expressed as:

[0025]

[0026] Where E(u) represents user feature embedding, represents the feature embedding of user u’s shopping basket b at time t, represents the feature embedding of the item at time t, |S| represents the number of item code embeddings in shopping basket b, and W K ,W V represents a learnable parameter;

[0027] The attention heads of the multi-head attention mechanism are configured using attention parameters, and the self-attention mechanism is used in each attention head to extract more important price-aware feature information. The attention heads are then concatenated and imported into the multi-layer perceptron to generate the final encoding embedding.

[0028] In this solution, the final encoded embeddings obtained are added and aggregated, and the aggregated final encoded embeddings are converted into probability distributions through softmax to obtain the score of each product item;

[0029] Each item is sorted according to its score, and a preset number of items are selected as recommendations for the next shopping cart based on the sort.

[0030] The second aspect of the present invention also provides a shopping basket recommendation system based on graph convolution and self-attention mechanism, the system comprising: a data input module, a data preprocessing module, a graph structure data processing module, a price sequence processing module, a shopping basket representation generation module, a shopping basket encoding module and a prediction output module;

[0031] The data input module is responsible for receiving diversified data information, including shopping basket details, product prices, product items, users, and product types;

[0032] The data preprocessing module processes the received data in a refined manner, filters the shopping basket data and divides the data according to preset rules;

[0033] The graph structure data processing module generates a corresponding interaction graph through the user-shopping basket, shopping basket-commodity item, commodity item-price, commodity item-commodity type interaction matrix, reflects the relationship between the user-shopping basket and the shopping basket-commodity through each matrix position value, and uses normalization processing to eliminate the influence of data scale;

[0034] The price sequence processing module encodes the original prices of the commodities in the shopping basket through a gated recurrent unit to generate an original price feature embedding;

[0035] The shopping basket representation generation module aggregates the node feature information of commodity items, shopping baskets, prices, and commodity types through a graph convolutional network based on the graph structure data to generate a price-aware graph feature representation;

[0036] The shopping basket encoding module performs inner product on the embeddings of users with price preferences, product items, and shopping baskets, combines the original price feature embeddings to determine the attention parameters in the self-attention mechanism, uses the self-attention mechanism to capture the long-term and short-term preferences of products, and generates the final encoding embedding;

[0037] The prediction output module calculates the probability of all products appearing in the next shopping basket through the final encoding embedding, sorts them according to the calculation results, and selects a preset number of products as recommendations for the next shopping basket.

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

[0039] (1) By introducing node information of price ranges, the present invention can capture and utilize more commodity information in the market, so that the model can be more sensitive and accurate to price changes in the market. Moreover, in data sets with fluctuating market prices, the model can perform more stably and recommend more accurate commodities.

[0040] (2) The present invention treats the price range and product type as independent nodes respectively, so that the model can learn richer semantic information between prices and item types, and generate a personalized recommendation list based on the user's response information to different prices and product types.

[0041] (3) The next shopping basket recommendation of the present invention also introduces the technology of attention mechanism. By allocating weights of information such as price, basket, and item, the model can better adapt to changes in market prices and commodity types, and can maintain efficient and accurate analysis capabilities in a market environment with relatively large price fluctuations. The price attention mechanism can also analyze the user's historical behavior and preferences in different price ranges, so as to accurately obtain the user's price sensitivity, which can enable the recommendation algorithm to provide recommendation results that are more in line with the user's expectations and budget, thereby improving user satisfaction and recommendation accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A flowchart of a shopping basket recommendation method based on graph convolution and self-attention mechanism of the present invention is shown;

[0043] Figure 2 A flowchart of the present invention showing representation learning of interaction graphs through graph convolutional networks is shown;

[0044] Figure 3 The flowchart of the present invention using the multi-head self-attention mechanism to generate the final encoding embedding is shown;

[0045] Figure 4 A block diagram of a shopping basket recommendation system based on graph convolution and self-attention mechanism of the present invention is shown. DETAILED DESCRIPTION

[0046] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is 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.

[0047] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.

[0048] Figure 1 A flowchart of the shopping basket recommendation method based on graph convolution and self-attention mechanism of the present invention is shown.

[0049] like Figure 1 As shown, the first aspect of the present invention provides a shopping basket recommendation method based on graph convolution and self-attention mechanism, comprising:

[0050] S102, obtaining shopping basket sequence data of the user, preprocessing the shopping basket sequence data, and constructing a user-shopping basket interaction matrix, a shopping basket-commodity item interaction matrix, a commodity item-price interaction matrix, and a commodity item-commodity type interaction matrix in a matrix form to generate an interaction graph;

[0051] S104, constructing a price range for each product, constructing corresponding feature embeddings according to product items, product types, price ranges, shopping carts, and users, and encoding the original prices of the products in the shopping cart through a gated recurrent unit to generate original price feature embeddings;

[0052] S106, performing representation learning on the interaction graph through a graph convolutional network, aggregating product items, product types, price ranges, shopping carts, and user nodes to generate a price-aware graph feature representation;

[0053] S108, determining attention parameters according to the price-aware graph feature representation and the original price feature embedding, generating a final coding embedding using a multi-head self-attention mechanism, calculating the probability of a product being recommended in the next shopping cart through the final coding embedding, and selecting a preset number of products for recommendation after sorting.

[0054] It should be noted that the types of data sets generally constructed by reading the user's historical commodity interaction data include user purchase data sets of small grocery stores, corporate groups, and cosmetics purchase data sets, and the data is generally in the form of a simple table file. We can first use the program to select the commodities purchased by each user in the same time period as the user's basket, and select multiple time periods, clean the historical commodity interaction data, and filter the shopping basket data purchased by users in different time periods according to preset rules. Each row of data represents multiple shopping basket data owned by a user. After constructing the data, high-quality shopping baskets can be selected to construct the user's shopping basket sequence data; for example, a shopping basket with more than 3 items and less than 10 items. After processing the data, the data format is as follows: u1|i1,i2,i3|i1,i2,i4|i1,i5,i6|, u represents the user, i represents the commodity item, and each two "|"s represent a shopping basket. The last shopping basket is the data to be predicted.

[0055] Read the data of five categories, namely user, shopping basket, price, commodity type and commodity item, from the shopping basket sequence data, determine whether there is an interaction relationship between different categories of data, and construct the user-shopping basket interaction matrix, shopping basket-commodity item interaction matrix, commodity item-price interaction matrix, commodity item-commodity type interaction matrix according to the interaction relationship; if user 1 and shopping basket 1 interact, the position of matrix (1,1) is 1, and if there is no interaction, it is 0. After the matrix construction is completed, normalization is performed to prevent the occurrence of gradient disappearance during training; generate corresponding interaction graphs according to different interaction matrices, reflect the relationship between user-shopping basket and shopping basket-commodity through each matrix position value, and read the graph structure data.

[0056] It should be noted that the original price of the product The lowest price among similar products min and the highest price p max Calculate the price range of the product price and embed it into p as the price range feature of the product i , the calculation formula is:

[0057] Given a learnable parameter, the feature embedding of product item, product type, price range, shopping basket, and user node is obtained by random initialization and training using the learnable parameter. For example, the shopping basket feature embedding E(b) is expressed as E(b)=W b *b, b represents shopping basket data, W b represents a learnable parameter.

[0058] The original prices of the items in the shopping basket are encoded through the gated recurrent unit to generate the original price feature embedding. The calculation formula is:

[0059]

[0060] in Respectively represent the price code embedding of the items in the shopping basket b of user u at time t and time t+1, Represents the original price feature embedding of the items in user u’s shopping basket b.

[0061] Figure 2 A flowchart of the present invention for learning the representation of an interaction graph through a graph convolutional network is shown.

[0062] According to an embodiment of the present invention, the interaction graph is represented and learned by a graph convolutional network, specifically:

[0063] S202, generating an adjacency matrix associated with nodes according to the interaction graph, initializing feature embedding of commodity items, commodity types, price ranges, shopping carts, and user nodes for connection, obtaining a unified feature vector and the adjacency matrix and inputting them into an embedding propagation layer;

[0064] S204, capturing the relationship between each node and graph structure data through the message passing and neighbor aggregation mechanism of the graph convolutional network, updating the feature embedding of each node, and generating a price-aware graph feature representation.

[0065] It should be noted that for the feature embedding of product items, product types, price ranges, shopping carts, and user nodes, graph convolutional networks are used for aggregation to obtain higher-order semantic information of each node. Initialize the feature embedding of product items, product types, price ranges, shopping carts, and user nodes and connect them to obtain a unified feature vector H 0 , H 0 =*E(u)|E(b)|E(i)|E(c)|E(p)|+, E(u) represents user feature embedding, E(b) represents shopping basket feature embedding, E(i) represents item feature embedding, E(c) represents item type feature embedding, and E(p) represents price feature embedding. Graph convolutional network is a classic deep learning model for processing graph structure data. It better captures the relationship between nodes and graph structure information by aggregating the information of each node's neighbor nodes.

[0066] Figure 3 A flowchart of the present invention using a multi-head self-attention mechanism to generate the final encoding embedding is shown.

[0067] According to an embodiment of the present invention, attention parameters are determined based on the price-aware graph feature representation and the original price feature embedding, and a multi-head self-attention mechanism is used to generate a final encoding embedding, specifically:

[0068] S302, embedding the price range code of each item in the shopping basket Generate the query vector Q in the self-attention mechanism, expressed as W Q represents a learnable parameter;

[0069] S304, based on the feature embedding of the commodity items with price preference, the shopping cart, and the type node, an inner product is performed to generate a key vector K and a value vector V in the self-attention mechanism, which can be expressed as:

[0070]

[0071] Where E(u) represents user feature embedding, represents the feature embedding of user u’s shopping basket b at time t, represents the feature embedding of the item at time t, |S| represents the number of item code embeddings in shopping basket b, and W K ,W V represents a learnable parameter;

[0072] S306, using the attention parameters to configure the attention heads of the multi-head attention mechanism, using the self-attention mechanism in each attention head to extract more important price perception feature information, splicing each attention head into a multi-layer perceptron to generate a final code embedding;

[0073] Attention head of multi-head self-attention mechanism i It is expressed as,

[0074] By splicing the attention heads i ,i=1,2…,n to get the features, expressed as Multihead(X)=Concat(Head1,Head2,…,Head n );

[0075] The concatenated features Multihead(X) are imported into the multi-layer perceptron, and the final feature learning is completed through a layer of multi-layer perceptron (MLP) to generate the final encoding embedding Z, Z = Multihead(X)W O , W O Represents the parameters of the multilayer perceptron.

[0076] It should be noted that the final encoded embeddings obtained are added and aggregated n represents the number of final code embeddings. The aggregated final code embeddings are converted into a probability distribution p = MLP (L) through softmax to obtain the score of each product item. σ represents the activation function; sorting is performed according to the score of each item, and a preset number of items are selected as the recommendation for the next shopping basket based on the sorting. In order to train the recommendation model, two loss functions are designed: binary cross entropy function L bce (BCE Loss) and recommendation loss L rec (Rec Loss). The binary cross entropy function is a binary classification loss function, which is mainly used to calculate the cross entropy loss between the model and the true label to evaluate the accuracy of the model. The purpose of the recommendation loss is to improve the accuracy and diversity of the recommendation. The formula is:

[0077]

[0078] in, represents the true label of the i-th sample, represents the probability of the i-th sample, and γ represents the hyperparameter.

[0079] Figure 4 A block diagram of a shopping basket recommendation system based on graph convolution and self-attention mechanism of the present invention is shown.

[0080] The second aspect of the present invention further provides a shopping basket recommendation system 4 based on graph convolution and self-attention mechanism, the system comprising: a data input module 41, a data preprocessing module 42, a graph structure data processing module 43, a price sequence processing module 44, a shopping basket representation generation module 45, a shopping basket encoding module 46 and a prediction output module 47;

[0081] The data input module 41 is responsible for receiving diversified data information, including shopping basket details, product prices, product items, users, and product types;

[0082] The data preprocessing module 42 performs refined processing on the received data, filters the shopping basket data according to preset rules and performs data segmentation;

[0083] The graph structure data processing module 43 generates a corresponding interaction graph through the user-shopping basket, shopping basket-commodity item, commodity item-price, commodity item-commodity type interaction matrix, reflects the relationship between the user-shopping basket and the shopping basket-commodity through each matrix position value, and uses normalization processing to eliminate the influence of data scale;

[0084] The price sequence processing module 44 encodes the original prices of the commodities in the shopping basket through a gated recurrent unit to generate an original price feature embedding;

[0085] The shopping basket representation generation module 45 aggregates the node feature information of commodity items, shopping baskets, prices, and commodity types through a graph convolutional network based on the graph structure data to generate a graph feature representation with price perception;

[0086] The shopping basket encoding module 46 performs inner product on the embeddings of users with price preferences, product items, and shopping baskets, determines the attention parameters in the self-attention mechanism in combination with the price encoding embedding, uses the self-attention mechanism to capture the long-term and short-term preferences of products, and generates the final encoding embedding;

[0087] The prediction output module 47 calculates the probability of all products appearing in the next shopping basket through the final code embedding, sorts them according to the calculation results, and selects a preset number of products as recommendations for the next shopping basket.

[0088] The third aspect of the present invention also provides a computer-readable storage medium, which includes a shopping basket recommendation method program based on graph convolution and self-attention mechanism. When the shopping basket recommendation method program based on graph convolution and self-attention mechanism is executed by a processor, the steps of the shopping basket recommendation method based on graph convolution and self-attention mechanism as described in any one of the above items are implemented.

[0089] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0090] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0091] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0092] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.

[0093] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

[0094] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A shopping basket recommendation method based on graph convolution and self-attention mechanism, characterized in that: The following steps are involved: Acquire the shopping basket sequence data of the user, pre-process the shopping basket sequence data, and construct a user-shopping basket interaction matrix, a shopping basket-commodity item interaction matrix, a commodity item-price interaction matrix, and a commodity item-commodity type interaction matrix in a matrix form to generate an interaction graph; Construct the price range for each product, build the corresponding feature embedding according to the product item, product type, price range, shopping basket, and user, and encode the original price of the products in the shopping basket through the gated recurrent unit to generate the original price feature embedding; The interaction graph is represented and learned through graph convolutional networks, and product items, product types, price ranges, shopping carts, and user nodes are aggregated to generate price-aware graph feature representations. Attention parameters are determined according to the price-aware graph feature representation and the original price feature embedding, a final coding embedding is generated using a multi-head self-attention mechanism, the probability of a product being recommended in the next shopping basket is calculated using the final coding embedding, and a preset number of products are selected for recommendation after sorting.

2. A shopping basket recommendation method based on graph convolution and self-attention mechanism according to claim 1, characterized in that: Read the user's historical commodity interaction data, clean the historical commodity interaction data, and filter the shopping basket data purchased by the user in different time periods according to preset rules to construct the user's shopping basket sequence data; Reading data of five categories, namely, user, shopping basket, price, commodity type and commodity item, from the shopping basket sequence data, determining whether there is an interaction relationship between different category data, constructing a user-shopping basket interaction matrix, a shopping basket-commodity item interaction matrix, a commodity item-price interaction matrix and a commodity item-commodity type interaction matrix according to the interaction relationship, and performing normalization processing; Generate corresponding interaction graphs based on different interaction matrices, reflect the relationship between user-shopping basket and shopping basket-product through the position value of each matrix, and read the graph structure data.

3. The shopping basket recommendation method based on graph convolution and self-attention mechanism according to claim 1, characterized in that: By the original price of the item The lowest price among similar products min and the highest price p max Calculate the price range of the product price and embed it into p as the price range feature of the product i , the calculation formula is: Given learnable parameters, feature embedding of product items, product types, price ranges, shopping carts, and user nodes is obtained by random initialization and training using the learnable parameters.

4. The shopping basket recommendation method based on graph convolution and self-attention mechanism according to claim 1, characterized in that: The original prices of the items in the shopping basket are encoded through the gated recurrent unit to generate the original price feature embedding. The calculation formula is: in The price range encoding embeddings corresponding to the original prices of the items in the shopping basket b of user u at time t and time t+1 respectively, Represents the original price feature embedding of the items in user u’s shopping basket b.

5. The shopping basket recommendation method based on graph convolution and self-attention mechanism according to claim 1, characterized in that: The interaction graph is represented and learned through graph convolutional networks, specifically: Generate an adjacency matrix associated with nodes according to the interaction graph, initialize the feature embedding of commodity items, commodity types, price ranges, shopping carts, and user nodes for connection, obtain a unified feature vector and the adjacency matrix and input them into the embedding propagation layer; The relationship between each node and graph structure data is captured through the message passing and neighbor aggregation mechanism of the graph convolutional network, the feature embedding of each node is updated, and a price-aware graph feature representation is generated.

6. The shopping basket recommendation method based on graph convolution and self-attention mechanism according to claim 1, characterized in that: The attention parameters are determined according to the price-aware graph feature representation and the original price feature embedding, and the final encoding embedding is generated using the multi-head self-attention mechanism, specifically: Embedding based on the original price features of the items in the shopping basket Generate the query vector Q in the self-attention mechanism, expressed as W Q represents a learnable parameter; According to the feature embedding of the commodity items, shopping baskets, and type nodes with price level preferences, the key vector K and value vector V in the self-attention mechanism are generated, which are expressed as: Where E(u) represents user feature embedding, represents the feature embedding of user u’s shopping basket b at time t, represents the feature embedding of the item at time t, |S| represents the number of embeddings of item b in the shopping cart, and W K ,W V represents a learnable parameter; The attention heads of the multi-head attention mechanism are configured using attention parameters, and the self-attention mechanism is used in each attention head to extract more important price-aware feature information. The attention heads are then concatenated and imported into the multi-layer perceptron to generate the final encoding embedding.

7. The shopping basket recommendation method based on graph convolution and self-attention mechanism according to claim 1, characterized in that: The final encoded embeddings are added and aggregated, and the aggregated final encoded embeddings are converted into probability distributions through softmax to obtain the score of each product item; Each item is sorted according to its score, and a preset number of items are selected as recommendations for the next shopping cart based on the sort.

8. A shopping basket recommendation system based on graph convolution and self-attention mechanism, characterized in that: The system includes: a data input module, a data preprocessing module, a graph structure data processing module, a price sequence processing module, a shopping basket representation generation module, a shopping basket encoding module and a prediction output module; The data input module is responsible for receiving diversified data information, including shopping basket details, product prices, product items, users, and product types; The data preprocessing module processes the received data in a refined manner, filters the shopping basket data and divides the data according to preset rules; The graph structure data processing module generates a corresponding interaction graph through the user-shopping basket, shopping basket-commodity item, commodity item-price, commodity item-commodity type interaction matrix, reflects the relationship between the user-shopping basket and the shopping basket-commodity through each matrix position value, and uses normalization processing to eliminate the influence of data scale; The price sequence processing module encodes the original prices of the commodities in the shopping basket through a gated recurrent unit to generate an original price feature embedding; The shopping basket representation generation module aggregates the node feature information of commodity items, shopping baskets, prices, and commodity types through a graph convolutional network based on the graph structure data to generate a price-aware graph feature representation; The shopping basket encoding module performs inner product on the embeddings of users with price preferences, product items, and shopping baskets, combines the original price feature embeddings to determine the attention parameters in the self-attention mechanism, uses the self-attention mechanism to capture the long-term and short-term preferences of products, and generates the final encoding embedding; The prediction output module calculates the probability of all products appearing in the next shopping basket through the final encoding embedding, sorts them according to the calculation results, and selects a preset number of products as recommendations for the next shopping basket.

Citation Information

Patent Citations

  • Recommendation method and device based on heterogeneous relational graph neural network and medium

    CN115082142A

  • Next shopping basket recommendation system based on user graph enhanced graph neural network

    CN115907913A