Point of interest recommendation method, medium and electronic device based on temporal knowledge graph

By constructing a time-series knowledge graph and a static group knowledge graph, integrating multi-modal information and using sentiment analysis, the problem of insufficient utilization of multi-modal information in the existing technology is solved, and the accuracy and personalization of point of interest recommendations are achieved. .

CN118377979BActive Publication Date: 2024-09-27HANGZHOU DIANZI UNIV +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410813896.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-09-27
Estimated Expiration
2044-06-24

AI Technical Summary

Technical Problem

Existing technologies fail to make full use of multi-modal information, especially behavioral pattern information in users' historical trajectories, resulting in insufficient personalized preference learning and affecting the accuracy of point-of-interest recommendation.

Method used

Adopt a method based on temporal knowledge graph to construct dynamic temporal knowledge graph and static group knowledge graph, integrate multi-modal information through heterogeneous mutual attention mechanism, and use aspect-level sentiment analysis module to extract emotional tendencies from user comments to assist users Cross learning of features and interest point features.

Benefits of technology

It achieves accurate prediction of user behavior trends, improves the accuracy and personalization of point of interest recommendations, can timely grasp changes in user behavior, and provides technical support for personalized recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118377979B
    Figure CN118377979B
Patent Text Reader

Abstract

The present invention discloses a method, medium and electronic device for recommending points of interest based on a time-series knowledge graph. Based on the historical behavior trajectory and multimodal information of users, the present invention constructs a dynamic time-series knowledge graph and a static group knowledge graph, which are respectively used to learn the user's interest preferences that change over time and stable features that do not change over time. At the same time, the present invention uses a deep learning method to establish a point of interest recommendation model, which can extract a point of interest fusion feature representation and a user fusion feature representation from two knowledge graphs in combination with the user comment sentiment embedding sequence, so as to accurately predict the point of interest that the target user is most likely to visit at the next moment. The present invention has the characteristics of high accuracy and strong scalability, and can provide support for personalized user behavior trajectory prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of personalized recommendation technology, and in particular to a method, medium and electronic device for recommending points of interest based on a temporal knowledge graph. Background Art

[0002] With the breakthrough development of mobile Internet, users around the world are increasingly connected. People can share their daily activities and pass on the joy of life on location-based social platforms. A large amount of user interaction information has also prompted the emergence of geo-tagged data sets such as Foursquare, Gowalla, and Yelp, providing new vitality and motivation for point-of-interest (POI) recommendations. POI recommendation can use the user's historical check-in information to predict the next place the user may visit. At the same time, it can also use multimodal information such as time, location, POI category, social relationship, etc. to achieve better prediction capabilities and provide convenience for users' daily travel.

[0003] In the existing technology, many methods based on graph neural networks have achieved good results by learning global user and POI features. However, most existing methods only use one of the factors such as trajectory information, geographic location, social network and user comments in a targeted manner, and do not give full play to the advantages of multimodal information in real scenarios. In addition, the behavioral pattern information contained in the user's historical trajectory has not been effectively divided, which is not conducive to the learning of user personalized preferences.

[0004] Therefore, how to construct an effective model to establish multimodal information relationships and fully integrate them is a technical problem that needs to be solved urgently. Summary of the invention

[0005] In order to overcome the above-mentioned deficiencies of the prior art, the present invention provides a method for recommending points of interest based on a temporal knowledge graph, which can effectively solve the above-mentioned problems.

[0006] The technical solutions specifically adopted in the present invention are as follows:

[0007] In a first aspect, the present invention provides a method for recommending points of interest based on a temporal knowledge graph, which comprises:

[0008] S1. According to the complete historical behavior trajectory of all users, a dynamic time series knowledge graph and a static group knowledge graph are constructed; the dynamic time series knowledge graph is a graph set composed of dynamic relationship knowledge graphs of different historical time slices, each dynamic relationship knowledge graph records the dynamic relationship between all users and points of interest in the historical time slice, and the dynamic relationship includes an access relationship for recording the user's access behavior to points of interest, and a follow-up relationship for recording the user's adjacent access behavior to different points of interest; the static group knowledge graph records the static relationship between all users and points of interest in all historical time slices, and the static relationship includes a social relationship for recording the friendship between users, a positional relationship for recording the spatial area where the points of interest are located, an adjacent relationship for recording whether different points of interest belong to neighboring points, a category relationship for recording the point of interest category to which the points of interest belong, and a group relationship for recording user groupings according to the visited points of interest and the visited spatial area;

[0009] S2, obtain the historical behavior trajectory substring of the target user before the time to be predicted, and extract the user comment text of each point of interest visited by the user in turn, use the aspect-level sentiment analysis module built based on the pre-trained model to embed the user comment text, and splice the sentiment embeddings of all user comment texts to obtain the user comment sentiment embedding sequence;

[0010] S3. Input the historical behavior trajectory substring, dynamic time series knowledge graph, static group knowledge graph and user comment sentiment embedding sequence into the interest point recommendation model. The embedding module first performs word embedding operation on the input data, and then the multimodal knowledge fusion module fuses the dynamic time series knowledge graph and the static group knowledge graph based on the heterogeneous mutual attention mechanism, and fuses the interest points, users and other multimodal information to obtain the interest point fusion feature representation and user fusion feature representation. Finally, the decoding module splices the interest point fusion feature representation and the user fusion feature representation and inputs them into the cascaded recurrent neural network and multi-layer perceptron to predict the interest points that the target user may visit at the next moment.

[0011] As a preferred embodiment of the first aspect, in the dynamic time series knowledge graph, the access relationship is recorded by a four-tuple consisting of a user, an access relationship identifier, a visited point of interest, and a visit time, and the follow-up relationship is recorded by a four-tuple consisting of a previously visited location, a follow-up relationship identifier, a later visited location, and a visit time;

[0012] In the static group knowledge graph, social relationships are recorded by triples consisting of user, social relationship identifier, and user; location relationships are recorded by triples consisting of point of interest, location relationship identifier, and the Geohash-5 spatial area in which they are located; adjacent relationships are recorded by triples consisting of point of interest, adjacent relationship identifier, and point of interest; category relationships are recorded by triples consisting of point of interest, category relationship identifier, and the category of point of interest to which it belongs; group relationships are recorded by triples consisting of user, group relationship identifier, and the user group to which they belong, wherein user groups are divided into point of interest level groups obtained by clustering based on visited points of interest and region level groups obtained by clustering based on visited Geohash-5 spatial areas.

[0013] As a preferred embodiment of the first aspect, the aspect-level sentiment analysis module is obtained by fine-tuning a pre-trained DistilBERT model and a cascade of multiple classifiers; in the aspect-level sentiment analysis module, the DistilBERT model first generates an embedding representation for the user comment text, and then the embedding representation is input into the multiple classifier to obtain the comment dimension corresponding to the user comment text and the positive and negative scores on each comment dimension, and the positive and negative scores on all comment dimensions are concatenated and output as the sentiment embedding corresponding to the user comment text.

[0014] Furthermore, the review dimensions include three dimensions: product, price and service.

[0015] As a preferred embodiment of the first aspect, the processing flow in the multimodal knowledge fusion module is as follows:

[0016] S31, respectively inputting the dynamic time series knowledge graph and the static group knowledge graph into the heterogeneous graph attention network for information fusion, and obtaining the fused dynamic time series knowledge graph and the static group knowledge graph;

[0017] S32, arranging all the points of interest in the historical behavior trajectory substring according to the order of the user's visit, sequentially extracting the hidden layer vectors corresponding to each point of interest from the fused dynamic time series knowledge graph to form a user behavior trajectory embedding with global time slice information, sequentially extracting the hidden layer vectors corresponding to each point of interest from the fused static group knowledge graph to form a user behavior trajectory embedding with global static information; extracting point of interest level group features and region level group features from the fused static group knowledge graph;

[0018] S33, taking the user comment sentiment embedding sequence as a query, fusing the user behavior trajectory embedding with global time slice information and the original user behavior trajectory embedding through an attention mechanism to obtain a fused user behavior trajectory embedding; taking the fused user behavior trajectory embedding as a value, taking the user behavior trajectory embedding with global static information as a query, taking the interest point level group feature as a key, inputting them into the Encoder module of the Transformer model for fusion encoding, and obtaining an interest point fusion feature representation;

[0019] S34. Concatenate and fuse the group features at the point of interest level and the group features at the area level, use the obtained fused group features as the key, use the user embedded feature representation of all users in the fused static group knowledge graph as the query, use the user embedded feature representation of all users in the original static group knowledge graph as the value, input them into the Encoder module of the Transformer model for fusion encoding, and obtain the user fused feature representation.

[0020] As a preferred embodiment of the first aspect, the POI recommendation model needs to be optimized in advance by a total loss function, and the total loss function is obtained by weighting the POI prediction loss and the static graph loss.

[0021] Furthermore, the POI recommendation model needs to be trained in advance, and the total loss function used for training is obtained by weighting the POI prediction loss and the static graph loss of all historical time slices; the POI prediction loss is the cross entropy loss between the predicted value and the label value output by the POI recommendation model, and the static graph loss of any x-th historical time slice is calculated as follows: , where the hyperparameters represents the increasing speed of the deviation angle, Represents the entity set consisting of all users and all points of interest in the static group knowledge graph The number of entities in and Represents a collection of entities The corresponding embedded feature representation of the i-th entity in the fused dynamic temporal knowledge graph and the fused static group knowledge graph.

[0022] In a second aspect, the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, can implement the method for recommending points of interest based on a temporal knowledge graph as described in any one of the solutions of the first aspect above.

[0023] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for recommending points of interest based on a temporal knowledge graph as described in any one of the schemes of the first aspect above can be implemented.

[0024] In a fourth aspect, the present invention provides a computer electronic device comprising a memory and a processor;

[0025] The memory is used to store computer programs;

[0026] The processor is used to implement the method for recommending points of interest based on a temporal knowledge graph as described in any one of the solutions of the first aspect above when executing the computer program.

[0027] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0028] The present invention aims at the next point of interest recommendation problem in multimodal scenarios, and proposes a point of interest recommendation method based on a time series knowledge graph. The method constructs a dynamic time series knowledge graph and a static group knowledge graph based on the user's historical behavior trajectory to learn the user's dynamic behavior preferences and static features. In addition, the present invention uses a heterogeneous mutual attention mechanism to aggregate information on the dynamic time series knowledge graph and the static group knowledge graph to learn the multivariate heterogeneous information in the knowledge graph, and introduces a multimodal knowledge fusion module. With the assistance of high-quality semantic information reflecting the user's emotional tendency extracted from the user comment text by the aspect-level sentiment analysis module, the user characteristics and point of interest characteristics are cross-learned, which effectively copes with the information fusion problem in real scenarios and provides guidance for the next point of interest recommendation. The present invention has the characteristics of high accuracy and strong scalability, and can grasp the user behavior trend in a timely manner, providing technical support for realizing personalized user behavior trajectory prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 Schematic diagram of the steps of the method for recommending points of interest based on a temporal knowledge graph in an embodiment of the present invention.

[0030] Figure 2 Schematic diagram of the network architecture of the POI recommendation model in an embodiment of the present invention.

[0031] Figure 3 A schematic diagram of constructing a dynamic temporal knowledge graph in an embodiment of the present invention.

[0032] Figure 4 It is a schematic diagram of a dynamic time series knowledge graph taking user B as an example and extracting user behavior trajectory embedding therefrom in an embodiment of the present invention.

[0033] Figure 5The figure is a schematic diagram of the structure of a computer electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings. However, the present invention covers any substitution, modification, equivalent method and scheme made on the essence and scope of the present invention as defined by the claims. Further, in order to make the public have a better understanding of the present invention, some specific details are described in detail in the detailed description of the present invention below. Those skilled in the art can fully understand the present invention without the description of these details.

[0035] In the description of the present invention, it should be understood that the terms "first" and "second" are only used for the purpose of distinguishing descriptions, and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features.

[0036] like Figure 1 As shown, in a preferred embodiment of the present invention, the above-mentioned method for recommending points of interest based on time series knowledge graph is specifically implemented by the following steps S1 to S3. The method for recommending points of interest can be based on the user's historical check-in data and multimodal information, and a network framework is established using a deep learning method. Figure 2 The deep learning model shown is used to extract user preference features, and then accurately predict the places that the current user is most likely to visit. The present invention can use the dynamic time series knowledge graph and the static group knowledge graph to learn the trajectory sequence and multimodal relationship respectively and organically integrate them; at the same time, the behavior pattern information contained in the user's historical trajectory is effectively divided through the dynamic time series knowledge graph, and the intrinsic pattern and evolution relationship of each time slice are learned in a targeted manner, so as to realize the prediction of the next point of interest that meets the user's personalized preferences.

[0037] The specific implementation methods of steps S1 to S3 are described in detail below.

[0038] S1. According to the complete historical behavior trajectory of all users, a dynamic time series knowledge graph and a static group knowledge graph are constructed; the dynamic time series knowledge graph is a graph set composed of dynamic relationship knowledge graphs of different historical time slices, and each dynamic relationship knowledge graph records the dynamic relationship between all users and points of interest in the historical time slice, and the dynamic relationship includes an access relationship for recording the user's access behavior to points of interest, and a follow-up relationship for recording the user's adjacent access behavior to different points of interest; the static group knowledge graph records the static relationship between all users and points of interest in all historical time slices, and the static relationship includes a social relationship for recording the friendship between users, a positional relationship for recording the spatial area where the points of interest are located, an adjacent relationship for recording whether different points of interest belong to neighboring points, a category relationship for recording the point of interest category to which the points of interest belong, and a group relationship for recording user groupings according to the visited points of interest and the visited spatial area.

[0039] It should be noted that the construction of the two graphs requires the complete historical behavior trajectories of all users. The complete historical behavior trajectories of each user can be obtained from social platforms that record the user's POI visit behavior, such as Foursquare, Gowalla, and Yelp. In addition, the construction of the two graphs requires the trajectories of all users on the social platform. The time span of a complete historical behavior trajectory is a specified historical period. The specific length of the historical period can be reasonably selected according to the actual data situation, such as the last 6 months or the last 1 year.

[0040] In addition, the specific construction method of the knowledge graph belongs to the existing technology, and the relationship between entities can be recorded by designing reasonable tuples.

[0041] In an embodiment of the present invention, for the two types of dynamic relationships existing in the dynamic time series knowledge graph, the access relationship can be recorded by a four-tuple consisting of user, access relationship identifier, visited interest point and visit time, and the follow-up relationship can be recorded by a four-tuple consisting of a previously visited location, a follow-up relationship identifier, a later visited location and visit time.

[0042] Specifically, when constructing a dynamic time series knowledge graph, the time span of each user's complete historical behavior trajectory can be divided into a series of historical time slices according to a fixed interval T, and all trajectory segments of each historical time slice can be constructed into a dynamic relational knowledge graph. Figure 3 As shown in , in one example, the complete historical behavior trajectories of user B and user A can be divided into three historical time slices: t-3, t-2, and t-1, and then a dynamic relationship knowledge graph can be constructed for each time slice. Figure 4 As shown, taking user B as an example, he visited , , , this information is recorded in the corresponding dynamic relationship knowledge graph, and the same is true for the other two historical time slices t-2 and t-1. However, it should be noted that the dynamic relationship knowledge graph of each historical time slice contains all users and points of interest POIs, and records the dynamic relationship between them, not just for a single user. Therefore, in the embodiment of the present invention, the dynamic time series knowledge graph can be expressed as , where each dynamic relational knowledge graph Both include user nodes, POI nodes and two dynamic relationships between them. It is a node set consisting of two entities: user nodes and POI nodes. A relationship set that records two kinds of dynamic relationships. It is a set of four tuples that record the dynamic relationship between nodes in the current historical time slice, where: The marked visit relationship shows the interaction between users and POIs, which consists of four tuples: Composition, indicating user Visited location at time t ;by The marked follow-up relationship shows the adjacent visit behavior between two POIs, which consists of a four-tuple Composition, indicating that the user first visited the location , followed by visiting location at time t The fixed interval T can be optimized and adjusted according to actual conditions. In the embodiment of the present invention, T is set to 1 month, so each dynamic relationship knowledge graph contains the access behavior data of all users to POIs within one month.

[0043] In an embodiment of the present invention, when constructing a static group knowledge graph, it is not necessary to consider different historical time slices like constructing a dynamic time series knowledge graph. It is only necessary to construct all data in the complete time span into a graph. For the five static relationships existing in the static group knowledge graph, the social relationship can be recorded by a triple consisting of a user, a social relationship identifier, and a user; the location relationship can be recorded by a triple consisting of an interest point, a location relationship identifier, and the Geohash-5 spatial area in which it is located; the adjacent relationship can be recorded by a triple consisting of an interest point, an adjacent relationship identifier, and an interest point; the category relationship can be recorded by a triple consisting of an interest point, a category relationship identifier, and the category of the interest point to which it belongs; and the group relationship can be recorded by a triple consisting of a user, a group relationship identifier, and the user group to which it belongs. The user group is divided into an interest point level group obtained by clustering the visited interest points and an area level group obtained by clustering the visited Geohash-5 spatial area. The clustering here is essentially to group users according to the points of interest and Geohash-5 spatial areas they visited, that is, users who have visited the same point of interest are grouped at the point of interest level for this point of interest, and users who have visited the same Geohash-5 spatial area are grouped at the area level for this Geohash-5 spatial area.

[0044] Therefore, in an embodiment of the present invention, the static group knowledge graph can be expressed as , which includes all types of nodes and the five static relationships between them. Since the static group knowledge graph also introduces the concepts of Geohash-5 spatial regions and point of interest categories, two additional types of nodes can be added to the graph to facilitate recording relationships through triples. It is a node set consisting of five entities: user nodes, POI nodes, category nodes and region nodes. A relationship set that records 5 types of static relationships. are the set of interest point categories and the set of Geohash-5 spatial regions, respectively. is a set of triples that record the static relationship between nodes, where: The labeled social relationship shows the friendship relationship between users, which consists of triples Composition, indicating user and The relationship between them is friendship; The position relationship of the markers shows the position relationship between the POI and the Geohash-5 spatial area, which consists of a triple Composition, indicating POI nodes Located in the area ;by The labeled adjacency relationship shows the neighbor relationship between POI nodes, which consists of triples Composition, indicating POI nodes and The distance is less than the given distance threshold; The labeled category relationship shows the category relationship of POI, which consists of triples Composition, indicating POI nodes Belongs to category ;by The labeled group relationship shows the user group relationship based on POI and region, which consists of triples Composition, indicating user Belong to group Since groups are divided into point-of-interest level groups and area-level groups, groups .

[0045] The Geohash-5 spatial region adopted by the present invention can be obtained by encoding the entire geographic space through the Geohash algorithm. The algorithm is an address encoding method that can encode two-dimensional spatial longitude and latitude data into a string. It belongs to the prior art and can be directly calculated using existing related functions or programs. The basic steps of the algorithm are: first, the longitude and latitude are converted into binary according to different accuracy requirements, then the longitude and latitude are merged, the longitude occupies the even digits, and the latitude occupies the odd digits, and finally the binary string is encoded according to Base32. The longer the code, the smaller the range of representation and the more accurate the position. The specific value of the accuracy can be optimized and adjusted according to the actual situation. In the embodiment of the present invention, the accuracy is taken as 5, that is, the code length is 5.

[0046] The above dynamic time series knowledge graph is built based on user entities, POI entities and the dynamic relationships between them, and can be used to learn the user's behavior patterns in each time slice and the behavior preferences that change over time; the static group knowledge graph is built based on the static relationship between entities, and can be used to learn multi-heterogeneous information and stable feature dependencies that do not change over time. Both can provide users with preference information for future POI selection from different dimensions.

[0047] S2, obtain the historical behavior trajectory substring of the target user before the time to be predicted, and extract the user comment text of each point of interest visited by the user in turn, use the aspect-level sentiment analysis module built based on the pre-trained model to embed the user comment text, and splice the sentiment embeddings of all user comment texts to obtain the user comment sentiment embedding sequence;

[0048] It should be noted that the historical behavior trajectory substring of the target user before the predicted moment refers to the behavior trajectory composed of a series of interest points recently visited by the target user who needs to recommend interest points before the predicted moment. The number of interest points constituting the historical behavior trajectory substring can be adjusted according to actual needs. In the embodiment, the most recent 20 interest points can be used, that is, the length of the historical behavior trajectory substring is 20.

[0049] It should be noted that the above-mentioned aspect-level sentiment analysis module can theoretically be trained and fine-tuned on the basis of any pre-trained language model. In an embodiment of the present invention, taking into account the requirements for model scale and running speed in actual operation scenarios, the aspect-level sentiment analysis module preferably adopts the DistilBERT model pre-trained on a large-scale corpus to construct the aspect-level sentiment analysis module, and after the pre-trained DistilBERT model, it is also necessary to cascade a multi-classifier, and then fine-tune the cascaded model together on the sentiment analysis data set to obtain the aspect-level sentiment analysis module. The processing flow in the aspect-level sentiment analysis module is: first, the DistilBERT model generates an embedded representation for the input user comment text, and then the embedded representation is input into the multi-classifier to obtain the comment dimension corresponding to the user comment text and the positive and negative scores on each comment dimension (i.e., a two-dimensional vector recording positive scores and negative scores), and the positive and negative scores on all comment dimensions are spliced ​​and output as the sentiment embedding corresponding to the user comment text.

[0050] It should be noted that the sentiment analysis data set used in the fine-tuning process can be obtained by manually annotating the task of the present invention. The training samples in the sentiment analysis data set include user comment texts on points of interest and the true value labels of the user comment texts on the comment dimensions and the positive and negative scores of the comments. After the DistilBERT model is cascaded with multiple classifiers, supervised learning is performed on the sentiment analysis data set, and fine-tuning is completed after convergence. The specific comment dimensions can be designed according to the actual situation of the user comment text data actually collected. For example, in a general review website, the dimensions involved in the user comment texts on points of interest will cover the three dimensions of products, prices, and services. Therefore, these three dimensions can be considered as the comment dimensions output by the multi-classifier.

[0051] It should be noted that the products mentioned in the aforementioned comment dimension refer to the service products provided by the merchants corresponding to the points of interest. For example, for a restaurant, its products are food, and for an amusement park, its products are recreational projects.

[0052] In an embodiment of the present invention, the entire pre-training and fine-tuning process can be specifically implemented through the following steps:

[0053] S21. Pre-train the DistilBERT pre-trained model on a large-scale corpus, namely the BookCorpus dataset and English Wikipedia data;

[0054] S22. User comment text The review dimensions are divided into three indicators, namely product, price and service , and then calculate the positive / negative score of each comment dimension; use the DistilBERT pre-trained model to get the embedded representation of the user comment text z , and then use multiple classifiers to calculate its classification score on each comment dimension ; In addition to calculating the classification score of the comment dimension, it is also necessary to calculate the positive / negative score of the user's comment text on each comment dimension , ,symbol" " indicates modulus length operation. Positive / negative score Represents the user's comment dimension The calculation formulas of the two scores are as follows:

[0055]

[0056]

[0057] in Indicates Comment dimensions, are all learnable parameters.

[0058] S23: Concatenate the positive / negative scores of each comment dimension to obtain the sentiment embedding corresponding to the user comment text :

[0059]

[0060] in Represents a join operation.

[0061] S24, Combination and The true value label of the comment dimension can be calculated separately using the cross entropy loss function and loss of affective tendencies , the final total loss function is:

[0062]

[0063] Based on the calculated The learnable parameters in DistilBERT+ multi-classifier can be optimized in reverse order to continuously iterate the training. After the model training is completed, the trained DistilBERT can be used to embed the user comment text of each point of interest visited by the user, and the sentiment embedding corresponding to each user comment text can be generated. , these sentiment embeddings The user comment sentiment embedding sequence can be obtained by sequentially concatenating.

[0064] S3. Input the substring of the target user's historical behavior trajectory before the predicted moment, the dynamic time series knowledge graph, the static group knowledge graph and the user comment sentiment embedding sequence into the interest point recommendation model. The embedding module first performs word embedding on the input data, and then the multimodal knowledge fusion module fuses the dynamic time series knowledge graph and the static group knowledge graph based on the heterogeneous mutual attention mechanism, and fuses the interest points, users and other multimodal information to obtain the interest point fusion feature representation and user fusion feature representation. Finally, the decoding module splices the interest point fusion feature representation and the user fusion feature representation and inputs them into the cascaded recurrent neural network and multi-layer perceptron to predict the interest points that the target user may visit at the next moment.

[0065] It should be noted that the embedding operation in the embedding module belongs to the prior art, and the specific word vector dimension can be adjusted according to the input requirements of the actual model. In the embodiment of the present invention, the four entities of user, POI, point of interest category and Geohash-5 space area in the input data can be subjected to the embedding operation to obtain word vectors with dimensions of The four feature vectors represent the four word vectors: user word vector , POI word vector , category word vector and regional word vectors , Preferably 64.

[0066] In an embodiment of the present invention, the multimodal knowledge fusion module can perform fusion operations on the dynamic time series knowledge graph and the static group knowledge graph respectively, and fuse POI, user and other multimodal information to obtain richer context information. The processing flow in the multimodal knowledge fusion module is as follows:

[0067] S31. Input the dynamic time series knowledge graph and the static group knowledge graph into the heterogeneous graph attention network respectively, and perform information fusion of heterogeneous nodes based on the heterogeneous mutual attention mechanism within the network to obtain the fused dynamic time series knowledge graph and static group knowledge graph.

[0068] The heterogeneous graph attention (Heterogeneous Graph Transformer) network belongs to the existing technology and will not be described in detail. The heterogeneous graph attention fusion of the two types of knowledge graphs is performed separately. For dynamic time series knowledge graphs, Input the HGT network, perform fusion operations on each historical time slice, and obtain the fused dynamic time series knowledge graph, where the hidden layer vector is represented as Similarly, for static group knowledge graphs, Input the HGT network for fusion operation to obtain the fused static group knowledge graph, in which the hidden layer vector is represented as .

[0069] S32. Arrange all the points of interest in the historical behavior trajectory substring according to the order of user visits, extract the hidden layer vectors corresponding to each point of interest in sequence from the fused dynamic time series knowledge graph to form a user behavior trajectory embedding with global time slice information, extract the hidden layer vectors corresponding to each point of interest in sequence from the fused static group knowledge graph to form a user behavior trajectory embedding with global static information; extract the point of interest level group features and area level group features from the fused static group knowledge graph.

[0070] It should be noted that the above two user behavior trajectory embeddings are respectively obtained from the hidden layer vector representation of the fused dynamic time series knowledge graph. and the hidden layer vector representation of the static group knowledge graph Extracted from and The hidden layer vectors of each node in the graph are recorded in (also called embedded feature representation). When constructing the above two user behavior trajectory embeddings, it is only necessary to extract the hidden layer vectors of each point of interest according to the user's visit order, and then combine them in order to form the user behavior trajectory embedding. Figure 4 As shown in the figure, for user B, assuming that he visited some POIs in the three historical time slices t-3, t-2 and t-1 respectively, since the hidden layer vector representation of the dynamic time series knowledge graph It is still divided according to historical time slices, so for each visited POI, you can Find the hidden layer vector representation of the historical time slice corresponding to the access time, and extract the hidden layer vector of the POI node. After splicing according to the access order of the POI, the user behavior trajectory embedding can be formed. The user behavior trajectory embedding in the static group knowledge graph is also extracted in a similar way, but there is no division of historical time slices in the static group knowledge graph. There is no need to consider the user's access time. The hidden layer vector of the POI can be directly extracted from the graph in sequence. In addition, since there are two types of group information for each point of interest in the static group knowledge graph, the point of interest level group features of each point of interest can also be extracted from the fused static group knowledge graph according to the user's access order. and regional level group characteristics , all visited points of interest Composition of the overall POI level group features , all visited points of interest Composition of the overall POI level group features Among them, each point of interest records a user group that has visited it through a triplet, and the average value of the user word vectors of all users in this group constitutes the point of interest level group feature of this POI Similarly, each POI records the POI category to which it belongs and a user group that has visited this POI category through a triplet. The average value of the user word vectors of all users in this group constitutes the regional level group feature of this POI. .

[0071] S33, taking the user comment sentiment embedding sequence as a query, the user behavior trajectory embedding with global time slice information and the original user behavior trajectory embedding are fused through the attention mechanism to obtain the fused user behavior trajectory embedding; the fused user behavior trajectory embedding is used as the value, the user behavior trajectory embedding with global static information is used as the query, and the interest point level group feature is used as the key, and input into the Encoder module of the Transformer model for fusion encoding to obtain the interest point fusion feature representation.

[0072] It should be noted that the query, key, and value in the present invention are respectively Q (Query), K (Key), and V (Value) in the attention mechanism.

[0073] The above original user behavior trajectory embedding refers to the user behavior trajectory embedding formed by extracting the hidden layer vectors corresponding to each interest point in the historical behavior trajectory substring in the order of access from the dynamic time series knowledge graph that has not been fused by the HGT network. , the user behavior trajectory with global time slice information can be embedded as , the original user behavior trajectory is embedded as , then the fusion process of the attention mechanisms of the two can be expressed by the formula:

[0074]

[0075]

[0076]

[0077]

[0078] in, and Respectively and The hidden layer vector of the jth interest point in , Embedding vectors for user comments sentiment, are all learnable parameters, Embedding of fused user behavior trajectories.

[0079] Similarly, the user behavior trajectory with global static information is embedded as , then the process of fusion encoding through the Encoder module can be expressed by the formula:

[0080]

[0081]

[0082] in: Representation layer normalization operation; Represents a multi-head attention mechanism, where As Q, K, and V, they represent user / POI static information, user / POI group information, and user / POI dynamic information, respectively; represents a feed-forward neural network; The final fusion feature representation of the interest point.

[0083] S34. Concatenate and fuse the group features at the point of interest level and the group features at the area level, use the obtained fused group features as the key, use the user embedded feature representation of all users in the fused static group knowledge graph as the query, use the user embedded feature representation of all users in the original static group knowledge graph as the value, input them into the Encoder module of the Transformer model for fusion encoding, and obtain the user fused feature representation.

[0084] It should be noted that the user embedding feature representation as a value refers to all users extracted from the static group knowledge graph that has not been fused by the HGT network. The user embedding feature representation is denoted as If all users in the fused static group knowledge graph The user embedding feature representation is denoted as , then the process of generating user fusion feature representation by the above fusion coding can be expressed by the formula:

[0085]

[0086]

[0087]

[0088] in: Indicates a connection operation. are all learnable parameters, is the final user fusion feature representation.

[0089] Therefore, the multimodal knowledge fusion module can finally output the fusion feature representation of interest points and user fusion feature representation , these two feature representations both integrate multimodal information, and both can be input into the decoding module to predict the points of interest. In the decoder module, a recurrent neural network RNN ​​and a multi-layer perceptron MLP are included, and the two are used in cascade. In an embodiment of the present invention, the recurrent neural network uses a long short-term memory network LSTM, and the corresponding point of interest prediction process can be expressed by the formula:

[0090]

[0091] in: Indicates a connection operation. and Respectively represented in LSTM network Moment and The hidden layer state information at the moment, , m is the total time step of the LSTM network. The hidden layer state information output by LSTM at the end Input into the multi-layer perceptron MLP to obtain the final point of interest prediction result :

[0092]

[0093] It should be noted that the above step S3 describes the prediction process of the interest point recommendation model in actual application and reasoning scenarios, but it should be understood that the interest point recommendation model needs to be trained and optimized in advance through the total loss function before being used for actual reasoning. In an embodiment of the present invention, the total loss function is obtained by weighting the interest point prediction loss and the static graph loss of all historical time slices.

[0094] Among them, the interest point prediction loss Prediction value output by the POI recommendation model With label value The cross entropy loss between , the calculation formula is:

[0095]

[0096] in Dynamic temporal knowledge graph The number of dynamic relational knowledge graphs in represents the total number of historical time slices; and Represents the predicted value and label value corresponding to the kth interest point.

[0097] When calculating the static graph loss, it is necessary to limit the deviation angle of the same entity embedding in the dynamic time series knowledge graph and the static group knowledge graph so that it does not exceed a threshold related to the timestamp. For any x-th historical time slice, the deviation angle is specifically defined as follows:

[0098]

[0099] in Indicates the rate at which the deviation angle increases, which is a hyperparameter; represents the xth historical time slice in the dynamic time series knowledge graph, and the maximum deviation angle between the two entity embeddings is 90°. Therefore, the calculation formula for the static graph loss corresponding to the xth historical time slice is:

[0100]

[0101] in Represents the entity set consisting of all users and all points of interest in the static group knowledge graph The number of entities in and Respectively represent The corresponding embedded feature representation of the i-th entity in the fused dynamic temporal knowledge graph and the fused static group knowledge graph.

[0102] The total loss function of the final training POI recommendation model is expressed as:

[0103]

[0104] in is a hyperparameter used to balance the prediction loss of interest points And the sum of the static graph losses of all historical time slices .

[0105] The specific model training process belongs to the existing technology. The learnable parameters can be continuously optimized by combining the above-mentioned total loss function and optimizer. The optimized POI recommendation model can be used for actual reasoning.

[0106] It should be noted that the method steps shown in S1 to S3 above can essentially be implemented in the form of a computer program.

[0107] Therefore, based on the same inventive concept, Figure 5 As shown, the present invention also provides a computer electronic device corresponding to the method for recommending points of interest based on a temporal knowledge graph provided in the above embodiment, which includes a memory and a processor;

[0108] The memory is used to store computer programs;

[0109] The processor is used to implement the above-mentioned method for recommending points of interest based on a temporal knowledge graph when executing the computer program;

[0110] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.

[0111] Therefore, based on the same inventive concept, the present invention provides a computer-readable storage medium corresponding to the interest point recommendation method based on the temporal knowledge graph, and a computer program is stored on the storage medium. When the computer program is executed by the processor, it can implement the interest point recommendation method based on the temporal knowledge graph as described above.

[0112] Therefore, based on the same inventive concept, the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, can implement the method for recommending points of interest based on a temporal knowledge graph as described above.

[0113] Specifically, in the computer-readable storage medium of the above three embodiments, the stored computer program is executed by the processor to perform the above steps S1 to S3.

[0114] It is understandable that the above storage medium may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage. The storage medium may also be a U disk, a mobile hard disk, a magnetic disk or an optical disk, etc., which can store program codes.

[0115] It can be understood that the above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be 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.

[0116] It should also be noted that those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the various embodiments provided in this application, the division of steps or modules in the system and method is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or steps can be combined or integrated together, and a module or step can also be split.

[0117] The present invention will further demonstrate the detailed implementation process and technical effects of the POI recommendation method based on the temporal knowledge graph shown in the above steps S1 to S3 on a specific data set through a specific embodiment, so as to facilitate understanding of the essence of the present invention.

[0118] Example

[0119] The steps of this embodiment are the same as the method for recommending points of interest based on the temporal knowledge graph shown in the aforementioned steps S1 to S3, and will not be repeated here. The specific data set, some specific parameter settings and implementation results of this embodiment are mainly presented. And for the convenience of description, the method shown in steps S1 to S3 is referred to as the method of the present invention, and the point of interest recommendation model used is recorded as MINet.

[0120] The original data used in this embodiment are three widely used real-world datasets: Foursquare, Gowalla, and Yelp. In the Gowalla dataset, there are 3,300,986 check-in behaviors of 52,979 users in a total of 121,851 locations; in the Foursquare dataset, there are 9,447,873 check-in behaviors of 46,065 users in a total of 69,005 locations; in the Yelp dataset, there are 632,476 check-in behaviors of 9,627 users in a total of 8,696 locations. Since the Foursquare and Gowalla datasets do not contain user comment information, this embodiment also constructs a default version model based on MINet that does not input the user comment sentiment embedding sequence, denoted as MINet-Revised, as one of the control methods in subsequent experiments.

[0121] In this embodiment, some parameters of MINet are selected as follows: Take 20, the word vector dimension 64; HGT stacking layers Take 1, the number of attention heads Take 1; weighted weight hyperparameter of static graph loss is 0.01, the deviation angle increases at a hyperparameter The iteration termination condition set during the training of the POI recommendation model is that the iteration rounds reach 50 times or the total loss function value converges.

[0122] In addition, the experiment of this embodiment also compares the method of the present invention with several traditional prediction methods. The traditional prediction methods used as comparisons are: (1) FPMC: a traditional Markov chain model based on user personalized behavior; (2) RNN: a recurrent neural network based on historical trajectory sequence prediction; (3) DeepMove: a recurrent neural network based on fusion attention information and trajectory sequence; (4) STAN: a two-layer attention network based on spatial-temporal attention; (5) TiSASRec: an attention network based on sequence position and time interval; (6) Flashback: a recurrent neural network based on past hidden layer and current hidden layer context information; (7) GETNext: a Transformer model that predicts user behavior based on global transition probability; (8) a model based on spatial-temporal knowledge graph to learn POI transfer relations; (9) MARAN: a model based on local center trajectory aggregation and user behavior patterns. This embodiment uses average accuracy (Acc@K) and mean reciprocal rank (MRR) as evaluation indicators of the prediction model. Acc@K calculates the ratio of true positive samples in the first K predicted samples. In the experiment, we set K={5,10}. MRR can reflect the overall performance of recommendation and puts more emphasis on predicting ranking.

[0123] The final experimental results are shown in Table 1. It can be seen that MINet in the method of the present invention achieves better results on the Yelp dataset than the control model. Specifically, on the Yelp dataset, MINet improves by 9.86%, 6.48% and 7.21% in Acc@5, Acc@10 and MRR indicators compared with the best-performing control model MARAN, respectively. In addition, the default version of MINet-Revised also achieves better results on Gowalla than the control model, with improvements of 2.56%, 0.90% and 3.45%, respectively. In the Foursquare dataset, it is slightly inferior to the best-performing control model MARAN, with an average difference of 1.40%. It is worth mentioning that on the Yelp dataset, MINet improves by 47.17%, 45.24% and 33.53% in various indicators compared with the default version, respectively. The comparison shows the effectiveness of the method of the present invention.

[0124] Table 1 Comparison of experimental results of the method of the present invention and the control method

[0125]

[0126] The above-described embodiment is only a preferred solution of the present invention, but it is not intended to limit the present invention. A person skilled in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.

Claims

1. A method for recommending points of interest based on a temporal knowledge graph, characterized in that: include: S1. According to the complete historical behavior trajectory of all users, a dynamic time series knowledge graph and a static group knowledge graph are constructed; the dynamic time series knowledge graph is a graph set composed of dynamic relationship knowledge graphs of different historical time slices, each dynamic relationship knowledge graph records the dynamic relationship between all users and points of interest in the historical time slice, and the dynamic relationship includes an access relationship for recording the user's access behavior to points of interest, and a follow-up relationship for recording the user's adjacent access behavior to different points of interest; the static group knowledge graph records the static relationship between all users and points of interest in all historical time slices, and the static relationship includes a social relationship for recording the friendship between users, a positional relationship for recording the spatial area where the points of interest are located, an adjacent relationship for recording whether different points of interest belong to neighboring points, a category relationship for recording the point of interest category to which the points of interest belong, and a group relationship for recording user groupings according to the visited points of interest and the visited spatial area; S2, obtain the historical behavior trajectory substring of the target user before the time to be predicted, and extract the user comment text of each point of interest visited by the user in turn, use the aspect-level sentiment analysis module built based on the pre-trained model to embed the user comment text, and splice the sentiment embeddings of all user comment texts to obtain the user comment sentiment embedding sequence; S3, input the historical behavior trajectory substring, dynamic time series knowledge graph, static group knowledge graph and user comment sentiment embedding sequence into the interest point recommendation model, first the embedding module performs word embedding operation on the input data, then the multimodal knowledge fusion module performs fusion operation on the dynamic time series knowledge graph and the static group knowledge graph based on the heterogeneous mutual attention mechanism, and fuses the interest points, users and other multimodal information to obtain the interest point fusion feature representation and user fusion feature representation, finally the decoding module splices the interest point fusion feature representation and the user fusion feature representation and inputs them into the cascaded recurrent neural network and multilayer perceptron to predict the interest points that the target user may visit at the next moment; The processing flow in the multimodal knowledge fusion module is as follows: S31, respectively inputting the dynamic time series knowledge graph and the static group knowledge graph into the heterogeneous graph attention network for information fusion, and obtaining the fused dynamic time series knowledge graph and the static group knowledge graph; S32, arranging all the points of interest in the historical behavior trajectory substring according to the order of the user's visit, sequentially extracting the hidden layer vectors corresponding to each point of interest from the fused dynamic time series knowledge graph to form a user behavior trajectory embedding with global time slice information, sequentially extracting the hidden layer vectors corresponding to each point of interest from the fused static group knowledge graph to form a user behavior trajectory embedding with global static information; extracting point of interest level group features and region level group features from the fused static group knowledge graph; S33, taking the user comment sentiment embedding sequence as a query, fusing the user behavior trajectory embedding with global time slice information and the original user behavior trajectory embedding through an attention mechanism to obtain a fused user behavior trajectory embedding; taking the fused user behavior trajectory embedding as a value, taking the user behavior trajectory embedding with global static information as a query, taking the interest point level group feature as a key, inputting them into the Encoder module of the Transformer model for fusion encoding, and obtaining an interest point fusion feature representation; S34. Concatenate and fuse the group features at the point of interest level and the group features at the area level, use the obtained fused group features as the key, use the user embedded feature representation of all users in the fused static group knowledge graph as the query, use the user embedded feature representation of all users in the original static group knowledge graph as the value, input them into the Encoder module of the Transformer model for fusion encoding, and obtain the user fused feature representation.

2. The method for recommending points of interest based on a temporal knowledge graph according to claim 1, characterized in that: In the dynamic time series knowledge graph, the visit relationship is recorded by a four-tuple consisting of a user, a visit relationship identifier, a visit point of interest, and a visit time, and the follow-up relationship is recorded by a four-tuple consisting of a previously visited location, a follow-up relationship identifier, a later visited location, and a visit time; In the static group knowledge graph, social relationships are recorded by triples consisting of user, social relationship identifier, and user; location relationships are recorded by triples consisting of point of interest, location relationship identifier, and the Geohash-5 spatial area in which they are located; adjacent relationships are recorded by triples consisting of a first point of interest, an adjacent relationship identifier, and a second point of interest; category relationships are recorded by triples consisting of a point of interest, a category relationship identifier, and the category of the point of interest to which it belongs; and group relationships are recorded by triples consisting of a user, a group relationship identifier, and the user group to which they belong, wherein user groups are divided into interest point level groups obtained by clustering based on visited interest points and region level groups obtained by clustering based on visited Geohash-5 spatial areas.

3. The method for recommending points of interest based on a temporal knowledge graph according to claim 1, characterized in that: The aspect-level sentiment analysis module is obtained by fine-tuning a pre-trained DistilBERT model and a cascade of multiple classifiers. In the aspect-level sentiment analysis module, the DistilBERT model first generates an embedding representation for the user comment text, and then the embedding representation is input into the multiple classifiers to obtain the comment dimensions corresponding to the user comment text and the positive and negative scores on each comment dimension. The positive and negative scores on all comment dimensions are concatenated and output as the sentiment embedding corresponding to the user comment text.

4. The method for recommending points of interest based on a temporal knowledge graph according to claim 3, characterized in that: The review dimensions include three dimensions: product, price and service.

5. The method for recommending points of interest based on a temporal knowledge graph according to claim 1, characterized in that: The POI recommendation model needs to be trained in advance. The total loss function used in the training is obtained by weighting the POI prediction loss and the static graph loss of all historical time slices. The POI prediction loss is the cross entropy loss between the predicted value and the label value output by the POI recommendation model. x The calculation formula for the static graph loss of a historical time slice is , where the hyperparameters represents the increasing speed of the deviation angle, Represents the entity set consisting of all users and all points of interest in the static group knowledge graph The number of entities in and Represents a collection of entities Middle i The corresponding embedded feature representation of each entity in the fused dynamic temporal knowledge graph and the fused static group knowledge graph.

6. The method for recommending points of interest based on a temporal knowledge graph according to claim 1, characterized in that: The recurrent neural network in the decoding module adopts a long short-term memory network.

7. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, it can implement the method for recommending points of interest based on a temporal knowledge graph as described in any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the method for recommending points of interest based on a temporal knowledge graph as described in any one of claims 1 to 6 is implemented.

9. A computer electronic device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is used to implement the method for recommending points of interest based on a temporal knowledge graph as described in any one of claims 1 to 6 when executing the computer program.

Citation Information

Patent Citations

  • Recommendation method based on knowledge graph and long-term and short-term interests of user

    CN114491247A

  • Random group POI recommendation method, system and device and storage medium

    CN116244513A

  • Recommendation method and device based on multi-attention mechanism and readable storage medium

    CN117633371A

  • Interpretable recommendation method based on graph neural network inference

    WO2022222037A1

  • Knowledge graph recommendation method and system based on improved KGAT model

    WO2023097929A1