Contrastive learning model generation method, item recommendation method, and device
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUZHOU VOCATIONAL UNIVERSITY (SUZHOU OPEN UNIVERSITY)
- Filing Date
- 2023-02-22
- Publication Date
- 2026-04-28
AI Technical Summary
[0018] The method for generating a contrastive learning model, the method for recommending items, and the apparatus provided in this invention have the following advantages: This invention discloses a method for generating a contrastive learning model, a method for recommending items, and the apparatus thereof. The generation method includes the following steps: acquiring several interaction sequences, each interaction sequence containing a user and several items that the user has interacted with; acquiring a set E of codes corresponding to all items in each interaction sequence; preprocessing the multiple interaction sequences to create a contrastive learning model, and training the contrastive learning model using the several interaction sequences. In summary, this contrastive learning model can recommend several items that are most likely to be interacted with in the future, thereby greatly increasing the likelihood that the user will purchase the item.
Smart Images

Figure CN116089724B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of item recommendation technology, and in particular to a method for generating a contrastive learning model, an item recommendation method, and an apparatus thereof. Background Technology
[0002] With societal progress and the development of information technology, more and more users are using e-commerce systems for online shopping, ordering takeout, and purchasing movie tickets. When a user visits, purchases, or reviews an item (which could be a product, takeout, or movie ticket), the e-commerce system stores this interaction data. Understandably, if the e-commerce system can process this interaction data to predict which items the user might visit or purchase in the future, and then recommend those items to the user, it can significantly increase the likelihood of the user purchasing those items. Summary of the Invention
[0003] In view of this, the main objective of the present invention is to provide a method for generating a contrastive learning model, a method for recommending items, and an apparatus thereof.
[0004] To achieve the above objectives, the technical solution of the present invention is implemented as follows: a method for generating a contrastive learning model for item recommendation, comprising the following steps: acquiring several interaction sequences, each interaction sequence containing a user and several items that have interacted with the user; acquiring a set E of codes corresponding to all items in each interaction sequence; creating a contrastive learning model, wherein the contrastive learning model is obtained by replacing the Filter Layer in the transformer neural network with a self-attention module; in the p-th layer self-attention module, its input temporal feature is... Its output time characteristics are ,and This is the input to the (p+1)th layer self-attention module, where the contrastive learning model includes N cascaded self-attention modules, p=1,2,...,N, and the input to the 1st layer self-attention module. E; The p-th layer self-attention module is also used to perform F() is a one-dimensional Fast Fourier Transform; the self-attention module includes a dynamic frequency selection module and a static frequency division module. The dynamic frequency selection module is used to select features at specific frequencies in the frequency domain, and the static frequency division module is used to compensate for the lack of frequency domain features in the dynamic frequency selection module; then, the features extracted by the dynamic filter and the features extracted by the static filter are mixed, and the modulation spectrum is processed using an inverse one-dimensional FFT. Transform back to the time domain to convert the complex tensor into a real tensor;
[0005] The contrastive learning model is trained based on several interaction sequences, with the overall objective function during training being: , , , ; , Where Num represents the quantity of all items. An embedding matrix that encodes all items.
[0006] As an improvement to this embodiment of the invention, obtaining the set E of codes corresponding to all items in each interaction sequence specifically includes: obtaining the set E of one-hot codes corresponding to all items in each interaction sequence.
[0007] As an improvement to this embodiment of the invention, in the dynamic frequency selection module... The corresponding frequency characteristics are , , , , , , , ;in, The lower bound of the corresponding frequency range is The upper bound is The filter size in the dynamic frequency selection module is I() is an indicator function. For learnable filters, The indicator function for the dynamic frequency selection module sliding along the p-th layer from high frequency to low frequency.
[0008] As an improvement to an embodiment of the present invention, the self-attention module in the Lth layer... Corresponding to the first frequency range, in the (p+1)th layer self-attention module For the second frequency range, the intersection of the first and second frequency ranges is not empty.
[0009] As an improvement to this embodiment of the invention, in the static frequency division module... The corresponding frequency characteristics are , , , , , , ,in, The lower bound of the corresponding frequency range is The upper bound is The filter size in the dynamic frequency selection module is I() is an indicator function. For learnable filters, This is the indicator function for the static frequency divider module sliding along the p-th layer from high frequency to low frequency.
[0010] As an improvement to this embodiment of the invention, the contrastive learning model further includes: skip connections, layer normalization, and dropout operations.
[0011] This invention also provides an apparatus for generating a contrastive learning model for item recommendation, comprising the following modules:
[0012] The data acquisition module is used to acquire several interaction sequences, each of which contains a user and several items that have interacted with the user; and to acquire the set E of codes corresponding to all items in each interaction sequence.
[0013] The model creation module is used to create a contrastive learning model, which is obtained by replacing the Filter Layer in the transformer neural network with a self-attention module; in the p-th layer self-attention module, the temporal features of the input are... Its output time characteristics are ,and This is the input to the (p+1)th layer self-attention module, where the contrastive learning model includes N cascaded self-attention modules, p=1,2,...,N, and the input to the 1st layer self-attention module. E; The p-th layer self-attention module is also used to perform F() is a one-dimensional Fast Fourier Transform; the self-attention module includes a dynamic frequency selection module and a static frequency division module. The dynamic frequency selection module is used to select features at specific frequencies in the frequency domain, and the static frequency division module is used to compensate for the lack of frequency domain features in the dynamic frequency selection module; then, the features extracted by the dynamic filter and the features extracted by the static filter are mixed, and the modulation spectrum is processed using an inverse one-dimensional FFT. Transform back to the time domain to convert the complex tensor into a real tensor;
[0014] The training module is used to train the contrastive learning model based on several interaction sequences, where the overall objective function during training is... , , , ; , Where Num represents the quantity of all items. An embedding matrix that encodes all items.
[0015] As an improvement to this embodiment of the invention, the data acquisition module is further configured to: acquire the set E of unique hot codes corresponding to all items in each interaction sequence.
[0016] This invention also provides an item recommendation method, comprising the following steps: performing the above-described generation method to obtain a contrastive learning model; acquiring several items that have interacted with a preset user, and inputting the several items into the contrastive learning model to obtain recommended items.
[0017] This invention also provides an item recommendation device, comprising the following modules: a preprocessing module, used to execute the above-described generation method and obtain a contrastive learning model; and a processing module, used to acquire several items that have interacted with a preset user, input the several items into the contrastive learning model, and thereby obtain recommended items.
[0018] The method for generating a contrastive learning model, the method for recommending items, and the apparatus provided in this invention have the following advantages: This invention discloses a method for generating a contrastive learning model, a method for recommending items, and the apparatus thereof. The generation method includes the following steps: acquiring several interaction sequences, each interaction sequence containing a user and several items that the user has interacted with; acquiring a set E of codes corresponding to all items in each interaction sequence; preprocessing the multiple interaction sequences to create a contrastive learning model, and training the contrastive learning model using the several interaction sequences. In summary, this contrastive learning model can recommend several items that are most likely to be interacted with in the future, thereby greatly increasing the likelihood that the user will purchase the item. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating the method for generating the contrastive learning model in this embodiment.
[0020] Figure 2 The figure shows the experimental results of the contrastive learning model in the embodiment. Detailed Implementation
[0021] The present invention will now be described in detail with reference to the embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional modifications made by those skilled in the art based on these embodiments are included within the scope of protection of the present invention.
[0022] The following description and accompanying drawings fully illustrate specific embodiments described herein to enable those skilled in the art to practice them. Some embodiments may include or substitute parts and features of other embodiments. The scope of the embodiments herein encompasses the entire scope of the claims and all available equivalents thereof. Throughout this document, the terms “first,” “second,” etc., are used only to distinguish one element from another without requiring or implying any actual relationship or order between the elements. Indeed, a first element can also be referred to as a second element, and vice versa. Furthermore, the terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that a structure, apparatus, or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a structure, apparatus, or device. Without further limitation, an element defined by the phrase “comprising one…” does not exclude the presence of other identical elements in the structure, apparatus, or device that includes said element. The various embodiments described herein are presented in a progressive manner, with each embodiment focusing on its differences from other embodiments; similar or identical parts between embodiments can be referred to interchangeably.
[0023] The terms "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer" used in this document to indicate orientations or positional relationships are based on the orientations or positional relationships shown in the accompanying drawings. They are used solely for the convenience of describing the document and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. In the description herein, unless otherwise specified and limited, the terms "installed," "connected," and "linked" should be interpreted broadly. For example, they can refer to mechanical or electrical connections, or internal connections between two elements; they can be direct connections or indirect connections through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.
[0024] Embodiment 1 of the present invention provides a method for generating a contrastive learning model for item recommendation, comprising the following steps:
[0025] Step 101: Obtain several interaction sequences, each containing a user and several items that have interacted with the user; obtain the set E of codes corresponding to all items in each interaction sequence;
[0026] Here, when a user visits an online shopping platform or video website, the user may access, purchase, or rate an item (such as a product, audio, or video), and then the user has interacted with that item.
[0027] Here, the set of users can be represented as U, and the number of distinct users in set U is |U|; the set of items can be represented as V, and the number of distinct items in set V is |V|; for users In other words, its corresponding interaction sequence ,in, Indicates user The t-th item has been interacted with, and N represents the length of the interaction sequence. It is understood that the purpose of this invention is to provide a given user-item interaction sequence... Then predict the next product that user u is most likely to click. .
[0028] In practice, different items can be assigned different IDs, and then an item ID embedding matrix can be created. By converting the item ID into an embedding vector through lookup, a high-dimensional one-hot encoding is projected onto a low-dimensional dense representation, where d is the embedding size (i.e., the length of the one-hot encoding). The user's behavior sequence is encoded using the following formula: The LookUp(.,.) function retrieves the embedding vector from the embedding matrix. Input: User and item IDs; Output: Embedded representations of users and items; Implementation: Create an embedding vector table and query for user and item IDs.
[0029] Step 102: Create a contrastive learning model, which is obtained by replacing the Filter Layer in the transformer neural network with a self-attention module; in the p-th layer self-attention module, the temporal feature of its input is... Its output time characteristics are ,and This is the input to the (p+1)th layer self-attention module, where the contrastive learning model includes N cascaded self-attention modules, p=1,2,...,N, and the input to the 1st layer self-attention module. E; The p-th layer self-attention module is also used to perform F() is a one-dimensional Fast Fourier Transform; the self-attention module includes a dynamic frequency selection module and a static frequency division module. The dynamic frequency selection module is used to select features at specific frequencies in the frequency domain, and the static frequency division module is used to compensate for the lack of frequency domain features in the dynamic frequency selection module; then, the features extracted by the dynamic filter and the features extracted by the static filter are mixed, and the modulation spectrum is processed using an inverse one-dimensional FFT. Transforming back to the time domain converts the complex tensor to a real tensor; here, , .
[0030] Here, in the L-th layer self-attention module, F is executed first. ,in, This refers to the temporal features of layer L. It's understandable that the entire contrastive learning model consists of N layers of stacked self-attention modules. The input to the first-layer self-attention module is [value], and the output of the first-layer self-attention module is [value]. , The input to the second-layer self-attention module is [value], and the output of the second-layer self-attention module is [value]. ,..., The input to the Lth layer self-attention module is [value], and the output of the Lth layer self-attention module is [value]. .
[0031] Here, due to the conjugate symmetry property in the frequency domain, half of the DFT (Discrete Fourier Transform) contains complete information about the periodic characteristics in the time domain. M is calculated as follows: , The sequence length is almost equal to Half of it. Understandably, It is a complex tensor, representing The score.
[0032] Step 103: Train the contrastive learning model based on several interaction sequences. The overall objective function during training is... , , , ; , Where Num represents the quantity of all items. An embedding matrix is formed by encoding all items. Here, and These represent unsupervised and supervised incremental views, respectively.
[0033] To enhance recommendations through self-supervised learning tasks, a multi-task training strategy is used to jointly optimize the primary recommendation loss and the auxiliary contrast loss. This loss learns to minimize the difference between different augmented views of the same user and maximize the difference between the two from augmented sequences of different users.
[0034] After the filter mixer block adaptively and hierarchically extracts behavioral pattern information from previously interacted items, the inventors obtain a final combined representation of items that represent user preferences. Using this user representation, the inventors can calculate the recommendation probability of candidate items as a prediction of the likelihood of the user adopting that item.
[0035] In this embodiment, obtaining the set E of codes corresponding to all items in each interaction sequence specifically includes: obtaining the set E of one-hot codes corresponding to all items in each interaction sequence.
[0036] In this embodiment, in the dynamic frequency selection module... The corresponding frequency characteristics are , , , , , , , ;in, The lower bound of the corresponding frequency range is The upper bound is The filter size in the dynamic frequency selection module is I() is an indicator function. For learnable filters, The indicator function for the dynamic frequency selection module sliding along the p-th layer from high frequency to low frequency.
[0037] The frequency here is not frequency in a statistical sense, nor is it the number of times it occurs. Rather, it refers to the time and frequency domains in digital signal processing. A signal that fluctuates along the time axis t in the time domain can be expressed in the frequency domain using a Fourier transform. To represent it.
[0038] Here, the dynamic frequency selection module selects features at specific frequencies in the frequency domain, rather than retaining all frequency components, and multiplies them by a globally learnable filter to remove noise. Since filter operations in the frequency domain are equivalent to circular convolutions in the time domain, the size of the learnable filter in the frequency domain directly affects the receptive field of the circular convolution kernel in time. This is achieved by multiplying by the corresponding learnable filter. The frequency range corresponding to different self-attention modules. They are not the same. There are M frequency components, using Indicates the index of each frequency component.
[0039] here, This can be understood as the filter size in the dynamic frequency selection module. Relative to frequency characteristic range The ratio. Filter It is learnable because it consists of complex parameters that can be optimized using SGD (Stochastic Gradientdescent) to adaptively capture sequential pattern features in the frequency domain. When the receptive field of a frequency-domain learnable filter is set to a fixed-length window, it masks other surrounding frequency components to eliminate dependence on irrelevant frequencies. Therefore, when capturing features within a specific frequency range, the learnable filter will simply disable all features not in the current range.
[0040] To ensure that the filters in each self-attention module cover a specific range, a frequency ramp structure was further designed, allowing the learnable filters to slide across the spectrum of different layers. Specifically, for the dynamic frequency selection module, a frequency ramp structure was designed to... Defined as This is because a dynamic frequency selection module and a static frequency segmentation module are proposed, and both modules have a separate frequency selection range for each layer. This represents the indicator function for the dynamic frequency selection module sliding along the Lth layer from high frequency to low frequency. Wherein, Indicates the direction of filter sliding, from high frequency to low frequency (low). high), Indicates the direction from low frequency to high frequency (low). (High). When the filter size ratio is set to 1, this dynamic filter will not slide across the spectrum. Considering that the top layer focuses more on modeling low-frequency global information, while the bottom layer focuses more on capturing high-frequency details, the direction from high frequency to low frequency is chosen.
[0041] In this embodiment, the self-attention module in the Lth layer Corresponding to the first frequency range, in the (p+1)th layer self-attention module For the second frequency range, the intersection of the first and second frequency ranges is not empty.
[0042] In this embodiment, in the static frequency division module... The corresponding frequency characteristics are , , , , , , ,in, The lower bound of the corresponding frequency range is The upper bound is The filter size in the dynamic frequency selection module is I() is an indicator function. For learnable filters, This is the indicator function for the static frequency divider module sliding along the p-th layer from high frequency to low frequency.
[0043] Here, it can be understood that the static frequency divider module can compensate for some frequency domain feature loss issues that may exist in the dynamic frequency selection module. This is achieved by multiplying by a static learnable filter. The spectrum can be modified to capture missing frequency features that even dynamic filters cannot capture. It is the filter size in the static frequency selection module. Relative to frequency characteristic range Finally, the inventors combined the features extracted by the dynamic filter and the features extracted by the static filter, and used an inverse one-dimensional fast Fourier transform to convert the modulation spectrum. Transforming back to the time domain converts the complex tensor into a real tensor.
[0044] In this embodiment, the contrastive learning model further includes skip connections, layer normalization, and dropout operations. While common augmentation methods, such as item pruning, masking, and reordering, can improve the performance of sequence recommendation models, data-level augmentation cannot guarantee high semantic similarity. Instead, a dropout-based augmentation method is used. When modeling user preferences from input sequences, sequences of the same user are passed through the network twice. Due to the different dropout layers in the network modules, two output views with different numerical features but semantically similar are obtained. Furthermore, to increase the supervision signal for contrastive learning, sequences with the same objective are used as positive samples for supervised contrastive learning. All other augmented samples in the training batch are treated as negative samples to effectively create negative samples for a pair of augmented samples.
[0045] To evaluate the model's performance, experiments were conducted on four widely used recommendation datasets. These datasets are Amazon Beauty, Amazon Clothing, Amazon Sports, ML-1M, and Yelp. Detailed data for these datasets is shown in the table below.
[0046]
[0047] The inventors employed two commonly used performance evaluation metrics: recall and Normalized Discounted Cumulative Gain (NDCG). Recall is the accuracy of ground-truth items appearing in the top N recommendations. NDCG is a ranking loss used to measure the position of the true item in the top N recommendations. For each user, the inventors sorted each item in descending order based on its predicted score and generated a recommendation list, then truncated the top N items to calculate the top N results for the evaluation metrics. Since Recall@1 is equivalent to NDCG@1, the inventors reported the results for Recall@{5,10,20} and NDCG@{5,10,20}. Furthermore, the inventors compared their performance with common sequential recommendation models, with specific recommendation performance details as follows: Figure 2 As shown, SLIME4Rec is the contrastive learning model in this embodiment.
[0048] Embodiment 2 of the present invention provides a device for generating a comparative learning model for item recommendation, comprising the following modules:
[0049] The data acquisition module is used to acquire several interaction sequences, each of which contains a user and several items that have interacted with the user; and to acquire the set E of codes corresponding to all items in each interaction sequence.
[0050] The model creation module is used to create a contrastive learning model, which is obtained by replacing the Filter Layer in the transformer neural network with a self-attention module; in the p-th layer self-attention module, the temporal features of the input are... Its output time characteristics are ,and This is the input to the (p+1)th layer self-attention module, where the contrastive learning model includes N cascaded self-attention modules, p=1,2,...,N, and the input to the 1st layer self-attention module. E; The p-th layer self-attention module is also used to perform F() is a one-dimensional Fast Fourier Transform; the self-attention module includes a dynamic frequency selection module and a static frequency division module. The dynamic frequency selection module is used to select features at specific frequencies in the frequency domain, and the static frequency division module is used to compensate for the lack of frequency domain features in the dynamic frequency selection module; then, the features extracted by the dynamic filter and the features extracted by the static filter are mixed, and the modulation spectrum is processed using an inverse one-dimensional FFT. Transform back to the time domain to convert the complex tensor into a real tensor;
[0051] The training module is used to train the contrastive learning model based on several interaction sequences, where the overall objective function during training is... , , , ; , Where Num represents the quantity of all items. An embedding matrix that encodes all items.
[0052] In this embodiment, the data acquisition module is further configured to: acquire the set E of unique hot codes corresponding to all items in each interaction sequence.
[0053] Embodiment 3 of the present invention provides an item recommendation method, comprising the following steps: executing the generation method described in Embodiment 1 and obtaining a contrastive learning model; acquiring several items that have interacted with a preset user, and inputting the several items into the contrastive learning model to obtain recommended items.
[0054] Embodiment 4 of the present invention provides an item recommendation device, comprising the following modules: a preprocessing module, used to execute the generation method in Embodiment 1 and obtain a contrastive learning model; and a processing module, used to acquire several items that have been interacted with by a preset user, input the several items into the contrastive learning model, and thereby obtain recommended items.
[0055] It should be noted that although the steps are described in a specific order above, it does not mean that the steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently, or even in a different order, as long as the required function can be achieved.
[0056] This invention can be a system, method, and / or computer program product. A computer program product may include a readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the invention.
[0057] A readable storage medium can be a tangible device that holds and stores instructions for use by an instruction execution device. Readable storage media can include, for example, but not limited to, electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof.
[0058] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or technical improvements to the embodiments in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for generating a contrastive learning model for item recommendation, characterized in that, Includes the following steps: Obtain several interaction sequences, each containing a user and several items that have interacted with the user; obtain the set E of codes corresponding to all items in each interaction sequence; A contrastive learning model is created by replacing the Filter Layer in the transformer neural network with a self-attention module; in the p-th layer self-attention module, the temporal features of the input are... Its output time characteristics are ,and This is the input to the (p+1)th layer self-attention module, where the contrastive learning model includes N cascaded self-attention modules, p=1,2,...,N, and the input to the 1st layer self-attention module. E; The p-th layer self-attention module is also used to perform F() is a one-dimensional Fast Fourier Transform; the self-attention module includes a dynamic frequency selection module and a static frequency division module. The dynamic frequency selection module is used to select features at specific frequencies in the frequency domain, and the static frequency division module is used to compensate for the lack of frequency domain features in the dynamic frequency selection module; then, the features extracted by the dynamic filter and the features extracted by the static filter are mixed, and the modulation spectrum is processed using an inverse one-dimensional FFT. Transform back to the time domain to convert the complex tensor into a real tensor; in the dynamic frequency selection module... The corresponding frequency characteristics are , , , , , , , ;in, The lower bound of the corresponding frequency range is The upper bound is The filter size in the dynamic frequency selection module is I() is an indicator function. For learnable filters, The dynamic frequency selection module follows the indicator function of the p-th layer sliding from high frequency to low frequency; the self-attention module in the L-th layer... Corresponding to the first frequency range, in the (p+1)th layer self-attention module For the second frequency range, the intersection of the first and second frequency ranges is not empty; in the static frequency division module, The corresponding frequency characteristics are , , , , ,in, It is a learnable filter; The contrastive learning model is trained based on several interaction sequences, with the overall objective function during training being: , , , ; , Where Num represents the quantity of all items. An embedding matrix that encodes all items.
2. The generation method according to claim 1, characterized in that, The specific steps of obtaining the set E of codes corresponding to all items in each interaction sequence include: Obtain the set E of one-hot codes corresponding to all items in each interaction sequence.
3. The generation method according to claim 1, characterized in that, The contrastive learning model also includes: skip connections, layer normalization, and dropout operations.
4. A device for generating a contrastive learning model for item recommendation, characterized in that, Includes the following modules: The data acquisition module is used to acquire several interaction sequences, each of which contains a user and several items that have interacted with the user; and to acquire the set E of codes corresponding to all items in each interaction sequence. The model creation module is used to create a contrastive learning model, which is obtained by replacing the Filter Layer in the transformer neural network with a self-attention module; in the p-th layer self-attention module, the temporal features of the input are... Its output time characteristics are ,and This is the input to the (p+1)th layer self-attention module, where the contrastive learning model includes N cascaded self-attention modules, p=1,2,...,N, and the input to the 1st layer self-attention module. E; The p-th layer self-attention module is also used to perform F() is a one-dimensional Fast Fourier Transform; the self-attention module includes a dynamic frequency selection module and a static frequency division module. The dynamic frequency selection module is used to select features at specific frequencies in the frequency domain, and the static frequency division module is used to compensate for the lack of frequency domain features in the dynamic frequency selection module; then, the features extracted by the dynamic filter and the features extracted by the static filter are mixed, and the modulation spectrum is processed using an inverse one-dimensional FFT. Transform back to the time domain to convert the complex tensor into a real tensor; in the dynamic frequency selection module... The corresponding frequency characteristics are , , , , , , , ;in, The lower bound of the corresponding frequency range is The upper bound is The filter size in the dynamic frequency selection module is I() is an indicator function. For learnable filters, The dynamic frequency selection module follows the indicator function of the p-th layer sliding from high frequency to low frequency; the self-attention module in the L-th layer... Corresponding to the first frequency range, in the (p+1)th layer self-attention module For the second frequency range, the intersection of the first and second frequency ranges is not empty; in the static frequency division module, The corresponding frequency characteristics are , , , , ,in, It is a learnable filter; The training module is used to train the contrastive learning model based on several interaction sequences, where the overall objective function during training is... , , , ; , Where Num represents the quantity of all items. An embedding matrix that encodes all items.
5. The generating apparatus according to claim 4, characterized in that, The data acquisition module is also used for: Obtain the set E of one-hot codes corresponding to all items in each interaction sequence.
6. A method for recommending items, characterized in that, Includes the following steps: Perform the generation method according to any one of claims 1-3 and obtain a contrastive learning model; A number of items that have been interacted with by a preset user are obtained, and these items are input into the contrastive learning model to obtain recommended items.
7. An item recommendation device, characterized in that, Includes the following modules: A preprocessing module is used to execute the generation method according to any one of claims 1-3 and obtain a contrastive learning model; The processing module is used to acquire several items that have been interacted with by a preset user, input the items into the contrastive learning model, and thus obtain recommended items.
Citation Information
Patent Citations
Self-supervised recommendation method combined with contrast learning method
CN114564651A
News recommendation method based on comparative learning
CN114840747A