A point of interest recommendation method based on contrastive learning
Through the comparative learning method, the spatial and temporal information and preference characteristics of the user's check-in sequence are used to improve the performance of the point of interest recommendation model, solve the problem of failure to fully utilize the spatial and temporal information in the existing technology, and achieve more efficient point of interest recommendation.
Patent Information
- Application Number
- CN202411116312.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-08-14
AI Technical Summary
The existing point-of-interest recommendation model fails to make full use of the spatiotemporal information in user data, resulting in low recommendation performance.
The method based on contrast learning is adopted to divide the user's check-in sequence into subsequences, use Transformer to obtain hidden representations, and train the point-of-interest recommendation model through three comparison learning methods (spatial semantics, temporal features and preference features) to improve the recommendation accuracy.
Effectively modeling of spatiotemporal semantics improves the performance of point-of-interest recommendations, especially in the case of sparse data, surpassing the performance indicators of traditional models.
Smart Images

Figure CN118643221B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of machine learning, and in particular to a method for recommending points of interest based on contrastive learning. Background Art
[0002] Recommendation systems are currently widely used in online networks to solve the problem of data overload. The task of recommendation systems is to use a large amount of data to recommend items of potential interest to users.
[0003] Recommending the next point of interest (POI) for users provides important value to both location-based service providers and users. In the prior art, POI recommendation models usually rely on a supervised paradigm, using historical user-POI interaction data to learn model parameters and data representation for the final POI prediction.
[0004] However, these models overemphasize the final POI recommendation performance, which leads to the failure to fully utilize the potential spatiotemporal information in user data, resulting in poor recommendation performance. Summary of the invention
[0005] In order to solve the deficiencies in the prior art, the purpose of this application is to provide a method for recommending points of interest based on contrastive learning to improve the recommendation accuracy of the recommendation system.
[0006] To achieve the above objectives, the present application provides a method for recommending points of interest based on contrastive learning, comprising:
[0007] Based on a set time interval threshold, the user check-in sequence is divided into a plurality of subsequences, wherein the user check-in sequence is composed of a plurality of data including users, time and points of interest;
[0008] Based on the user check-in sequence, using Transformer to obtain a hidden representation of the user check-in sequence;
[0009] The interest points in the subsequence to which the target interest point belongs are taken as positive samples, and the interest points in other subsequences are taken as negative samples, and the first contrastive learning is performed;
[0010] The subsequences with the same temporal features are regarded as positive samples, and the subsequences with other temporal features are regarded as negative samples, and the second contrastive learning is performed;
[0011] Taking the hidden representation with the same preference as the current hidden representation as the positive sample, and taking the hidden representation with different preferences from the same user as the negative sample, and performing the third contrastive learning;
[0012] Train and fine-tune a POI recommendation model based on contrastive learning.
[0013] Furthermore, the specific steps of using Transformer to obtain a hidden representation of the user sign-in sequence based on the user sign-in sequence include:
[0014] Based on the user check-in sequence, determining an embedding matrix of the user check-in sequence;
[0015] Based on the embedding matrix, a Transformer encoder is used to determine the hidden representation of the user check-in sequence.
[0016] Furthermore, the specific step of determining the embedding matrix of the user sign-in sequence based on the user sign-in sequence includes:
[0017] Project the high-dimensional one-hot encoded interest point representation using the interest point embedding matrix;
[0018] Convert the user's check-in sequence into a fixed-length sequence, and create an input embedding matrix based on a query of the fixed-length sequence in the POI embedding matrix;
[0019] Based on the input embedding matrix, construct a position encoding matrix;
[0020] Based on the position encoding matrix and the input embedding matrix, an embedding matrix of the user check-in sequence is determined by summing up.
[0021] Furthermore, the specific steps of taking the interest points in the subsequence to which it belongs as positive samples and taking the interest points in other subsequences as negative samples to perform the first comparative learning include:
[0022] An average pooling operation is performed on the subsequence to which the positive sample belongs as an embedded representation of the positive sample.
[0023] Furthermore, the specific steps of taking subsequences with the same time characteristics as positive samples and subsequences with other time characteristics as negative samples and performing the second contrastive learning include:
[0024] The time feature of the last check-in in the subsequence is used as the time feature of the subsequence;
[0025] Based on the time characteristics, coarse-grained clustering and fine-grained clustering are performed separately and combined to obtain the preference set;
[0026] Based on the preference set, subsequences with the same time features are taken as positive samples, and subsequences with other time features are taken as negative samples, and a second comparative learning is performed.
[0027] Furthermore, average pooling is used to obtain the embedding representations of all subsequences with the same temporal features.
[0028] Furthermore, the specific steps of taking the hidden representation with the same preference as the current hidden representation as a positive sample and taking the hidden representation with different preferences from the same user as a negative sample to perform the third contrastive learning include:
[0029] Based on the temporal features of the points of interest, a preference set including temporal features is constructed;
[0030] Based on the preference set, a hidden representation with the same temporal features and the same interest point category as the current hidden representation is used as a positive sample, and a hidden representation with the same temporal features and different interest point categories from the same user is used as a negative sample to perform a third comparative learning.
[0031] Furthermore, the specific steps of training and fine-tuning to generate a POI recommendation model based on contrastive learning include:
[0032] Based on the loss function of the first contrastive learning, the loss function of the second contrastive learning, and the loss function of the third contrastive learning, a total loss function is determined to perform pre-training;
[0033] Initialize the encoder using pre-trained parameters and fine-tune the parameters using binary cross entropy.
[0034] To achieve the above-mentioned purpose, the electronic device provided by the present application includes:
[0035] processor;
[0036] a memory having stored thereon one or more computer program instructions executed on the processor;
[0037] Wherein, when the processor runs the computer program instructions, the above-mentioned method for recommending points of interest based on contrastive learning is executed.
[0038] To achieve the above objectives, the present application provides a computer-readable storage medium on which computer instructions are stored. When the computer instructions are executed by a processor, the steps of the interest point recommendation method based on contrastive learning as described above are executed.
[0039] The present invention discloses a method for recommending points of interest based on contrastive learning, which can effectively model the spatiotemporal semantics in learning representation and achieve higher recommendation performance.
[0040] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent from the description, or may be understood by practicing the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings are used to provide a further understanding of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings:
[0042] Figure 1 A flowchart of a method for recommending points of interest based on contrastive learning in this application;
[0043] Figure 2 This is a schematic diagram of the structure of the point of interest recommendation model of this application;
[0044] Figure 3 A schematic diagram of a test data set for this application;
[0045] Figure 4 A schematic diagram of the performance indicators of the item recommendation model of the present application;
[0046] Figure 5 Schematic diagram of parameter selection for the POI recommendation model of this application. DETAILED DESCRIPTION
[0047] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be construed as being limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are only for exemplary purposes and are not intended to limit the scope of protection of the present application.
[0048] It should be understood that the various steps described in the method implementation of the present application can be performed in different orders and / or performed in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present application is not limited in this respect.
[0049] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0050] It should be noted that the modifications of "one" and "plurality" mentioned in this application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more". "Plurality" should be understood as two or more.
[0051] Hereinafter, embodiments of the present application will be described in detail with reference to the accompanying drawings.
[0052] Example 1
[0053] An embodiment of the present application provides a method for recommending points of interest based on contrastive learning. Figure 1-5 The POI recommendation method based on contrastive learning of the present application is described in detail.
[0054] Step S101: dividing a user check-in sequence into a plurality of subsequences based on a set time interval threshold, wherein the user check-in sequence is composed of a plurality of data including users, time and points of interest;
[0055] In the recommended method of this implementation, For a group of users, is a set of POIs, represents a set of timestamps, where |U|, |P|, and |T| are the total number of users, the total number of interest points, and the total number of timestamps, respectively.
[0056] Each timestamp By a tuple Time features are hour, weekday (e.g., Sunday), and whether it is a weekend; each POI Tuples of latitude, longitude and category respectively Represents; a check-in data in the user check-in sequence is a tuple q = <u, p, t>, indicating that user u visits point of interest p at time t.
[0057] Sign the user in is divided into subsequences, where Indicates the number of check-ins of user u. When the time interval exceeds the time threshold When , the current access is segmented, while ensuring that the distance between any pair of interest points in the subsequence is less than Therefore, the subsequence set Can be written as ,in yes The number of neutron sequences.
[0058] Step S102: Based on the user check-in sequence, use Transformer to obtain a hidden representation of the user check-in sequence;
[0059] First, using the interest point embedding matrix Project the high-dimensional one-hot encoded interest point representation onto a low-dimensional dense vector.
[0060] The input sign-in sequence of user u Convert to a fixed-length sequence Then, in Perform query operations based on Create input embedding matrix In order to maintain the temporal order of the sequence, a position encoding matrix is constructed .
[0061] Then, by summing these two embedding matrices, we get the user embedding matrix:
[0062] .
[0063] Use Transformer as the encoder to learn the representation of the check-in sequence. Given the embedding matrix of the user's check-in sequence , we get its hidden expression , the formula is as follows:
[0064] ;
[0065] in represents the parameters of the model, and In The hidden representation corresponding to the i-th visit in the sequence of the current user u.
[0066] Step S103: taking the interest points in the subsequence to which it belongs as positive samples and taking the interest points in other subsequences as negative samples, and performing a first comparative learning;
[0067] Since each subsequence is grouped with interest points in a small region where the distance between interest points is less than the distance interval kd, it indicates that these interest points are similar in spatial semantics.
[0068] Therefore, in order to strengthen the correlation between interest points within each subsequence, spatial semantics is modeled.
[0069] In this embodiment, a contrastive learning method is used to perform contrastive learning on a certain interest point by treating the interest points in the same subsequence as positive samples and treating the interest points in other subsequences as negative samples.
[0070] Since each interest point has multiple positive samples during contrastive learning, resulting in high time complexity, in this implementation, for an interest point, we use the subsequence to which it belongs as its positive sample sequence and obtain the representation of the subsequence through an average pooling operation.
[0071] For example, for user u and its subsequence , where | | is a subsequence The number of interest points, we get its representation through average pooling, where yes The embedding representation of is:
[0072] ;
[0073] In this embodiment, based on the InfoNCE loss, the loss function of the first contrastive learning of spatial semantics is as follows:
[0074] ;
[0075] in, For users, For the user set, For users The set of subsequences of Subsequence set subsequence in For subsequence Points of interest in is the temperature coefficient, Represents a subsequence set Any subsequence of .
[0076] Step S104: taking subsequences with the same time characteristics as positive samples and subsequences with other time characteristics as negative samples, and performing a second comparative learning;
[0077] Since the sign-in sequence of the user shows weekly and daily periodicity, in this embodiment, the time feature of the last sign-in in the subsequence of the sign-in sequence of the user is used as the time feature of the subsequence;
[0078] Based on the time characteristics, coarse-grained clustering and fine-grained clustering are performed separately and combined to obtain the preference set;
[0079] At a coarse-grained level, , the subsequences of the same user are divided into 24 (i.e., one hour of a day) or 7 (i.e., one day of a week) as preference clusters; at a fine-grained level (e.g., weekday mornings), which considers time characteristics from a daily perspective; and finally combines these two grouping methods, namely .
[0080] In this embodiment, in order to improve efficiency, we use average pooling to obtain representations of all subsequences with the same temporal features from user u.
[0081] For example, for a given subsequence , we get the preference set , which includes Under each clustering method The representation of all subsequences of user u with the same time feature c is:
[0082] ;
[0083] in , is a subsequence The expression, Have the same time characteristics Users set of subsequences.
[0084] Based on the preference set, subsequences with the same time features are taken as positive samples, and subsequences with other time features are taken as negative samples, and the second contrastive learning is performed. The loss function is as follows:
[0085] ;
[0086] in, For users, For the user set, For users The set of subsequences of Subsequence set subsequence in For the current time feature The collection of all time features under the same cluster, For collection Any time feature in is the temperature coefficient.
[0087] Step S105: taking a hidden representation with the same preference as the current hidden representation as a positive sample, and taking a hidden representation from the same user with a different preference as a negative sample, and performing a third comparative learning;
[0088] Since the categories of POIs in a user’s check-in sequence can represent their preferences at that time, the preferences of users in sequential transitions within the same category are often similar, and modeling the semantic consistency in these transitions enhances the model’s understanding of user sequential behavior.
[0089] Specifically include:
[0090] Based on the temporal features of the points of interest, a preference set including temporal features is constructed;
[0091] In this embodiment, the conversion with the same target category is defined in the same time feature as having similar preferences For conversion, we use hours As the time feature when the interest point is visited, the preference set can be constructed .
[0092] By capturing contextual information through the Transformer encoder defined in Sequence Encoder, we obtain the hidden representation of the i-th transition (i.e., visit) in the current sequence.
[0093] Based on the preference set, a hidden representation with the same temporal features and the same interest point category as the current hidden representation is used as a positive sample, and a hidden representation with the same temporal features and different interest point categories from the same user is used as a negative sample to perform a third comparative learning.
[0094] In this embodiment, the last converted representation is used as positive samples for other samples instead of using average pooling.
[0095] The loss function of the third contrastive learning is as follows:
[0096] ;
[0097] in, For the same preference in the current sequence The transformed hidden representation matrix, For users The preference set, is the representation of the i-th preference, For any preference, For those who have the same preference The last transformed representation of is the temperature coefficient.
[0098] Step S106: training and fine-tuning to generate a POI recommendation model based on contrastive learning.
[0099] First, based on the loss function of the first contrastive learning, the loss function of the first contrastive learning, and the loss function of the third contrastive learning, it is determined to perform pre-training, using the following formula:
[0100] ;
[0101] in, , , is a hyperparameter.
[0102] After the pre-training phase, these parameters are transferred to the sequence encoder for fine-tuning. In the fine-tuning phase, we use the pre-trained parameters to initialize the encoder parameters. Subsequently, we fine-tune the parameters using binary cross entropy for each user u at each step i:
[0103] ;
[0104] in Is the current user In the The hidden representation of the step, represents the embedding of the target interest point, Indicates that it is not used by the current user Interactive Points of Interest Embedding.
[0105] In this implementation, in order to evaluate the performance of our model, we conduct experiments on three widely used datasets for POI recommendation. For details of the datasets, see Figure 3 The datasets are FourSquare-NYC, FourSquare-TKY and Gowalla-CA.
[0106] See also Figure 4 , a schematic diagram of the performance indicators of the item recommendation model of this application, such as Figure 4 As shown, two indicators Acc@K and MRR are used to evaluate the POI recommendation model of this application (i.e. Figure 4 The information in the figure shows that this model has surpassed the existing model methods on multiple data sets, especially in the indicator Acc@20. In addition, this model works well on sparse data such as CA, which shows that the model can effectively solve the problem of data sparsity.
[0107] See also Figure 5 , Figure 5 This is a schematic diagram of parameter selection for the POI recommendation model of the present application, which shows in detail the optimal parameter selection for the model on three test data sets respectively.
[0108] Example 2
[0109] In this embodiment, an electronic device is also provided, including a processor and a memory. The memory is used to store non-temporary computer-readable instructions. The processor is used to run the non-temporary computer-readable instructions, and when the non-temporary computer-readable instructions are run by the processor, one or more steps of the interest point recommendation method based on contrastive learning described above can be executed. The memory and the processor can be interconnected through a bus system and / or other forms of connection mechanisms.
[0110] For example, the processor can be a central processing unit (CPU), a digital signal processor (DSP), or other forms of processing units with data processing capabilities and / or program execution capabilities, such as a field programmable gate array (FPGA); for example, the central processing unit (CPU) can be an X86 or ARM architecture, etc.
[0111] For example, the memory may include any combination of one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, erasable programmable read-only memory (EPROM), portable compact disk read-only memory (CD-ROM), USB memory, flash memory, etc. One or more computer program modules may be stored on the computer-readable storage medium, and the processor may run one or more computer program modules to implement various functions of the electronic device. Various applications and various data, as well as various data used and / or generated by the application, etc. may also be stored in the computer-readable storage medium.
[0112] It should be noted that, in the embodiments of the present application, the specific functions and technical effects of the electronic device can refer to the above description of the method for recommending points of interest based on contrastive learning, which will not be repeated here.
[0113] Example 3
[0114] In this embodiment, a computer-readable storage medium is further provided, and the storage medium is used to store non-transitory computer-readable instructions. For example, when the non-transitory computer-readable instructions are executed by a computer, one or more steps in the method for recommending points of interest based on contrastive learning described above can be executed.
[0115] For example, the storage medium can be applied to the above-mentioned electronic device. For example, the storage medium can be the memory in the electronic device of Example 2. For example, the relevant description of the storage medium can refer to the corresponding description of the memory in the electronic device of Example 2, which will not be repeated here.
[0116] It should be noted that the storage medium (computer-readable medium) mentioned above in the present application may be a computer-readable signal medium or a non-transitory computer-readable storage medium or any combination of the above two. The non-transitory computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of non-transitory computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0117] In the present application, a non-transitory computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, apparatus, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a non-transitory computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0118] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0119] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server.
[0120] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0121] The units involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of a unit does not, in some cases, constitute a limitation on the unit itself.
[0122] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), etc.
[0123] The above description is only a partial embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.
[0124] In addition, although each operation is described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the application. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0125] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A method for recommending points of interest based on contrastive learning, comprising: Based on a set time interval threshold, the user check-in sequence is divided into a plurality of subsequences, wherein the user check-in sequence is composed of a plurality of data including users, time and points of interest; Based on the user check-in sequence, using Transformer to obtain a hidden representation of the user check-in sequence; The interest points in the subsequence to which the target interest point belongs are taken as positive samples, and the interest points in other subsequences are taken as negative samples, and a first contrastive learning is performed, wherein the specific steps include: performing an average pooling operation on the subsequence to which the positive sample belongs as an embedded representation of the positive sample; The subsequences with the same temporal features are regarded as positive samples, and the subsequences with other temporal features are regarded as negative samples, and the second contrastive learning is performed; Taking the hidden representation with the same preference as the current hidden representation as the positive sample, and taking the hidden representation with different preferences from the same user as the negative sample, and performing the third contrastive learning; Train and fine-tune a POI recommendation model based on contrastive learning.
2. The method for recommending points of interest based on contrastive learning according to claim 1, characterized in that: The specific steps of using Transformer to obtain the hidden representation of the user check-in sequence based on the user check-in sequence include: Based on the user check-in sequence, determining an embedding matrix of the user check-in sequence; Based on the embedding matrix, a Transformer encoder is used to determine the hidden representation of the user check-in sequence.
3. The method for recommending points of interest based on contrastive learning according to claim 2, characterized in that: The specific step of determining the embedding matrix of the user sign-in sequence based on the user sign-in sequence comprises: Project the high-dimensional one-hot encoded interest point representation using the interest point embedding matrix; Convert the user's check-in sequence into a fixed-length sequence, and create an input embedding matrix based on a query of the fixed-length sequence in the POI embedding matrix; Based on the input embedding matrix, construct a position encoding matrix; Based on the position encoding matrix and the input embedding matrix, an embedding matrix of the user check-in sequence is determined by summing up.
4. The method for recommending points of interest based on contrastive learning according to claim 1, characterized in that: The specific steps of taking subsequences with the same time features as positive samples and subsequences with other time features as negative samples and performing the second contrastive learning include: The time feature of the last check-in in the subsequence is used as the time feature of the subsequence; Based on the time characteristics, coarse-grained clustering and fine-grained clustering are performed separately and combined to obtain the preference set; Based on the preference set, subsequences with the same time features are taken as positive samples, and subsequences with other time features are taken as negative samples, and a second comparative learning is performed.
5. The method for recommending points of interest based on contrastive learning according to claim 4, characterized in that: Average pooling is used to obtain embedding representations of all subsequences with the same temporal features.
6. The method for recommending points of interest based on contrastive learning according to claim 1, characterized in that: The specific steps of taking the hidden representation with the same preference as the current hidden representation as a positive sample and taking the hidden representation with different preferences from the same user as a negative sample to perform the third contrastive learning include: Based on the temporal features of the points of interest, a preference set including temporal features is constructed; Based on the preference set, a hidden representation with the same temporal features and the same interest point category as the current hidden representation is used as a positive sample, and a hidden representation with the same temporal features and different interest point categories from the same user is used as a negative sample to perform a third comparative learning.
7. The method for recommending points of interest based on contrastive learning according to claim 1, characterized in that: The specific steps of training and fine-tuning to generate a POI recommendation model based on contrastive learning include: Based on the loss function of the first contrastive learning, the loss function of the second contrastive learning, and the loss function of the third contrastive learning, a total loss function is determined to perform pre-training; Initialize the encoder using pre-trained parameters and fine-tune the parameters using binary cross entropy.
8. An electronic device, characterized in that: include: processor; a memory having stored thereon one or more computer program instructions executed on the processor; Wherein, when the processor runs the computer program instructions, it executes the method for recommending points of interest based on contrastive learning as described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that: Computer instructions are stored thereon, and when the computer instructions are executed by the processor, the steps of the interest point recommendation method based on contrastive learning described in any one of claims 1 to 7 are executed.
