A recommendation method and apparatus
By using a graph neural network with heterogeneous spatiotemporal graph modeling and a two-layer attention mechanism, temporal and spatial information is extracted, which solves the problems of insufficient utilization of spatiotemporal information and data sparsity in point of interest recommendation, thereby improving recommendation accuracy and user experience.
Patent Information
- Application Number
- CN202310991058.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-07
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2043-08-07
AI Technical Summary
Existing POI recommendation algorithms fail to effectively utilize spatiotemporal information, ignore the complex interactions between geographic locations and users and POIs, and fail to effectively solve the problem of data sparsity, resulting in insufficient recommendation accuracy.
We employ heterogeneous spatiotemporal graph modeling, extract node representation vectors through time-aware and space-aware graph neural networks, and fuse them with a two-layer attention mechanism to learn high-quality node representations. We also utilize the dual-view comparison learning of heterogeneous spatiotemporal graphs to provide rich supervision information.
It improves the accuracy of POI recommendations, enhances user experience, solves data sparsity and heterogeneity problems, and enhances the quality of recommendation results.
Smart Images

Figure CN119441586B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to a recommendation method and device. BACKGROUND
[0002] With the rise of location-based social networks, users record and share their visits to points of interest (POI) on the network, which brings a new recommendation task, i.e., POI recommendation. Since the user's check-in data includes the visited POI location and the check-in time, POI recommendation algorithms often rely on these spatio-temporal information, which is the biggest difference between POI recommendation and other recommendation tasks. Figure 1 An example of a POI recommendation scenario. However, traditional POI recommendation algorithms model the POI recommendation scenario as a User-POI bipartite graph, modeling the simple interaction between the two. In fact, Location, as a geographic location point, has more complex interactions with users and POIs and has an impact on POI recommendation. SUMMARY
[0003] Embodiments of the present application provide a recommendation method, which models the heterogeneity in POI recommendation, considers spatio-temporal information, extracts higher-order information representation of nodes through graph neural networks, and improves the accuracy of the recommendation result.
[0004] In a first aspect, the present application provides a recommendation method, comprising: obtaining a time view and a space view, wherein the time view comprises user nodes, POI nodes, and first connection edges, the first connection edges being used to connect the user nodes and the POI nodes, the user nodes representing user information, the POI nodes representing POI information, and the connection edges comprising time information; the space view comprises user nodes, POI nodes, geographic location nodes, second connection edges, third connection edges, and fourth connection edges, the geographic location nodes representing geographic location information, the second connection edges being used to connect the user nodes and the POI nodes, the third connection edges being used to connect the POI nodes and the geographic location nodes, and the fourth connection edges being used to connect two different geographic location nodes; taking the time view as an input of a first graph neural network, and outputting first node representation vectors of the user nodes and first node representation vectors of the POI nodes; taking the space view as an input of a second graph neural network, and outputting second node representation vectors of the user nodes and second node representation vectors of the POI nodes; obtaining node representations of the user nodes based on the first node representation vectors of the user nodes and the second node representation vectors of the user nodes; obtaining node representations of the POI nodes based on the first node representation vectors of the POI nodes and the second node representation vectors of the POI nodes; and determining a recommendation result based on the node representations of the user nodes and the node representations of the POI nodes.
[0005] The recommendation method provided in the application models a visual view including interaction time information and a spatial view including spatial information, extracts a node representation vector under the time view through a first graph neural network, extracts a node representation vector under the spatial view through a second graph neural network, fuses the node representation vector under the time view and the node representation vector under the spatial view to obtain a final node representation including time-space information, determines a recommendation result based on the final node representation, and recommends a point of interest to a user, thereby improving the accuracy of the recommendation result and improving user experience.
[0006] In one possible implementation, the time view is taken as the input of the first graph neural network, and a specific implementation of outputting the first node representation vector of the user node and the first node representation vector of the point of interest node includes that the first graph neural network includes a first multi-layer neural network layer, and after the time view is input into the first graph neural network, the first node representation vector of the user node and the first node representation vector of the point of interest node are obtained through processing of the first multi-layer neural network layer.
[0007] Each neural network layer in the first multi-layer neural network layer performs the following operation on each node in the time view: aggregating the time information on the first connection edge connected with each node in the time view to obtain a first aggregation result; aggregating the last layer node representation vector of the neighbor node of each node in the time view to obtain a second aggregation result; and performing weighted fusion on the first aggregation result and the second aggregation result to obtain the node representation vector of each node in the time view at the current layer; wherein the node representation vector of the user node output by the last layer neural network layer in the first multi-layer neural network layer is the first node representation vector of the user node, and the node representation vector of the point of interest node is the first node representation vector of the point of interest node.
[0008] In this possible implementation, the first graph neural network can learn a time-aware node representation, for example, aggregate the time information on the connection edge connected with the node to obtain a node representation vector including the time information, and improve the high-order information representation of the node representation.
[0009] In one possible implementation, the weight of the first aggregation result is determined based on an attention coefficient of the first aggregation result, and the weight of the second aggregation result is determined based on an attention coefficient of the second aggregation result.
[0010] Through the attention mechanism, the first aggregation result and the second aggregation result are fused, it is learned that which information of the first aggregation result and the second aggregation result is more important, the weighted fusion weight of the important information is improved, the important information is focused with a high weight, and the reasoning learning speed is accelerated.
[0011] In another possible implementation, the space view is taken as an input of the second graph neural network, and a specific implementation of outputting the second node representation vector of the user node and the second node representation vector of the point of interest node includes that: the second graph neural network includes a second multi-layer neural network layer, and after the space view is input into the second graph neural network, the space view is processed by the second multi-layer neural network layer to obtain the second node representation vector of the user node and the second node representation vector of the point of interest node.
[0012] Each neural network layer in the second multi-layer neural network layer performs the following operation on each node in the space view: aggregating the last layer node representation vectors of the same type neighbor nodes of each node in the space view to obtain an aggregation result of each type neighbor node; and fusing the aggregation results of each type neighbor node by weighting to obtain a node representation vector of each node in the space view at a current layer; wherein the node representation vector of the user node output by the last layer neural network layer in the second multi-layer neural network layer is the second node representation vector of the user node, and the node representation vector of the point of interest node is the second node representation vector of the point of interest node.
[0013] In this possible implementation, the second graph neural network can learn a node representation with spatial perception, for example, aggregating spatial neighbors (for example, geographic location nodes) of the node to obtain a node representation vector including spatial location information, and improving high-order information representation of the node representation.
[0014] Optionally, the weights of the aggregation results of each type neighbor node are determined based on attention coefficients of each type neighbor node.
[0015] By using the attention mechanism, the attention coefficients of the aggregation results of each type neighbor node are determined, and the attention coefficients are taken as the aggregation results of each type neighbor node to fuse the aggregation results of each type neighbor node,
[0016] By using the attention mechanism, it can be learned that each type neighbor node is more important, the weighting fusion weight of the important neighbor node is improved, and the weighting fusion weight of the unimportant neighbor node is reduced, so that important information is focused on with a high weight, less important information is ignored with a low weight, and the reasoning learning speed is accelerated.
[0017] In another possible implementation, based on the first node representation vector of the user node and the second node representation vector of the user node, one specific implementation of obtaining the node representation of the user node is: fusing the first node representation vector of the user node and the second node representation vector of the user node by weighting to obtain the node representation of the user node; wherein the weight of the first node representation vector of the user node is determined based on the attention coefficient of the first node representation vector of the user node, and the weight of the second node representation vector of the user node is determined based on the attention coefficient of the second node representation vector of the user node.
[0018] In another possible implementation, based on the first node representation vector of the interest point node and the second node representation vector of the interest point node, one specific implementation of obtaining the node representation of the interest point node is: fusing the first node representation vector of the interest point node and the second node representation vector of the interest point node by weighting to obtain the node representation of the interest point node; wherein the weight of the first node representation vector of the interest point node is determined based on the attention coefficient of the first node representation vector of the interest point node, and the weight of the second node representation vector of the interest point node is determined based on the attention coefficient of the second node representation vector of the interest point node.
[0019] By means of the double-layer attention mechanism, the neighbor nodes of the target node are aggregated, and the reasoning learning speed is further accelerated.
[0020] In another possible implementation, based on the node representation of the user node and the node representation of the interest point node, one specific implementation of determining the recommendation result is: calculating the similarity between the node representation of the user node and the node representation of the interest point node to obtain a similarity result; determining the predicted scores of the interest point nodes based on the similarity result; and determining the N interest points recommended to the user based on the predicted scores, wherein the predicted scores corresponding to the N interest points are higher than the predicted scores corresponding to other interest points, and N is a positive integer greater than 1.
[0021] For example, the predicted scores of the plurality of interest points are sorted from large to small, and the first N interest points are recommended to the user in the order of the sorting, and the interest point with the highest predicted score is recommended to the user first.
[0022] In one example, the similarity between the node representation of the user node and the node representation of the interest point node is also related to the time information between the user node and the interest point node. Considering the influence of the interaction time between the user and the interest point, the predicted score is more accurate.
[0023] In another possible implementation, the first graph neural network and the second graph neural network adjust parameters of the first graph neural network and parameters of the second graph neural network based on a target loss function; wherein the target loss function is determined based on a sum of a bayesian personalized ranking (BPR) loss function and a contrastive loss function, the contrastive loss function being used to maximize mutual information between positive examples and minimize mutual information between negative examples, the same node in the temporal view and the spatial view being the positive example, and different nodes of the same type in the temporal view and the spatial view being the negative example.
[0024] Through the dual-view contrastive learning of the temporal view and the spatial view, rich supervised information can be effectively provided, and the problem that the graph neural network is difficult to learn high-quality node representations due to the sparsity of data can be effectively overcome.
[0025] In another possible implementation, a specific implementation of obtaining the temporal view and the spatial view is as follows: a heterogeneous spatio-temporal graph is obtained, the heterogeneous spatio-temporal graph comprising the user node, the point-of-interest node, the geographic location node, the first connection edge, the third connection edge and the fourth connection edge; and the heterogeneous spatio-temporal graph is split to obtain the temporal view and the spatial view.
[0026] In a second aspect, the present application further provides a recommendation device, comprising an obtaining module, a temporal view node representation extraction module, a spatial view node representation extraction module and a recommendation module, wherein the obtaining module is configured to obtain a temporal view and a spatial view, wherein the temporal view comprises a user node, a point-of-interest node and a first connection edge, the first connection edge being configured to connect the user node and the point-of-interest node, the user node representing user information, the point-of-interest node representing point-of-interest information, and the connection edge comprising time information; the spatial view comprises the user node, the point-of-interest node, a geographic location node, a second connection edge, a third connection edge and a fourth connection edge, the geographic location node representing geographic location information, the second connection edge being configured to connect the user node and the point-of-interest node, the third connection edge being configured to connect the point-of-interest node and the geographic location node, and the fourth connection edge being configured to connect two different geographic location nodes; the temporal view node representation extraction module is configured to input the temporal view into a first graph neural network, and output a first node representation vector of the user node and a first node representation vector of the point-of-interest node; the spatial view node representation extraction module is configured to input the spatial view into a second graph neural network, and output a second node representation vector of the user node and a second node representation vector of the point-of-interest node; and the recommendation module is configured to obtain a node representation of the user node based on the first node representation vector of the user node and the second node representation vector of the user node, obtain a node representation of the point-of-interest node based on the first node representation vector of the point-of-interest node and the second node representation vector of the point-of-interest node, and determine a recommendation result based on the node representation of the user node and the node representation of the point-of-interest node.
[0027] In a possible implementation, the time view node representation extraction module is specifically configured to: the first graph neural network comprises a first multi-layer neural network layer, and each neural network layer in the first multi-layer neural network layer performs the following operations on each node in the time view: aggregating the time information on the first connection edge connected to each node in the time view to obtain a first aggregation result; aggregating the node representation vector of the previous layer of the neighbor node of each node in the time view to obtain a second aggregation result; and performing weighted fusion on the first aggregation result and the second aggregation result to obtain the node representation vector of each node in the time view at the current layer; and the node representation vector of the user node output by the last neural network layer in the first multi-layer neural network layer is the first node representation vector of the user node, and the node representation vector of the point of interest node is the first node representation vector of the point of interest node.
[0028] In another possible implementation, the weight of the first aggregation result is determined based on the attention coefficient of the first aggregation result, and the weight of the second aggregation result is determined based on the attention coefficient of the second aggregation result.
[0029] In another possible implementation, the space view node representation extraction module is specifically configured to: the second graph neural network comprises a second multi-layer neural network layer, and each neural network layer in the second multi-layer neural network layer performs the following operations on each node in the space view: aggregating the node representation vector of the previous layer of the same type neighbor node of each node in the space view to obtain an aggregation result of each type neighbor node; and performing weighted fusion on the aggregation result of each type neighbor node to obtain the node representation vector of each node in the space view at the current layer; and the node representation vector of the user node output by the last neural network layer in the second multi-layer neural network layer is the second node representation vector of the user node, and the node representation vector of the point of interest node is the second node representation vector of the point of interest node.
[0030] In another possible implementation, the weight of the aggregation result of each type neighbor node is determined based on the attention coefficient of each type neighbor node.
[0031] In another possible implementation, the recommendation module is specifically configured to: performing weighted fusion on the first node representation vector of the user node and the second node representation vector of the user node to obtain the node representation of the user node; and the weight of the first node representation vector of the user node is determined based on the attention coefficient of the first node representation vector of the user node, and the weight of the second node representation vector of the user node is determined based on the attention coefficient of the second node representation vector of the user node.
[0032] In another possible implementation, the recommendation module is further configured to: fuse the first node representation vector of the point of interest node and the second node representation vector of the point of interest node by weighting, to obtain a node representation of the point of interest node; and wherein a weight of the first node representation vector of the point of interest node is determined based on the attention coefficient of the first node representation vector of the point of interest node, and a weight of the second node representation vector of the point of interest node is determined based on the attention coefficient of the second node representation vector of the point of interest node.
[0033] In another possible implementation, the recommendation module is further configured to: calculate a similarity between the node representation of the user node and the node representation of the point of interest node, to obtain a similarity result; determine a prediction score of each of the point of interest nodes based on the similarity result; and determine N points of interest to be recommended to the user based on the prediction score, the N points of interest corresponding to prediction scores higher than prediction scores of other points of interest, N being a positive integer greater than 1.
[0034] In another possible implementation, the similarity between the node representation of the user node and the node representation of the point of interest node is further related to time information between the user node and the point of interest node.
[0035] In another possible implementation, the first graph neural network and the second graph neural network are adjusted based on a target loss function to obtain the parameters of the first graph neural network and the parameters of the second graph neural network; and wherein the target loss function is determined based on a sum of a BPR loss function and a contrastive loss function, the contrastive loss function is used to maximize mutual information between positive examples and minimize mutual information between negative examples, and the same node in the time view and the space view is a positive example, and different nodes of the same type in the time view and the space view are negative examples.
[0036] In another possible implementation, the obtaining module is configured to: obtain a heterogeneous spatio-temporal graph, the heterogeneous spatio-temporal graph including a user node, a point of interest node, a geographic location node, a first connection edge, a third connection edge, and a fourth connection edge; and split the heterogeneous spatio-temporal graph to obtain a time-space view and a space view.
[0037] In a third aspect, an embodiment of the present application provides a computing device, including a memory and a processor, the memory storing instructions, when the instructions are executed by the processor, the method of the first aspect is implemented.
[0038] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, storing a computer program, when the computer program is executed by a processor, the method of the first aspect is implemented.
[0039] In a fifth aspect, the embodiments of the present application further provide a computer program or a computer program product, which comprises instructions, when the instructions are executed, causing a computer to execute the method of the first aspect.
[0040] In a sixth aspect, the embodiments of the present application further provide a chip, comprising at least one processor and a communication interface, the processor being configured to execute the method of the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0041] Figure 1 A schematic diagram showing a point of interest recommendation scenario is shown;
[0042] Figure 2 A schematic diagram showing an exemplary system in which the various methods and apparatus described herein can be implemented according to embodiments of the present disclosure is shown;
[0043] Figure 3 A schematic diagram showing another exemplary system in which the various methods and apparatus described herein can be implemented according to embodiments of the present disclosure is shown;
[0044] Figure 4 A flowchart of a recommendation method provided by the embodiments of the present application is shown;
[0045] Figure 5 A schematic diagram of a heterogeneous spatio-temporal graph contrastive learning method provided by the embodiments of the present application is shown;
[0046] Figure 6 A performance diagram of the HestGCL model provided by the embodiments of the present application in different representation vector dimensions is shown;
[0047] Figure 7 A structural diagram of a recommendation apparatus provided by the embodiments of the present application is shown;
[0048] Figure 8 A structural diagram of a computing device provided by the embodiments of the present application is shown. DETAILED DESCRIPTION
[0049] The technical solutions of the present application are described in further detail below with reference to the accompanying drawings and embodiments.
[0050] In recommendation systems, the main challenge is to learn effective user / item representations from interactions and auxiliary information. Graph neural network (GNN) techniques have been widely applied in recommendation systems for the following three reasons: (1) most information in recommendation systems is essentially graph-structured, and GNNs have advantages in graph representation learning; (2) from a graph structure perspective, different types of information can be modeled in a unified framework; (3) GNNs can explicitly encode high-order signals in user interaction behavior through multi-layer network information propagation.
[0051] The GNN recommendation algorithm in the related art can model the POI recommendation scenario as a User-POI bipartite graph, and model the simple interaction between the two. However, in fact, the Location as a geographic location point has more complex interactions with users and POIs and has an impact on POI recommendations.
[0052] For recommendations, the representation learning of the user-item graph has evolved from using a single ID or interaction history to leveraging high-order neighbors, which has led to the success of graph convolutional network (GCN) based recommendations such as PinSage and LightGCN. Although effective, they have two limitations: (1) popular items have a greater impact on representation learning, which worsens the recommendation of cold (long-tail) items; (2) the neighborhood aggregation scheme further amplifies the influence of observed edges, so the representation is vulnerable to noisy interactions.
[0053] To improve the accuracy and robustness of GNN recommendations, some works have designed GNN recommendations combined with self-supervised learning. Self-supervised learning is to set an auxiliary task to extract additional signals from the input data itself, especially by exploiting the unlabeled data space. Compared with supervised learning, self-supervised learning allows the use of unlabeled data space by making changes to the input data, thereby improving the performance of downstream tasks. Although GNN recommendations combined with self-supervised learning can alleviate the data sparsity problem in POI recommendations, none of the methods take into account the spatio-temporal information.
[0054] For example, one recommendation scheme is GPR, which is a graph neural network-based point-of-interest recommendation algorithm that considers two types of influence: incoming and outgoing influence. Based on a graph autoencoder, the latent representations of incoming and outgoing influence are trained, and the trained geographic latent representations of input and output influence are used to estimate user preferences. The specific implementation steps are as follows:
[0055] Step S11, a POI-POI bipartite graph is constructed, and the edge weight represents the frequency of two POIs being visited adjacent to each other within a period of time. Then a User-POI interaction graph is constructed.
[0056] Step S12: Use GGLR (a GAE variant) to learn POI embeddings. First, the GNN-based similarity between POI embeddings is calculated, followed by the physical distance embeddings between POIs. The physical distance embeddings are then multiplied by the POI embedding similarity to produce the predicted probability between POIs. This probability is used to reconstruct the POI-POI graph.
[0057] Step S13: Use GCN to learn user embeddings. Considering the different feature dimensions of users and POIs, different W matrices are used. Finally, the multiple layers of user embeddings are concatenated, and the multiple layers of POI embeddings are concatenated. The inner product is calculated as the similarity.
[0058] However, applying the recommendation scheme to point of interest recommendation has the following drawbacks:
[0059] 1. Coarse-grained modeling of heterogeneity in POI recommendation data. Only a bipartite graph between users and POIs, and a homogeneous graph between POIs, are constructed to model simple interactions between them. However, as a geographic point, a location has more complex interactions with users and POIs, which is ignored by GPR.
[0060] 2. The sparsity of interactions is not fully considered. Recommendation systems are often affected by data sparsity, which may make it difficult for GPR models to learn high-quality node representations or be easily affected by interaction noise.
[0061] Another recommendation solution is SGL, a graph-based self-supervised learning model. It designs three data augmentation mechanisms and combines contrastive learning techniques to improve the performance of graph neural network-based recommendation algorithms. The main implementation steps are as follows:
[0062] Step S21, data enhancement, generates multiple views for each node, including three operators: node drop, edge drop and random walk.
[0063] Step S22: Use LightGCN to learn node representations of users and POIs.
[0064] Step S23: Use contrastive learning to maximize the consistency between different views of the same node and different views of other nodes
[0065] However, applying the recommendation scheme to point of interest recommendation has the following drawbacks:
[0066] 1. Not applicable to heterogeneous spatio-temporal graphs: SGL only considers simple bipartite graphs and does not consider the high-order semantic information and spatio-temporal information between different types of nodes on heterogeneous spatio-temporal graphs.
[0067] 2. Not designed for point-of-interest recommendation: spatio-temporal information modeling is very important for point-of-interest recommendation, and SGL does not consider spatio-temporal information and can only be applied to non-spatio-temporal recommendation scenarios.
[0068] To solve the above problems, the embodiments of the present application propose a recommendation method and device, which models the heterogeneity and sparsity problems in point-of-interest recommendation, so that the graph neural network learns high-quality node representations and improves the recommendation effect. In terms of technology, the heterogeneity and sparsity problems in point-of-interest recommendation are considered, and a graph neural network framework HestGCL for point-of-interest recommendation is proposed by using heterogeneous spatio-temporal graph modeling.
[0069] The graph neural network framework HestGCL for point-of-interest recommendation proposed in the embodiments of the present application is designed to solve the data sparsity and heterogeneity problems in point-of-interest recommendation. A heterogeneous graph neural network module is designed to enhance node representation. Simply put, by introducing a time-aware graph neural network (which can be referred to as a first graph neural network) and a space-aware graph neural network (which can be referred to as a second graph neural network), time-aware node representations and space-aware node representations can be learned. Comparing the two can provide additional supervision information. The GNN method in the related art ignores the modeling of heterogeneity and sparsity, resulting in poor quality of node representations learned by GNN. Therefore, the embodiments of the present application propose a double-view heterogeneous spatio-temporal graph contrastive learning to aggregate time neighbors and space neighbors respectively, and compared to the original supervision information using only historical interaction behavior, this double-view operation can effectively provide rich supervision information
[0070] The recommendation method provided by the embodiments of the present application aims to better utilize the heterogeneous graph neural network of spatio-temporal information to solve the deficiencies of the GNN-based recommendation method in the related art in the point-of-interest recommendation scenario.
[0071] The recommendation method provided by the embodiments of the present application can be applied to various point-of-interest recommendation scenarios and problems that use graph modeling, such as restaurant recommendation, takeout recommendation, tourist attraction recommendation, and other point-of-interest recommendation scenarios.
[0072] For example, in the restaurant recommendation scenario, a restaurant can be defined as a point of interest, and the dining behavior of a user in the restaurant can be used as interaction data. By using the recommendation method provided by the embodiments of the present application, the dining preferences of the user and the influence of time and space factors on the dining preferences can be captured.
[0073] In the takeout recommendation recommendation scenario, the takeout can be defined as a point of interest, and the user's behavior of ordering takeout can be used as interaction data. By using the recommendation method provided in the embodiments of the present application, the user's preference for ordering takeout, as well as the influence of time and space factors on the preference for ordering takeout, can be captured.
[0074] In the tourist attraction recommendation scenario, the tourist attraction can be defined as a point of interest, and the user's behavior of visiting the attraction can be used as interaction data. By using the recommendation method provided in the embodiments of the present application, the user's preference for visiting the attraction, as well as the influence of time and space factors on the preference for visiting the attraction, can be captured.
[0075] In the point of interest recommendation scenario, the general GNN can achieve certain effects, but due to the lack of consideration of the heterogeneity and sparsity of data, the effect is not good. Therefore, the above examples can solve the problem of data heterogeneity and sparsity in actual business scenarios by using the graph neural network framework HestGCL for point of interest recommendation proposed in the embodiments of the present application, so as to achieve better performance.
[0076] Figure 2 A schematic diagram of an exemplary system in which the various methods and apparatus described herein can be implemented according to embodiments of the present disclosure is shown.
[0077] As shown in Figure 2 , the system 200 includes a terminal 210, a server 230, and a network 220 that communicatively connects the terminal 210 and the server 230. The terminal 210 can run one or more services or software applications that can perform the recommendation method. The server 230 can run one or more services or software applications that can perform the training method of the neural network model related to the embodiments of the present application.
[0078] In some embodiments, the server 230 can also provide other services or software applications including non-virtual environments and virtual environments. In some embodiments, these services can be provided as web-based services or cloud services, for example, to users of the terminal under a software as a service (SaaS) model.
[0079] In the system shown in Figure 2 , the server 230 can include one or more components that implement the functions performed by the server 230. These components can include software components executable by one or more processors, hardware components, or a combination thereof.
[0080] In one example, the graph neural network framework HestGCL for point of interest recommendation proposed in the embodiments of the present application can be deployed in the server 230 for inference to obtain a recommendation result. The terminal 210 collects interaction data (for example, check-in data) of a user with a point of interest. The terminal 210 sends the interaction data of the user with the point of interest to the server 230. The server 230 models a heterogeneous spatio-temporal graph of a point of interest recommendation scenario based on the interaction data. The heterogeneous spatio-temporal graph is input into the HestGCL model (which can also be referred to as a HestGCL point of interest recommendation model). A recommendation result is obtained. The recommendation result is fed back to the terminal 210. The terminal 210 displays the recommendation result to the user. The HestGCL model is deployed in the server 230. The inference and training of the recommendation model are completed in the server, thereby saving the storage and computing power of the terminal 210.
[0081] In another example, the graph neural network framework HestGCL for point of interest recommendation proposed in the embodiments of the present application can be deployed in the terminal 210 for inference to obtain a recommendation result. The terminal 210 collects interaction data (for example, check-in data) of a user with a point of interest. The terminal 210 models a heterogeneous spatio-temporal graph of a point of interest recommendation scenario based on the interaction data. The heterogeneous spatio-temporal graph is input into the HestGCL model. A recommendation result is obtained. The terminal 210 displays the recommendation result to the user. The server 230 is used to train the HestGCL model. The parameters of the HestGCL model after training are used to update the model parameters in the terminal 210 through the network 220. The HestGCL model is deployed in the terminal 210. The inference process is completed in the terminal 230. The data does not leave the terminal of the user, thereby protecting the privacy and security of the user data.
[0082] It should be understood that, Figure 2 The above merely describes one example of a system for implementing various methods described in the embodiments of the present application. There can be other different configurations, which are not limited in the embodiments of the present application.
[0083] Terminal 210 can include various types of computer devices, such as portable handheld devices, general purpose computers (e.g., personal computers or laptops), workstation computers, wearable devices, etc. These computer devices can run various types and versions of software applications and operating systems, such as Microsoft Windows, Apple IOS, UNIX-like operating systems, Linux or Linux-like operating systems (e.g., Google Chrome OS); or various mobile operating systems, such as Microsoft Windows Mobile OS, Windows phone, Android, iPhone OS, etc. Portable handheld devices can include cellular telephones, smartphones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices can include head-mounted displays and smartwatches, etc.
[0084] Network 220 can be any type of network familiar to those skilled in the art that can support data communications using any of a variety of available protocols, including without limitation TCP / IP, SNA, IPX, 3G, 4G, 5G, etc. For example, one or more of networks 220 can be a LAN, an Ethernet network, a Token Ring network, a WAN, the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., a Bluetooth network, a WIFI network), and / or any combination of these and / or other networks.
[0085] Server 230 can include one or more general purpose computers, special purpose server computers (e.g., personal computer servers, UNIX servers, terminal servers), blade servers, mainframe computers, server clusters, or any other appropriate arrangement or combination. Server 230 can include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization, such as one or more flexible pools of logical storage devices that can be virtualized to maintain virtual storage devices for servers. In various embodiments, server 230 can run one or more services or software applications that provide the functionality described below.
[0086] Computing units in server 230 can run one or more operating systems including any of the operating systems described above, as well as any commercially available server operating systems. Server 230 can also run any of a variety of additional server applications and / or mid-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
[0087] In some embodiments, the server 230 can include one or more applications to analyze and consolidate data feeds and / or event updates received from users of the terminal 210. The server 230 can also include one or more applications to present the data feeds and or real-time events via one or more display devices of the terminal 210.
[0088] In some embodiments, the server 230 can be a server of a distributed system, or a server combined with a blockchain. The server 230 can also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. The cloud server is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and virtual private server (VPS) services.
[0089] In another example, as shown in Figure 3 The training of the model can also be deployed in the cloud, and the training of the model can be completed by using a specific cloud service (model training service), and then the trained model is updated to the terminal through the network.
[0090] Figure 4 A flowchart of a recommendation method provided by an embodiment of the present application is shown. The recommendation method provided by the embodiment of the present application can be executed by any device, apparatus, computing platform, or computing cluster with computing and processing capabilities. For example, the terminal device shown in Figure 2 , the server, or the terminal device and the server cooperatively complete the execution. As shown in Figure 4 , the recommendation method provided by the embodiment of the present application includes at least steps S401 to S406.
[0091] In step S401, a time view and a space view are obtained.
[0092] The interaction data of the user and the point of interest is obtained. Taking a restaurant as an example, the interaction data of the user and the point of interest can include the check-in data of the user, which includes the geographic location data of the visited restaurant, the check-in time data, and the check-in frequency. In some other examples, the interaction data of the user and the point of interest can also include the user's comments on the restaurant, the dining cost, and the like.
[0093] A heterogeneous spatio-temporal graph of a point-of-interest recommendation task is constructed based on interaction data of users and points of interest, the heterogeneous spatio-temporal graph including multiple types of nodes such as user nodes, point-of-interest nodes and geographic location nodes and multiple types of connection edges, the multiple types of connection edges including connection edges connecting user nodes and point-of-interest nodes, connection edges connecting point-of-interest nodes and geographic location nodes and connection edges connecting geographic location nodes and geographic location nodes. Among them, the user nodes represent user information, the point-of-interest nodes represent point-of-interest information, and the geographic location nodes represent geographic location information. The connection edges between the user nodes and the point-of-interest nodes have time information, which represents the interaction time information of the user and the point-of-interest node.
[0094] Taking a restaurant as an example, the information of each user, the information of each restaurant and the dining information of the user in the restaurant in a certain area (for example, a city) are obtained, a heterogeneous spatio-temporal graph is constructed, the user nodes represent users, the point-of-interest nodes represent restaurants, and the geographic location nodes represent the geographic locations where the restaurants are located. According to the interaction data between the users and the points of interest, each node is connected, for example, if a user visits a restaurant, the user node corresponding to the user and the point-of-interest node corresponding to the restaurant are connected by a connection edge, and each point-of-interest node and the geographic location node corresponding to each point-of-interest node (i.e., connecting each restaurant and the geographic location where each restaurant is located) are connected, and adjacent geographic location nodes are connected, for example, geographic locations less than 5 km apart are connected.
[0095] After obtaining the heterogeneous spatio-temporal graph, the heterogeneous spatio-temporal graph is split into a temporal view including time information and a spatial view including spatial information, the temporal view including user nodes, point-of-interest nodes and first connection edges, the first connection edges being used to connect the user nodes and the point-of-interest nodes, and the first connection edges having time attributes. The spatial view includes user nodes, point-of-interest nodes, geographic location nodes, second connection edges, third connection edges and fourth connection edges, the second connection edges being used to connect the user nodes and the point-of-interest nodes, the second connection edges not having time attributes, the third connection edges being used to connect the point-of-interest nodes and the geographic location nodes, and the fourth connection edges being used to connect two different geographic location nodes.
[0096] For example, a complete heterogeneous spatio-temporal graph can be defined as: G=(V, E, L, T). Wherein, V is a node set, E is an edge set, L is a location set, and T is a timestamp set. L and T need to be mapped to nodes or edges. In the embodiments of the present application, L (location) and user, POI are regarded as nodes together, and T is regarded as an attribute on the connection edge of user and POI.
[0097] View split: In order to subsequent modeling, the complete heterogeneous spatio-temporal graph is split into a temporal view and a spatial view. The definitions of the two views are as follows:
[0098] Temporal view: Only contains user, POI nodes and edges between them based on historical interactions, and T is considered on the edges.
[0099] Spatial view: Contains user, POI, Location three types of nodes, and user-POI, POI-location, location-location three types of edges. The POI-location edge represents the location where the POI is located, and the edge between the locations represents the proximity of the geographical position. The user-POI edge does not consider T.
[0100] In step S402, the temporal view is taken as the input of the first graph neural network, and the first node representation vector of the user node and the first node representation vector of the interest point node are output.
[0101] The first graph neural network can be referred to as a time-aware graph neural network, and the time-aware graph neural network
[0102] has a plurality of neural network layers, updates the representation vectors of the nodes through the plurality of neural network layers, and the node representation vector output by the last layer is the first node representation vector. In the plurality of neural network layers of the time-aware graph neural network, each neural network layer performs the following operations on each node in the temporal view: aggregates the time information on the first connection edge connected to each node in the temporal view to obtain a first aggregation result; aggregates the node representation vector of the neighbor node of each node in the temporal view in the last layer to obtain a second aggregation result; and the first aggregation result and the second aggregation result are weighted and fused to obtain the node representation vector of each node in the temporal view in the current layer; wherein the node representation vector of the user node output by the last neural network layer in the plurality of neural network layers of the time-aware graph neural network is the first node representation vector of the user node, and the node representation vector of the interest point node is the first node representation vector of the interest point node.
[0103] Optionally, the weight of the first aggregation result is determined based on the attention coefficient of the first aggregation result, and the weight of the second aggregation result is determined based on the attention coefficient of the second aggregation result.
[0104] For example, for the temporal view, the time-aware graph neural network designed by the embodiments of the present application is as follows:
[0105] For user i and interest point j∈N i , the interaction time t ij is first encoded at the hour level to obtain
[0106]
[0107] where is a sigmoid function and N is the number of hours (N = 24). Then we have participate in the process of learning the representation x i of user i. The specific formula is as follows:
[0108]
[0109]
[0110] Note that here we learn two representations for each node x i and where denotes the timestamp t ij of the aggregated edge, and denotes the node representation obtained by aggregating the neighbor nodes (related to the layer number l). Finally, we fuse the time information and the neighbor information to obtain the node representation of the next layer using the following formula:
[0111]
[0112] This process is repeated for L layers until the final node representation is obtained.
[0113] The processing process of the interest point node in the time-aware graph neural network is similar to that of the user node. For brevity, it will not be repeated here.
[0114] After the time view is processed by the multiple neural network layers in the time-aware graph neural network, the node representation vector of the user node output by the last layer is the first node representation vector of the user node, and the node representation vector of the interest point node is the first node representation vector of the interest point node.
[0115] In step S403, the spatial view is taken as the input of the second graph neural network, and the second node representation vector of the user node and the second node representation vector of the interest point node are output.
[0116] The second graph neural network can be referred to as a space-aware graph neural network. The space-aware graph neural network has multiple neural network layers, and the representation vectors of the nodes are updated through the multiple neural network layers. The node representation vector output by the last layer is the second node representation vector. In the multiple neural network layers of the space-aware graph neural network, each neural network layer performs the following operations on each node in the spatial view:
[0117] The last layer node representation vector of each node in the spatial view is obtained by aggregating the last layer node representation vectors of the same type of neighbor nodes of each node.
[0118] Optionally, the weights of the aggregation results of the various types of neighbor nodes are determined based on the attention coefficients of the various types of neighbor nodes.
[0119] For example, for the spatial view, the spatial perception graph neural network is designed as follows: for node i, different types of neighbors are distinguished, and then the specific type of neighbor is aggregated, and then all types are fused using the attention coefficient b.
[0120]
[0121] where R is the total number of all types, is the node-specific attention coefficient.
[0122] After the spatial view is processed by the multi-layer neural network layer in the spatial perception graph neural network, the node representation vector of the user node output by the last layer is the second node representation vector of the user node, and the node representation vector of the interest point node is the second node representation vector of the interest point node.
[0123] In step S404, the node representation of the user node is obtained based on the first node representation vector of the user node and the second node representation vector of the user node.
[0124] In step S405, the node representation of the interest point node is obtained based on the first node representation vector of the interest point node and the second node representation vector of the interest point node.
[0125] After the time view and the spatial view are processed by the time perception graph neural network and the spatial perception graph neural network respectively, two groups of node representation vectors are obtained, one group being the first node representation vector of the user node and the first node representation vector of the interest point node, and the other group being the second node representation vector of the user node and the second node representation vector of the interest point node.
[0126] Then the two sets of node representation vectors are fused to obtain the final node representation, that is, the first node representation vector of the user node and the second node representation vector of the user node are fused to obtain the node representation of the user node, and the first node representation vector of the interest point node and the second node representation vector of the interest point node are fused to obtain the node representation of the interest point node.
[0127] For example, we design the following time-aware prediction module: first, the user and POI representations in the two views are weighted and fused,
[0128] X F = aX S + (1-a)X T
[0129] where a is the attention coefficient of spatio-temporal fusion.
[0130] In step S406, a recommendation result is determined based on the node representation of the user node and the node representation of the interest point node.
[0131] The similarity between the user node and the interest point node is calculated through the node representation of the user node and the node representation of the interest point node, and the prediction score of each interest point is determined based on the similarity. The similarity is positively correlated with the prediction score, for example, the higher the similarity between the interest point node and the target user node, the higher the prediction score of the interest point, and the more likely the interest point is recommended to the user, or the higher the ranking of the interest point recommended to the user.
[0132] In another example, the calculation of the similarity between the user node and the interest point node is also related to time information. For example: the time-aware similarity is calculated as the prediction score.
[0133]
[0134] where · is the inner product, and is the Hadamard product.
[0135] Next, the training and learning method of the HestGCL interest point recommendation model mentioned in the embodiments of the present application is introduced.
[0136] In order to solve the sparsity of the training data, the embodiment of the present application proposes a heterogeneous spatio-temporal graph contrast learning method, which aggregates time neighbors and space neighbors respectively through double-view-based heterogeneous spatio-temporal graph contrast learning. Compared with the original use of historical interaction behavior as supervision information, this double-view operation can effectively provide rich supervision information.
[0137] Specifically, the HestGCL interest point recommendation model adjusts parameters of the HestGCL interest point recommendation model based on a target loss function, including adjusting parameters of the time-aware graph neural network and parameters of the space-aware graph neural network; wherein the target loss function is determined based on a sum of a BPR loss function and a contrastive loss function, the contrastive loss function is used to maximize mutual information between positive examples and minimize mutual information between negative examples, the same node in the time view and the space view is taken as a positive example, and different nodes of the same type in the time view and the space view are taken as negative examples.
[0138] For example, BPR is used as the loss function of the recommendation task:
[0139]
[0140] wherein σ is a Sigmoid function.
[0141] In addition, the cross-view contrastive learning module is designed in the embodiment of the application, the same node in different views is taken as a positive example, and different nodes are taken as negative examples, mutual information between positive examples is maximized, and mutual information between negative examples is minimized. The formula is as follows:
[0142]
[0143] wherein f is a cosine similarity function, X represents a node representation X6 in the space view or a node representation X in the time view. T .
[0144] Finally, the BPR loss and the contrastive learning loss are jointly optimized in a multi-task learning manner, and the total loss function is as follows:
[0145] L = L BPR + βL CL
[0146] wherein β is a balance hyperparameter.
[0147] Figure 5 FIG. 1 shows a schematic diagram of a heterogeneous spatio-temporal graph contrastive learning method provided by an embodiment of the application.
[0148] The recommendation method provided by the embodiment of the application has a complete prototype implementation and is used for application of the HestGCL in actual problems. Since the embodiment of the application focuses on solving the modeling of heterogeneity in the GNN method, the recommendation effect can be improved through the double-view contrast mechanism. The expected advantages and beneficial effects are preliminarily verified through the experimental test in the actual data set. For example:
[0149] The recommendation effect is improved: this is mainly due to the double-view aggregation and contrast learning module designed in the embodiment of the application. By introducing prior knowledge, the node representation learned is improved, and by contrast learning, a self-supervised signal is provided, which provides additional self-supervised information.
[0150] Robustness: this is because the architecture of the embodiment of the application is based on graph contrast learning, which is robust to hyperparameters.
[0151] Compared with related technologies (including schemes GPR and SGL): the embodiment of the application can be applied to a heterogeneous spatio-temporal graph, thereby better modeling the data sparsity and heterogeneity problem. The above effects are mainly achieved by proposing a time-space double-view aggregation mechanism and adopting a cross-view contrast learning strategy. Specifically, the differences from related technologies can be shown in Table 1:
[0152]
[0153] Table 1
[0154] Through experiments on real data sets, the beneficial effects of the recommendation method provided by the embodiment of the application are verified, which are specifically explained from the following aspects:
[0155] Baseline selection: since there is no interest point recommendation method based on heterogeneous spatio-temporal graph contrast learning at present, the HestGCL method proposed in the embodiment of the application is compared with these baselines: 1) non-GNN recommendation algorithm: NeuMF; 2) GNN recommendation algorithm: NGCF, LightGCN; 3) self-supervised GNN recommendation algorithm: SGL, NCL; 4) GNN POI recommendation algorithm: GPR.
[0156] Evaluation index: Recall@K, MAP@K, where K = 5, 10, 20, 50.
[0157] Effect explanation: the effectiveness of the key technical points of the application is evaluated by evaluating on three real data sets (Foursquare data set, Gowalla data set, Meituan data set respectively). The overall results are shown in Table 2, and the best results are indicated in bold.
[0158]
[0159] Table 2
[0160] According to Table 2, the following conclusions can be drawn:
[0161] The model HestGCL of the embodiment of the application is better than other baselines in all indicators.
[0162] For the Foursquare and Gowalla datasets, the GNN-based methods are generally superior to the NeuMF method, which suggests that GNN-based methods can obtain better node representations by aggregating high-order information. For the Meituan dataset, NeuMF can also achieve similar results to GNN-based methods, which may be because the Meituan dataset has the lowest degree of sparsity.
[0163] Compared with GNN-based methods (LightGCN, NGCF), self-supervised GNN models (SGL, NCL) can improve the results in some cases, but are not stable. In contrast, the HestGCL model can consistently achieve better results, which may be because it is specifically designed for spatio-temporal data and therefore provides more effective self-supervised signals.
[0164] Robustness: To demonstrate the robustness of the HestGCL model proposed in the embodiments of the present application, we designed a hyperparameter experiment. Specifically, we used embedding dimensions d = {64, 12, 256} to evaluate the robustness of HestGCL under different hyperparameter settings. From Table 4, we can see that HestGCL has high robustness on the Foursquare and Gowalla datasets, while on the Meituan dataset, as the embedding dimension increases, the recommendation effect also improves. The reason may be that the Meituan dataset has a lower degree of sparsity, so a larger embedding dimension is needed to store more information. Figure 6
[0165] Based on the same concept as the foregoing embodiment of a recommendation method, the embodiments of the present application also provide a recommendation device 700, which can be deployed on any device or platform with computing capability, such as the terminal 210 shown in FIG. 10, to improve the recommendation effect. The recommendation device 700 includes units or modules to implement each step in the recommendation method shown in FIG. 11. Figure 2 Figures 4-6
[0166] Figure 7 A structural diagram of a recommendation device according to an embodiment of the present application is shown in FIG. 12. As shown in FIG. 12, the recommendation device 700 includes a processor 710, a memory 720, and a communication interface 730. Figure 7 As shown, the recommendation device 700 at least includes an acquisition module 701, a time view node representation extraction module 702, a space view node representation extraction module 703, and a recommendation module 704. The acquisition module 701 is configured to acquire a time view and a space view. The time view includes a user node, a point of interest node, and a first connection edge connecting the user node and the point of interest node. The user node represents user information, and the point of interest node represents point of interest information. The first connection edge includes time information. The space view includes the user node, the point of interest node, a geographic location node, a second connection edge, a third connection edge, and a fourth connection edge. The geographic location node represents geographic location information. The second connection edge connects the user node and the point of interest node. The third connection edge connects the point of interest node and the geographic location node. The fourth connection edge connects two different geographic location nodes. The time view node representation extraction module 702 is configured to input the time view into a first graph neural network, and output a first node representation vector of the user node and a first node representation vector of the point of interest node. The space view node representation extraction module 703 is configured to input the space view into a second graph neural network, and output a second node representation vector of the user node and a second node representation vector of the point of interest node. The recommendation module 704 is configured to obtain a node representation of the user node based on the first node representation vector of the user node and the second node representation vector of the user node, obtain a node representation of the point of interest node based on the first node representation vector of the point of interest node and the second node representation vector of the point of interest node, and determine a recommendation result based on the node representation of the user node and the node representation of the point of interest node.
[0167] In one possible implementation, the time view node representation extraction module 702 is specifically configured to: the first graph neural network includes a first multi-layer neural network layer, and each neural network layer in the first multi-layer neural network layer performs the following operations on each node in the time view: aggregates the time information on the first connection edge connected to each node in the time view to obtain a first aggregation result; aggregates the last layer node representation vector of the neighbor node of each node in the time view to obtain a second aggregation result; and performs weighted fusion on the first aggregation result and the second aggregation result to obtain the node representation vector of each node in the time view at the current layer. The node representation vector of the user node output by the last layer neural network layer in the first multi-layer neural network layer is the first node representation vector of the user node, and the node representation vector of the point of interest node is the first node representation vector of the point of interest node.
[0168] In another possible implementation, the weight of the first aggregation result is determined based on an attention coefficient of the first aggregation result, and the weight of the second aggregation result is determined based on an attention coefficient of the second aggregation result.
[0169] In another possible implementation, the spatial view node representation extraction module 703 is specifically configured to: the second graph neural network comprises a second multi-layer neural network layer, and each neural network layer in the second multi-layer neural network layer performs the following operations on each node in the spatial view: aggregating the last layer node representation vectors of the same type neighbor nodes of each node in the spatial view to obtain an aggregation result of each type neighbor node;
[0170] fusing the aggregation results of each type neighbor node by weighting to obtain the node representation vector of each node in the spatial view at the current layer; and wherein the node representation vector of the user node output by the last neural network layer in the second multi-layer neural network layer is the second node representation vector of the user node, and the node representation vector of the point of interest node is the second node representation vector of the point of interest node.
[0171] In another possible implementation, the weights of the aggregation results of each type neighbor node are determined based on the attention coefficients of each type neighbor node.
[0172] In another possible implementation, the recommendation module 704 is specifically configured to: fuse the first node representation vector of the user node and the second node representation vector of the user node by weighting to obtain the node representation of the user node; wherein the weight of the first node representation vector of the user node is determined based on the attention coefficient of the first node representation vector of the user node, and the weight of the second node representation vector of the user node is determined based on the attention coefficient of the second node representation vector of the user node.
[0173] In another possible implementation, the recommendation module 704 is further specifically configured to: fuse the first node representation vector of the point of interest node and the second node representation vector of the point of interest node by weighting to obtain the node representation of the point of interest node; wherein the weight of the first node representation vector of the point of interest node is determined based on the attention coefficient of the first node representation vector of the point of interest node, and the weight of the second node representation vector of the point of interest node is determined based on the attention coefficient of the second node representation vector of the point of interest node.
[0174] In another possible implementation, the recommendation module 704 is further specifically configured to: calculate the similarity between the node representation of the user node and the node representation of the point of interest node to obtain a similarity result; determine the predicted scores of each of the points of interest based on the similarity result; and determine the N points of interest recommended to the user based on the predicted scores, wherein the N points of interest correspond to predicted scores higher than those of other points of interest, and N is a positive integer greater than 1.
[0175] In another possible implementation, the similarity between the node representation of the user node and the node representation of the point of interest node is further related to time information between the user node and the point of interest node.
[0176] In another possible implementation, the first graph neural network and the second graph neural network adjust the parameters of the first graph neural network and the parameters of the second graph neural network based on a target loss function; wherein the target loss function is determined based on a sum of a BPR loss function and a contrastive loss function, the contrastive loss function is used to maximize mutual information between positive examples and minimize mutual information between negative examples, and the same node in the temporal view and the spatial view is a positive example, and different nodes of the same type in the temporal view and the spatial view are negative examples.
[0177] In another possible implementation, the obtaining module 701 is specifically configured to: obtain a heterogeneous spatio-temporal graph, the heterogeneous spatio-temporal graph including user nodes, interest point nodes, geographic location nodes, first connection edges, third connection edges, and fourth connection edges; and split the heterogeneous spatio-temporal graph to obtain the spatio-temporal view and the spatial view.
[0178] The recommendation apparatus 700 according to the embodiments of the present application can correspond to performing the methods described in the embodiments of the present application, and the above and other operations and / or functions of each module in the recommendation apparatus 700 are respectively for realizing the corresponding procedures of each method in Figures 4-6 For brevity, no further description is given here.
[0179] The embodiments of the present application also provide a computing device including at least one processor, a memory, and a communication interface, the processor being configured to execute Figures 4-6 the method described above.
[0180] Figure 8 The structure schematic diagram of the computing device provided by the embodiments of the present application is shown in the following figure.
[0181] As Figure 8 shown in the figure, the terminal device 800 includes at least one processor 801, a memory 802, and a communication interface 803. The processor 801, the memory 802, and the communication interface 803 are communicatively connected, and can be communicatively connected in a wired (for example, a bus) manner or in a wireless manner. The communication interface 803 is configured to send and / or receive data sent by other devices; the memory 802 stores computer instructions, and the processor 801 executes the computer instructions to execute the recommendation method in the foregoing method embodiments, so as to improve the recommendation effect.
[0182] It should be appreciated that in the embodiments of the present application, the processor 801 can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0183] The memory 802 can include a read-only memory and a random access memory, and provide instructions and data for the processor 801. The memory 802 can also include a non-volatile random access memory.
[0184] The memory 802 can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. The non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM) used as an external cache. By way of example, but not limitation, many forms of RAM can be used, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0185] It should be appreciated that the computing device 800 according to the embodiments of the present application can perform the method shown in the embodiments of the present application, and the detailed description of the method implemented by the computing device 800 is described above. For brevity, it will not be repeated here. Figures 4-6 It should be appreciated that the computing device 800 according to the embodiments of the present application can perform the method shown in the embodiments of the present application, and the detailed description of the method implemented by the computing device 800 is described above. For brevity, it will not be repeated here.
[0186] Embodiments of the present application provide a computer readable storage medium having stored thereon computer program, which when executed by a processor, causes the above-mentioned method to be implemented.
[0187] Embodiments of the present application provide a chip, comprising at least one processor and an interface, the at least one processor determines program instructions or data through the interface; the at least one processor is used to execute the program instructions to implement the above-mentioned method.
[0188] Embodiments of the present application provide a computer program or computer program product, comprising instructions, which when executed, cause a computer to execute the above-mentioned method.
[0189] Those of ordinary skill in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, each example has been described in general terms by its constituent and steps in the above description. Whether the functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those of ordinary skill in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0190] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein can be implemented by hardware, software modules executed by a processor, or a combination of both. The software modules can be placed in random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art.
[0191] The above specific embodiments further illustrate the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A recommendation method characterized by comprising: The method comprises: obtaining a time view and a space view, wherein the time view comprises a user node, a point of interest node and a first connection edge, the first connection edge is used for connecting the user node and the point of interest node, the user node represents user information, the point of interest node represents point of interest information, and time information is included on the connection edge; the space view comprises the user node, the point of interest node, a geographic location node, a second connection edge, a third connection edge and a fourth connection edge, the geographic location node represents geographic location information, the second connection edge is used for connecting the user node and the point of interest node, the third connection edge is used for connecting the point of interest node and the geographic location node, and the fourth connection edge is used for connecting two different geographic location nodes; inputting the time view into a first graph neural network to output a first node representation vector of the user node and a first node representation vector of the point of interest node; inputting the space view into a second graph neural network to output a second node representation vector of the user node and a second node representation vector of the point of interest node; obtaining a node representation of the user node based on the first node representation vector of the user node and the second node representation vector of the user node; obtaining a node representation of the point of interest node based on the first node representation vector of the point of interest node and the second node representation vector of the point of interest node; determining a recommendation result based on the node representation of the user node and the node representation of the point of interest node.
2. The method of claim 1, wherein, The inputting the time view into the first graph neural network to output the first node representation vector of the user node and the first node representation vector of the point of interest node comprises: The first graph neural network comprises a first multi-layer neural network layer, and each neural network layer in the first multi-layer neural network layer performs the following operations on each node in the time view: aggregating time information on the first connection edge connected to each node in the time view to obtain a first aggregation result; aggregating a last layer node representation vector of a neighbor node of each node in the time view to obtain a second aggregation result; performing weighted fusion on the first aggregation result and the second aggregation result to obtain a node representation vector of each node in the time view at a current layer; wherein the node representation vector of the user node output by the last layer neural network layer in the first multi-layer neural network layer is the first node representation vector of the user node, and the node representation vector of the point of interest node is the first node representation vector of the point of interest node.
3. The method of claim 2, wherein, The weight of the first aggregation result is determined based on an attention coefficient of the first aggregation result, and the weight of the second aggregation result is determined based on an attention coefficient of the second aggregation result.
4. The method of claim 1, wherein, The inputting the space view into the second graph neural network to output the second node representation vector of the user node and the second node representation vector of the point of interest node comprises: The second graph neural network comprises a second multi-layer neural network layer, and each neural network layer in the second multi-layer neural network layer performs the following operations on each node in the spatial view: aggregating the last-layer node representation vectors of the same type of neighbor nodes of each node in the spatial view to obtain an aggregation result of each type of neighbor node; performing weighted fusion on the aggregation results of each type of neighbor node to obtain a node representation vector of each node in the spatial view at a current layer; wherein the node representation vector of the user node output by the last neural network layer in the second multi-layer neural network layer is a second node representation vector of the user node, and the node representation vector of the point of interest node is a second node representation vector of the point of interest node.
5. The method of claim 4, wherein, The weights of the aggregation results of each type of neighbor node are determined based on attention coefficients of each type of neighbor node.
6. The method of claim 1, wherein, The node representation of the user node is obtained based on the first node representation vector of the user node and the second node representation vector of the user node, comprising: performing weighted fusion on the first node representation vector of the user node and the second node representation vector of the user node to obtain the node representation of the user node; wherein the weights of the first node representation vector of the user node and the second node representation vector of the user node are determined based on attention coefficients of the first node representation vector of the user node and the second node representation vector of the user node.
7. The method of claim 1, wherein, The node representation of the point of interest node is obtained based on the first node representation vector of the point of interest node and the second node representation vector of the point of interest node, comprising: performing weighted fusion on the first node representation vector of the point of interest node and the second node representation vector of the point of interest node to obtain the node representation of the point of interest node; wherein the weights of the first node representation vector of the point of interest node and the second node representation vector of the point of interest node are determined based on attention coefficients of the first node representation vector of the point of interest node and the second node representation vector of the point of interest node.
8. The method of claim 1, wherein, The recommendation result is determined based on the node representation of the user node and the node representation of the point of interest node, comprising: calculating a similarity between the node representation of the user node and the node representation of the point of interest node to obtain a similarity result; determining a predicted score of each point of interest node based on the similarity result; determining N points of interest recommended to the user based on the predicted score, wherein the predicted scores corresponding to the N points of interest are higher than the predicted scores corresponding to other points of interest, and N is a positive integer greater than 1.
9. The method of claim 8, wherein, The similarity between the node representation of the user node and the node representation of the point of interest node is also related to time information between the user node and the point of interest node.
10. The method of claim 1, wherein, The first graph neural network and the second graph neural network are adjusted based on a minimized target loss function to obtain The target loss function is determined based on a sum of a Bayesian personalized ranking loss function and a contrastive loss function, the contrastive loss function is used to maximize mutual information between positive examples and minimize mutual information between negative examples, and the same node in the time view and the space view is a positive example, and different nodes of the same type in the time view and the space view are negative examples.
11. The method according to any one of claims 1 to 10, characterized in that, The time view and the space view are obtained, including: Obtaining a heterogeneous spatio-temporal graph, the heterogeneous spatio-temporal graph comprising the user node, the point of interest node, the geographic location node, the first connection edge, the third connection edge and the fourth connection edge; Splitting the heterogeneous spatio-temporal graph to obtain the time view and the space view.
12. A recommendation apparatus characterized by comprising: Comprising: An obtaining module is configured to obtain a time view and a space view, wherein the time view comprises a user node, a point of interest node and a first connection edge, the first connection edge is used to connect the user node and the point of interest node, the user node represents user information, the point of interest node represents point of interest information, and the connection edge comprises time information; the space view comprises the user node, the point of interest node, a geographic location node, a second connection edge, a third connection edge and a fourth connection edge, the geographic location node represents geographic location information, the second connection edge is used to connect the user node and the point of interest node, the third connection edge is used to connect the point of interest node and the geographic location node, and the fourth connection edge is used to connect two different geographic location nodes; A time view node representation extraction module is configured to take the time view as an input of a first graph neural network, and output a first node representation vector of the user node and a first node representation vector of the point of interest node; A space view node representation extraction module is configured to take the space view as an input of a second graph neural network, and output a second node representation vector of the user node and a second node representation vector of the point of interest node; A recommendation module is configured to obtain a node representation of the user node based on the first node representation vector of the user node and the second node representation vector of the user node; obtain a node representation of the point of interest node based on the first node representation vector of the point of interest node and the second node representation vector of the point of interest node; and determine a recommendation result based on the node representation of the user node and the node representation of the point of interest node.
13. The apparatus of claim 12, wherein, The time view node representation extraction module is specifically configured to: The first graph neural network comprises a first multi-layer neural network layer, and each neural network layer in the first multi-layer neural network layer performs the following operations on each node in the time view: aggregate time information on the first connection edge connected to each node in the time view to obtain a first aggregation result; aggregate a last layer node representation vector of a neighbor node of each node in the time view to obtain a second aggregation result; perform weighted fusion on the first aggregation result and the second aggregation result to obtain a node representation vector of each node in the time view at a current layer. Among them, the node representation vector of the user node output by the last neural network layer in the first multi-layer neural network layer is the first node representation vector of the user node, and the node representation vector of the point of interest node is the first node representation vector of the point of interest node.
14. The apparatus of claim 13, wherein, The weight of the first aggregation result is determined based on the attention coefficient of the first aggregation result, and the weight of the second aggregation result is determined based on the attention coefficient of the second aggregation result.
15. The apparatus of claim 12, wherein, The spatial view node representation extraction module is specifically used to: The second graph neural network includes a second multi-layer neural network layer, and each neural network layer in the second multi-layer neural network layer performs the following operation on each node in the spatial view: Aggregating the upper-layer node representation vectors of neighboring nodes of the same type for each node in the spatial view to obtain aggregation results of neighboring nodes of each type; Performing weighted fusion on the aggregation results of neighbor nodes of each type to obtain a node representation vector of each node in the spatial view at the current layer; Among them, the node representation vector of the user node output by the last neural network layer in the second multi-layer neural network layer is the second node representation vector of the user node, and the node representation vector of the point of interest node is the second node representation vector of the point of interest node.
16. The apparatus of claim 15, wherein, The weights of the aggregation results of the neighbor nodes of each type are determined based on the attention coefficients of the neighbor nodes of each type.
17. The apparatus of claim 12, wherein, The recommendation module is specifically used for: Performing weighted fusion on the first node representation vector of the user node and the second node representation vector of the user node to obtain a node representation of the user node; The weight of the first node representation vector of the user node is determined based on the attention coefficient of the first node representation vector of the user node, and the weight of the second node representation vector of the user node is determined based on the attention coefficient of the second node representation vector of the user node.
18. The apparatus of claim 12, wherein, The recommendation module is further specifically used for: Performing weighted fusion on the first node representation vector of the point of interest node and the second node representation vector of the point of interest node to obtain a node representation of the point of interest node; The weight of the first node representation vector of the point of interest node is determined based on the attention coefficient of the first node representation vector of the point of interest node, and the weight of the second node representation vector of the point of interest node is determined based on the attention coefficient of the second node representation vector of the point of interest node.
19. The apparatus of claim 12, wherein, The recommendation module is further specifically used for: Calculating the similarity between the node representation of the user node and the node representation of the point of interest node to obtain a similarity result; Determining a prediction score for each of the interest points based on the similarity results; Based on the prediction scores, N points of interest are determined to be recommended to the user, where the prediction scores corresponding to the N points of interest are higher than the prediction scores corresponding to other points of interest, and N is a positive integer greater than 1.
20. The apparatus of claim 19, wherein, The similarity between the node representation of the user node and the node representation of the point of interest node is also related to the time information between the user node and the point of interest node.
21. The apparatus of claim 12, wherein, The first graph neural network and the second graph neural network adjust parameters of the first graph neural network and parameters of the second graph neural network based on a target loss function to obtain the first graph neural network and the second graph neural network. The target loss function is determined based on a sum of a Bayesian personalized ranking loss function and a contrastive loss function, the contrastive loss function is used for maximizing mutual information between positive examples and minimizing mutual information between negative examples, and the same node in the time view and the space view is taken as a positive example, and different nodes of the same type in the time view and the space view are taken as negative examples.
22. The apparatus of any of claims 12-21, wherein, The acquisition module is specifically configured to: acquire a heterogeneous spatio-temporal graph, the heterogeneous spatio-temporal graph comprising the user node, the interest point node, the geographic location node, the first connection edge, a third connection edge and a fourth connection edge; split the heterogeneous spatio-temporal graph to obtain the time view and the space view.
23. A computing device comprising a memory and a processor, wherein: The memory has instructions stored therein, and when the instructions are executed by the processor, the method according to any one of claims 1-11 is implemented.
24. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, causes the method according to any one of claims 1-11 to be implemented.
Citation Information
Patent Citations
Friend and interest point recommendation method and terminal
CN115146180A
Point of interest recommendation method and system based on brain-inspired spatiotemporal perceptual representation
WO2023015658A1