Temporal scoring context-aware recommendation method and system based on self-attention
The self-attention mechanism captures the time-scoring impact and combines ratings and time context to solve the problems of sequence information loss and insufficient hobby capture in existing recommendation systems, achieve accurate recommendations for the user's next choice, and improve the performance of the recommendation system. performance.
Patent Information
- Application Number
- CN202210611580.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-31
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-05-31
AI Technical Summary
Existing recommendation systems will lose a lot of sequence information when the sequence is very long and cannot recommend accurately. Moreover, the collaborative filtering method cannot capture the user's short-term and long-term hobbies, and cannot recommend items that have never been browsed. The recommendation effect is poor.
A recommendation method based on self-attention based time rating aware context is used to capture the time-rating influence through the self-attention mechanism. It combines the rating context, time context and item information in the user's historical interaction sequence to predict the item the user will choose next, and Recommend according to the preset ranking strategy.
It achieves accurate capture of changes in users' dynamic preferences, improves the accuracy and personalization of recommendations, can accurately predict the items that users will choose next, and improves the overall performance of the recommendation system.
Smart Images

Figure CN114912984B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of recommendation methods, and in particular to a recommendation method and system based on time-scoring-aware context of self-attention. Background Art
[0002] With the rapid development of the Internet and big data technology, the number of users has increased rapidly. Major platforms have provided users with a variety of massive information data. While these massive data provide users with sufficient reference options, they also increase the difficulty for people to find the items they need. However, the emergence of recommendation systems has helped people solve this problem well. It recommends different items to users based on the user's browsing history, allowing people to quickly find the items they need. It can provide users with personalized product recommendations, perform personalized calculations based on user needs and interests, and guide users to actively discover their interests. Today, recommendation systems have achieved good application results in e-commerce and some online platforms.
[0003] However, the performance of existing recommendation systems is not perfect, and there is still a lot of room for optimization in recommendation methods. For example, an existing item recommendation method uses a recommendation method based on Markov chains, which is a context-based sequence recommendation method (that is, combining the user's recent behavior with the user's recent intention, and capturing the user's next intention from the user's recent behavior). It can assume that the next behavior is only related to the previous behavior, and then predict and recommend the next item. However, the Markov chain-based method is heavily dependent on the previous behavior. In the case of a long sequence, a lot of sequence information will be lost, and accurate recommendations cannot be made, and the recommendation effect is poor. There are also recommendation methods based on collaborative filtering. Since collaborative filtering does not consider the order between sequences, it cannot capture users' short-term and long-term preferences, and it cannot recommend items that users have never browsed, and the recommendation effect is also poor.
[0004] Therefore, it is necessary to provide a new recommendation method and system with better recommendation effect and better overall performance. Summary of the invention
[0005] The present invention aims to provide a recommendation method and system based on time-scoring-aware context of self-attention, which can accurately predict the item that the user will select next time based on the user's dynamic changes in preferences, thereby achieving accurate recommendations.
[0006] To achieve the above object, the present invention provides the following solutions:
[0007] Option 1:
[0008] The temporal scoring-aware context-aware recommendation method based on self-attention includes the following steps:
[0009] Step 1: Collect feature data and form an information sequence; the information sequence includes a user historical interaction sequence;
[0010] Step 2: Obtain rating context, time context, and item information from the user's historical interaction sequence and input them into the recommendation model;
[0011] Step 3: The recommendation model uses a self-attention mechanism to capture the time-rating influence; the time-rating influence is the influence of the time context and the rating context on the user's preferences;
[0012] Step 4: The recommendation model obtains several recommended items based on the time-rating impact prediction and ranks the recommended items according to the preset ranking strategy;
[0013] Step 5: Recommend items to users based on their rankings.
[0014] The working principle and advantages of this solution are: using the user's historical interaction sequence to obtain the rating context, time context and item information and other content related to the user's preferences and user intentions, and using the recommendation model to capture the time-rating influence from the above content, that is, capturing the user's preferences, and based on the user's preferences and the user's historical interaction behavior, predicting the item that the user will choose next time, the prediction basis is reliable and sufficient, and can accurately complete the recommendation prediction.
[0015] Most importantly, this solution pays special attention to the rating-related information and time-related information in the user's historical interaction sequence, extracts the rating context and time context, and uses the self-attention mechanism to learn the relationship between the time context, rating context and user preferences to capture the time-rating influence. The time-rating influence reflects the relationship between time, rating and user preferences, that is, it captures the impact of the rating of items in different time periods on the user's next behavior. The key to this setting is that this solution has made a breakthrough discovery of an important point that is overlooked in conventional recommendation solutions - the impact of ratings on predicted items.
[0016] Conventional recommendation schemes often focus on user behavior itself, on the user's selection actions, selection objects and selection frequency, and focus on the appearance of behavior, while ignoring the different feedback of users on items and the dynamic changes of feedback. Specifically, in different time periods, the user's rating of an item may affect the user's choice of the next item. Existing recommendation schemes have not taken this into account. In fact, the rating of the same item has different importance in different time periods. Because the subject of item rating - the user, its behavior changes dynamically, and the same user in different time periods has a dynamic preference for the same item. Feedback is a specific behavior performance, that is, the same user in different time periods may give inconsistent ratings to the same item. The change in the rating indicates that the user has different preferences for the item over time. And this dynamic change in preference is closely related to the user's next behavior and the item the user chooses next time.
[0017] This solution captures this important association. When making item predictions, it considers the rating context, time context, item information and user preferences in association with each other, accurately captures the time-rating influence, accurately confirms the impact of time and rating on user preferences, and then recommends items based on the time-rating influence. The recommendation is combined with the dynamic changes in user preferences, allowing this solution to accurately predict the user's next choice of item, thereby achieving accurate recommendations.
[0018] Further, in step 1, the user historical interaction sequence includes the user's item sequence, a time sequence corresponding to the items in the user's item sequence, and a rating sequence corresponding to the items in the user's item sequence.
[0019] The user's historical interaction sequence contains sufficient user behavior information, including item sequence, time series and rating sequence, which can provide sufficient recommendation analysis basis for the recommendation model and ensure that the recommendation model can operate effectively.
[0020] Furthermore, in step 2, when obtaining the temporal context, a gated recurrent unit is used to capture the impact of the time series on the user behavior and form the temporal context.
[0021] The gated recurrent unit, or GRU, is a commonly used gated recurrent neural network that is often used to solve problems such as long-term memory and gradients in back propagation. It can better capture dependencies with large intervals in time series data.
[0022] This scheme is set up in this way, using gated recurrent units to process time series, which can better capture the impact of time series hidden in the time series on user behavior, and then determine the impact of time factors on user preferences, which is helpful for subsequent accurate prediction of items.
[0023] Furthermore, when the gated recurrent unit captures the impact of the time series on the user behavior, it captures it based on the time series, the item sequence and the user information; wherein the user information is input into the hidden layer of the gated recurrent unit, and the time series and the item sequence are integrated into the main network structure of the gated recurrent unit.
[0024] In this solution, user information is also input into the gate recurrent unit, because this solution finds that among various user behaviors, for different users, even if the time series and item series they show are the same, their deeper action logic and selection logic are different. However, this problem is not found in conventional solutions, so that when processing time context, conventional solutions often only focus on the time series and item series themselves, but not on the action logic under the appearance, resulting in poor correspondence between the subsequent recommended content and different users, and poor recommendation accuracy. However, this solution is set up in this way, which can further distinguish user behaviors with the same item series and time series. When capturing the impact of the time series on user behavior, the captured impact is more targeted, and the subsequent recommended content is more corresponding and accurate.
[0025] Furthermore, the recommendation model is a SATSA model; the recommendation model includes a self-attention layer, a residual connection layer and a normalization layer arranged in sequence.
[0026] The SATSA model is the abbreviation of the recommendation model designed in this solution, and is a special term defined in this solution. The setting of the self-attention layer is used to capture the time-score influence through the self-attention mechanism; the setting of the residual connection layer can better process the time-score influence captured by the self-attention mechanism, and then obtain the preliminary embedding information of the recommended items, and the setting of the residual connection layer can effectively improve the neural network representation ability of the recommendation model and improve the overall performance of the model; the setting of the standardization layer can further enhance the ability of the recommendation model and accelerate the neural network training in the model.
[0027] Furthermore, the recommendation model also includes a point-by-point feedforward neural network; a GELU function is provided in the point-by-point feedforward neural network.
[0028] Point-by-point feedforward neural network is a type of feedforward neural network (FNN). Feedforward neural network adopts a unidirectional multi-layer structure, in which each layer contains several neurons. In this kind of neural network, each neuron can receive the signal of the previous layer of neurons and generate output to the next layer.
[0029] This solution adopts a point-by-point feedforward neural network with a GELU function, which can give the recommendation model nonlinearity, making it a nonlinear model and enabling the recommendation model to take into account the interactions between different potential dimensions. The recommendation model has stronger analytical capabilities and better overall performance, thereby achieving better recommendation effects.
[0030] Furthermore, the recommendation model is trained using dropout.
[0031] Dropout refers to temporarily discarding neural network units from the network with a certain probability during the training process of the deep learning network. Dropout is often used to solve the overfitting problem of neural networks. This solution uses the dropout training model to effectively solve the overfitting problem of the recommendation model, and the recommendation model has better performance and better recommendation effect.
[0032] Furthermore, the recommendation model also includes a prediction layer; the prediction layer is used to predict the item that the user will select next time and rank the items according to a preset ranking strategy; the items described in step 4 and step 5 are the items that the prediction layer predicts the user will select next time; the preset ranking strategy is to arrange the items from high to low according to the time-score influence size.
[0033] The prediction layer predicts the item that the user will select next time as the recommended item, and ranks it according to the time-score influence for easy recommendation. With this setting, the recommended items are positively correlated with the user's preferences and the recommendation accuracy is high.
[0034] Furthermore, the recommendation model also includes a loss function; the loss function is a binary cross entropy loss function; and the recommendation model is optimized using an Adam optimizer, and the loss function is an objective function of the Adam optimizer.
[0035] The loss function is often used to express the degree of difference between the prediction and the actual data. In this scheme, the binary cross entropy loss function is set to help measure the quality of the model prediction. At the same time, the Adam optimizer is used to optimize the recommendation model. The Adam optimizer can effectively optimize the parameters of the loss function to reach the most appropriate value, that is, to minimize the loss function and make the model achieve the best prediction effect.
[0036] Option 2:
[0037] A recommendation system based on time-scoring-aware context based on self-attention, used for the recommendation method based on time-scoring-aware context based on self-attention as described in Scheme 1, comprising: an acquisition module, an input module and a recommendation module; the acquisition module is used to acquire feature data and form an information sequence; the input module is used to obtain scoring context, time context and item information and input them into the recommendation module; a recommendation model is provided in the recommendation module, and the recommendation model is used to capture the time-scoring influence; the time-scoring influence is the influence of time context and scoring context on user preferences; the recommendation model also predicts recommended items based on the time-scoring influence and ranks the recommended items, and recommends items to users according to the ranking.
[0038] The effect and advantage of this solution are: each module cooperates with each other, and the recommendation model confirms the time-score influence and predicts the ranking based on the time-score influence. When predicting, it can use the time-score influence, combine the relationship between time, score and user preferences, and combine the dynamic changes in user preferences to accurately predict the user's next choice of items, thereby achieving accurate recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A method flow diagram of an embodiment of a recommendation method and system for time-scoring-aware context based on self-attention of the present invention;
[0040] Figure 2 A schematic diagram of a temporal context module of an embodiment of a recommendation method and system for temporal scoring-aware context based on self-attention of the present invention;
[0041] Figure 3 A schematic diagram of a recommendation model of an embodiment of a recommendation method and system based on self-attention time-scoring-aware context. DETAILED DESCRIPTION
[0042] The following is a further detailed description through specific implementation methods:
[0043] The embodiment is basically as shown in the attached Figure 1 As shown:
[0044] The temporal scoring-aware context-aware recommendation method based on self-attention includes the following steps:
[0045] Step 1: Collect feature data and form an information sequence; the information sequence includes a user historical interaction sequence;
[0046] The feature data includes user information, item information, time information, rating information, etc., and can be obtained based on the historical interaction information between the user and the item, including the user's behavior on the item, the frequency of the user's behavior on the item, the time and time interval of the user's behavior on the item, the user's rating of the item, etc. In addition, the user information in this embodiment refers to the user ID information. The user's historical interaction sequence includes the user's item sequence, the time sequence corresponding to the items in the user's item sequence, and the rating sequence corresponding to the items in the user's item sequence.
[0047] For ease of description and understanding, in this embodiment, U, I, S, and T are used to represent the collection of user information, item information, rating information, and time information, respectively.
[0048] For user u, u∈U; adopt Represents the time series corresponding to the items in the user's item sequence, using represents the user's item sequence, Represents the rating sequence corresponding to the items in the user's item sequence. In addition, in order to facilitate the smooth input of the above sequence data into the recommendation model, the sequence data needs to be converted into an embedded representation. Specifically, in the process of embedding representation, a fixed input length is defined as m. If the length of the user's item sequence is less than m, a padding item 0 is added to the left of the item sequence. If the length of the user's item sequence is greater than m, the nearest m items in the item sequence are selected as the input of the recommendation model. The resulting embedding layer is as follows:
[0049]
[0050]
[0051]
[0052]
[0053] in represents the embedding of the time series corresponding to the items in the item sequence of user u, represents the embedding of the item sequence of user u, represents the embedding of user u, represents the embedding of the rating sequence corresponding to the items in the item sequence of user u.
[0054] Step 2: Obtain rating context, time context, and item information from the user's historical interaction sequence and input them into the recommendation model.
[0055] When obtaining the time context, a gated recurrent unit is used to capture the influence of the time series on the user behavior and form the time context. When the gated recurrent unit captures the influence of the time series on the user behavior, it is captured based on the time series, the item series and the user information; wherein, the user information is input into the hidden layer of the gated recurrent unit, and the time series and the item series are integrated into the main network structure of the gated recurrent unit. In this way, the user information is also taken into consideration in the time context, so as to make differentiated recommendations for different users, so that the subsequent recommended content is more targeted and accurate, because for different users, even if the item series and the time series are the same, their deeper interaction logic is different, and the final recommendations should also be different. In addition, compared with the conventional recurrent neural network, the conventional network often does not input the user information into the network when capturing the influence of the time series on the user, because the conventional scheme arbitrarily believes that the user information is not related to the above influence, but in fact, there is a special correlation between the two, and the user information can help the network better point the captured influence to each user itself, so the setting of this scheme can more accurately capture the influence of time information on the user's own hobbies.
[0056] Specifically, as attached Figure 2 As shown, when obtaining the time context, the time context module is used to obtain it. The time context module establishes a gated recurrent network through a gated recurrent unit to capture the impact of time series on user behavior.
[0057] The following are the initial values of the input layer and hidden layer of the input gated recurrent unit, where the time series and item sequence are input to the input layer, and the user information is input to the hidden layer:
[0058]
[0059]
[0060] in represents the time embedding vector of the user at time t, Represents the embedding representation of the item at time t. Furthermore, a temporal context can be obtained through the gated recurrent network (GRU)
[0061]
[0062] in, It is the time context that contains user information and item time information.
[0063] When obtaining the scoring context, the embedding information of the scoring sequence is fused with the embedding information of the item sequence to obtain the scoring context. Specifically,
[0064]
[0065] in, It represents the scoring context that combines the embedding information of the rating sequence and the embedding information of the item sequence, that is, the scoring context that combines the item information in the user's historical interaction sequence and the corresponding rating information of the items in the user's historical interaction sequence.
[0066] When obtaining item information, the item information is obtained from the embedded information of the item sequence.
[0067] Step 3: The recommendation model uses a self-attention mechanism to capture the time-rating influence; the time-rating influence is the influence of time context and rating context on user preferences.
[0068] The recommendation model is a SATSA model; the recommendation model includes a self-attention layer, a residual connection layer, a normalization layer, a point-by-point feedforward neural network and a prediction layer arranged in sequence. The self-attention layer of the SATSA model uses a self-attention mechanism to capture the influence of time and rating on user preferences, that is, to capture the time-rating influence. The time-rating influence is also the pre-embedded information for predicting the item that the user will select next time, that is, the recommended item.
[0069] Specifically, as attached Figure 3 As shown, the self-attention layer of the SATSA model is defined as follows:
[0070]
[0071] Among them, Q represents the rating context, K represents the time context, and V represents the item information.
[0072] The time-rating influence information captured by the self-attention layer, i.e., the pre-embedded information of the recommended items, is as follows:
[0073]
[0074] Where Z u ∈R m×d .
[0075] Furthermore, the residual connection layer performs a residual connection on the score context information and the information captured by the self-attention mechanism, i.e., the time-score influence information obtained in formula (1). The operation is defined as follows:
[0076]
[0077] Furthermore, the normalization layer is used to obtain Z from the residual connection above. uThe information is further processed. In order to enhance the model's capabilities and accelerate neural network training, the statistics used in the normalization layer are independent of other samples in the same batch. The specific operations are defined as follows:
[0078] Z u =LayerNorm(Z u )…………(2)
[0079] Where LayerNorm(x) is defined as follows:
[0080]
[0081] where ⊙ is the element-wise product, μ and σ are the mean and variance of x, and α and β are the scaling factor and bias term, respectively.
[0082] Furthermore, we use a point-by-point feedforward neural network to solve Z in (2) u Processed again, and the GELU function is set in the point-by-point feedforward neural network. Because, although the self-attention layer can aggregate the time context and the scoring context with adaptive weights, the model formed only based on the self-attention layer is a linear model, and the data obtained is not good. The use of the GELU function can recommend giving the model nonlinearity and considering the interaction between different potential dimensions, so that the model performance is better and the information obtained is more reliable. At the same time, dropout is used to train the SATSA model, specifically:
[0083] FFN(Z u )=Dropout(GELU(Z u )).
[0084] Furthermore, the SATSA model stacks the self-attention layer to obtain the embedding information of the recommended items:
[0085]
[0086] The Z obtained here u Represents the embedded information of the item selected by user u next time.
[0087] The prediction layer is used to predict the next item selected by the user and rank the items according to the preset ranking strategy; the items mentioned in step 4 and step 5 are the items predicted by the prediction layer to be selected by the user next time; the preset ranking strategy is to rank the items from high to low according to the time-score influence. Specifically, the prediction layer uses the following calculation method to rank the items:
[0088]
[0089] in is the embedding of item i.
[0090] Finally, the prediction layer obtains the rankings of the m items and recommends the top-ranked items to user u.
[0091] The recommendation model also includes a loss function; the loss function is a binary cross entropy loss function; and the recommendation model is optimized using an Adam optimizer, and the loss function is an objective function of the Adam optimizer.
[0092] Specifically, the loss function and Adam optimizer are used to train the SATSA model. When training the SATSA model, the input item sequence is: Fixed length is The output of this scheme is expected to be:
[0093]
[0094] in <pad>Indicates a filling item. t Indicates the expected output.
[0095] Specifically, binary cross entropy loss is used as the objective function of the Adam optimizer:
[0096]
[0097] For the filled items, we choose to ignore their losses. Then we train the final SATSA model, which achieves the best prediction effect.
[0098] Step 4: The recommendation model obtains several recommended items based on the time-rating impact prediction, and ranks the recommended items according to the preset ranking strategy. Specifically, the ranking of m items is obtained by the prediction layer of the recommendation model.
[0099] Step 5: Recommend items to users based on their rankings.
[0100] Specifically, the recommendation model recommends the top-ranked items among the m items to user u. The top-ranked items are the top 20% items. With this setting, the number of recommended items is relatively large, providing more choices for the user. Preferably, the top-ranked items can also be set to the top 8% items. With this setting, although the number of recommended items is relatively small, the recommended items are all selected items, giving the user a better experience.
[0101] The present embodiment also provides a recommendation system based on time-scoring-aware context of self-attention, which is used for the recommendation method based on time-scoring-aware context of self-attention as mentioned above, including: an acquisition module, an input module and a recommendation module; the acquisition module is used to collect feature data and form an information sequence; the input module is used to obtain scoring context, time context and item information and input them into the recommendation module; a recommendation model is provided in the recommendation module, and the recommendation model is used to capture the time-scoring influence; the time-scoring influence is the influence of time context and scoring context on user preferences; the recommendation model also predicts recommended items based on the time-scoring influence and ranks the recommended items, and recommends items to users according to the ranking.
[0102] The recommendation method and system based on the time-rating-aware context of self-attention provided in this embodiment can accurately predict the item that the user will select next time in combination with the dynamic changes in the user's hobbies, thereby achieving accurate recommendations. In this solution, a time context module is established, and the user information, item sequence and time series are modeled using gated recurrent neural units to obtain the time context, through which the dynamic changes in the user's hobbies over time can be known. In addition, the scoring context is obtained by fusing the item sequence and the scoring sequence, and the self-attention mechanism is used to learn and capture the impact of time and scoring on the user's hobbies, thereby accurately knowing the dynamic changes in the user's hobbies. Accurate recommendations are then made based on multiple factors such as time, scoring, item information, and changes in user hobbies. This solution specifically takes into account the impact of scores in different time periods on predicted items, and the prediction of user hobbies is more accurate, and the recommendations made are more effective.
[0103] In addition, the SATSA model is specially designed in this solution. The settings of the model structure such as self-attention layer, residual connection, normalization layer, point-by-point feedforward neural network, etc. make the model have better overall performance in capturing time-rating influence and item prediction, and have better recommendation performance.
[0104] In order to prove the effectiveness and high performance of the SATSA model in this solution, this embodiment also uses the indicator hit rate as a comparison standard to evaluate and compare the SATSA model and other existing recommendation models or recommendation methods. Specifically, the indicator hit rates include: Hit@10 and NDCG@10. Among them, Hit@10 calculates the ratio of basic fact items in the top 10 items; NDCG@10 takes into account the position and assigns higher weights to higher positions. For each user, m-1 negative items are randomly sampled, and these items are ranked with basic fact items, and Hit@10 and NDCG@10 are calculated based on the rankings of these m items.
[0105] The existing models involved in the comparison include: BPR model: Bayesian ranking is a personalized ranking that is often used as a matrix factorization recommender. GRURec algorithm: It uses RNNs to model user action sequences for session-based recommendations. An algorithm that regards each user's feedback sequence as a session for recommendation. Caser algorithm: A convolution-based algorithm that aims to capture users' general preferences and sequential patterns. SASRec model: A sequential recommendation model based on self-attention mechanism. MARank recommendation method: This method considers recent items and applies multi-order attention to capture item relevance at the single and joint levels. HGN model: A sequence model that contains feature selection and instance selection modules and is combined with Bayesian personalized ranking (BPR) to capture long-term and short-term user interests. TiSASRec model: A recently proposed advanced model, this model mainly considers sequential recommendation with self-attention for time interval modeling.
[0106] When comparing, all models and algorithms used exactly the same dataset and experimental parameter settings. The datasets used were public datasets, as shown in Appendix 1, including: Movies-1M dataset, which contains 1 million user-rated movie records; Amazon dataset, only Amazon-movies and Amazon-CDs datasets are used here. These three datasets all include user ratings and timestamps, and filter out cold start users and users with less than 3 interaction sequences in the dataset. When calculating the time interval between adjacent items, this scheme sets a maximum time interval value. If the time interval between adjacent items in the user interaction sequence is greater than the set time interval value, then the time interval between adjacent items is set to a fixed value. The maximum time interval value set in the three datasets is 2048. For each user, the latest item in the interaction record is used for testing, the second to last item is used for verification, and the remaining items are used for training.
[0107] All datasets use a learning rate of 0.001 and the same number of training times. The number of self-attention heads and self-attention layers are set to 1, the dropout value is 0.2, and m and d are set to 50; the m value is selected from [10,20,30,40,50], and the potential dimension d is selected from [10,20,30,40,50], and different values are compared. If all indicators are lower than the previous evaluation indicators, the training is terminated. The maximum number of training times is 200.
[0108] The hit rates (Hit@10 and NDCG@10) of the indicators corresponding to each model obtained by the final comparison are shown in Appendix 2. It can be clearly seen that the SATSA model provided by this solution has obvious advantages in different data sets, better performance and higher hit rate compared with other recommended models or algorithms.
[0109] Schedule 1
[0110] Dataset Users Items Ratings Movies-1M 6040 3416 999611 Amazon-Movies 40928 37564 1163413 Amazon-CDs 26875 42779 770188
[0111] Schedule 2
[0112]
[0113]
[0114] The above is only an embodiment of the present invention. The common sense such as the known specific structure and characteristics in the scheme is not described in detail here. The ordinary technicians in the relevant field know all the common technical knowledge in the technical field of the invention before the application date or priority date, can obtain all the existing technologies in the field, and have the ability to apply the conventional experimental means before that date. The ordinary technicians in the relevant field can improve and implement this scheme in combination with their own abilities under the enlightenment given by this application. Some typical known structures or known methods should not become obstacles for ordinary technicians in the relevant field to implement this application. It should be pointed out that for those skilled in the art, without departing from the structure of the present invention, several deformations and improvements can be made, which should also be regarded as the protection scope of the present invention, which will not affect the effect of the implementation of the present invention and the practicality of the patent. The protection scope required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to interpret the content of the claims.< / pad>
Claims
1. A temporal scoring-aware context-based recommendation method based on self-attention, characterized in that: The following steps are involved: Step 1: Collect feature data and form an information sequence; the information sequence includes a user historical interaction sequence; Step 2: Obtain rating context, time context, and item information from the user's historical interaction sequence and input them into the recommendation model; Step 3: The recommendation model uses a self-attention mechanism to capture the time-rating influence; the time-rating influence is the influence of the time context and the rating context on the user's preferences; The recommendation model includes a self-attention layer, a residual connection layer, a normalization layer, a point-by-point feedforward neural network and a prediction layer arranged in sequence; the self-attention layer uses a self-attention mechanism to capture the time-score influence; the residual connection layer performs a residual connection on the score context information and the time-score influence information captured by the self-attention mechanism; The standardization layer further processes the information obtained by the residual connection, and then uses a point-by-point feedforward neural network to process the information processed by the standardization layer again, and a GELU function is provided in the point-by-point feedforward neural network; At the same time, dropout is used to train the recommendation model; the recommendation model stacks the self-attention layer to obtain the embedding information of the recommended items; Step 4: The recommendation model obtains several recommended items based on the time-rating impact prediction and ranks the recommended items according to the preset ranking strategy; Step 5: Recommend items to users based on their rankings.
2. The time-scoring context-aware recommendation method based on self-attention according to claim 1, characterized in that: In step 1, the user historical interaction sequence includes the user's item sequence, a time sequence corresponding to the items in the user's item sequence, and a rating sequence corresponding to the items in the user's item sequence.
3. The time-scoring context-aware recommendation method based on self-attention according to claim 2, characterized in that: In step 2, when obtaining the temporal context, a gated recurrent unit is used to capture the impact of the time series on the user behavior and form the temporal context.
4. The time-scoring context-aware recommendation method based on self-attention according to claim 3, characterized in that: When the gated recurrent unit captures the impact of the time series on the user behavior, it captures it based on the time series, the item sequence and the user information; wherein the user information is input into the hidden layer of the gated recurrent unit, and the time series and the item sequence are integrated into the main network structure of the gated recurrent unit.
5. The time-scoring context-aware recommendation method based on self-attention according to claim 1, characterized in that: The prediction layer is used to predict the item that the user will select next time and rank the items according to a preset ranking strategy; The items described in step 4 and step 5 are the items that the prediction layer predicts the user will select next time; the preset ranking strategy is to arrange the items from high to low according to the time-score influence size.
6. The time-scoring context-aware recommendation method based on self-attention according to claim 5, characterized in that: The recommendation model also includes a loss function; the loss function is a binary cross entropy loss function; and the recommendation model is optimized using an Adam optimizer, and the loss function is an objective function of the Adam optimizer.
7. A temporal scoring context-aware recommendation system based on self-attention, characterized in that A self-attention-based time-scoring-aware context recommendation method as described in any one of claims 1 to 6, comprising: an acquisition module, an input module and a recommendation module; the acquisition module is used to acquire feature data and form an information sequence; the input module is used to obtain scoring context, time context and item information and input them into the recommendation module; a recommendation model is provided in the recommendation module, and the recommendation model is used to capture the time-scoring influence; the time-scoring influence is the influence of the time context and the scoring context on the user's preferences; the recommendation model also predicts recommended items based on the time-scoring influence and ranks the recommended items, and recommends items to the user according to the ranking.
