Sequence Recommendation Method, Apparatus, Electronic Device, and Storage Medium
By constructing a self-supervised sequence recommendation model, using GRU and MLP network structures to explicitly acquire long-term and short-term interests of users, the problem of insufficient sequence recommendation accuracy in the prior art is solved, and higher recommendation accuracy is achieved.
Patent Information
- Application Number
- CN202211493847.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-25
- Publication Date
- 2025-07-11
- Estimated Expiration
- 2042-11-25
AI Technical Summary
The existing sequence recommendation methods have insufficient accuracy, especially because the critical value of long and short-term interest is difficult to determine, which affects the accuracy of recommendation.
Build a self-supervised sequence recommendation model based on the evolution of user's personalized interests, and explicitly obtain the user's long-term, short-term and last-minute interests, use GRU and MLP network structure to extract the user's future interests, and combine self-attention and average pooling operations to improve the accuracy of the model.
By explicitly obtaining the network structure of users' future interests, the accuracy of sequence recommendations is improved, the extraction strategy of long-term and short-term interests is optimized, and the accuracy of recommendations is improved.
Smart Images

Figure CN115858925B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of sequential recommendation, and more specifically, to a sequential recommendation method, apparatus, electronic device, and storage medium. Background Art
[0002] Sequential recommendation is a very important task in the recommendation system. It models the user behavior sequence, such as the sequence of purchased products / items, to learn the change of user interest, so as to predict the user's next behavior. However, the accuracy of existing sequential recommendation still needs to be improved. Summary of the Invention
[0003] In view of the above problems, the present application proposes a sequential recommendation method, apparatus, electronic device, and storage medium to improve the above problems.
[0004] In a first aspect, an embodiment of the present application provides a sequential recommendation method, which is applied to an electronic device. The method includes: obtaining a sequence data set corresponding to the interaction behavior between the user and the electronic device; constructing a self-supervised sequential recommendation model based on the evolution of the user's personalized interest according to the sequence data set. The self-supervised sequential recommendation model includes a network structure for explicitly obtaining the user's future interest, and the network structure is used to obtain the user's next interest according to the user's long-term interest, short-term interest, and the interest at the last moment; training the self-supervised sequential recommendation model based on the sequence data set to obtain a target sequential recommendation model; and recommending application programs for the user through the target sequential recommendation model.
[0005] In a second aspect, an embodiment of the present application provides a sequential recommendation apparatus, which runs on an electronic device. The apparatus includes: a data acquisition module, configured to obtain a sequence data set corresponding to the interaction behavior between the user and the electronic device; a model construction module, configured to construct a self-supervised sequential recommendation model based on the evolution of the user's personalized interest according to the sequence data set. The self-supervised sequential recommendation model includes a network structure for explicitly obtaining the user's future interest, and the network structure is used to obtain the user's next interest according to the user's long-term interest, short-term interest, and the interest at the last moment; a model training module, configured to train the self-supervised sequential recommendation model based on the sequence data set to obtain a target sequential recommendation model; and a sequential recommendation module, configured to recommend application programs for the user through the target sequential recommendation model.
[0006] In a third aspect, the present application provides an electronic device, including one or more processors and a memory; one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method described in the first aspect above.
[0007] In a fourth aspect, the present application provides a computer-readable storage medium, in which program code is stored, and wherein, when the program code runs, the method described in the first aspect above is executed.
[0008] A sequence recommendation method, apparatus, electronic device, and storage medium provided by the present application obtain a sequence data set corresponding to an interaction behavior between a user and the electronic device; construct a self-supervised sequence recommendation model based on the evolution of the user's personalized interests according to the sequence data set, the self-supervised sequence recommendation model includes a network structure for explicitly obtaining the user's future interests, and the network structure is used to obtain the user's next interest according to the user's long-term interests, short-term interests, and the interest at the last moment; train the self-supervised sequence recommendation model based on the sequence data set to obtain a target sequence recommendation model; recommend application programs for the user through the target sequence recommendation model. Thus, through the above method, the future interests of the user can be extracted through the network structure in the model that can explicitly obtain the user's future interests, and the accuracy of the model for sequence recommendation can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings without creative efforts based on these drawings.
[0010] Figure 1 The flowchart of a sequence recommendation method proposed in an embodiment of the present application is shown.
[0011] Figure 2 The flowchart of a sequence recommendation method proposed in another embodiment of the present application is shown.
[0012] Figure 3 The flowchart of a sequence recommendation method proposed in yet another embodiment of the present application is shown.
[0013] Figure 4 The block diagram of a sequence recommendation apparatus proposed in an embodiment of the present application is shown.
[0014] Figure 5A structural block diagram of an electronic device for implementing a sequence recommendation method or a risk assessment method according to an embodiment of the present application is shown.
[0015] Figure 6 It is a storage unit for storing or carrying program codes for implementing a sequence recommendation method or a risk assessment method according to an embodiment of the present application. Detailed implementation manners
[0016] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0017] Sequence recommendation is a recommendation system paradigm that recommends relevant items to users by modeling the patterns of user behavior and items in a time series. There are two types of objects in the recommendation system, namely users and items, and both contain several interaction behaviors in the time dimension, such as user browsing, clicking, and purchase conversion behaviors. The sequence recommendation system arranges these interaction behaviors in chronological order, uses various different modeling methods to mine the sequential patterns therein, and uses them to support the recommendation of one or more items at the next moment. That is, sequence recommendation can recommend items that a user may be interested in at a future moment based on the user's dynamically changing historical behavior sequence.
[0018] There are many existing sequence recommendation methods. For example, sequence recommendation can be based on the long and short interests of users. However, a general sequence recommendation model based on the long and short interests of users will segment the interaction sequence between users and items, and the long and short interests need to be extracted from the segmented sequences respectively. Since it is difficult to determine the critical value for segmenting the long sequence and the short sequence, and there is a constraint relationship between the long-term interest and the short-term interest, segmenting the interaction sequence between users and items is likely to affect the accuracy of the sequence recommendation model.
[0019] To optimize the above problems, through long-term research, the inventors have proposed a sequence recommendation method, device, electronic device, and storage medium provided in the embodiments of the present application. This sequence recommendation method is applied to an electronic device, and this sequence recommendation method can extract the user's future interest through a network structure in the model that can explicitly obtain the user's future interest, which can improve the accuracy of the model for sequence recommendation.
[0020] For ease of understanding the solution described in this application, the following briefly explains the terms involved in the embodiments of this application:
[0021] GRU (Gate Recurrent Unit): Represents a gated recurrent unit.
[0022] DIEN (Deep Interest Evolution Network): Represents a deep interest evolution network.
[0023] MLP (Multilayer Perceptron): Represents a multilayer perceptron.
[0024] The following will specifically describe the embodiments of this application in conjunction with the accompanying drawings.
[0025] Please refer to Figure 1 , an embodiment of this application provides a sequence recommendation method, which can be applied to an electronic device. The method includes:
[0026] Step S110: Obtain a sequence data set corresponding to the interaction behavior between the user and the electronic device.
[0027] Among them, the electronic device is configured with application programs. The specific type of the application programs may not be limited. For example, it may be a shopping application program, an instant messaging application program, or a game application program, etc. The number of application programs may be one or more.
[0028] In the implementation manner of this application, the interaction behavior between the user and the electronic device may include behaviors such as the user opening and / or browsing the application programs configured in the electronic device. In this way, the sequence data set corresponding to the interaction behavior may include the behavior data of the user opening and / or browsing the application programs configured in the electronic device arranged in chronological order, specifically, it may include the behavior data of the user opening the application programs configured in the electronic device arranged in the chronological order of opening the application programs, and / or the behavior data of the user browsing the application programs configured in the electronic device arranged in the order of browsing duration.
[0029] In the implementation manner of this application, the interaction behavior between the user and the electronic device may also include behaviors such as the user browsing and / or purchasing items through the application programs configured in the electronic device. In this way, the sequence data set corresponding to the interaction behavior may include the behavior data of the user browsing and / or purchasing items through the application programs configured in the electronic device arranged in chronological order, specifically, it may include the behavior data of the user browsing items through the application programs configured in the electronic device arranged in the chronological order of browsing items, and / or the behavior data of the user purchasing items through the application programs configured in the electronic device arranged in the chronological order of purchasing items.
[0030] As an implementation manner, a sequence data set corresponding to the interaction behavior between a user and an electronic device can be obtained periodically. For example, taking a day as 24 hours, assuming that the duration of the user using the electronic device during the day (0-12 hours) is greater than the duration of the user using the electronic device at night (12-24 hours), in order to ensure the accuracy of the data, the sequence data set corresponding to the interaction behavior between the user and the electronic device can be obtained during the day, and the obtaining step can be repeated after an interval of 12 hours. Among them, the sequence data set corresponding to the interaction behavior between the user and the electronic device can be obtained by constructing a user portrait. The specific process of constructing the user portrait and the process of the sequence data set will not be elaborated here.
[0031] It should be noted that in the implementation manner of this application, the obtained sequence data set is the one corresponding to the interaction behavior between the user and the electronic device within a historical time period (past time period).
[0032] As a way, in order to improve the calculation speed, the interaction behavior sequence data can be preprocessed. For example, the non-application interaction data (such as unlocking the screen, inserting headphones, making a call, etc.) and the interaction data with a usage duration lower than a preset threshold in the interaction behavior sequence data can be filtered out, abnormal data can be deleted, and the data can be normalized, etc.
[0033] Step S120: Construct a self-supervised sequence recommendation model based on the evolution of the user's personalized interests according to the sequence data set. The self-supervised sequence recommendation model includes a network structure for explicitly obtaining the user's future interests. The network structure is used to obtain the user's next moment's interests according to the user's long-term interests, short-term interests, and the interests at the last moment.
[0034] In the implementation manner of this application, the constructed self-supervised sequence recommendation model includes a network structure that can explicitly obtain the user's future interests. The network structure can obtain the user's next moment's interests according to the user's long-term interests, short-term interests, and the interests at the last moment. In at least one embodiment, the network structure can be an MLP structure.
[0035] Among them, the sequence dataset includes the long-term interests, short-term interests, and the interests at the last moment of the user within a historical time period. As a way, by inputting the long-term interests, short-term interests, and the interests at the last moment of the user within a historical time period into the MLP structure, the contribution degrees of the long-term interests, short-term interests, and the interests at the last moment of the user within a historical time period to the user's interests at the next moment can be obtained, and the representation of the user's interests at the next moment can be obtained in this way. Since the interest evolution laws of different users are usually different, the parameters when extracting the contribution of the current type of interests of the user (that is, the long-term interests, short-term interests, and the interests at the last moment of the user within a historical time period) to future interests in this MLP structure are personalized. The structure that can obtain the user's future interests in this way can improve the accuracy of the self-supervised sequence recommendation model.
[0036] Step S130: Train the self-supervised sequence recommendation model based on the sequence dataset to obtain a target sequence recommendation model.
[0037] Among them, the sequence dataset can be divided into training data and test data. For example, 70% of the data in the sequence dataset can be divided into training data, and the remaining 30% of the data in the sequence dataset can be divided into test data. In this way, the self-supervised sequence recommendation model can be trained based on the training data to obtain a sequence recommendation model to be evaluated, and then the sequence recommendation model to be evaluated can be tested based on the test data. The sequence recommendation model that passes the test is used as the target sequence recommendation model. Among them, the process of training the self-supervised sequence recommendation model based on the training data will not be elaborated here.
[0038] Step S140: Recommend application programs for the user through the target sequence recommendation model.
[0039] As an implementation method, when the interaction behavior between the user and the electronic device includes behaviors such as the user opening and / or browsing the application programs configured in the electronic device, application programs can be recommended for the user through the target sequence recommendation model; when the interaction behavior between the user and the electronic device includes behaviors such as the user browsing and / or purchasing items through the application programs configured in the electronic device, items can be recommended for the user through the target sequence recommendation model.
[0040] A sequence recommendation method provided by the present application includes obtaining a sequence data set corresponding to the interaction behavior between a user and the electronic device; constructing a self-supervised sequence recommendation model based on the evolution of the user's personalized interests according to the sequence data set, where the self-supervised sequence recommendation model includes an explicit network structure for obtaining the user's future interests, and the network structure is used to obtain the user's next interest according to the user's long-term interests, short-term interests, and the interest at the last moment; training the self-supervised sequence recommendation model based on the sequence data set to obtain a target sequence recommendation model; and recommending application programs to the user through the target sequence recommendation model. Thus, through the above method, the future interests of the user can be extracted through the network structure in the model that can explicitly obtain the user's future interests, which can improve the accuracy of the model for sequence recommendation.
[0041] Please refer to Figure 2 , another embodiment of the present application provides a sequence recommendation method, which can be applied to an electronic device. This embodiment mainly describes the process of constructing a self-supervised sequence recommendation model based on the evolution of the user's personalized interests according to the sequence data set. The method includes:
[0042] Step S210: Obtain the embedding representation of the user according to the user data, obtain the embedding representation of the application program according to the application program data, obtain the embedding representation of the context features according to the context data, and obtain the embedding representation of the behavior sequence according to the user's behavior sequence data. The embedding representation of the user includes the ID embedding representation of the user, and the embedding representation of the behavior sequence includes the ID embedding representations of multiple application programs.
[0043] In the embodiment of the present application, the sequence data set corresponding to the interaction behavior between the user and the electronic device may include user data, application program data, context data when the user interacts with the electronic device, and the user's behavior sequence data. In the process of constructing a self-supervised sequence recommendation model based on the evolution of the user's personalized interests according to the sequence data set, the embedding representation of the user can be obtained according to the user data, the embedding representation of the application program can be obtained according to the application program data, the embedding representation of the context features can be obtained according to the context data, and the embedding representation of the behavior sequence can be obtained according to the user's behavior sequence data. Among them, the embedding representation of the user may include the ID embedding representation of the user, and the embedding representation of the behavior sequence may include the ID embedding representations of multiple application programs. Among them, the embedding representation can be understood as the representation method of variables, and the embedding can be understood as the actual value of variables.
[0044] Step S220: Obtain the long-term interest embedding representation of the user from the behavior sequence data based on the ID embedding representation of the user and the ID embedding representations of the multiple application programs.
[0045] As an implementation, the user's ID can be embedded, and target attention calculation can be performed on the ID embedding representations of each of the multiple application programs respectively with the ID embedding representation of the user, obtaining multiple attention scores, which can reflect the correlation between the interest currently shown by the user and the user's long-term interest; then, weighted summation is performed on the obtained multiple attention scores based on the respective weights of the ID embedding representations of the multiple application programs, obtaining the long-term interest embedding representation of the user.
[0046] Among them, the respective weights of the ID embedding representations of the multiple application programs can be obtained according to the frequency of the user opening and / or browsing the application programs, or the respective weights of the ID embedding representations of the multiple application programs can be obtained according to the duration of the user opening and / or browsing the application programs.
[0047] In at least one embodiment, the higher the frequency of the user opening and / or browsing the application program, the greater the weight of the ID embedding representation of the corresponding application program, and if the frequency of the user opening and / or browsing the application program is lower, the weight of the ID embedding representation of the corresponding application program is smaller.
[0048] In at least one embodiment, the longer the duration of the user opening and / or browsing the application program, the greater the weight of the ID embedding representation of the corresponding application program, and if the duration of the user opening and / or browsing the application program is shorter, the weight of the ID embedding representation of the corresponding application program is smaller.
[0049] Step S230: Obtain the short-term interest embedding representation of the user from the behavior sequence data based on the ID embedding representations of the multiple application programs, and obtain the interest embedding representation of the user at the last moment from the behavior sequence data based on the ID embedding representation of the last application program among the ID embedding representations of the multiple application programs.
[0050] In the implementation of this application, the self-supervised sequence recommendation model may further include a gated recurrent neural network (GRU structure). As an implementation, the ID embedding representations of multiple application programs can be input into the gated recurrent neural network, and the hidden state of the ID embedding representation of each application program output by the gated recurrent neural network can be obtained; then, self-attention operation and average pooling operation are performed on the hidden state of the ID embedding representation of each application program, obtaining the short-term interest embedding representation of the user.
[0051] As an implementation, the hidden state of the ID embedding representation of the last application program among the ID embedding representations of multiple application programs can be used as the interest embedding representation of the user at the last moment.
[0052] Step S240: Obtain a user representation based on the embedded representation of the user, the embedded representation of the context features, the long-term interest embedded representation, the short-term interest embedded representation, and the last-moment interest embedded representation.
[0053] As an implementation, the embedded representation of the user, the embedded representation of the context features, the long-term interest embedded representation, the short-term interest embedded representation, and the last-moment interest embedded representation can be input into a multi-layer perceptron (MLP structure), and the user representation output by the multi-layer perceptron can be obtained. Among them, the parameters of the first fully connected layer in the MLP structure are personalized, and the contributions of the user's long-term interest, short-term interest, and last-moment interest to the user's next-moment interest can be displayed, so as to obtain the user's next-moment interest.
[0054] Step S250: Obtain an application representation based on the embedded representation of the application.
[0055] As a way, the embedded representation of the application can be concatenated according to the ID of the application, that is, all the information belonging to the same application is concatenated with its corresponding ID, and the concatenated data is input into the MLP structure, and then the application representation is obtained.
[0056] Step S260: Obtain a first loss parameter according to the user representation and the application representation.
[0057] As an implementation, the similarity between the user representation and the application representation can be calculated, and then the similarity is input into the loss function of the self-supervised sequence recommendation model to obtain the first loss parameter output by the loss function.
[0058] It should be noted that the process of constructing the self-supervised sequence recommendation model described in the embodiments of the present application refers to constructing a calculation framework of a self-supervised sequence recommendation model, so that when using the self-supervised sequence recommendation model for sequence recommendation, inference calculation can be performed through this calculation framework.
[0059] A sequence recommendation method provided by the present application obtains a sequence data set corresponding to the interaction behavior between a user and the electronic device; constructs a self-supervised sequence recommendation model based on the user's personalized interest evolution according to the sequence data set, and the self-supervised sequence recommendation model includes a network structure for explicitly obtaining the user's future interests, and the network structure is used to obtain the user's next interest according to the user's long-term interests, short-term interests and the interests at the last moment; trains the self-supervised sequence recommendation model based on the sequence data set to obtain a target sequence recommendation model; recommends application programs for the user through the target sequence recommendation model. Thus, through the above method, the future interests of the user can be extracted through the network structure in the model that can explicitly obtain the future interests of the user, which can improve the accuracy of the model for sequence recommendation.
[0060] At the same time, compared with separately extracting long-term interests and short-term interests from long and short sequences, this method proposes a new extraction strategy for long and short interests, that is, the long-term interests can be obtained by performing Target Attention on the user's unique identifier ID and the sequence, and the short-term interests can be obtained by performing Self-Attention and Average Pooling operations on the sequence.
[0061] Please refer to Figure 3 , another embodiment of the present application provides a sequence recommendation method, which can be applied to an electronic device, and the method includes:
[0062] Step S310: Obtain a sequence data set corresponding to the interaction behavior between the user and the electronic device, where the sequence data set includes user data, application program data, context data when the user interacts with the electronic device, and the user's behavior sequence data.
[0063] Among them, the specific implementation of step S310 can refer to the specific description of step S110 in the foregoing embodiment, and will not be elaborated here.
[0064] Step S320: Obtain the embedding representation of the user according to the user data, obtain the embedding representation of the application program according to the application program data, obtain the embedding representation of the context features according to the context data, and obtain the embedding representation of the behavior sequence according to the user's behavior sequence data. The embedding representation of the user includes the ID embedding representation of the user, and the embedding representation of the behavior sequence includes the ID embedding representations of multiple application programs.
[0065] Among them, the specific implementation of step S320 can refer to the specific description of step S210 in the foregoing embodiment, and will not be elaborated here.
[0066] Step S330: Obtain the long-term interest embedding representation of the user from the behavior sequence data based on the ID embedding representation of the user and the ID embedding representations of the multiple applications.
[0067] Among them, for the specific implementation of step S330, reference can be made to the specific description of step S220 in the foregoing embodiments, which will not be elaborated here.
[0068] Step S340: Obtain the short-term interest embedding representation of the user from the behavior sequence data based on the ID embedding representations of the multiple applications, and obtain the last-moment interest embedding representation of the user from the behavior sequence data based on the ID embedding representation of the last application among the ID embedding representations of the multiple applications.
[0069] Among them, for the specific implementation of step S340, reference can be made to the specific description of step S230 in the foregoing embodiments, which will not be elaborated here.
[0070] Step S350: Obtain the user representation based on the embedding representation of the user, the embedding representation of the context features, the long-term interest embedding representation, the short-term interest embedding representation, and the last-moment interest embedding representation.
[0071] Among them, for the specific implementation of step S350, reference can be made to the specific description of step S240 in the foregoing embodiments, which will not be elaborated here.
[0072] Step S360: Obtain the application representation based on the embedding representation of the application.
[0073] Among them, for the specific implementation of step S360, reference can be made to the specific description of step S250 in the foregoing embodiments, which will not be elaborated here.
[0074] Step S370: Obtain the first loss parameter according to the user representation and the application representation.
[0075] Among them, for the specific implementation of step S370, reference can be made to the specific description of step S260 in the foregoing embodiments, which will not be elaborated here.
[0076] Step S380: Enhance the behavior sequence data to obtain the enhanced behavior sequence data.
[0077] As an implementation, to further enhance the richness of training samples, the behavior sequence data can be enhanced to obtain enhanced behavior sequence data. Among them, the behavior sequence data can be enhanced by random sampling; or a random value is calculated for each position of the behavior sequence. If the random value is less than a specified threshold (the specific value of the specified threshold can be not limited), the information corresponding to this position is overwritten with a default value to achieve enhancement, and the specific enhancement method is not limited here.
[0078] Step S390: Perform contrastive learning on the behavior sequence data and the enhanced behavior sequence data to obtain a second loss parameter.
[0079] By performing contrastive learning on the original behavior sequence data and the enhanced behavior sequence data and inputting the learned result into the loss function of the self-supervised sequence recommendation model, the second loss parameter output by the loss function can be obtained.
[0080] Step S391: Obtain a target loss parameter based on the first loss parameter and the second loss parameter.
[0081] As a way, the first loss parameter can be added to the second loss function to obtain a target loss parameter.
[0082] Step S392: Backpropagate the target loss parameter during the process of training the self-supervised sequence recommendation model until the self-supervised sequence recommendation model converges to obtain a target sequence recommendation model.
[0083] Among them, the self-supervised sequence recommendation model can be trained by backpropagating the target loss parameter until the self-supervised sequence recommendation model converges to obtain a target sequence recommendation model.
[0084] Step S393: Recommend application programs for users through the target sequence recommendation model.
[0085] In at least one embodiment, the trained and tested target sequence recommendation model can be deployed in the cloud to facilitate recommending application programs of interest to users through the target sequence recommendation model.
[0086] A sequence recommendation method provided by this application obtains a sequence data set corresponding to the interaction behavior between a user and the electronic device; obtains the embedding representation of the user according to the user data, obtains the embedding representation of the application program according to the application program data, obtains the embedding representation of the context features according to the context data, and obtains the embedding representation of the behavior sequence according to the user's behavior sequence data. The embedding representation of the user includes the ID embedding representation of the user, and the embedding representation of the behavior sequence includes the ID embedding representations of multiple application programs; obtains the long-term interest embedding representation of the user from the behavior sequence data based on the ID embedding representation of the user and the ID embedding representations of the multiple application programs; obtains the short-term interest embedding representation of the user from the behavior sequence data based on the ID embedding representations of the multiple application programs, and obtains the last-moment interest embedding representation of the user from the behavior sequence data based on the ID embedding representation of the last application program among the ID embedding representations of the multiple application programs; obtains the user representation based on the embedding representation of the user, the embedding representation of the context features, the long-term interest embedding representation, the short-term interest embedding representation, and the last-moment interest embedding representation; obtains the application program representation based on the embedding representation of the application program; obtains the first loss parameter according to the user representation and the application program representation; enhances the behavior sequence data to obtain the enhanced behavior sequence data; performs contrastive learning on the behavior sequence data and the enhanced behavior sequence data to obtain the second loss parameter; obtains the target loss parameter based on the first loss parameter and the second loss parameter; backpropagates the target loss parameter during the process of training the self-supervised sequence recommendation model until the self-supervised sequence recommendation model converges to obtain the target sequence recommendation model; recommends application programs for the user through the target sequence recommendation model. Thus, through the above method, it is possible to extract the user's future interests through the network structure in the model that can explicitly obtain the user's future interests, which can improve the accuracy of the model for sequence recommendation.
[0087] Meanwhile, by introducing contrastive learning, the expressive ability of the application program embedding can be enhanced, and further improve the accuracy of the model for sequence recommendation.
[0088] Please refer to Figure 4 , an embodiment of this application provides a sequence recommendation device 400, which runs on an electronic device. The device 400 includes:
[0089] A data acquisition module 410, configured to acquire a sequence data set corresponding to the interaction behavior between a user and the electronic device.
[0090] In the implementation manner of this application, the sequence data set may include user data, application program data, context data when the user interacts with the electronic device, and the user's behavior sequence data.
[0091] The model construction module 420 is configured to construct a self-supervised sequence recommendation model based on the evolution of the user's personalized interests according to the sequence data set. The self-supervised sequence recommendation model includes an explicit network structure for obtaining the user's future interests, and the network structure is configured to obtain the user's next moment interests based on the user's long-term interests, short-term interests, and the interests at the last moment.
[0092] As an implementation, the model construction module 420 can be configured to obtain the embedded representation of the user according to the user data, obtain the embedded representation of the application according to the application data, obtain the embedded representation of the context features according to the context data, and obtain the embedded representation of the behavior sequence according to the user's behavior sequence data. The embedded representation of the user includes the ID embedded representation of the user, and the embedded representation of the behavior sequence includes the ID embedded representations of multiple applications; obtain the long-term interest embedded representation of the user from the behavior sequence data based on the ID embedded representation of the user and the ID embedded representations of the multiple applications; obtain the short-term interest embedded representation of the user from the behavior sequence data based on the ID embedded representations of the multiple applications, and obtain the interest embedded representation of the user at the last moment from the behavior sequence data based on the ID embedded representation of the last application in the ID embedded representations of the multiple applications; obtain the user representation based on the embedded representation of the user, the embedded representation of the context features, the long-term interest embedded representation, the short-term interest embedded representation, and the interest embedded representation at the last moment; obtain the application representation based on the embedded representation of the application; and obtain the first loss parameter according to the user representation and the application representation.
[0093] Among them, the obtaining of the long-term interest embedded representation of the user from the behavior sequence data based on the ID embedded representation of the user and the ID embedded representations of the multiple applications may include: performing target attention calculation on the ID embedded representation of the user and each ID embedded representation of the multiple applications respectively to obtain multiple attention scores; and performing weighted summation on the multiple attention scores based on the respective weights of the ID embedded representations of the multiple applications to obtain the long-term interest embedded representation of the user.
[0094] Among them, the obtaining of the short-term interest embedded representation of the user from the behavior sequence data based on the ID embedded representations of the multiple applications may include: inputting the ID embedded representations of the multiple applications into a gated recurrent neural network, and obtaining the hidden state of each ID embedded representation of the application output by the gated recurrent neural network; and performing self-attention operation and average pooling operation on the hidden state of each ID embedded representation of the application to obtain the short-term interest embedded representation of the user.
[0095] Among them, obtaining the user's last - moment interest embedding representation from the behavior sequence data using the ID embedding representation of the last application in the ID embedding representations of the multiple applications may include: using the hidden state of the ID embedding representation of the last application in the ID embedding representations of the multiple applications as the user's last - moment interest embedding representation.
[0096] Among them, obtaining the user representation based on the user's embedding representation, the embedding representation of the context feature, the long - term interest embedding representation, the short - term interest embedding representation, and the last - moment interest embedding representation may include: inputting the user's embedding representation, the embedding representation of the context feature, the long - term interest embedding representation, the short - term interest embedding representation, and the last - moment interest embedding representation into a multi - layer perceptron, and obtaining the user representation output by the multi - layer perceptron.
[0097] The model training module 430 is configured to train the self - supervised sequence recommendation model based on the sequence data set to obtain a target sequence recommendation model.
[0098] In at least one embodiment, the apparatus 400 may further include a contrastive learning module, which is configured to enhance the behavior sequence data to obtain enhanced behavior sequence data after obtaining the first loss parameter according to the user representation and the application representation; perform contrastive learning on the behavior sequence data and the enhanced behavior sequence data to obtain a second loss parameter. In this way, the model training module 430 may be configured to obtain a target loss parameter based on the first loss parameter and the second loss parameter; back - propagate the target loss parameter during the process of training the self - supervised sequence recommendation model until the self - supervised sequence recommendation model converges to obtain a target sequence recommendation model.
[0099] The sequence recommendation module 440 is configured to recommend applications for the user through the target sequence recommendation model.
[0100] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above - described devices and modules can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.
[0101] In several embodiments provided in the present application, the coupling, direct coupling, or communication connection between the modules shown or discussed with each other may be through some interfaces. The indirect coupling or communication connection between the devices or modules may be in electrical, mechanical, or other forms.
[0102] In addition, in each embodiment of the present application, each functional module can be integrated into a processing module, can exist separately physically for each module, or two or more modules can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module.
[0103] Please refer to Figure 5 , based on the above sequence recommendation method and device, an embodiment of the present application further provides an electronic device 100 that can execute the foregoing sequence recommendation method. The electronic device 100 includes a memory 102 and one or more (only one is shown in the figure) processors 104 that are coupled to each other, and a communication line connection is provided between the memory 102 and the processor 104. A program that can execute the content in the foregoing embodiments is stored in the memory 102, and the processor 104 can execute the program stored in the memory 102.
[0104] Among them, the processor 104 can include one or more processing cores. The processor 104 uses various interfaces and lines to connect various parts within the entire electronic device 100, and by running or executing instructions, programs, code sets, or instruction sets stored in the memory 102, and by calling data stored in the memory 102, it executes various functions of the electronic device 100 and processes data. Optionally, the processor 104 can be implemented in at least one of the hardware forms of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 104 can integrate one or several combinations of a central processing unit (CPU), a graphics processing unit (GPU), and a modem, etc. Among them, the CPU mainly processes the operating system, user interface, application programs, etc.; the GPU is responsible for rendering and drawing the displayed content; the modem is used to process wireless communication. It can be understood that the above modem can also not be integrated into the processor 104 and can be implemented separately through a communication chip.
[0105] The memory 102 may include a Random Access Memory (RAM), or may also include a Read-Only Memory. The memory 102 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 102 may include a program storage area and a data storage area. Among them, the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing each of the foregoing embodiments, etc. The data storage area may also store data created during the use of the electronic device 100 (such as a phone book, audio and video data, chat record data, etc.).
[0106] Please refer to Figure 6 , which shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application. Program code is stored in the computer-readable storage medium 500, and the program code can be called by a processor to execute the method described in the above method embodiment.
[0107] The computer-readable storage medium 500 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk, or a ROM. Optionally, the computer-readable storage medium 500 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 500 has a storage space for the program code 510 that executes any method step in the above method. These program codes can be read from or written into one or more computer program products. The program code 510 can be compressed in an appropriate form, for example.
[0108] In summary, a sequence recommendation method, device, electronic device, and storage medium provided by the present application obtain a sequence data set corresponding to an interaction behavior between a user and the electronic device; construct a self-supervised sequence recommendation model based on the user's personalized interest evolution according to the sequence data set. The self-supervised sequence recommendation model includes a network structure for explicitly obtaining the user's future interests, and the network structure is used to obtain the user's next moment's interests according to the user's long-term interests, short-term interests, and the interests at the last moment; train the self-supervised sequence recommendation model based on the sequence data set to obtain a target sequence recommendation model; recommend application programs for the user through the target sequence recommendation model. Thus, through the above method, it is possible to extract the user's future interests through the network structure in the model that can explicitly obtain the user's future interests, and the accuracy of the model for sequence recommendation can be improved.
[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A sequence recommendation method, characterized in that, Applied to an electronic device, the method includes: Obtaining a sequence data set corresponding to the interaction behavior between the user and the electronic device; Constructing a self-supervised sequence recommendation model based on the evolution of the user's personalized interests according to the sequence data set. The self-supervised sequence recommendation model includes an explicit network structure for obtaining the user's future interests, and the network structure is used to obtain the user's next moment's interests according to the user's long-term interests, short-term interests, and the interests at the last moment. Among them, the sequence data set includes user data, application data, context data when the user interacts with the electronic device, and the user's behavior sequence data. The constructing of the self-supervised sequence recommendation model based on the evolution of the user's personalized interests according to the sequence data set includes: obtaining the embedding representation of the user according to the user data, obtaining the embedding representation of the application according to the application data, obtaining the embedding representation of the context features according to the context data, and obtaining the embedding representation of the behavior sequence according to the user's behavior sequence data. The embedding representation of the user includes the ID embedding representation of the user, and the embedding representation of the behavior sequence includes the ID embedding representations of multiple applications; Obtaining the long-term interest embedding representation of the user from the behavior sequence data based on the ID embedding representation of the user and the ID embedding representations of the multiple applications, obtaining the short-term interest embedding representation of the user from the behavior sequence data based on the ID embedding representations of the multiple applications, and obtaining the interest embedding representation of the user at the last moment from the behavior sequence data based on the ID embedding representation of the last application in the ID embedding representations of the multiple applications; Obtaining the user representation based on the embedding representation of the user, the embedding representation of the context features, the long-term interest embedding representation, the short-term interest embedding representation, and the interest embedding representation at the last moment, obtaining the application representation based on the embedding representation of the application, and obtaining the first loss parameter of the loss function of the self-supervised sequence recommendation model according to the user representation and the application representation; Training the self-supervised sequence recommendation model based on the sequence data set to obtain a target sequence recommendation model; Recommending applications for the user through the target sequence recommendation model.
2. The method according to claim 1, wherein The obtaining the long-term interest embedding representation of the user from the behavior sequence data based on the ID embedding representation of the user and the ID embedding representations of the multiple applications includes: Performing target attention calculation on the ID embedding representation of the user and the ID embedding representation of each application in the ID embedding representations of the multiple applications respectively to obtain multiple attention scores; Performing weighted summation on the multiple attention scores based on the respective weights of the ID embedding representations of the multiple applications to obtain the long-term interest embedding representation of the user.
3. The method according to claim 1, characterized in that, The obtaining the short-term interest embedding representation of the user from the behavior sequence data based on the ID embedding representations of the multiple applications includes: Embed the IDs of the multiple application programs into the input of the gated recurrent neural network, and obtain the hidden states of the ID embedding representations of each application program output by the gated recurrent neural network; Perform self-attention operation and average pooling operation on the hidden states of the ID embedding representations of each application program to obtain the short-term interest embedding representation of the user.
4. The method according to claim 3, characterized in that, The obtaining of the last moment interest embedding representation of the user from the behavior sequence data based on the ID embedding representation of the last application program among the ID embedding representations of the multiple application programs includes: Use the hidden state of the ID embedding representation of the last application program among the ID embedding representations of the multiple application programs as the last moment interest embedding representation of the user.
5. The method according to claim 1, wherein The obtaining of the user representation based on the embedding representation of the user, the embedding representation of the context feature, the long-term interest embedding representation, the short-term interest embedding representation, and the last moment interest embedding representation includes: Input the embedding representation of the user, the embedding representation of the context feature, the long-term interest embedding representation, the short-term interest embedding representation, and the last moment interest embedding representation into a multi-layer perceptron, and obtain the user representation output by the multi-layer perceptron.
6. The method according to claim 1, wherein After obtaining the first loss parameter according to the user representation and the application program representation, the method further includes: Enhance the behavior sequence data to obtain enhanced behavior sequence data; Perform contrastive learning on the behavior sequence data and the enhanced behavior sequence data to obtain a second loss parameter; The training of the self-supervised sequence recommendation model based on the sequence data set to obtain a target sequence recommendation model includes: Obtain a target loss parameter based on the first loss parameter and the second loss parameter; Backpropagate the target loss parameter during the training of the self-supervised sequence recommendation model until the self-supervised sequence recommendation model converges to obtain a target sequence recommendation model.
7. A sequence recommendation device, characterized in that, Running on an electronic device, the device includes: A data acquisition module for acquiring a sequence data set corresponding to the interaction behavior between the user and the electronic device; A model construction module for constructing a self-supervised sequence recommendation model based on the evolution of user personalized interests according to the sequence dataset. The self-supervised sequence recommendation model includes an explicit network structure for obtaining the user's future interests, and the network structure is used to obtain the user's next moment interests based on the user's long-term interests, short-term interests, and the interests at the last moment; wherein, the sequence dataset includes user data, application data, context data when the user interacts with the electronic device, and the user's behavior sequence data. The construction of the self-supervised sequence recommendation model based on the sequence dataset includes: obtaining the embedding representation of the user according to the user data, obtaining the embedding representation of the application according to the application data, obtaining the embedding representation of the context features according to the context data, and obtaining the embedding representation of the behavior sequence according to the user's behavior sequence data. The embedding representation of the user includes the ID embedding representation of the user, and the embedding representation of the behavior sequence includes the ID embedding representations of multiple applications; obtaining the long-term interest embedding representation of the user from the behavior sequence data based on the ID embedding representation of the user and the ID embedding representations of the multiple applications, obtaining the short-term interest embedding representation of the user from the behavior sequence data based on the ID embedding representations of the multiple applications, and obtaining the last moment interest embedding representation of the user from the behavior sequence data based on the ID embedding representation of the last application in the ID embedding representations of the multiple applications; obtaining the user representation based on the embedding representation of the user, the embedding representation of the context features, the long-term interest embedding representation, the short-term interest embedding representation, and the last moment interest embedding representation, obtaining the application representation based on the embedding representation of the application, and obtaining the first loss parameter of the loss function of the self-supervised sequence recommendation model according to the user representation and the application representation; A model training module for training the self-supervised sequence recommendation model based on the sequence dataset to obtain a target sequence recommendation model; A sequence recommendation module for recommending applications for the user through the target sequence recommendation model.
8. An electronic device, characterized in that, Comprising one or more processors and a memory; One or more programs are stored in the memory and are configured to be executed by the one or more processors. The one or more programs are configured to execute the method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, Program code is stored in the computer-readable storage medium, and when the program code is run by the processor, it executes the method according to any one of claims 1-6.
Citation Information
Patent Citations
Self-supervised sequence recommendation method based on long-term and short-term interests of user
CN114528490A
Sequential recommendation method based on long-term and short-term interests
US20220301024A1