A point of interest recommendation method based on deep semantic extraction

By constructing a deep semantic model (DSM) and a next-generation POI prediction model (NPPM), and using a pre-trained language model (PLM) to reconstruct discrete trajectory data into continuous natural language sentences, and combining multi-task learning and multi-head attention mechanisms, the problem of learning deep semantic information from discrete trajectory data in existing technologies is solved, thereby improving the accuracy and performance of POI recommendations.

CN116611442BActive Publication Date: 2026-11-24CHONGQING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310431484.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-21
Publication Date
2026-11-24
Estimated Expiration
2043-04-21

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively learn deep semantic information from discrete trajectory data in POI recommendations, resulting in limited recommendation performance. Furthermore, existing methods primarily focus on shallow trajectory semantic information, failing to fully utilize semantic information for prediction.

Method used

We employ a deep semantic extraction method, which involves constructing a deep semantic model (DSM) and a next-next-point-of-interest (POI) prediction model (NPPM). We then use a pre-trained language model (PLM) to reconstruct discrete trajectory data into continuous natural language sentences. By combining multi-task learning and multi-head attention mechanisms, we inject deep semantic features and improve model performance through feature fusion and time interval encoding.

Benefits of technology

It improves the accuracy and performance of POI recommendations, effectively mines deep semantic information in discrete sequences, enhances the generalization ability of recommendation models, and is applicable to other recommendation fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116611442B_ABST
    Figure CN116611442B_ABST
Patent Text Reader

Abstract

This invention relates to a point-of-interest (POI) recommendation method based on deep semantic extraction. First, existing data is acquired. A deep semantic recommendation model (DSMR) is constructed for recommending the next POI. The DSMR training involves two steps: first, the parameters in the DSM and the semantic embedding layer of the DSMR are trained, while other parameters in the DSMR are frozen; second, the parameters in the DSM and the semantic embedding layer of the DSMR are frozen, and the other parameters in the DSMR are trained. After both training steps, a trained DSMR is obtained. For a new user, the POI of that new user is input into the trained DSMR, and the output of the trained DSMR is the next POI recommended to that new user. The method proposed in this invention can mine the implicit deep semantic information within discrete sequences and inject it into the recommendation model to improve its recommendation performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of interest point recommendation technology, and in particular to an interest point recommendation method based on deep semantic extraction. Background Technology

[0002] Currently, Point-of-Interest (POI) recommendation has garnered significant attention from both academia and industry, and is commonly used in Location-Based Social Networks (LBSNs) to recommend locations users are most likely to visit in the next moment based on their historical trajectories. In the current paradigm, POI recommendation tasks primarily focus on representation learning, i.e., mapping discrete trajectories to a continuous high-dimensional feature space using deep neural networks and making predictions based on these features. Due to the powerful capabilities of Recurrent Neural Networks (RNNs) in sequence modeling, many works have proposed RNN-based recommendation models. On the other hand, user decisions in real-world scenarios are influenced by numerous factors, and attention mechanisms are used to control the proportion of different information. In LBSNs, spatial and temporal information are key features for check-ins, and user decisions are largely influenced by current time and geographic location. Adding spatiotemporal information has also proven to be an effective approach. These studies learn the state transition relationships between two check-ins by modeling the contextual features of the trajectory.

[0003] Generally, the current paradigm for POI recommendation tasks is as follows: First, an encoder (e.g., an RNN-based, self-attention-based one) learns embeddings (e.g., user / place / category IDs) for each element in the trajectory. These embeddings (i.e., features) contain the learned trajectory contextual information. Next, a prediction module makes predictions based on these embeddings. Therefore, in this paradigm, the quality of the embeddings plays a crucial role in the final prediction. Existing methods mainly focus on learning the contextual information of the check-in sequence; however, contextual information in the trajectory is not the only medium for establishing state transitions between check-ins. Semantic information has proven to be a powerful medium, which can be learned from semantic data and injected into source sequence embeddings for better predictions in other recommendation tasks. Unfortunately, for POI recommendation tasks, most trajectory data lacks explicit semantic information; that is, most key elements in the trajectory are discrete, and there is no direct semantic association between check-ins. Therefore, we believe that learning deep semantic information from discrete trajectory data to improve the quality of trajectory embeddings is key to further improving recommendation performance in POI recommendation tasks.

[0004] To infuse semantic information into trajectory embeddings, some recent works have attempted to add textual data (e.g., location categories) to the trajectories to construct semantic trajectories and learn their semantic features. Their findings suggest that the use of semantic information helps their methods outperform non-semantic approaches. However, they fail to mitigate the aforementioned limitations: (1) these works only utilize a subset of textual properties in the trajectory data, thus remaining at a superficial level of trajectory semantic information. (2) While deep neural networks can model continuous and dense data well, the semantic trajectories they construct remain discrete. Consequently, the ability of deep neural networks to learn the semantic features of discrete semantic trajectories is limited. Summary of the Invention

[0005] The purpose of this invention is to provide an interest point recommendation method based on deep semantic extraction, so as to solve the above-mentioned problems existing in the prior art.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: an interest point recommendation method based on deep semantic extraction.

[0007] Includes the following steps:

[0008] S1: Obtain the existing data, and let the sets of users and locations be U = (u1, u2, ..., u3). N L = (l1, l2, ..., l) M ), where N is the number of users and M is the number of POIs. i = (id, cat, lon, lat), where id is the site identifier, cat represents the site category, and lon and lat are the longitude and latitude, respectively, used to indicate the location of the point of interest;

[0009] User u i The trajectory is a check-in sequence arranged in chronological order. Let... Indicates user u i The trajectory Each check-in c in the trajectory k They are all tuples (u i , l i , tem i ), that is, user u i In time tem i Location l was visited i , tem i = (w, q), where w represents the week and q represents the time period of each day.

[0010] S2: Construct a deep semantic recommendation model DSMR for the next POI recommendation. The DSMR includes a deep semantic model DSM and a next POI prediction model NPPM. The DSM adopts the existing PLM model. The NPPM includes an embedding layer, a context feature learning layer and a prediction layer in sequence. The embedding layer includes a semantic embedding layer and a trajectory embedding layer, a feature fusion layer and a time interval embedding layer in parallel. The context feature learning layer includes a multi-head attention module and a feedforward neural network in sequence.

[0011] S3: Train the DSMR. The training of DSMR includes two steps. The first step is to train the parameters in the DSM and the parameters of the semantic embedding layer in the DSMR, while the other parameters in the DSMR are frozen. The second step is to freeze the parameters in the DSM and the parameters of the semantic embedding layer in the DSMR, and train the other parameters in the DSMR.

[0012] After the two-step training is completed, the trained DSMR is obtained;

[0013] S4: For a new user, input the new user's POI into the trained DSMR. The output of the trained DSMR is the next POI recommended for the new user.

[0014] Preferably, the first step in S3, which involves training the parameters in the DSM and the parameters of the semantic embedding layer in the DSMR, is as follows:

[0015] S311: Construct prompt sentences to reconstruct discrete trajectory data, i.e., check-in data, into continuous natural language sentences;

[0016] S312: Enter the prompt into PLM to obtain the token context representation

[0017] S313: Use these representation vectors output by PLM to update the parameters of the semantic embedding layer through multi-task learning;

[0018] Three tasks were designed to drive PLM: Task 1) inferring user mobility preferences; Task 2) inferring when and where users prefer to go; and Task 3) learning the relationship between points of interest and categories of points of interest.

[0019] Preferably, the steps for constructing the prompt in S31 are as follows:

[0020] S3111: Create a set of text templates (hardprompt) and fill the input slots to form fill hints. First, it is quantitatively divided, that is... Where p is the predefined subsequence length, z = n / p. Let f template (x) is a template function, ftemplate (x) is a sentence with some slots, a sequence The items in the list will be filled into the corresponding slots;

[0021] S3112: Three templates with different functions were designed:

[0022] template 1 PLM infers user mobility preferences, template 2 Guide PLM to infer users' preferred times and places to go, template 3 Help PLM learn the relationship between venues and venue categories.

[0023] S3113: Combine the three template sentences into a final prompt sentence, and add special characters at the beginning and end of each template. <bos>and <eos>.

[0024] S3114: Tokenize the prompts and convert the text tokens into corresponding numerical tokens by referencing the PLM vocabulary;

[0025] Preferably, the S312 prompt is input to the PLM to obtain the token context representation. The process is as follows:

[0026] V = f PLM (PS, θ) (1)

[0027] Where f PLM (·) represents the pre-trained language model, PS is the prompt sentence after word segmentation, θ are the parameters of the PLM, and V represents the token representation vector output by the PLM. b is the batch size, sl is the sequence length, and d p It is the output feature dimension of PLM. Represents the real number field;

[0028] The formula for dense processing of V is:

[0029]

[0030] Preferably, the specific steps of the three tasks in S313 to drive the PLM are as follows:

[0031] Let e c e t e v They represent The characteristic representation of the first, second, and third identifiers in the text;

[0032] definition and These are the user semantic embedding matrix, the interest point semantic embedding matrix, the interest point category semantic embedding matrix, the weekly semantic embedding matrix, and the periodic semantic embedding matrix, respectively, used to store the deep semantic information of the trajectory; Where N c It refers to the number of venue categories. Used to distinguish matrix E, it has no actual meaning. U represents a group of users, and the value of U ranges from [1, N]. u As a user, These are the tags for each task;

[0033] For Task1, first set e u and e c Adding them together gives e uc as template 1 The sentence indicates that, venue category dis c The distribution is calculated as follows:

[0034]

[0035] The loss is calculated using the cross-entropy loss function:

[0036]

[0037] Randomly select some site categories (neg) from the location set L of each trajectory in the batch. c The selected venue category and The difference is that for negative samples (neg) c Calculate the distribution and train the task as a binary classification problem, let This represents the negative site category distribution, where z1 is the number of negative samples, and O c Is with We use all-zero tensors of the same shape, and then employ a binary cross-entropy loss function to calculate the loss for negative samples:

[0038]

[0039] For Task1, the objective function That and These are the Binary-Cross-Entropy loss function and the Cross-Entropy loss function, respectively.

[0040] For Task2, first set e u and e t Adding them together gives e ut as template 2 The sentence indicates that e ut =e u +e t and Let dis w and dis p For weekly and periodic distribution:

[0041]

[0042]

[0043] ,in and These are labels for weeks and periods; the objective function is obj. t The calculation is as follows:

[0044]

[0045] For Task 3, first set e u and e v Adding them together gives e uv as template 3 The sentence indicates that e uv =e u +e v and Let dis v Indicates site distribution:

[0046]

[0047] For negative samples, neg v ,make This represents the negative site category distribution, where z2 is the number of negative samples, and O v Is with Given all-zero tensors of the same shape, then the objective function obj v The calculation is as follows:

[0048]

[0049] obj DSM =obj c +obj t +obj v (11)

[0050] By making the objective function obj DSM To minimize the parameters of the semantic embedding layer, when the objective function obj DSM When the value of no longer changes, the training of the parameters of the semantic embedding layer is complete.

[0051] Preferably, the steps for training other parameters in the second step of S3 of DSMR are as follows:

[0052] S321: Order Indicate u i trajectory sequence, For u i Training is performed based on the trajectory. yes Tags;

[0053] The semantic embedding layer includes a semantic user embedding matrix. Semantic Embedding Matrix Interest Point Category Semantic Embedding Matrix Zhou semantic embedding matrix Periodic semantic embedding matrix for make and These represent semantic user features, semantic location features, semantic location category features, semantic week features, and semantic cycle features.

[0054] The trajectory embedding layer includes the user embedding matrix E user Site embedding matrix E venue Site category embedding matrix E category , Weekly embedding matrix E week Periodic embedding matrix E period .make Indicates user embedding, site embedding enter Site category embedding, weekly embedding, and periodic embedding, respectively from E user E venue E category E week E period The data is retrieved from the database and then embedded into an embedding layer to obtain the embedding vector of the input trajectory sequence.

[0055] S322: Feature Fusion Layer: Through the semantic embedding layer and the trajectory embedding layer, the discrete elements in the trajectory are mapped to a continuous high-dimensional feature space, and the semantic features and trajectory embeddings are fused together through feature fusion operations. The specific steps are as follows:

[0056] set up The formulas for user fusion features, site fusion features, site category fusion features, weekly fusion features, and periodic fusion features after semantic feature fusion are as follows:

[0057]

[0058]

[0059]

[0060]

[0061]

[0062] Here, λ is a hyperparameter used to control the proportion of deep semantic features. Representing user semantic embedding and site semantic embedding respectively enter Site category semantic embedding, week semantic embedding, periodic semantic embedding;

[0063] S323: Calculate the time interval between check-ins, let express The time interval encoding is given by the formula:

[0064]

[0065] d j =f Δ (c j c j+1 (18)

[0066] Where f Δ (c j c j+1 This is a function used to calculate the number of days between two check-ins, with a threshold set. If d j >Γ, then d j =Γ, perform an embedding operation to map the time interval encoding to a continuous feature vector e I , in This represents a learnable embedding matrix;

[0067] S324: Let e S The formula for representing the trajectory is:

[0068]

[0069] Where Concat(·) represents the concatenation operation, concatenating e S Aligning the dimensions and incorporating time interval encoding into the trajectory representation, the formula is as follows:

[0070]

[0071] in It is a learnable parameter matrix.

[0072] Construct three vectors Q, K, and V to calculate the attention score, using the following formula:

[0073]

[0074]

[0075]

[0076] Where LN represents layer normalization. It is a learnable parameter matrix.

[0077]

[0078] MultiHead(Q,K,V)=Concat(head1,head2,...,head h W o (25)

[0079]

[0080] in It is a learnable parameter matrix. h is the number of attention heads;

[0081] S325: Apply a point-by-point two-layer feedforward network, let e o This indicates the output of the multi-head attention module, e′ o Trajectory context features:

[0082]

[0083] e′ o =Φ(e o W (1) +b (1) W (2) +b (2) (28)

[0084] in It is a learnable parameter matrix, and Φ is the LeakyReLU activation function. These are two d-dimensional bias vectors.

[0085] S326: The prediction of the next POI is calculated using matrix multiplication to determine the POI location distribution. The formula is as follows:

[0086]

[0087]

[0088]

[0089] in It is a probability distribution. yes The last sign-in spot in the middle, l i Let L represent the site embedding matrix, the site semantic embedding matrix, the distance calculation function, and the set of sites for a given site, respectively. It is used to calculate location l x , l y The distance score is a function of the distance between two locations. The haversine is a semi-sine formula that calculates the distance between two locations on Earth based on latitude and longitude, and takes the top k maximum values ​​as the prediction result, i.e., top-k.

[0090] S327: Order express negative samples, of which The item in the middle did not appear In the middle, and and Since the lengths are the same, the formula is:

[0091]

[0092]

[0093]

[0094] in These are the probability distributions of the labels and negative samples, respectively. @ represents the dot product operation, and f... sum (x) is a summation function that sums over the last dimension of the input tensor x, O(x). (0) Is with All-zero tensors of the same shape, O (1) Is with O (0) A single sheet of the same shape It is a training objective. It is a binary cross-entropy loss function.

[0095] By making the objective function obj NPPM Minimize other parameters in DSMR when the objective function obj NPPM When the value of no longer changes, the training of other parameters in DSMR is complete.

[0096] Compared with the prior art, the present invention has at least the following advantages:

[0097] 1. This invention addresses the problem of learning high-quality deep semantic features from discrete data in current representation learning paradigms; 2. The model proposed in this invention can mine the implicit deep semantic information within discrete sequences and inject it into recommendation models to improve their recommendation performance; 3. The method proposed in this invention can be transferred to other models and even other recommendation domains, possessing a certain degree of universality. Attached Figure Description

[0098] Figure 1 This is to indicate the engineering process.

[0099] Figure 2 This provides the framework for the DSMR model in the method of this invention.

[0100] Figure 3 A framework for encoding time intervals.

[0101] Figure 4 The graph shows the results of the hyperparameter experiment. Detailed Implementation

[0102] The present invention will now be described in further detail.

[0103] An interest point recommendation method based on deep semantic extraction includes the following steps:

[0104] S1: Obtain the existing data, and let the sets of users and locations be U = (u1, u2, ..., u3). N L = (l1, l2, ..., l) M ), where N is the number of users and M is the number of POIs. i = (id, cat, lon, lat), where id is the site identifier, cat represents the site category, and lon and lat are the longitude and latitude, respectively, used to indicate the location of the point of interest;

[0105] User u i The trajectory is a check-in sequence arranged in chronological order. Let... Indicates user u i The trajectory Each check-in c in the trajectory k They are all tuples (u i , l i , tem i ), that is, user u i In time tem i Location l was visited i , tem i = (w, q), where w represents the week and q represents the time period of each day.

[0106] In our DSMR, since the Deep Semantic Model (DSM) requires input text (i.e., prompt statements), the subsequent POI prediction model (NPPM) needs to use the same time segmentation criterion as the DSM. We divide the day into five time periods: midnight (0:00–5:59), early morning (6:00–9:59), noon (10:00–12:59), afternoon (13:00–18:59), and evening (19:00–23:59). Each user may have a trajectory of variable length, and we convert each trajectory into a fixed-length sequence. If the sequence length n is greater than a threshold τ, we only consider the most recent check-in, i.e., (c n-τ+1 c n-1 c n If n < τ, we padded the sequence to the right with zeros until the sequence length equals τ and masked the padded terms during computation.

[0107] S2: Construct a Deep Semantic Recommendation Model (DSMR) for next POI recommendations. The DSMR includes a Deep Semantic Model (DSM) and a Next POI Prediction Model (NPPM). The DSM uses an existing PLM model (which is an existing model). The NPPM sequentially includes an embedding layer, a contextual feature learning layer, and a prediction layer. The embedding layer includes a semantic embedding layer and a trajectory embedding layer (the semantic embedding layer encodes user, location category, location, and time (i.e., week and time period) into a latent representation storing deep semantic information of the trajectory). During the training phase, the trajectory embedding layer is used to obtain the input trajectory. The dense representation (the trajectory embedding layer and the semantic embedding layer have the same structure), feature fusion layer and time interval embedding layer; the context feature learning layer includes a multi-head attention module and a feedforward neural network in sequence.

[0108] S3: Train the DSMR. The training of DSMR consists of two steps. The first step is to train the parameters in the DSM and the parameters of the semantic embedding layer in the DSMR, while the other parameters in the DSMR are frozen. The second step is to freeze the parameters in the DSM and the parameters of the semantic embedding layer in the DSMR, and train the other parameters in the DSMR.

[0109] After the two-step training is completed, the trained DSMR is obtained;

[0110] S4: For a new user, input the new user's POI into the trained DSMR. The output of the trained DSMR is the next POI recommended for the new user.

[0111] Specifically, the first step in S3, which involves training the parameters in the DSM and the semantic embedding layer in the DSMR, is as follows:

[0112] S311: Construct prompt sentences to reconstruct discrete trajectory data, i.e., check-in data, into continuous natural language sentences;

[0113] S312: Enter the prompt into PLM to obtain the token context representation

[0114] S313: By using these representation vectors output by PLM to update the parameters of the semantic embedding layer through multi-task learning, the deep semantic information of the trajectory can be transferred into these embedding matrices.

[0115] Three tasks were designed to drive PLM: Task 1) inferring user mobility preferences; Task 2) inferring when and where users prefer to go; and Task 3) learning the relationship between points of interest and categories of points of interest.

[0116] Specifically, the steps for constructing the prompt in S31 are as follows:

[0117] S3111: Create a set of text templates (hardprompt) and fill the input slots to form fill hints. First, it is quantitatively divided, that is... Where p is the predefined subsequence length, z = n / p. Let f template (x) is a template function, f template (x) is a sentence with some slots, a sequence The items in the list will be filled into the corresponding slots;

[0118] S3112: Three templates with different functions were designed:

[0119] template 1 PLM infers user mobility preferences, template 2 Guide PLM to infer users' preferred times and places to go, template 3 Help PLM learn the relationship between venues and venue categories.

[0120] template 1 ="User went to the[]on[][], the[]on[][]and the[]on[][].Now it's[][], where might the user go?",,template 2 ="The user is now in the[], what time should it be?", template 3 ="What point of interest belongs to the category of []?". For the most important S3113: concatenate the three template sentences to form the final prompt sentence, and add special characters at the beginning and end of each template. <bos>and <eos>(That is, marking the beginning of each template).

[0121] S3114: The prompt phrases are tokenized, and the text tokens are converted into corresponding numerical tokens by referencing the PLM vocabulary; the processing procedure is as follows: Figure 1 As shown. Using this method, we reconstruct discrete trajectory (i.e., check-in) data into continuous natural language sentences.

[0122] Specifically, the S312 prompt statement is input into the PLM to obtain the token context representation. The process is as follows:

[0123] V = f PLM (PS, θ) (1)

[0124] Where f PLM (·) represents the pre-trained language model, PS is the prompt sentence after word segmentation, θ are the parameters of the PLM, and V represents the token representation vector output by the PLM. b is the batch size, sl is the sequence length, and d... p It is the output feature dimension of PLM. Represents the real number field.

[0125] We perform dense processing on V to match the hidden dimension d of our NPPM, using the following formula:

[0126]

[0127] in It is a learnable parameter matrix.

[0128] Specifically, the three tasks in S313 (each of which can be viewed as a multi-classification problem) drive the PLM process in the following steps:

[0129] Let e c e t e v They represent The first, second, and third identifiers in (i.e.) <eos>The characteristic representation of );

[0130] definition and These are the user semantic embedding matrix, the interest point semantic embedding matrix, the interest point category semantic embedding matrix, the weekly semantic embedding matrix, and the periodic semantic embedding matrix, respectively, used to store the deep semantic information of the trajectory; Where N c It refers to the number of venue categories. Used to distinguish matrix E, it has no actual meaning. U represents a group of users, and the value of U ranges from [1, N]. u As a user, These are the tags for each task;

[0131] For Task1, first set e u and e c Adding them together gives e uc as template 1 The sentence indicates that, venue category dis c The distribution is calculated as follows:

[0132]

[0133] The loss is calculated using the cross-entropy loss function:

[0134]

[0135] Negative sampling is used to improve the model's generalization ability. Specifically, some site categories (neg) are randomly selected from the location set L of each trajectory in the batch. c The selected venue category and The difference is that for negative samples (neg) c Calculate the distribution and train the task as a binary classification problem, let This represents the negative site category distribution, where z1 is the number of negative samples, and O c Is with We use all-zero tensors of the same shape, and then employ a binary cross-entropy loss function to calculate the loss for negative samples:

[0136]

[0137] For Task1, the objective function That and These are the Binary-Cross-Entropy loss function and the Cross-Entropy loss function, respectively.

[0138] For Task 2, the goal is to predict the check-in time (i.e., week and period) based on the prompt. First, let's define e... u and e t Adding them together gives e ut as template 2 The sentence indicates that e ut =e u +e t and Let dis w and dis p For weekly and periodic distribution:

[0139]

[0140]

[0141] in and These are labels for weeks and periods; the objective function is obj. t The calculation is as follows:

[0142]

[0143] For Task 3, first set e u and e v Adding them together gives e uv as template 3 The sentence indicates that e uv =e u +e v and Let dis v Indicates site distribution:

[0144]

[0145] Similar to Task 1, Task 3 also employs a negative sampling strategy, where negative samples are processed using the negative sampling method. v ,make This represents the negative site category distribution, where z2 is the number of negative samples, and O v Is with Given all-zero tensors of the same shape, then the objective function obj v The calculation is as follows:

[0146]

[0147] obj DSM =obj c +obj t +obj v (11)

[0148] By making the objective function obj DSM To minimize the parameters of the semantic embedding layer, when the objective function obj DSM When the value of no longer changes, the training of the parameters of the semantic embedding layer is complete.

[0149] Specifically, the steps for training other parameters in the second step of S3 are as follows:

[0150] S321: Order Indicate u i trajectory sequence, For u i Training is performed based on the trajectory. yes Tags;

[0151] The semantic embedding layer includes a semantic user embedding matrix. Semantic Embedding Matrix Interest Point Category Semantic Embedding Matrix Zhou semantic embedding matrix Periodic semantic embedding matrix for make and These represent semantic user features, semantic location features, semantic location category features, semantic week features, and semantic cycle features.

[0152] The trajectory embedding layer includes the user embedding matrix E user Site embedding matrix E venue Site category embedding matrix E category , Weekly embedding matrix E week Periodic embedding matrix E period .make Indicates user embedding, site embedding enter Site category embedding, weekly embedding, and periodic embedding, respectively from E user E venue E category E week E period The data is retrieved from the database and then embedded into an embedding layer to obtain the embedding vector of the input trajectory sequence.

[0153] S322: Feature Fusion Layer: Through the semantic embedding layer and the trajectory embedding layer, the discrete elements in the trajectory are mapped to a continuous high-dimensional feature space, and the semantic features and trajectory embeddings are fused together through feature fusion operations. The specific steps are as follows:

[0154] set up The formulas for user fusion features, site fusion features, site category fusion features, weekly fusion features, and periodic fusion features after semantic feature fusion are as follows:

[0155]

[0156]

[0157]

[0158]

[0159]

[0160] Here, λ is a hyperparameter used to control the proportion of deep semantic features. Representing user semantic embedding and site semantic embedding respectively enter Site category semantic embedding, week semantic embedding, and periodic semantic embedding are used. Through feature fusion operations, deep semantic features of the trajectory are injected into the model.

[0161] To mitigate the weakness of the self-attention mechanism in causing the model to ignore positional information between tokens in the sequence, we propose a novel positional encoding function, temporal interval encoding, to mark the time interval between check-in points in the trajectory, thereby avoiding the loss of temporal information.

[0162] S323: Calculate the time interval between check-ins, let express The time interval encoding is given by the formula:

[0163]

[0164] d j =f Δ (c j c j+1 (18)

[0165] Where f Δ (c j c j+1 This is a function used to calculate the number of days between two check-ins, with a threshold set. If d j >Γ, then d j =Γ, the construction of the time interval code is as follows Figure 3 As shown. Next, we perform an embedding operation, mapping the time interval encoding to a continuous feature vector e. I , in This represents a learnable embedding matrix;

[0166] S324: Let e S The formula for representing the trajectory is:

[0167]

[0168] Where Concat(·) represents the concatenation operation, concatenating e S Aligning the dimensions and incorporating time interval encoding into the trajectory representation, the formula is as follows:

[0169]

[0170] in It is a learnable parameter matrix. Multi-head attention allows the model to collectively focus on different representation subspaces from different locations.

[0171] Construct three vectors Q, K, and V to calculate the attention score, using the following formula:

[0172]

[0173]

[0174]

[0175] Where LN represents layer normalization. It is a learnable parameter matrix.

[0176]

[0177] MultiHead(Q,K,V)=Concat(head1,head2,...,head h W o (25)

[0178]

[0179] in It is a learnable parameter matrix. h is the number of attention heads (i.e., heads) i ).

[0180] S325: To impart nonlinearity to the model, we apply a pointwise two-layer feedforward network, letting e o This indicates the output of the multi-head attention module, e′ o Trajectory context features:

[0181]

[0182] e′ o =Φ(e o W (1) +b (1) W (2) +b (2) (28)

[0183] in It is a learnable parameter matrix, and Φ is the LeakyReLU activation function. These are two d-dimensional bias vectors.

[0184] S326: The prediction of the next POI is calculated using matrix multiplication to determine the POI location distribution. The formula is as follows:

[0185]

[0186]

[0187]

[0188] in It is a probability distribution; the larger the value, the greater the probability that the corresponding position will be recommended. yes The last sign-in spot in the middle, l i Let L represent the site embedding matrix, the site semantic embedding matrix, the distance calculation function, and the set of sites for a given site, respectively. It is used to calculate location l x , l y The distance score is a function of the distance between two locations. The haversine is a semi-sine formula that calculates the distance between two locations on Earth based on latitude and longitude, and takes the top k maximum values ​​as the prediction result, i.e., top-k.

[0189] S327: Negative sampling is used to improve the model's generalization ability. Let express negative samples, of which The item in the middle did not appear In the middle, and and Since the lengths are the same, the formula is:

[0190]

[0191]

[0192]

[0193] in These are the probability distributions of the labels and negative samples, respectively. @ represents the dot product operation, and f... sum (x) is a summation function that sums over the last dimension of the input tensor x, O(x). (0) Is with All-zero tensors of the same shape, O (1) Is with O (0) A single sheet of the same shape It is a training objective. It is a binary cross-entropy loss function.

[0194] By making the objective function obj NPPM Minimize other parameters in DSMR when the objective function obj NPPM When the value of no longer changes, the training of other parameters in DSMR is complete.

[0195] 1.1 Dataset

[0196] We evaluate the DSMR model on two real-world datasets: NYC and TKY. To filter inactive users and locations in the NYC and TKY datasets, we remove records of users with fewer than 10 check-ins and locations with fewer than 10 visits. Based on the trajectories in NYC and TKY, we employ cue engineering to convert discrete check-ins into dense text sentences (i.e., cue statements) to learn deep semantic information about the trajectories. The number of users, locations, venue categories, trajectories, check-ins, and cue statements in each dataset are shown in Table 1. For each user's trajectory of length n, the first n-2 check-in points are used as the training set, the (n-1)th check-in point is used as the label for the training set, and the nth check-in point is used as the label for the test set.

[0197] Table 1. Dataset Structure

[0198]

[0199] 1.2 Baseline Models for Comparison

[0200] The method of the present invention is compared with the following baseline model:

[0201] LSTM: A recurrent neural network that learns the check-in order dependency.

[0202] GRU: A variant of LSTM.

[0203] Transformer: The first sequential transduction model based entirely on attention.

[0204] STAN: A self-attention-based model for next point of interest (POI) recommendations.

[0205] SASRec: A self-attention-based sequential model for next item recommendation.

[0206] TiSASRec: A self-attention model for next-point-of-interest (POI) recommendations.

[0207] SSE-PT: A Transformer-based personalization model for sequential recommendations.

[0208] 1.3 Evaluation Indicators

[0209] Top-k accuracies Acc@1, Acc@5, Acc@10, and Acc@20 are used to evaluate recommendation performance; these are common metrics in recommendation systems. Acc@k represents whether the true Point of Interest (i.e., the label) appears in the top k recommended Points of Interest. Given a dataset containing m samples, we define:

[0210]

[0211] in It is an indicator function. It returns 1 if the condition is true, and 0 otherwise.

[0212] 1.4 Results Analysis

[0213] Recommended Performance: Table 2 shows the performance comparison between our model and the baselines for the two datasets. Bold indicates best performance, and underline indicates second-best. We present the accuracy for top-1, top-5, top-10, and top-20. For all datasets, except for Acc@1 in the TKY dataset, our model significantly outperforms the baselines. In the NYC dataset, compared to the best baseline SASRec, we achieve a 12.54% improvement on Acc@1, a 5.35% improvement on Acc@5, a 6.34% improvement on Acc@10, and a 5.54% improvement on Acc@20. In the TKY dataset, compared to the best baseline for each metric, DSMR achieves a 6.61% improvement on Acc@5, a 10.64% improvement on Acc@10, and a 9.05% improvement on Acc@20, but only a 1.30% decrease on Acc@1.

[0214] Table 3. Impact of different pre-trained language models on model performance

[0215]

[0216] Table 4. Performance comparison of different pre-trained language models on Task 1

[0217]

[0218] The impact of using different language models on the results: To investigate the contribution of pre-trained language model PLMs to DSMR performance, we employed different state-of-the-art pre-trained language models to learn deep semantic feature trajectories and observed their impact on the final performance. Specifically, we selected BERT, RoBERTa, XLNet, BART, and GPT-2 as our candidate PLMs. For BERT, RoBERTa, XLNet, BART, and GPT-2, we used the base versions of these PLMs provided by HuggingFace (https: / / huggingface.co). We replaced the DSM's PLM with the aforementioned pre-trained language models, updated the parameters of the SemanticEmbeddingLayer, and saved checkpoints for testing. Table 3 shows the performance comparison of learning deep semantic features using different PLMs. As can be seen from Table 3, different PLMs have different impacts on performance, with GPT-2 showing the most significant improvement in deep semantic feature learning. To compare the capabilities of the aforementioned PLMs in deep semantic features of deep learning trajectories, we chose Task 1 (i.e., predicting the next site category based on historical check-ins) as the objective because Task 1 is more challenging and allows for intuitive verification of the PLM's natural language understanding and reasoning abilities. Table 4 shows the performance comparison with different PLMs in our multi-task learning phase. As can be seen from Table 4, GPT-2 achieved competitive results overall. Therefore, in this work, we selected GPT-2 as the PLM for DSM.

[0219] Compared to other PLMs, GPT-2 utilizes a larger scale of unlabeled training data and achieves state-of-the-art performance across numerous downstream NLP tasks. Our observations also confirm that high-performance PLMs can further improve the quality of learned trajectory deep semantic features. These results demonstrate the significant potential of prompt engineering in POI recommendation tasks.

[0220] Table 5. Performance comparison of baseline models after incorporating deep semantic features

[0221]

[0222] Validating the effectiveness of deep semantic features: To explore whether the learned trajectory deep semantic information can be transferred to other recommendation models to improve their performance, we selected our baseline models GRU, LSTM, and Transformer for experiments. For the baseline models above, the input data embedding process is the same as DSMR. In the above models, initially only the trajectory embedding layer maps sequential trajectories to continuous vector representations. We added a pre-trained semantic embedding layer and performed feature fusion to add trajectory deep semantic features. We chose GPT-2 as the PLM of DSM to pre-train the semantic embedding layer. Table 5 shows the performance of the baseline models with deep semantic features, where "+DSF" indicates the addition of deep semantic features (i.e., the addition of a pre-trained deep semantic layer). It can be observed that after adding deep semantic features, the performance of all models is improved to varying degrees overall. In the NYC dataset, GRU improves Acc@1 / 5 / 10 / 20 by 23.17 / 6.87 / 2.59 / 3.02%, while LSTM improves Acc@1 / 5 / 10 / 20 by 9.49 / 5.89 / 2.55 / 3.76%. Transformer achieves improvements of 12.08 / 1.24 / 1.43% on Acc@1 / 5 / 20, but declines by 1.52% on Acc@10. In the TYK dataset, GRU improves Acc@1 / 5 / 10 / 20 by 28.49 / 35.43 / 22.97 / 14.5%, LSTM improves Acc@1 / 5 / 10 / 20 by 45.89 / 30.69 / 24.54 / 13.86%, and Transformer improves Acc@1 / 5 / 10 / 20 by 1.81 / 4.74 / 2.22 / 1.35%. Based on these results, the method of this invention can also improve the performance of other baseline models.

[0223] Table 6. Ablation Test

[0224]

[0225] Ablation Study: Nine experiments were conducted: (1) Full model; (2) No time interval encoding; (3) Repeated time interval encoding with learnable positional embeddings; (4) Repeated time interval encoding with absolute positional embeddings; (5) No semantic user embeddings; (6) No semantic temporal embeddings (i.e., semantic periodic / cycle embeddings); (7) No semantic site embeddings; (8) No semantic category embeddings; (9) No semantic embeddings (i.e., semantic embedding layers). In each experiment, the remaining settings remained unchanged from the full model, with only one component being replaced or removed. The results are shown in Table 6, where Avg↓ represents the average performance degradation rate, Avg↓ = (Acc@1 + Acc@5 + Acc@10 + Acc@20) / 4.

[0226] The results show that: 1) the complete model achieves optimal performance; 2) compared to other components in the overall performance, our proposed time interval encoding contributes the most to the prediction. Without time interval encoding, the average accuracy drops by 22.68% on the NYC dataset and 12.70% on the TKY dataset; 3) time interval encoding outperforms absolute position encoding and learnable position encoding; 4) deep semantic features of the fused trajectory can make a significant contribution to the prediction; 5) other components also contribute to the prediction, with semantic category embedding playing a more important role than other semantic embedding matrices.

[0227] 1.5 Hyperparameter Experiment

[0228] The hyperparameter λ controls the proportion of trajectory depth semantic features; a larger value means more semantic information is fused into the trajectory features. We tested the NYC and TKY datasets, changing the hyperparameter λ from 0 to 1 with a step of 0.1 and recording the results. Figure 4 It can be seen that as the value of λ increases from 0 to 1, the model's performance first increases and then decreases. Generally, the best results are obtained around λ = 0.5. The results show that controlling an appropriate proportion of deep semantic feature fusion can improve the model's performance. Since the parameters of the deep semantic layer are fixed in the POI prediction parsing in this work, we believe that an excessively large proportion will cause the model to over-rely on these fixed semantic features and reduce the learning of contextual features of the input trajectory.

[0229] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.< / eos> < / eos> < / bos> < / eos> < / bos>

Claims

1. An interest point recommendation method based on deep semantic extraction, characterized in that, Includes the following steps: S1: Obtain the existing data, and let the sets of users and locations be respectively... , Where N is the number of users and M is the number of POIs. , where id is the site identifier, cat indicates the site category, and lon and lat are the longitude and latitude, respectively, used to indicate the location of the point of interest; user The trajectory is a check-in sequence arranged in chronological order. Let... Indicates user The trajectory Each check-in in the trajectory They are all tuples That is, users In time Location visited , , where w represents week and q is used to represent the time period of each day; S2: Construct a deep semantic recommendation model DSMR for the next POI recommendation. The DSMR includes a deep semantic model DSM and a next POI prediction model NPPM. The DSM adopts the existing PLM model. The NPPM includes an embedding layer, a context feature learning layer and a prediction layer in sequence. The embedding layer includes a semantic embedding layer and a trajectory embedding layer, a feature fusion layer and a time interval embedding layer in parallel. The context feature learning layer includes a multi-head attention module and a feedforward neural network in sequence. S3: Train the DSMR. The training of DSMR includes two steps. The first step is to train the parameters in the DSM and the parameters of the semantic embedding layer in the DSMR, while the other parameters in the DSMR are frozen. The second step is to freeze the parameters in the DSM and the parameters of the semantic embedding layer in the DSMR, and train the other parameters in the DSMR. After the two-step training is completed, the trained DSMR is obtained; The first step in S3, which involves training the parameters in the DSM and the semantic embedding layer in the DSMR, is as follows: S311: Construct prompt sentences to reconstruct discrete trajectory data, i.e., check-in data, into continuous natural language sentences; S312: Enter the prompt into PLM to obtain the token context representation ; S313: Use these representation vectors output by PLM to update the parameters of the semantic embedding layer through multi-task learning; Three tasks were designed to drive PLM, where Task 1) infers the user’s mobile preferences; Task 2) Infer what time and where users prefer to go; Task 3) Learn the relationship between points of interest and categories of points of interest; S4: For a new user, input the new user's POI into the trained DSMR. The output of the trained DSMR is the next POI recommended for the new user.

2. The interest point recommendation method based on deep semantic extraction as described in claim 1, characterized in that: The steps for constructing the prompt in S311 are as follows: S3111: Create a set of text templates (hardprompt) and fill the input slots to form fill hints. First, it is quantitatively divided, that is... Where p is the predefined subsequence length, ,make For template functions, It is a sentence with some slots, a sequence. The items in the list will be filled into the corresponding slots; S3112: Three templates with different functions were designed: PLM infers users' mobile preferences. Guide PLM to infer users' preferred times and locations. Help PLM learn the relationship between venues and venue categories; S3113: Concatenate the three template sentences into the final prompt sentence, and add special characters at the beginning and end of each template. <bos>and <eos> ;< / eos> < / bos> S3114: Tokenize the prompts and convert the text tokens into corresponding numerical tokens by referencing the PLM vocabulary.

3. The interest point recommendation method based on deep semantic extraction as described in claim 2, characterized in that: The S312 prompt message is input into the PLM to obtain the token context representation. The process is as follows: (1) in It is a pre-trained language model, and PS is the prompt sentence after word segmentation. These are parameters of the PLM, where V represents the token representation vector output by the PLM. 'b' is the batch size, and 'sl' is the sequence length. It is the output feature dimension of PLM. Represents the real number field; The formula for dense processing of V is: (2) in It is a learnable parameter matrix. .

Citation Information

Patent Citations

  • Recommendation method for next interest point of social network

    CN113205427A

  • Deep learning recommendation method and system based on comments and article description

    CN113268657A