A sequence recommendation method and device based on hypergraph and self-supervised learning and a medium
By combining hypergraph neural networks and self-supervised learning, the problems of multilateral relationship modeling and data sparsity in sequence recommendation are solved, thereby improving the accuracy and robustness of the recommendation model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTH CHINA UNIV OF TECH
- Filing Date
- 2023-03-20
- Publication Date
- 2026-05-12
AI Technical Summary
Existing sequence recommendation methods struggle to effectively model the combined influence of multiple items on a single item and face data sparsity issues, resulting in models failing to accurately capture changes in user interests.
A hypergraph neural network is used for global modeling, combined with self-supervised learning, and contrastive learning is used to alleviate the data sparsity problem. Embedded vectors of product and attribute sequences are constructed, and hypergraph convolution is used to extract multilateral relationship information.
It improves the model's recommendation performance, enhances its ability to capture sequence context, and improves the model's robustness and generalization performance.
Smart Images

Figure CN116452281B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence, deep learning and recommendation systems, and in particular to a sequence recommendation method, apparatus and medium based on hypergraph and self-supervised learning. Background Technology
[0002] With the rapid development of internet technology in today's world, massive amounts of data are generated online every moment. For ordinary users, such a vast amount of data makes it difficult to select content that interests them. For application service platforms, their operational strategy is to recommend content that users are interested in as much as possible, maximizing user retention and increasing daily active users. Recommendation systems can model massive amounts of user and product data, mine user interests, and push products or content that users are interested in to users, alleviating the problem of information overload. Therefore, recommendation systems have become an indispensable part of current online application platforms. Sequence recommendation is an important branch of the recommendation system field. On online shopping platforms like Taobao and JD.com, user behavior changes dynamically over time. In order to better capture changes in user interests and make accurate recommendations, it is necessary to model continuous user behavior. Therefore, sequence recommendation research has received widespread attention from researchers in recent years. Most existing sequence recommendation methods are based on deep learning methods, including recurrent neural networks, convolutional neural networks, and self-attention mechanisms. Among them, the self-attention mechanism can effectively capture the weight relationships of the sequence context, mine the correlation within the sequence, and thus extract user interest preferences from the sequence data. Therefore, most current state-of-the-art sequence recommendation methods use self-attention mechanisms as the main model and then extend them. However, when modeling sequence data, self-attention mechanisms can only model pairwise information within the sequence; that is, they can only calculate the influence of one item on another, not the combined influence of multiple items on a single item. To address this issue, hypergraph neural networks are used to globally model the sequence data, grouping multiple items together and calculating multilateral relationships. Furthermore, sequence recommendation often encounters sparsity problems, such as excessively short sequences. For such short sequences, the model struggles to capture sufficient information, resulting in a suboptimal sequence representation. Currently, self-supervised learning has achieved good results in computer vision, natural language processing, and graph representation learning. Self-supervised learning uses data augmentation methods to directly generate supervisory signals from the original data, constructing auxiliary tasks and jointly training them with the main task, thus mitigating data sparsity. Summary of the Invention
[0003] In order to at least partially solve one of the technical problems existing in the prior art, the present invention aims to provide a sequence recommendation method, apparatus and medium based on hypergraph and self-supervised learning.
[0004] The technical solution adopted in this invention is:
[0005] A sequence recommendation method based on hypergraphs and self-supervised learning includes the following steps:
[0006] Obtain a sequence dataset of user interactions on an e-commerce platform, the sequence dataset including product information, user interaction timestamps, and product attribute information;
[0007] The sequence data is cleaned, and the cleaned products and their corresponding attributes are constructed into a sequence structure according to time order.
[0008] The constructed product and attribute sequence data are input into the constructed hypergraph model to obtain the user's embedding vectors in the product sequence and attribute sequence;
[0009] Unsupervised comparative learning is performed on the embedding vectors of product sequences and attribute sequences;
[0010] The sequence recommendation model is trained using a combination of supervised loss for the sequence recommendation task and unsupervised loss for contrastive learning.
[0011] The embedding vectors of the finally learned product sequence are compared with the embedding vectors of all products in the sequence dataset to calculate the similarity, and items with higher similarity are recommended to the user.
[0012] Furthermore, the data cleaning of the sequence data includes:
[0013] The products interacted with by users and their corresponding attributes are sorted according to timestamps to obtain product sequence data and attribute sequence data in order of time from oldest to most recent.
[0014] Delete products and attributes that appear infrequently in the sequence data.
[0015] Furthermore, after the step of constructing a sequence structure of the cleaned goods and their corresponding attributes in chronological order, the method further includes a step of processing the sequence data into a form of equal length:
[0016] For shorter sequences, padding is used to fill them to the predicted sequence length;
[0017] For longer sequences, a truncation method is used, taking only the products with the most recent timestamps and their corresponding attributes.
[0018] Furthermore, the step of inputting the constructed product and attribute sequence data into the constructed hypergraph model to obtain the user's embedding vectors for the product sequence and attribute sequence includes:
[0019] Set learnable hyperedge embedding vectors on both the product and attribute sides;
[0020] A hypergraph matrix is constructed using the product sequence embedding vector and the hyperedge embedding vector to obtain a learnable first association matrix between products and hyperedges;
[0021] A hypergraph matrix is constructed using attribute sequence embedding vectors and hyperedge embedding vectors to obtain a second correlation matrix between learnable attributes and hyperedges.
[0022] Based on the obtained first and second correlation matrices, a multi-layer hypergraph network is superimposed, and hypergraph convolution is performed to obtain higher-order information on the sequence, resulting in the final embedding vectors of the product sequence and attribute sequence.
[0023] Furthermore, the expression for the first correlation matrix is:
[0024] H (v) =S v ·(E (v) ) T
[0025] The expression for the second correlation matrix is:
[0026] H (a) =S a ·(E (a) ) T
[0027] Among them, S v E is the hyperedge embedding vector matrix for the product side. (v) S is the embedding vector matrix of the product sequence. a E is the hyperedge embedding vector matrix at the attribute end. (a) This is the embedding vector matrix of the attribute sequence.
[0028] Furthermore, the unsupervised comparative learning of the embedding vectors of the product sequence and the embedding vectors of the attribute sequence includes:
[0029] Treat the product sequence and attribute sequence as two views for comparative learning;
[0030] The InfoNCE loss is used to treat the embedding vector of the product sequence and the embedding vector of its corresponding attribute as positive sample pairs, and the embedding vector of the product sequence and the embedding vector of other attributes as negative sample pairs for unsupervised comparative learning.
[0031] Furthermore, the supervised loss of the joint sequence recommendation task and the unsupervised loss of contrastive learning are used to train the sequence recommendation model, including:
[0032] The supervised loss of the sequence task and the unsupervised loss of the contrastive learning are summed and used as the target loss function of the recommendation model.
[0033] Gradient descent is used to update the model parameters until the loss of the objective function reaches a set threshold.
[0034] Furthermore, the expression for the supervised loss is:
[0035] L main =∑log(score) + -score - )
[0036] score + =δ(v T .(v i ) T )
[0037] score - =δ(v T .(v j ) T )
[0038] Where δ(.) is the sigmoid activation function, i represents a positive sample, j represents a negative sample, and v i v represents the embedding vector of a positive sample item. j v represents the embedding vector of the negative sample item. T The final embedding vector representing the product sequence;
[0039] The expression for the unsupervised loss is:
[0040]
[0041] Where sim(.) is the cosine similarity function, τ is the temperature coefficient, and a i a represents the final embedding vector of the attribute sequence corresponding to the product sequence. j I′ represents the final embedding vector of the attribute sequence that does not correspond to the product sequence, V represents the set of negative sample attribute sequences, and V represents all product sequences.
[0042] Another technical solution adopted in this invention is:
[0043] A sequence recommendation device based on hypergraphs and self-supervised learning includes:
[0044] At least one processor;
[0045] At least one memory for storing at least one program;
[0046] When the at least one program is executed by the at least one processor, the at least one processor implements the method described above.
[0047] Another technical solution adopted in this invention is:
[0048] A computer-readable storage medium storing a processor-executable program, which, when executed by a processor, performs the method described above.
[0049] The beneficial effects of this invention are as follows: This invention utilizes a hypergraph neural network to extract many-to-one relationships in sequence data, better captures global information of the sequence context, generates superior sequence representations, and enables the model to have better recommendation performance. Simultaneously, this invention also models both product sequence data and attribute sequence data, employing a contrastive learning approach to perform self-supervised learning on both representations, alleviating the data sparsity problem and improving the model's robustness and generalization performance. Attached Figure Description
[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following description is provided with accompanying drawings of the relevant technical solutions in the embodiments of the present invention or the prior art. It should be understood that the accompanying drawings described below are only for the purpose of clearly illustrating some embodiments of the technical solutions of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0051] Figure 1 This is a flowchart illustrating the steps of a sequence recommendation method based on hypergraphs and self-supervised learning in an embodiment of the present invention.
[0052] Figure 2 This is an overall flowchart of a sequence recommendation method based on hypergraphs and self-supervised learning in an embodiment of the present invention. Detailed Implementation
[0053] The embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention. The step numbers in the following embodiments are set only for ease of explanation, and there is no limitation on the order between the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0054] In the description of this invention, it should be understood that the orientation descriptions, such as up, down, front, back, left, right, etc., are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and 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 limiting this invention.
[0055] In the description of this invention, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.
[0056] In the description of this invention, unless otherwise explicitly defined, terms such as "set up," "install," and "connect" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this invention in conjunction with the specific content of the technical solution.
[0057] like Figure 1 and Figure 2 As shown, this embodiment provides a sequence recommendation method based on hypergraphs and self-supervised learning. It initializes the embedding vectors of products and attributes, as well as the hyperedge embedding vectors of both products and attributes. The product embedding vectors and hyperedge embedding vectors are concatenated to form a mapping matrix from products to hyperedges; similar operations are performed on the attribute side. Then, multiple hypergraph convolutions are performed on the product-hyperedge matrix to extract richer semantic information from the sequence, ultimately obtaining the embedding vector of the product sequence. A similar hypergraph convolution is performed on the attribute side to obtain the embedding vector of the attribute sequence. The embedding vectors of the product sequence and the embedding vectors of the attribute sequence are compared and learned to mine more supervisory signals from the data itself, assisting the learning of downstream tasks. The similarity between the embedding vector of the product sequence and all products in the dataset is calculated, and products with high similarity are recommended to the user. The method specifically includes the following steps:
[0058] S1. Model Data Preparation. Product information, user interaction timestamps, and corresponding product attribute information are collected from public datasets such as Amazon, Movielens, and Yelp to obtain a sequence dataset. The product information consists of the product's serial number (item_id), and the attribute information consists of the attribute's serial number (attribute_id).
[0059] S2. Perform data preprocessing on the sequence dataset. The steps include: sorting the products and their attributes according to timestamps to obtain chronologically ordered sequence data; and removing products with excessively low occurrence frequencies.
[0060] Specifically, step S2 includes S21-S22:
[0061] S21. Remove product items with fewer than 5 interactions from the sequence dataset. Then, also remove items whose attributes do not correspond to any products.
[0062] S22. Extract N sequences from the sequence dataset, where s represents a sequence, v represents a clicked product item, and a represents the attribute corresponding to the clicked product item. Sort the products and attributes in the sequence according to the timestamp. A product sequence is then represented as s. v ={v1,...,v t ,...,v T The attribute sequence is represented as s. a ={a1,...,a t ,...,a T}, where the subscripts of v and a indicate the order in which they were clicked, t indicates the time of the click, and T indicates the total time length of the sequence.
[0063] S23. Further process the sequence obtained in step S22, removing sequences with a length less than 5.
[0064] S3. Divide the preprocessed sequence dataset into training set, validation set and test set according to timestamps for model training, validation and testing.
[0065] The specific steps of step S3 are as follows: using the product sequence S v ={v1,v2,v3,v4...,v T-3 ,v T-2 ,v T-1 ,v T For example, let the training set be {v1, v2, v3, v4..., v}. T-3}, corresponding to the tags {v2,v3,v4...,v T-3 ,v T-2}; The validation set is {v2,v3,v4,...,v...}; T-3 ,v T-2}, corresponding to the tags {v3,v4...,v T-2 ,v T-1}; The test set is {v3, v4, ..., v T-2 ,v T-1}, corresponding to the tag {v4...,v T-1 ,v T}
[0066] S4. Initialize the model's learnable embedding vectors, including learnable embedding vectors for products and attributes, learnable embedding vectors for hyperedges on the product side and learnable embedding vectors for hyperedges on the attribute side, as well as position vectors.
[0067] Specifically, step S4 includes steps S41-S43:
[0068] S41. Assign learnable embedding vectors to all products and attributes, and perform random initialization. The initial embedding vectors are represented as follows:
[0069] V = {v1, ..., v} m , ..., v M}
[0070] A = {a1, ..., a} n , ..., a N}
[0071] Where V represents the total product embedding vector, and A represents the total attribute embedding vector; v m An embedding vector representing a specific product; there are M products in total; a n An embedding vector representing a certain attribute; there are a total of N attributes.
[0072] S42. The preset number of hyperedges is F. Learnable hyperedge embedding vectors are defined on both the product and attribute sides. The initial hyperedge embedding vector is represented as:
[0073]
[0074]
[0075] Where E represents the hyperedge embedding vector on the product side, and H represents the hyperedge embedding vector on the attribute side; e f h represents the embedding vector of a certain hyperedge on the product side. f This represents a hyperedge embedding vector at the attribute end, with a total of F hyperedges.
[0076] S43. Set a learnable position embedding vector so that the model can distinguish the relative or absolute position of interaction items in the sequence when modeling sequence data. The position embedding vector is represented as:
[0077] P = {p1, ..., p} t , ..., p T}
[0078] Where P represents the total position vector and T represents the total number of position embedding vectors, which is consistent with the length of the product sequence.
[0079] S5. Sequence Context Information Modeling. The processed sequence data is input into a hypergraph neural network, and hypergraph convolution is performed to obtain the most embedded vector of the product sequence and the final embedded vector of the attribute sequence.
[0080] Specifically, step S5 includes S51-S54:
[0081] S51. Model Input Vector Construction. Because HyperGraph Neural Networks can only perform global modeling of sequence data and cannot capture the order information of the sequence, the position embedding vector is appended to the product embedding vector and the attribute embedding vector, as shown in the formula:
[0082] S v ={v1+p1, ...,v t +p t , ..., v T +p T}
[0083] S a ={a1+p1,...,a t +p t , ..., a T +p T}
[0084] S52. Construct a hypergraph matrix using the embedding vectors of the product sequences and the corresponding hypergraph embedding vectors. Perform a similar operation on the attribute sequences. The specific formula is as follows:
[0085] H (v) =S v ·(E (v) ) T
[0086] H (a) =S a ·(E (a) ) T
[0087] in, d represents the dimension of the embedding vector.
[0088] S53. Construct multiple hypergraph neural network layers to further improve the model's fitting ability. The specific formula is as follows:
[0089]
[0090]
[0091]
[0092]
[0093] in, This represents the hyperedge embedding vector learned from the product / attribute embedding vector. 'l' indicates the layer number of the hypergraph network; there are a total of L layers. This is a learnable weight parameter matrix used for mapping the embedding vectors. σ represents the bias. σ(.) is the LeakyReLU nonlinear activation function, used to improve the model's ability to fit nonlinear data.
[0094] S54, obtain the final representation of the sequence, the specific formula is:
[0095]
[0096]
[0097] S6. Unsupervised Loss. Treating the product and attribute views as two separate views, we perform self-supervised comparative learning on them to extract more supervisory signals from the data itself, alleviating the data sparsity problem. This part uses InfoNCE loss, treating product sequences and their corresponding attribute sequences as positive sample pairs, and product sequences and other attribute sequences as negative sample pairs, and vice versa. Through this operation, positive example supervision makes the representations of different views of the same sequence tend to be consistent, while negative example supervision makes different sequences more discriminative. The specific formula is:
[0098]
[0099] Where sim(.) is the cosine similarity function, and τ is the temperature coefficient used to control the magnitude of the similarity value.
[0100] S7. Supervised Loss. Take the last item in the final representation of the product sequence as v. T Then, the BPRLoss loss function is used to obtain the loss for the recommendation task. The specific formula is shown below:
[0101] score + =δ(v T .(v i ) T )
[0102] score - =δ(v T .(v j ) T )
[0103] L main =∑log(score) + -score - )
[0104] Where δ(.) is the activation function sigmoid, i represents a positive sample, and j represents a negative sample.
[0105] S8. Loss Fusion. Supervised and unsupervised losses are combined to form the objective loss function of the sequence recommendation model. Gradient descent is used to calculate the gradients of each learnable parameter, which are then backpropagated into the network to iteratively update the model parameters. Early-stop is employed to prevent overfitting.
[0106] S9. Sequence Recommendation Prediction. Using prepared 1:100 ratio of positive and negative product examples, the inner product operation is performed between the sequence embedding vector (user embedding vector) learned by the model and the embedding vectors of these products to obtain the recommendation prediction score. A higher inner product value indicates a greater likelihood of the user choosing the product, and vice versa. The scores are then sorted in descending order. The hit rate can be represented by whether there are positive examples among the top 10 products. If there is a hit, the position of this product within the top 10 is calculated to further indicate the accuracy of the prediction; the earlier it appears, the more accurate the algorithm.
[0107] In summary, the method of this embodiment has at least the following advantages and beneficial effects compared to the prior art:
[0108] (1) This invention utilizes the advantages of hypergraph neural networks in modeling global information to model user behavior sequences, capture the multilateral relationships in the sequences, better mine the relationship information in the sequences, thereby obtaining more accurate sequence embedding vectors and improving the overall recommendation effect of the model.
[0109] (2) This invention introduces self-supervised learning, constructs a product perspective and an attribute perspective, and conducts comparative learning between the two perspectives to mine more supervision signals from the data itself, thereby mitigating the impact of data sparsity on the recommendation model.
[0110] This embodiment also provides a sequence recommendation device based on hypergraphs and self-supervised learning, including:
[0111] At least one processor;
[0112] At least one memory for storing at least one program;
[0113] When the at least one program is executed by the at least one processor, the at least one processor performs the following: Figure 1 The method shown.
[0114] This embodiment of the sequence recommendation device based on hypergraph and self-supervised learning can execute the sequence recommendation method based on hypergraph and self-supervised learning provided in the method embodiment of the present invention. It can execute any combination of the implementation steps of the method embodiment and has the corresponding functions and beneficial effects of the method.
[0115] This application also discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions, causing the computer device to perform... Figure 1 The method shown.
[0116] This embodiment also provides a storage medium storing instructions or programs that can execute the sequence recommendation method based on hypergraph and self-supervised learning provided in the method embodiment of the present invention. When the instructions or programs are run, any combination of implementation steps of the method embodiment can be executed, and the method has the corresponding functions and beneficial effects.
[0117] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this invention are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is altered and sub-operations described as part of a larger operation are executed independently.
[0118] Furthermore, although the invention has been described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the described functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the invention. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional skill of an engineer. Therefore, those skilled in the art can implement the invention as set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of the invention, which is determined by the full scope of the appended claims and their equivalents.
[0119] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0120] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0121] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0122] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0123] In the foregoing description of this specification, references to terms such as "one embodiment," "another embodiment," or "some embodiments" indicate that a specific feature, structure, material, or characteristic described in connection with an embodiment or example is included in at least one embodiment or example of the present invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0124] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
[0125] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.
Claims
1. A sequence recommendation method based on hypergraphs and self-supervised learning, characterized in that, Includes the following steps: Obtain a sequence dataset of user interactions on an e-commerce platform, the sequence dataset including product information, user interaction timestamps, and product attribute information; The sequence data is cleaned, and the cleaned products and their corresponding attributes are constructed into a sequence structure according to time order. The constructed product and attribute sequence data are input into the constructed hypergraph model to obtain the user's embedding vectors in the product sequence and attribute sequence; Unsupervised comparative learning is performed on the embedding vectors of product sequences and attribute sequences; The sequence recommendation model is trained using a combination of supervised loss for the sequence recommendation task and unsupervised loss for contrastive learning. The similarity between the embedding vector of the finally learned product sequence and the embedding vector of all products in the sequence dataset is calculated, and items with higher similarity are recommended to the user. The step of inputting the constructed product and attribute sequence data into the constructed hypergraph model to obtain the user's embedding vectors for the product sequence and attribute sequence includes: Set learnable hyperedge embedding vectors on both the product and attribute sides; A hypergraph matrix is constructed using the product sequence embedding vector and the hyperedge embedding vector to obtain a learnable first association matrix between products and hyperedges; A hypergraph matrix is constructed using attribute sequence embedding vectors and hyperedge embedding vectors to obtain a second correlation matrix between learnable attributes and hyperedges. Based on the obtained first and second correlation matrices, a multi-layer hypergraph network is superimposed, and hypergraph convolution is performed to obtain higher-order information on the sequence, resulting in the final embedding vectors of the product sequence and attribute sequence. The expression for the first correlation matrix is: The expression for the second correlation matrix is: in, For the hyperedge embedding vector matrix of the product side, This is the embedding vector matrix of the product sequence. Let be the embedding vector matrix of the hyperedges at the attribute end. This is the embedding vector matrix of the attribute sequence.
2. The sequence recommendation method based on hypergraph and self-supervised learning according to claim 1, characterized in that, The data cleaning of the sequence data includes: The products interacted with by users and their corresponding attributes are sorted according to timestamps to obtain product sequence data and attribute sequence data in order of time from oldest to most recent. Delete products and attributes that appear infrequently in the sequence data.
3. The sequence recommendation method based on hypergraph and self-supervised learning according to claim 1, characterized in that, Following the step of constructing a sequence structure of the cleaned goods and their corresponding attributes in chronological order, the method further includes a step of processing the sequence data into a uniform length format: For shorter sequences, padding is used to fill them to the predicted sequence length; For longer sequences, a truncation method is used, taking only the products with the most recent timestamps and their corresponding attributes.
4. The sequence recommendation method based on hypergraph and self-supervised learning according to claim 1, characterized in that, The unsupervised comparative learning of the embedding vectors of the product sequence and the embedding vectors of the attribute sequence includes: Treat the product sequence and attribute sequence as two views for comparative learning; The InfoNCE loss is used to treat the embedding vector of the product sequence and the embedding vector of its corresponding attribute as positive sample pairs, and the embedding vector of the product sequence and the embedding vector of other attributes as negative sample pairs for unsupervised comparative learning.
5. The sequence recommendation method based on hypergraph and self-supervised learning according to claim 1, characterized in that, The supervised loss for the joint sequence recommendation task and the unsupervised loss for contrastive learning are used to train the sequence recommendation model, including: The supervised loss of the sequence task and the unsupervised loss of the contrastive learning are summed and used as the target loss function of the recommendation model. Gradient descent is used to update the model parameters until the loss of the objective function reaches a set threshold.
6. The sequence recommendation method based on hypergraph and self-supervised learning according to claim 1, characterized in that, The expression for the supervised loss is: in, The activation function is sigmoid. Indicates a positive sample. Indicates a negative sample. This represents the embedding vector of a positive sample item. This represents the embedding vector of the negative sample item. The final embedding vector representing the product sequence; The expression for the unsupervised loss is: in, The cosine similarity function is used. For temperature coefficient, This represents the final embedding vector of the attribute sequence corresponding to the product sequence. The final embedding vector representing the attribute sequence that does not correspond to the product sequence. Represents a set of negative sample attribute sequences. This represents the sequence of all products.
7. A sequence recommendation device based on hypergraphs and self-supervised learning, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1-6.
8. A computer-readable storage medium storing a processor-executable program, characterized in that, The processor-executable program, when executed by the processor, is used to perform the method as described in any one of claims 1-6.