Personalized dining recommendation method and system based on graph contrast learning
By adopting a graph-contrast learning method in personalized dining recommendations, the user-restaurant interaction graph is constructed and data enhancement is carried out, and the problems of data sparseness and popularity deviation are solved, achieving higher personalized recommendation accuracy.
Patent Information
- Application Number
- CN202411664749.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-20
AI Technical Summary
The existing graph comparison learning technology has problems of sparse data and bias in personalized dining recommendations, making it difficult to effectively understand the real needs of users.
Using a personalized dining recommendation method based on graph comparison learning, we use user-restaurant interaction diagram to learn the embedding of deviated channels, use the variational graph autoencoder to perform data enhancement, and build comparison tasks to improve the personalization and accuracy of the recommendation system.
Through self-supervised learning, supervised signals are extracted, complex relationships between users and restaurants are captured, data sparseness and popularity deviations are alleviated, and the degree of personalization and accuracy of the recommendation system is significantly improved.
Smart Images

Figure CN119598017A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of smart city service recommendation, and specifically relates to a personalized dining recommendation method and system based on graph comparative learning. Background Art
[0002] Smart cities use advanced information technologies, such as the Internet of Things, cloud computing, and big data, to conduct intelligent management and services for all aspects of cities, in order to improve the efficiency of urban operations, optimize resource allocation, and promote the sustainable development of society. The construction of smart cities not only involves the intelligence of urban management and services, but also the convenience of residents' lives. Among them, personalized dining recommendations are the specific application of the concept of smart cities in the field of catering services. Personalized dining recommendations refer to recommending suitable restaurants and dishes to users through intelligent algorithms based on users' historical consumption data, likes, comments, favorites, and other information. However, in actual application scenarios, since popular restaurants are often selected and consumed by a large number of users, this forms a dominant interaction record in the recommendation system, which easily ignores the user's potential interest in unpopular restaurants, exacerbating the information cocoon effect and affecting the recommendation effect. Therefore, understanding the real needs of users is crucial for personalized dining recommendations.
[0003] In dining recommendations, traditional graph neural network models usually require a large amount of data to train in order to capture subtle changes in user preferences, but when data is sparse, the model may not be able to understand the user's real needs. Secondly, graph neural network models are difficult to make accurate recommendations for new users or new restaurants due to the lack of historical interaction data. In contrast, graph comparative learning methods generate positive sample pairs by using graph data augmentation techniques, such as node / edge perturbations or subgraph sampling, and learn node embeddings by contrastive learning. The core idea is to use the rich information in the graph structure to mine the complex relationship between users and restaurants through contrastive learning, thereby alleviating the adverse effects of data sparsity and popularity bias on the recommendation system. Therefore, the present invention proposes a recommendation model based on graph comparative learning, which uses self-supervised learning to effectively refine supervision signals, captures the complex relationship between users and restaurants through graph structures, and generates more representative recommendation results, thereby improving the personalization and accuracy of the recommendation system. Summary of the invention
[0004] In view of the impact of data enhancement on the performance of personalized dining recommendation tasks in existing graph comparative learning technologies, the present invention provides a personalized dining recommendation method and system based on graph comparative learning.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A personalized dining recommendation method based on graph contrast learning includes the following steps:
[0007] Step 1: User-restaurant interaction graph construction: Obtain data from restaurant review websites and construct a user-restaurant interaction graph;
[0008] Step 2, collaborative relationship encoding: construct a collaborative relationship encoder to capture the interaction features between users and restaurants, and learn the original embedding of user nodes and restaurant nodes in a low-dimensional latent space;
[0009] Step 3: Learn the embedding of the debiased channel; add uniform noise generated in the embedding space to the original embedding of the user-restaurant interaction graph learned in step 2 to generate personalized embeddings for users and restaurants;
[0010] Step 4: Learn the embedding of structure-preserving channels; use the variational graph autoencoder VGAE as the graph generation model to perform data augmentation on the user-restaurant interaction graph to obtain the user-restaurant generated graph, and use the collaborative relation encoder in step 2 to learn the embedding of the user-restaurant generated graph;
[0011] Step 5: Constructing the comparison task: Use the personalized embeddings of users and restaurants obtained in Steps 3 and 4 and the embeddings of the user-restaurant generated graph to construct the comparison task;
[0012] Step 6: Model construction and optimization: Combine the comparison task in step 5 with the recommendation task, build a personalized dining recommendation model based on graph comparison learning, and use the Adam optimization algorithm to optimize the model to improve the recommendation effect;
[0013] Step 7: Output the recommendation results. Based on the personalized dining recommendation model learned through graph comparison, generate recommendation results that meet the user's preferences, and provide the recommendation results to users and restaurant operators.
[0014] Further, the step 1 specifically includes the following steps:
[0015] Step 1.1, according to the needs of the personalized dining recommendation task, obtain and organize the interaction data between users and restaurants from the restaurant review website; this data includes users' ratings of restaurants, visit frequency, comment content, etc., as well as users' basic information and restaurant feature information (such as dish types, price range, etc.).
[0016] Step 1.2: Use the interaction data to construct a user-restaurant interaction graph G = (U, V), where each user and restaurant is considered as a node; U = {u1, ..., u i ,...,u I}(|U|=I) represents the user node set, V={v1,...,v j ,...,v J}(|V|=J) represents the set of restaurant nodes, I and J represent the number of user nodes and restaurant nodes respectively; the edge set N of the user-restaurant interaction graph G is constructed using the interaction data between users and restaurants; if user u i For restaurant j If there is interaction (such as rating, access, etc.), then at user node u i and restaurant node v j Create an edge n(u i ,v j ).
[0017] Furthermore, the step 2 constructs a collaborative relationship encoder to capture the interaction features between users and restaurants, and learns the original embedding of user nodes and restaurant nodes in a low-dimensional latent space, specifically including the following steps:
[0018] Step 2.1: Use graph convolution to construct a collaborative relationship encoder for user u i and restaurant j The generated size is The embedding vector e i and e j , d is the dimension of the latent space; define the embedding matrix and To represent the embedding of user nodes and restaurant nodes respectively; the embedding vectors of user and restaurant nodes are updated by aggregating the information of adjacent nodes:
[0019]
[0020] Among them, l represents the number of embedding propagation layers, and All have A vector of dimension , used to represent the distance from adjacent user / restaurant nodes to the central node u i and v j Aggregate information;
[0021] The normalized adjacency matrix of the user-restaurant interaction matrix A is obtained by formula (1):
[0022]
[0023] Step 2.2 integrates multiple embedding propagation layers and defines the embedding propagation process from the (l-1)th layer to the lth layer as follows:
[0024]
[0025] in, and Represents user u i and restaurant node v jEmbeddings at layer l of a neural network; sum the embeddings of all layers to get the final embedding of a node:
[0026]
[0027] Furthermore, step 3 adds uniform noise generated in the embedding space to the original embedding of the user-restaurant interaction graph learned in step 2, thereby generating personalized embeddings of users and restaurants. Specifically, the following steps are included:
[0028] Step 3.1, learn the embedding e of node i in the d-dimensional embedding space i , and implement the following data augmentation:
[0029] e′ i =e i +Δ′ i ,e″ i =e i +Δ″ i (5)
[0030] Among them, the added noise vector Δ′ i and Δ″ i Obey||Δ|| 2 = 0.1. This magnitude constraint makes Δ numerically equivalent to a point on a hypersphere with a radius of 0.1. There are also the following requirements for Δ:
[0031]
[0032] Among them, ω represents a vector with dimension d, which is used to control the size of Δ; sign(e i ) represents a symbolic function, returning e i The sign of , which in turn affects the direction of Δ;
[0033] These constraints make i , Δ′ and Δ″ are located in the same super-octant, so the noise is added to e i It does not lead to large deviations and can construct e i less informative enhancements;
[0034] Step 3.2, add different uniform random noises in the embedding aggregation process of each layer to obtain personalized embeddings of users and restaurants. This embedding learning involving noise can be expressed as:
[0035]
[0036] Where E′ represents the perturbation embedding obtained by aggregating multiple layers of embedding, L represents the number of aggregation layers, represents the normalized adjacency matrix of the lth layer, E (0)represents the initial node embedding matrix, i.e., the original user or restaurant node embedding at the model input; Δ (l) represents the uniform random noise of the lth layer;
[0037] Step 3.3, add an embedding consistency loss function with a regularization term to optimize the representation of the user and restaurant interaction graph and avoid overfitting:
[0038]
[0039] Among them, λ is the regularization coefficient, which is used to adjust the relative importance of embedding consistency loss and regularization loss in the total loss.
[0040] Furthermore, the step 4 learns the embedding of the structure-preserving channel; uses the variational graph autoencoder VGAE as a graph generation model to perform data enhancement on the user-restaurant interaction graph to obtain a user-restaurant generation graph, and uses the collaborative relationship encoder in step 2 to learn its embedding, specifically including the following steps:
[0041] Step 4.1, in the encoding phase, the distribution parameters (mean and variance) of the latent variables are learned using the co-relation encoder, and samples are sampled from the learned distribution;
[0042] Step 4.2, in the decoding stage, the decoder reconstructs the user-restaurant interaction graph based on the generated mean vector and adds the standard deviation of Gaussian noise to obtain the user-restaurant generated graph. The loss of this step is defined as:
[0043]
[0044] in, represents the KL divergence between the node embedding distribution and the standard Gaussian distribution; represents a cross entropy loss, which is used to quantify the difference between the user-restaurant generated graph and the user-restaurant interaction graph;
[0045] In step 4.3, the collaborative relation encoder is further used to learn the embedding of the user-restaurant generated graph.
[0046] Furthermore, in step 5, the comparison task is constructed by using the personalized embeddings of the user and restaurant obtained in step 3 and step 4 and the embeddings of the user-restaurant generated graph to construct the comparison task. Specifically, different embeddings of the same node are regarded as positive sample pairs, that is, (e i ′,e i ″)|u i ∈U, the embeddings of any two different nodes are regarded as negative sample pairs, that is, (e i ′,e i ″′)|u i ,u i′ ∈U,ui ≠u i′ ; The goal is to maximize the consistency between positive sample pairs and minimize the consistency between negative sample pairs. The user's contrast loss function is as follows:
[0047]
[0048] The cosine similarity function s(·) is used to measure the similarity between two embedding vectors. The hyperparameter τ is called the temperature coefficient in softmax. Similarly, the contrast loss of the restaurant is calculated. Combining the above two losses, we get the objective function of the comparison task
[0049] Furthermore, the step 6, model construction and optimization; combining the comparison task of step 5 with the recommendation task, constructing a personalized dining recommendation model based on graph comparison learning and optimizing the model using the Adam optimization algorithm to improve the recommendation effect, includes the following steps:
[0050] Step 6.1, the recommendation task is to maximize the predicted score of the high interaction restaurant node and the predicted ratings of low-interaction restaurant nodes The difference between them is used to drive the model to learn a more accurate ranking. The loss function of this process is expressed as:
[0051]
[0052] Among them, O=(u,i,j)|(u,i)∈O + ,(u,j)∈O - represents the training data, O + represents the observed interaction, O - =U×I / O + represents unobserved interactions;
[0053] Step 6.2, combining the comparison task with the recommendation task, constructing a personalized dining recommendation model based on graph comparison learning;
[0054] Step 6.3, the Adam optimization algorithm is used to optimize the model. The overall optimization model is shown in formula (14), which consists of two parts: the upper layer and the lower layer:
[0055] The upper layer consists of the loss of the recommendation task (Formula (11)) and the comparison task (Formula (10)):
[0056]
[0057] Where Θ represents the model parameter set in the recommendation task, λ1 and λ2 are hyperparameters that control the strength of SSL and regularization respectively;
[0058] The lower layer consists of the loss of the debiasing channel (Equation (8)) and the structure preserving channel (Equation (9)):
[0059]
[0060] The best training effect is achieved by jointly optimizing the losses of the upper and lower layers.
[0061] Furthermore, the step 7, outputting the recommendation results; based on the personalized dining recommendation model learned by graph comparison, generating recommendation results that meet the user's preferences, and providing the recommendation results to the user and the restaurant operator, specifically includes the following steps:
[0062] Step 7.1: When a user has a dining demand, the personalized dining recommendation model based on graph contrast learning is used to generate a corresponding recommendation sequence t based on the user’s personal preferences and historical consumption behavior. n :
[0063]
[0064] in, Used to predict user u a For restaurants b According to the preference values of specific users, different restaurants are sorted from large to small, and the top n restaurants are selected to generate a recommendation sequence t for them. n ;
[0065] Step 7.3, provide personalized dining recommendation results to users and restaurant operators; help users quickly find restaurants that meet their personal tastes and needs; help restaurant operators develop more targeted marketing strategies to attract customers and promote business growth.
[0066] A personalized dining recommendation system based on graph contrastive learning includes a computer processor and memory, a user-restaurant interaction graph construction unit, a collaborative relationship encoding unit, an embedding unit for learning a debiasing channel, an embedding unit for learning a structure-preserving channel, a contrast task construction unit, a model construction and optimization unit, and a recommendation result output unit.
[0067] The user-restaurant interaction graph construction unit executes step 1 to obtain data from the restaurant evaluation website, including information such as users' likes, comments, favorites, and historical consumption records of restaurants, and uses users and restaurants as nodes respectively to construct a user-restaurant interaction graph structure using the interaction data between users and restaurants;
[0068] The collaborative relationship encoding unit performs step 2 to construct a collaborative relationship encoder to capture the interaction features between users and restaurants and learn the original embeddings of user nodes and restaurant nodes in a low-dimensional latent space;
[0069] Learn the embedding unit of the debiased channel and perform step 3 to add the uniform noise generated in the embedding space to the original embedding of the user-restaurant interaction graph learned in step 2, thereby generating personalized embeddings for users and restaurants.
[0070] Learn the embedding unit of the structure-preserving channel, execute step 4, use the variational graph autoencoder (VGAE) as the graph generation model user-restaurant interaction graph for data enhancement, obtain the user-restaurant generation graph, and use the collaborative relation encoder in step 2 to learn the embedding of the user-restaurant generation graph;
[0071] The comparison task construction unit executes step 5 to construct the comparison task using the personalized embeddings of the user and restaurant obtained in steps 3 and 4 and the embedding of the user-restaurant generated graph;
[0072] The model building and optimization unit executes step 6, combines the comparison task in step 5 with the recommendation task, builds a personalized dining recommendation model based on graph comparative learning, and optimizes the model using the Adam optimization algorithm to improve the recommendation effect;
[0073] The recommendation result output unit executes step 7 to generate recommendation results that meet the user's preferences based on the personalized dining recommendation model learned through graph comparison, and provides the recommendation results to the user and restaurant operator for use.
[0074] Compared with the prior art, the present invention has the following advantages:
[0075] The personalized dining recommendation method based on graph contrast learning in the present invention effectively alleviates the adverse effects of popularity deviation on personalized restaurant recommendations through two different data enhancement methods.
[0076] The personalized dining recommendation method based on graph contrast learning in this paper uses self-supervised learning to effectively refine supervision signals and captures the complex relationship between users and restaurants through graph structures, thereby gaining a deep understanding of the user's true intentions. This method significantly improves the personalization and accuracy of the recommendation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 A model diagram of the personalized dining recommendation system of the present invention;
[0078] Figure 2 A computer-implemented system structure diagram of the personalized dining recommendation system of the present invention;
[0079] Figure 3 The figure is a flow chart of the personalized dining recommendation method of the present invention. DETAILED DESCRIPTION
[0080] In order to gain a deeper understanding of the present invention, we will provide a comprehensive and detailed description of the present invention. However, the present invention has multiple implementations and is not limited to the specific examples listed herein. The presentation of these examples is intended to deepen the comprehensive understanding of the disclosure of the present invention.
[0081] The personalized dining recommendation method based on graph contrast learning described in the present invention is implemented by a computer program. Figure 3 The process shown in the figure details the specific implementation of the technical solution proposed by the present invention, and uses the technical solution of the present invention to make recommendations on the Yelp dataset, which comes from the Yelp platform and contains user ratings, comments, business information (such as name, address, category, etc.) and relationships between users. We divide the dataset into three parts: training set, validation set and test set, with a ratio of 7:1:2. We adopt the full ranking evaluation protocol, and for each test user, the positive samples in the test set and all uninteracted restaurants are tested and ranked together.
[0082] Example 1
[0083] Step 1: Build a user-restaurant interaction graph. Obtain data from the restaurant review website and build a user-restaurant interaction graph. The specific steps are as follows:
[0084] Step 1.1, according to the needs of the personalized dining recommendation task, obtain and organize the interaction data between users and restaurants from the restaurant review website; this data includes users' ratings of restaurants, visit frequency, review content, etc., as well as basic information of users and characteristic information of restaurants (such as types of dishes, price range, etc.);
[0085] Step 1.2: Use the above information to construct a user-restaurant interaction graph G = (U, V), where each user and restaurant is considered as a node. i ,...,u I}(|U|=I) represents the user node set, V={v1,...,v j ,...,v J}(|V|=J) represents the set of restaurant nodes, I and J represent the number of user nodes and restaurant nodes respectively. The edge set N of the user-restaurant interaction graph G is constructed using the interaction data between users and restaurants. i For restaurant j If there is interaction (such as rating, access, etc.), then at user node u i and restaurant node v j Create an edge n(u i ,v j ).
[0086] Step 2: Cooperative relationship encoding. Construct a cooperative relationship encoder to capture the interaction features between users and restaurants and learn the original embedding of user nodes and restaurant nodes in a low-dimensional latent space. The specific steps are as follows:
[0087] Step 2.1: Use graph convolution to construct a collaborative relationship encoder for user u i and restaurant j The generated size is The embedding vector e i and e j , d is the dimension of the latent space; define the embedding matrix and To represent the embedding of user nodes and restaurant nodes respectively. The embedding vectors of user and restaurant nodes are updated by aggregating the information of adjacent nodes:
[0088]
[0089] Among them, l represents the number of embedding propagation layers, and All have A vector of dimension , used to represent the distance from adjacent user / restaurant nodes to the central node u i and v j Aggregate information;
[0090] The normalized adjacency matrix of the user-restaurant interaction matrix A is obtained by formula (1):
[0091]
[0092] Step 2.2 integrates multiple embedding propagation layers and defines the embedding propagation process from the (l-1)th layer to the lth layer as follows:
[0093]
[0094] in, and Represents user u i and restaurant node v j Embeddings at layer l of a neural network; sum the embeddings of all layers to get the final embedding of a node:
[0095]
[0096] Step 3 learns the embedding of the debiased channel. On the user and restaurant node embeddings learned in step 2, add the uniform noise generated in the embedding space to generate personalized embeddings for users and restaurants. The specific steps are as follows:
[0097] Step 3.1, learn the embedding e of node i in the d-dimensional embedding space i , and implement the following data augmentation:
[0098] e′ i =e i +Δ′ i ,e″ i =e i +Δ″ i (5)
[0099] The added noise vector Δ′ i and Δ″ i Obey||Δ|| 2 = 0.1. This magnitude constraint makes Δ numerically equivalent to a point on a hypersphere with a radius of 0.1. There are also the following requirements for Δ:
[0100]
[0101] Among them, ω represents a vector with dimension d, which is used to control the size of Δ; sign(e i ) represents a symbolic function, returning e i The sign of , which in turn affects the direction of Δ;
[0102] These constraints make i , Δ′ and Δ″ are located in the same super-octant, so the noise is added to e i It does not lead to large deviations and can construct e i less informative enhancements;
[0103] Step 3.2, add different uniform random noises in the embedding aggregation process of each layer to obtain personalized embeddings of users and restaurants. This embedding learning involving noise can be expressed as:
[0104]
[0105] Where E′ represents the perturbation embedding obtained by aggregating multiple layers of embedding, L represents the number of aggregation layers, represents the normalized adjacency matrix of the lth layer, E (0) represents the initial node embedding matrix, i.e., the original user or restaurant node embedding at the model input; Δ (l) represents the uniform random noise of the lth layer;
[0106] Step 3.3, add an embedding consistency loss function with a regularization term to optimize the embedding of the user and restaurant interaction graph and avoid overfitting:
[0107]
[0108] Among them, λ is the regularization coefficient, which is used to adjust the relative importance of embedding consistency loss and regularization loss in the total loss.
[0109] Step 4 learns the embedding of structure-preserving channels. The variational graph autoencoder (VGAE) is used as the graph generation model to perform data augmentation on the user-restaurant interaction graph to obtain the user-restaurant generation graph, and its embedding is learned using the collaborative relation encoder in step 2. The specific steps are as follows:
[0110] Step 4.1, in the encoding phase, the distribution parameters (mean and variance) of the latent variables are learned using the co-relation encoder, and samples are sampled from the learned distribution;
[0111] Step 4.2, in the decoding stage, the decoder reconstructs the user-restaurant interaction graph based on the generated mean vector and adds the standard deviation of Gaussian noise to obtain the user-restaurant generated graph. The loss of this step is defined as:
[0112]
[0113] in, represents the KL divergence between the node embedding distribution and the standard Gaussian distribution; represents a cross entropy loss, which is used to quantify the difference between the user-restaurant generated graph and the user-restaurant interaction graph;
[0114] In step 4.3, the collaborative relation encoder is further used to learn the embedding of the user-restaurant generated graph.
[0115] Step 5: Construct the comparison task. Use the personalized embeddings of users and restaurants obtained in Steps 3 and 4 and the embeddings of the user-restaurant generated graph to construct the comparison task. The specific steps are as follows:
[0116] Different embeddings of the same node are regarded as positive sample pairs, that is, (e i ′,e i ″)|u i ∈U, the embeddings of any two different nodes are regarded as negative sample pairs, that is, (e i ′,e i ″′)|u i ,u i′ ∈U,u i ≠u i′ , the goal is to maximize the consistency between positive sample pairs and minimize the consistency between negative sample pairs. The user's contrast loss function is as follows:
[0117]
[0118] The cosine similarity function s(·) is used to measure the similarity between two embedding vectors. The hyperparameter τ is called the temperature coefficient in softmax. Similarly, the contrast loss of the restaurant is calculated. Combining the above two losses, we get the objective function of the comparison task
[0119] Step 6: Model construction and optimization. Combine the comparison task in step 5 with the recommendation task, build a personalized dining recommendation model based on graph comparison learning, and use the Adam optimization algorithm to optimize the model to improve the recommendation effect. The specific steps are as follows:
[0120] Step 6.1, the recommendation task is to maximize the predicted score of the high interaction restaurant node and the predicted ratings of low-interaction restaurant nodes The difference between them is used to drive the model to learn a more accurate ranking. The loss function of this process is expressed as:
[0121]
[0122] Among them, O=(u,i,j)|(u,i)∈O + ,(u,j)∈O - represents the training data, O + represents the observed interaction, O - =U×I / O + represents unobserved interactions;
[0123] Step 6.2, combining the comparison task with the recommendation task, constructing a personalized dining recommendation model based on graph comparison learning;
[0124] Step 6.3, the Adam optimization algorithm is used to optimize the model. The overall optimization model is shown in formula (14), which consists of two parts: the upper layer and the lower layer:
[0125] The upper layer consists of the loss of the recommendation task (Formula (11)) and the comparison task (Formula (10)):
[0126]
[0127] Where Θ represents the model parameter set in the recommendation task, λ1 and λ2 are hyperparameters that control the strength of SSL and regularization respectively;
[0128] The lower layer consists of the loss of the debiasing channel (Equation (8)) and the structure preserving channel (Equation (9)):
[0129]
[0130] The best training effect is achieved by jointly optimizing the losses of the upper and lower layers.
[0131] Step 7: Output the recommendation results. Based on the personalized dining recommendation model learned through graph comparison, generate recommendation results that meet user preferences and provide the recommendation results to users and restaurant operators. The specific steps are as follows:
[0132] Step 7.1: When a user has a dining demand, the personalized dining recommendation model based on graph contrast learning is used to generate a corresponding recommendation sequence t based on the user’s personal preferences and historical consumption behavior. n :
[0133]
[0134] in, Used to predict user u a For restaurants b According to the preference values of specific users, different restaurants are sorted from large to small, and the top n restaurants are selected to generate a recommendation sequence t for them. n ;
[0135] Step 7.2, providing personalized dining recommendation results to users and restaurant operators; helping users quickly find restaurants that meet their personal tastes and needs; helping restaurant operators develop more targeted marketing strategies to attract customers and promote business growth.
[0136] Example 2
[0137] In order to verify the effectiveness and advancement of the technical solution proposed in the present invention, the present invention is compared with the lightweight graph convolution model LightGCN, GCCF, and the graph comparison collaborative filtering model NCL and SGL. Recall@20 and normalized discounted cumulative gain NDCG@20 are used as evaluation indicators for recommendation performance evaluation. The personalized dining recommendation results of the above method are evaluated using the Yelp dataset in the embodiment. The results are shown in Table 1:
[0138]
[0139] It can be seen from the results in the table that the method of the present invention can obtain more reliable recommendation results when performing personalized dining recommendations.
[0140] Example 3
[0141] like Figure 2 As shown, a personalized dining recommendation system based on graph contrast learning includes a computer processor and memory, a user-restaurant interaction graph construction unit, a collaborative relationship encoding unit, an embedding unit for learning a debiasing channel, an embedding unit for learning a structure-preserving channel, a contrast task construction unit, a model construction and optimization unit, and a recommendation result output unit.
[0142] The user-restaurant interaction graph construction unit executes step 1 to obtain data from the restaurant review website, including information such as users' likes, comments, favorites, and historical consumption records of restaurants, and construct a user-restaurant graph structure;
[0143] The collaborative relationship encoding unit performs step 2 to construct a collaborative relationship encoder to capture the interaction features between users and restaurants and learn the embedding of user nodes and restaurant nodes in a low-dimensional latent space;
[0144] Learn the embedding unit of the debiased channel and execute step 3 to add the uniform noise generated in the embedding space to the original embedding learned in step 2 to generate personalized embeddings for users and restaurants.
[0145] Learn the embedding unit of the structure-preserving channel, execute step 4, use the variational graph autoencoder (VGAE) as the graph generation model to perform data enhancement on the user-restaurant interaction graph constructed in step 1 to obtain the user-restaurant generated graph, and use the collaborative relation encoder in step 2 to learn the embedding of the user-restaurant generated graph;
[0146] The comparison task construction unit executes step 5 to construct the comparison task using the personalized embeddings of the user and restaurant obtained in steps 3 and 4 and the embedding of the user-restaurant generated graph;
[0147] The model building and optimization unit executes step 6, combines the comparison task in step 5 with the recommendation task, builds a personalized dining recommendation model based on graph comparative learning, and optimizes the model using the Adam optimization algorithm to improve the recommendation effect;
[0148] The recommendation result output unit executes step 7 to generate recommendation results that meet the user's preferences based on the personalized dining recommendation model learned through graph comparison, and provides the recommendation results to the user and restaurant operator for use.
[0149] The contents not described in detail in the specification of the present invention belong to the prior art known to the professional and technical personnel in the field. Although the illustrative specific embodiments of the present invention are described above to facilitate the understanding of the present invention by the technical personnel in the field, it should be clear that the present invention is not limited to the scope of the specific embodiments. For the ordinary technical personnel in the field, as long as various changes are within the spirit and scope of the present invention defined and determined by the attached claims, these changes are obvious, and all inventions and creations using the concept of the present invention are protected.
Claims
1. A personalized dining recommendation method based on graph contrast learning, characterized in that: The following steps are involved: Step 1: Obtain data from restaurant review websites and construct a user-restaurant interaction graph; Step 2: construct a collaborative relation encoder to capture the interaction features between users and restaurants and learn the original embeddings of user nodes and restaurant nodes in a low-dimensional latent space; Step 3: Add uniform noise generated in the embedding space to the original embedding of the user-restaurant interaction graph learned in step 2 to generate personalized embeddings for users and restaurants. Step 4: Use the variational graph autoencoder VGAE as a graph generation model to perform data enhancement on the user-restaurant interaction graph to obtain the user-restaurant generated graph, and use the collaborative relation encoder in step 2 to learn the embedding of the user-restaurant generated graph; Step 5: Use the personalized embeddings of users and restaurants obtained in steps 3 and 4 and the embeddings of the generated user-restaurant graph to construct a comparison task. Step 6: Combine the comparison task in step 5 with the recommendation task to build a personalized dining recommendation model based on graph comparison learning, and use the Adam optimization algorithm to optimize the model to improve the recommendation effect; Step 7: Based on the personalized dining recommendation model learned through graph comparison, a recommendation result that meets the user's preferences is generated, and the recommendation result is provided to the user and restaurant operator.
2. The personalized dining recommendation method based on graph contrast learning according to claim 1, characterized in that: The step 1 obtains data from the restaurant review website, and constructs a user-restaurant interaction graph, specifically including the following steps: Step 1.1, according to the needs of the personalized dining recommendation task, obtain and organize the interaction data between users and restaurants from the restaurant review website; Step 1.2: Use the interaction data to construct a user-restaurant interaction graph G = (U, V), where each user and restaurant is considered as a node; U = {u1, ..., u i ,...,u I }(U|=I) represents the user node set, V={v1,...,v j ,...,v J }(V|=J) represents the set of restaurant nodes, I and J represent the number of user nodes and restaurant nodes respectively; the edge set N of the user-restaurant interaction graph G is constructed using the interaction data between users and restaurants; if user u i For restaurant j If there is interaction, then at user node u i and restaurant node v j Create an edge n(u i ,v j ).
3. The personalized dining recommendation method based on graph contrast learning according to claim 1, characterized in that: The step 2 constructs a collaborative relationship encoder to capture the interaction features between users and restaurants, and learns the original embedding of user nodes and restaurant nodes in a low-dimensional latent space, specifically including the following steps: Step 2.1: Use graph convolution to construct a collaborative relationship encoder for user u i and restaurant j The generated size is The embedding vector e i and e j , d is the dimension of the latent space; define the embedding matrix and To represent the embedding of user nodes and restaurant nodes respectively; the embedding vectors of user and restaurant nodes are updated by aggregating the information of adjacent nodes: Where l represents the number of embedding propagation layers, and All have A vector of dimension , used to represent the distance from adjacent user / restaurant nodes to the central node u i and v j Aggregate information; The normalized adjacency matrix of the user-restaurant interaction matrix A is obtained by formula (1): Step 2.2 integrates multiple embedding propagation layers and defines the embedding propagation process from the (l-1)th layer to the lth layer as follows: in, and Represents user u i and restaurant node v j Embeddings at layer l of a neural network; sum the embeddings of all layers to get the final embedding of a node:
4. The personalized dining recommendation method based on graph contrast learning according to claim 1, characterized in that: The step 3 adds uniform noise generated in the embedding space to the original embedding of the user-restaurant interaction graph learned in step 2, thereby generating personalized embeddings of users and restaurants. Specifically, the following steps are included: Step 3.1, learn the embedding e of node i in the d-dimensional embedding space i , and implement the following data augmentation: And' i =and i +Δ′ i ,And" i =and i +Δ″ i (5) Among them, the added noise vector Δ′ i and Δ″ i Obey||Δ|| 2 =0.1, and there are the following requirements for Δ: Among them, ω represents a vector with dimension d, which is used to control the size of Δ; sign(e i ) represents a symbolic function, returning e i The sign of , which in turn affects the direction of Δ; Step 3.2, add different uniform random noises in the embedding aggregation process of each layer to obtain personalized embeddings for users and restaurants. The embedding learning involving noise is expressed as: Where E′ represents the perturbation embedding obtained by aggregating multiple layers of embedding, L represents the number of aggregation layers, represents the normalized adjacency matrix of the lth layer, E (0) represents the initial node embedding matrix, i.e., the original user or restaurant node embedding at the model input; Δ (l) represents the uniform random noise of the lth layer; Step 3.3, add an embedding consistency loss function with a regularization term to optimize the representation of the user and restaurant interaction graph and avoid overfitting: Among them, λ is the regularization coefficient, which is used to adjust the relative importance of embedding consistency loss and regularization loss in the total loss; Θ represents the set of model parameters in the recommendation task.
5. The personalized dining recommendation method based on graph contrast learning according to claim 1, characterized in that: The step 4 uses the variational graph autoencoder VGAE as a graph generation model to perform data enhancement on the user-restaurant interaction graph to obtain a user-restaurant generation graph, and uses the collaborative relationship encoder in step 2 to learn the embedding of the user-restaurant generation graph. Specifically, the following steps are included: Step 4.1, in the encoding phase, the distribution parameters of the latent variables are learned using the co-relation encoder and sampled from the learned distribution; Step 4.2, in the decoding stage, the decoder reconstructs the user-restaurant interaction graph based on the generated mean vector and adds the standard deviation of Gaussian noise to obtain the user-restaurant generated graph. The loss of this step is defined as: in, represents the KL divergence between the node embedding distribution and the standard Gaussian distribution; represents a cross entropy loss, which is used to quantify the difference between the user-restaurant generated graph and the user-restaurant interaction graph; In step 4.3, the collaborative relation encoder is further used to learn the embedding of the user-restaurant generated graph.
6. The personalized dining recommendation method based on graph contrast learning according to claim 1, characterized in that: The step 5 uses the personalized embeddings of users and restaurants obtained in steps 3 and 4 and the embeddings of the user-restaurant generated graph to construct a comparison task. Specifically, different embeddings of the same node are regarded as positive sample pairs, that is, (e i ′,e i ″)|u i ∈U, the embeddings of any two different nodes are regarded as negative sample pairs, that is, (e i ′,e i ″′)|u i ,u i′ ∈U,u i ≠u i′ ; The goal is to maximize the consistency between positive sample pairs and minimize the consistency between negative sample pairs. The user's contrast loss function is as follows: The cosine similarity function s(·) is used to measure the similarity between two embedding vectors. The hyperparameter τ is called the temperature coefficient in softmax. Similarly, the contrast loss of the restaurant is calculated. Combining the above two losses, we get the objective function of the comparison task 7. The personalized dining recommendation method based on graph contrast learning according to claim 1, characterized in that: The step 6 combines the comparison task in step 5 with the recommendation task to build a personalized dining recommendation model based on graph comparison learning, and optimizes the model using the Adam optimization algorithm to improve the recommendation effect; including the following steps: Step 6.1, the recommendation task is to maximize the predicted score of the high interaction restaurant node and the predicted ratings of low-interaction restaurant nodes The difference between them is used to drive the model to learn a more accurate ranking. The loss function of this process is expressed as: Among them, O=(u,i,j)|(u,i)∈O + ,(u,j)∈O - represents the training data, O + represents the observed interaction, O - =U×I / O + represents unobserved interactions; Step 6.2, combining the comparison task with the recommendation task, constructing a personalized dining recommendation model based on graph comparison learning; Step 6.3, the Adam optimization algorithm is used to optimize the model. The overall optimization model is shown in formula (14), which consists of two parts: the upper layer and the lower layer: The upper layer consists of the loss of the recommendation task and the comparison task: Where Θ represents the model parameter set in the recommendation task, λ1 and λ2 are hyperparameters that control the strength of SSL and regularization respectively; The lower layer consists of the loss of the debiasing channel and the structure preserving channel: The best training effect is achieved by jointly optimizing the losses of the upper and lower layers.
8. The personalized dining recommendation method based on graph contrast learning according to claim 1, characterized in that: The step 7, outputting the recommendation results; based on the personalized dining recommendation model learned by graph comparison, generating recommendation results that meet the user's preferences, and providing the recommendation results to the user and the restaurant operator, specifically includes the following steps: Step 7.1: When a user has a dining demand, the personalized dining recommendation model based on graph contrast learning is used to generate a corresponding recommendation sequence t based on the user’s personal preferences and historical consumption behavior. n : in, Used to predict user u a For restaurants b According to the preference values of specific users, different restaurants are sorted from large to small, and the top n restaurants are selected to generate a recommendation sequence t for them. n ; Step 7.2, providing personalized dining recommendation results to users and restaurant operators.
9. A personalized dining recommendation system based on graph contrast learning, characterized by: It includes a computer processor and memory, a user-restaurant interaction graph construction unit, a collaborative relationship encoding unit, an embedding unit for learning a debiasing channel, an embedding unit for learning a structure-preserving channel, a comparison task construction unit, a model construction and optimization unit, and a recommendation result output unit. The user-restaurant interaction graph construction unit obtains data from the restaurant review website, takes users and restaurants as nodes, and uses the interaction data between users and restaurants to construct a user-restaurant interaction graph structure; The collaborative relationship encoding unit constructs a collaborative relationship encoder to capture the interaction features between users and restaurants and learn the original embeddings of user nodes and restaurant nodes in a low-dimensional latent space; The embedding unit of the learning debiasing channel adds uniform noise generated in the embedding space to the original embedding of the user-restaurant interaction graph, thereby generating personalized embeddings of users and restaurants; The learning structure preserves the channel embedding unit, uses the variational graph autoencoder as a graph generation model to perform data enhancement on the user-restaurant interaction graph, obtains the user-restaurant generation graph, and uses the collaborative relation encoder to learn its embedding; The comparison task construction unit constructs the comparison task by using the personalized embeddings of users and restaurants and the embeddings of the user-restaurant generated graph; The model building and optimization unit combines the comparison task with the recommendation task, builds a personalized dining recommendation model based on graph comparison learning, and optimizes the model using the Adam optimization algorithm to improve the recommendation effect; The recommendation result output unit generates recommendation results that meet user preferences based on the personalized dining recommendation model learned through graph comparison, and provides the recommendation results to users and restaurant operators for use.
Citation Information
Patent Citations
Conditional variation auto-encoder-based neighborhood feature enhancement method on multi-channel heterogeneous attribute graph
CN117473161A
Data pushing method and device, electronic equipment and storage medium
CN117633341A
Knowledge perception-based graph self-supervised learning recommendation method
CN117634600A
Graph comparison recommendation method capable of learning enhancement
CN117668354A
Citation network graph representation learning system and method based on multi-view contrastive learning
US20240104376A1