Long-tail user interest point recommendation algorithm based on space and social perception
Through the long-tail user interest point recommendation algorithm based on spatial and social perception, the space-social correlation between POIs is used to calculate the associated POI, and a sequence enhancement operator and comparison learning model are constructed, which solves the problem of low recommendation accuracy of long-tail users. Achieve higher recommendation accuracy of points of interest.
Patent Information
- Application Number
- CN202410965531.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-11-12
Smart Images

Figure CN118939887A_ABST
Abstract
Description
[0001] Technology Neighborhood
[0002] The present invention relates to the field of recommendation technology, and in particular to a long-tail user interest point recommendation algorithm based on space and social perception. Background Art
[0003] With the widespread use of GPS-enabled devices and location-based social networks, mobile service-oriented recommendation systems have become an important part of people's daily lives. Point-of-Interest (POI) recommendation plays an increasingly important role in mobile service-oriented recommendation systems. It aims to provide users with the convenience of discovering points of interest for future visits based on their past visit records and current contextual information. POI recommendation relies on the temporal arrangement of users' historical check-in data. It not only focuses on user preferences, but also on the interdependencies between POIs. Modeling user behavior by capturing the relationship between user behaviors is a key part of POI recommendation. Effectively utilizing the correlation in sequence data has an important impact on POI recommendation performance. Existing methods for modeling user check-in sequences mainly perform well when users have sufficiently long check-in sequences, but perform poorly for long-tail users with significantly short check-in histories. Although long-tail users visit a limited number of POIs, they constitute the majority of the user population. Therefore, POI recommendation for long-tail users has become an important challenge in the field of POI recommendation systems. Summary of the invention
[0004] In order to solve the above technical problems existing in the prior art, the present invention proposes a long-tail user interest point recommendation algorithm based on space and social perception.
[0005] The technical solution of the present invention is: a long-tail user interest point recommendation algorithm based on space and social perception, which is carried out in the following steps:
[0006] Step 1. Extract the original interest points of long-tail users from the user's action trajectory data
[0007] Arrange all users in descending order according to the length of their check-in sequences, accumulate the total length of their sequences starting from the shortest sequence, define the users in the user set that accounts for 20% of the total number of check-ins as long-tail users, and extract the original check-in sequences of the long-tail users' points of interest from their action trajectory data; let the user set be U = {u 1 ,u 2 ,…,u |U|}, where |U| represents the total number of users; the POI set is O = {o 1 ,o 2 ,…,o |O|}, where |O| represents the total number of POIs; the original check-in sequence of the long-tail user u at the POI is Among them u,t represents the POI that the long-tail user u checked in at time t, |s u | represents the total length of the check-in sequence of long-tail user u;
[0008] Step 2: Use the spatial-social correlation between POIs to extract related POIs for each POI
[0009] Let the user check-in matrix be A |U|×|O| ,in is equal to 1 if and only if user u x Signed in i , otherwise its value is 0; let the user social relationship matrix be R |U|×|U| ,in is equal to 1 if and only if user u x and user u y There is a friend relationship between them, otherwise its value is 0; let the distance matrix between POIs be D |O|×|O| ,in Indicates o i and j The distance between them; let user u x The set of POIs that have been checked in is D(u x ), signed in i The user set is D(o i );
[0010] First, the user check-in matrix is used to calculate the correlation between POI and users. Let o i The initial value of f(o i ), transmitted to user u through the user check-in matrix x The value of g(u x ) as shown in Formula 1:
[0011]
[0012] Secondly, the user social relationship matrix is used to calculate the association between users. x The value of g(u x ) is transmitted to user u through the user social relationship matrix y The value of g soc (u y ) as shown in Formula 2:
[0013]
[0014] Next, the user check-in matrix is used to calculate the correlation between the user and the POI. y The value of g soc (u y) is transmitted to POI via user check-in matrix o j The value of h(o j ) as shown in Formula 3:
[0015]
[0016] Finally, the distance matrix between POIs is used to calculate the association between POIs and POIs. k The value of h(o j )Transfer to POI o i The value of h dis (o k ) as shown in Formula 4:
[0017]
[0018] Based on formula 4, we get o k and i Spatial-Social Relevance As shown in Formula 5:
[0019]
[0020] Calculate the spatial-social correlation between each pair of POIs, for each POI o i Select the POI with the highest spatial-social relevance as its associated POI
[0021] Step 3. Construct a sequence enhancement operator and use the associated POIs to generate different variants of the original POI check-in sequence for long-tail users
[0022] For the long-tail user u, the original interest point check-in sequence is Construct a random replacement index of the same length as its corresponding where rd t The value of rd is 0 or 1. t =1 means POI o u,t Will be associated with POI Replace, by randomly replacing the index to build a sequence enhancement algorithm Replace(*), when the random replacement index in rd t = 1 and other values are 0, the long-tail user original POI check-in sequence s generated by the sequence enhancement operator u Variants of As shown in Formula 6:
[0023]
[0024] Step 4. Use Transformer as the encoder to build a contrastive learning model SSL to train different variants
[0025] Generate different variant pairs for long-tail user u through sequence enhancement operator Using Transformer to transform and Encode it to get its embedding and Using the softmax cross entropy loss function L shown in Formula 7 SSL Optimize model SSL.
[0026]
[0027] Step 5. Use the trained contrastive learning model to generate the original POI check-in sequence s of long-tail users u Embed As shown in Formula 8:
[0028]
[0029] Step 6. Embed the original POI check-in sequence of long-tail users Embedding of POIs that long-tail users have not checked in o The inner product is performed to obtain the prediction score p as shown in Formula 9 u,o , recommend the top N POIs with the highest predicted scores to long-tail user u;
[0030]
[0031] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0032] Different from the method of randomly selecting associated POIs, the present invention uses the distance between POIs and user social network information to select associated POIs corresponding to POIs based on the short check-in sequence of long-tail users, thereby ensuring that the extracted associated POIs maintain close spatial and social associations with the original POIs, reducing the introduction of noise into the model, and improving the accuracy of POI recommendation for long-tail users. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 is a flow chart of an embodiment of the present invention.
[0034] Figure 2 It is a schematic diagram of the corresponding results of the HR index according to the embodiment of the present invention and the prior art as the recommended quantity changes. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below.
[0036] The present invention provides a long-tail user interest point recommendation algorithm based on space and social perception. Figure 1 As shown, proceed as follows:
[0037] Step 1. Extract the original interest points of long-tail users from the user's action trajectory data
[0038] Arrange all users in descending order according to the length of their check-in sequences, and accumulate the total length of their sequences starting from the shortest sequence. Define the users in the user set that accounts for 20% of the total number of check-ins as long-tail users, and extract the original point-of-interest (POI) check-in sequences of long-tail users from their action trajectory data; let the user set be U = {u 1 ,u 2 ,…,u |U|}, where |U| represents the total number of users; the POI set is O = {o 1 ,o 2 ,…,o |O|}, where |O| represents the total number of POIs; the original check-in sequence of the long-tail user u at the POI is Among them u,t represents the POI that the long-tail user u checked in at time t, |s u | represents the total length of the check-in sequence of long-tail user u;
[0039] For example, the user set is U = {u 1 ,u 2 ,u 3}, the POI set is O = {o 1 ,o 2 ,o 3 ,o 4 ,o 5 ,o 6}, long-tail user u 1 The original POI check-in sequence is
[0040] Step 2: Use the spatial-social correlation between POIs to extract related POIs for each POI
[0041] Let the user check-in matrix be A |U|×|O| ,in is equal to 1 if and only if user u x Signed in i , otherwise its value is 0; let the user social relationship matrix be R |U|×|U| ,in is equal to 1 if and only if user u x and user u y There is a friend relationship between them, otherwise its value is 0; let the distance matrix between POIs be D |O|×|O|,in Indicates o i and j The distance between them; let user u x The set of POIs that have been checked in is D(u x ), signed in i The user set is D(o i );
[0042] First, the user check-in matrix is used to calculate the correlation between POI and users. Let o i The initial value of f(o i ), transmitted to user u through the user check-in matrix x The value of g(u x ) as shown in Formula 1:
[0043]
[0044] Secondly, the user social relationship matrix is used to calculate the association between users. x The value of g(u x ) is transmitted to user u through the user social relationship matrix y The value of g soc (u y ) as shown in Formula 2:
[0045]
[0046] Next, the user check-in matrix is used to calculate the correlation between the user and the POI. y The value of g soc (u y ) is transmitted to POI via user check-in matrix o j The value of h(o j ) as shown in Formula 3:
[0047]
[0048] Finally, the distance matrix between POIs is used to calculate the association between POIs and POIs. k The value of h(o j )Transfer to POI o i The value of h dis (o k ) as shown in Formula 4:
[0049]
[0050] Based on formula 4, we get o k and i Spatial-Social Relevance As shown in Formula 5:
[0051]
[0052] Calculate the spatial-social correlation between each pair of POIs, for each POI o i Select the POI with the highest spatial-social relevance as its associated POI
[0053] For example, the user check-in matrix is shown in Table 1:
[0054] Table 1
[0055] o o o o o o u 1 0 0 1 0 1 u 1 1 1 1 1 1 u 1 1 1 1 1 1
[0056] The user social relationship matrix is shown in Table 2:
[0057] Table 2
[0058] u u u u 0 0 1 u 0 0 1 u 1 1 0
[0059] The distance matrix between POIs is shown in Table 3:
[0060] Table 3
[0061] o o o o o o o 0 2 1 3 4 2 o 2 0 2 4 2 3 o 1 2 0 2 1 2 o 3 4 2 0 3 2 o 4 2 1 3 0 1 o 2 3 2 2 1 0
[0062] o 4 The initial value of f(o 4 )=1,
[0063]
[0064] Calculate o using formula 1 4 The spatial-social correlation with other POIs is shown in Table 4:
[0065] Table 4
[0066] o o o o o o o 0 0.593 0.296 0.889 1.185 0.593 o 0.222 0.370 0.556 0 0.185 0.370 o 0.444 0.667 0.444 0.593 0.444 0
[0067] According to the calculated spatial-social correlation, 1 The POI with the highest spatial-social relevance is o 5 , with o 4 The most spatially-socially relevant POIs 3 , with o 6 The POI with the highest spatial-social relevance is o 2 ;
[0068] Step 3. Construct a sequence enhancement operator and use the associated POIs to generate different variants of the original POI check-in sequence for long-tail users
[0069] For the long-tail user u, the original interest point check-in sequence is Construct a random replacement index of the same length as its corresponding where rd t The value of rd is 0 or 1. t =1 means POI o u,t Will be associated with POI Replace, by randomly replacing the index to build a sequence enhancement algorithm Replace(*), when the random replacement index in rd t = 1 and other values are 0, the long-tail user original POI check-in sequence s generated by the sequence enhancement operator u Variants of As shown in Formula 6:
[0070]
[0071] Long tail user u 1 The original POI check-in sequence is Construct a random replacement index {0, 1, 0} of the same length as the corresponding one, and generate the original POI check-in sequence of the long-tail user through the sequence enhancement operator Variants of for: If the index {0, 0, 1} is randomly replaced, the original POI check-in sequence of the long-tail user generated by the sequence enhancement operator is Variants of for:
[0072] Step 4. Use Transformer as the encoder to build a contrastive learning model SSL to train different variants
[0073] Generate different variant pairs for long-tail user u through sequence enhancement operator Using Transformer to transform and Encode it to get its embedding and Using the softmax cross entropy loss function L shown in Formula 7 SSL Optimize model SSL.
[0074]
[0075] Step 5. Use the trained contrastive learning model to generate the original POI check-in sequence s of long-tail users u Embed As shown in Formula 8:
[0076]
[0077] Step 6. Embed the original POI check-in sequence of long-tail users Embedding of POIs that long-tail users have not checked in o The inner product is performed to obtain the prediction score p as shown in Formula 9 u,o , recommend the top N POIs with the highest predicted scores to long-tail user u;
[0078]
[0079] For example, the embedding of the original POI check-in sequence of long-tail users Long tail users did not check in to POI o 2 , o 3 , o 5 The embedding of The inner product is used to get the prediction score The POI with the highest predicted score will be o 3 Recommended to long-tail users 1 .
[0080] The method of the embodiment of the present invention is experimentally demonstrated, which specifically includes:
[0081] (1) Using public datasets
[0082] The dataset used in the present invention is Gowalla, which contains not only user-point of interest (POI) check-in data, but also rich contextual information, such as check-in timestamp, latitude and longitude of POI, and user relationships. It contains 7479 users, 27881 POIs, 168619 check-in records, and 167002 friend connection relationships.
[0083] (2) Evaluation indicators
[0084] The present invention uses click-through rate (HR) as the evaluation index of this experiment. HR can show the recommendation accuracy performance. The higher the value, the higher the recommendation accuracy. The calculation formula is as follows:
[0085]
[0086] in, Indicates that the final user u i Recommended N POIs, H(u i ) represents the set of POIs that the user has actually checked in, and I(x) represents an indicator function. When x>1, I(x)=1, otherwise I(x)=0.
[0087] The algorithm proposed in this paper is compared with the classic Transformer-based recommendation algorithm BERT4Rec. The results are as follows: Figure 2 As shown. Figure 2The experimental results show that as the number of recommendations increases, the HR results of the algorithm of the present invention are significantly higher than those of the BERT4Rec algorithm. Since the larger the HR value, the higher the recommendation accuracy, the algorithm of the present invention can recommend POIs for long-tail users with higher accuracy than BERT4Rec.
Claims
1. A long-tail user interest point recommendation algorithm based on space and social perception, Features Follow these steps: Step 1. Extract the original interest points of long-tail users from the user's action trajectory data Arrange all users in descending order according to the length of their check-in sequences, accumulate the total length of their sequences starting from the shortest sequence, define the users in the user set that accounts for 20% of the total number of check-ins as long-tail users, and extract the original check-in sequences of the long-tail users' points of interest from their action trajectory data; let the user set be U = {u 1 ,u 2 ,…,u |U| }, where |U| represents the total number of users; the POI set is O = {o 1 ,o 2 ,…,o |O| }, where |O| represents the total number of POIs; the original check-in sequence of the long-tail user u at the POI is Among them u,t represents the POI that the long-tail user u checked in at time t, |s u | represents the total length of the check-in sequence of long-tail user u; Step 2: Use the spatial-social correlation between POIs to extract related POIs for each POI Let the user check-in matrix be A |U|×|O| ,in is equal to 1 if and only if user u x Signed in i , otherwise its value is 0; let the user social relationship matrix be R |U|×|U| ,in is equal to 1 if and only if user u x and user u y There is a friend relationship between them, otherwise its value is 0; let the distance matrix between POIs be D |O|×|O| ,in Indicates o i and j The distance between them; let user u x The set of POIs that have been checked in is D(u x ), signed in i The user set is D(o i ); First, the user check-in matrix is used to calculate the correlation between POI and users. Let o i The initial value of f(o i ), transmitted to user u through the user check-in matrix x The value of g(u x ) as shown in Formula 1: Secondly, the user social relationship matrix is used to calculate the association between users. x The value of g(u x ) is transmitted to user u through the user social relationship matrix y The value of g soc (u y ) as shown in Formula 2: Next, the user check-in matrix is used to calculate the correlation between the user and the POI. y The value of g soc (u y ) is transmitted to POI via user check-in matrix o j The value of h(o j ) as shown in Formula 3: Finally, the distance matrix between POIs is used to calculate the association between POIs and POIs. k The value of h(o j )Transfer to POI o i The value of h dis (o k ) as shown in Formula 4: Based on formula 4, we get o k and i Spatial-Social Relevance As shown in Formula 5: Calculate the spatial-social correlation between each pair of POIs, for each POI o i Select the POI with the highest spatial-social relevance as its associated POI Step 3. Construct a sequence enhancement operator and use the associated POIs to generate different variants of the original POI check-in sequence for long-tail users For the long-tail user u, the original interest point check-in sequence is Construct a random replacement index of the same length as its corresponding where rd t The value of rd is 0 or 1. t =1 means POI o u,t Will be associated with POI Replace, by randomly replacing the index to build a sequence enhancement algorithm Replace(*), when the random replacement index in rd t = 1 and other values are 0, the long-tail user original POI check-in sequence s generated by the sequence enhancement operator u Variants of As shown in Formula 6: Step 4. Use Transformer as the encoder to build a contrastive learning model SSL to train different variants Generate different variant pairs for long-tail user u through sequence enhancement operator Using Transformer to transform and Encode it to get its embedding and Using the softmax cross entropy loss function L shown in Formula 7 SSL Optimize model SSL. Step 5. Use the trained contrastive learning model to generate the original POI check-in sequence s of long-tail users u Embed As shown in Formula 8: Step 6. Embed the original POI check-in sequence of long-tail users Embedding of POIs that long-tail users have not checked in o The inner product is performed to obtain the prediction score p as shown in Formula 9 u,o , recommend the top N POIs with the highest predicted scores to long-tail user u;
