Dynamic preference perception online course recommendation method based on Hawkes process and TimeXer mechanism
By combining the Hawkes process with the TimeXer mechanism, and using the BERT model and spherical Gaussian model to process user interaction data, the data sparsity and cold start problems in online course recommendations are solved, and accurate capture of users' dynamic preferences and personalized recommendations are achieved.
Patent Information
- Application Number
- CN202510943039.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-09
- Publication Date
- 2025-10-17
Smart Images

Figure CN120807237A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to a data processing method, in particular to a dynamic preference perception online course recommendation method based on Hawkes process and TimeXer mechanism, and belongs to the technical field of course recommendation. The method is applied to the online education scene and is an online course recommendation method capable of perceiving user dynamic preferences and effectively processing data sparsity and cold start problems. BACKGROUND
[0002] The popularity of online education platforms has led to a sharp increase in course resources, and users face information overload. Online course recommendation systems aim to provide personalized recommendation services by analyzing user behavior and course characteristics. However, existing recommendation algorithms still face many challenges.
[0003] First, users' learning interests and preferences are not static and will change dynamically over time, knowledge background, and external factors. Traditional recommendation algorithms (such as collaborative filtering and matrix factorization) mostly assume that user preferences are static, ignoring the "self-activation" behavior of users in the learning process due to the acquisition of new knowledge or the influence of others, making it difficult to capture the dynamic evolution of preferences and affecting the recommendation effect. Second, there is a common data sparsity and cold start problem in online recommendation systems. New users or new courses lack historical interaction data, making it difficult for algorithms to accurately model their characteristics and preferences. Traditional methods lack robustness in handling such problems, resulting in poor recommendation results and reducing user experience. In addition, traditional text feature representation methods such as TF-IDF, Word2Vec, Doc2Vec, etc. have limitations. These methods produce vectors that are usually high-dimensional and sparse, with low storage efficiency and difficulty in capturing deep semantic relationships. At the same time, they have limited ability to handle complex semantic relationships such as polysemy of words, subtle differences in context, etc., which is crucial for accurately understanding user preferences and course content.
[0004] Although there have been studies applying deep learning techniques such as CNN, RNN, LSTM, BERT, etc. to recommendation systems and achieving certain results, existing models still rarely effectively address the three core problems of user preference dynamics, data sparsity / cold start, and limitations of traditional embedding techniques. Therefore, there is an urgent need in the market to develop an online course recommendation method that can accurately capture user dynamic preferences, effectively address sparse and cold start scenarios, and utilize advanced representation learning techniques.
[0005] Related patent documents: CN118379117A discloses an online course recommendation method and system based on big data, which includes data collection, tensor processing, construction of online course recommendation model, online course recommendation model parameter search and real-time online course recommendation. Specifically, it refers to an online course recommendation method and system based on big data. The scheme uses singular value decomposition for tensor reconstruction, introduces a multi-head attention mechanism, uses residual connection and layer normalization technology to optimize the calculation process of the course latent embedding matrix, designs a total loss function based on reconstruction loss and prediction loss, and improves the efficiency and recommendation accuracy of the model. Through priority update design, a dynamic selection search strategy is designed, different strategies are used in different stages, and three strategies of spiral search, neighborhood search and adaptive walking search are designed to meet the needs of global search, local search and balance between global and local search, increasing the flexibility and randomness of the search. CN110990691A discloses an online course recommendation method and device and computer storage medium, which is used to recommend suitable learning courses to users when they select courses. According to the similarity between the to-be-recommended object and each historical object that has participated in learning, historical objects with a similarity greater than a set threshold value are grouped into a plurality of reference object sets. For any one reference object set, a course that matches the current learning state information of the to-be-recommended object is selected from the learning path of each historical object in the reference object set. The course that appears most frequently in the selected courses is taken as a candidate course corresponding to the reference object set. The target course to be recommended to the to-be-recommended object is determined from the candidate courses corresponding to each reference object set, and the determined target course is recommended to the to-be-recommended object, so that suitable learning courses can be recommended to users. CN118152656A discloses an online course recommendation method and system based on a large language model. First, the user portrait information and course learning information of each user are obtained, and an online learning platform dataset is constructed. Courses not selected by the user are obtained and a course information candidate dataset is constructed. Then, the user portrait information and course learning information are integrated. An input instruction for recommending appropriate courses to students is preset, and the user portrait information structured data and course learning information slice data are used to construct training data. The user portrait information of the to-be-recommended course user and the course learning information of the to-be-recommended course user selected at the historical timestamp are input into the trained course recommendation model, and the course learning information prediction data of the to-be-recommended course user at the future timestamp is predicted by the course recommendation model, realizing online course recommendation.
[0006] The above technologies do not solve the problem of accurately capturing the dynamic evolution process of user learning preferences and effectively alleviating the data sparsity and cold start problem in online course recommendation. SUMMARY
[0007] The application aims to provide a dynamic preference perception online course recommendation method based on a Hawkes process and a TimeXer mechanism, which can accurately capture the dynamic evolution process of user learning preferences, effectively alleviate the data sparsity and cold start problems in online course recommendation, improve the semantic understanding ability of user and course information, and ultimately improve the accuracy of the recommendation system.
[0008] To solve the above technical problems, the technical scheme adopted by the application is as follows: A dynamic preference perception online course recommendation method based on a Hawkes process and a TimeXer mechanism, the technical scheme of which comprises the following steps: S1: obtaining user data and course data, wherein the user data includes user attributes and user historical interaction sequences, and the course data includes course attributes.
[0009] S2: semantic embedding generation, using a pre-trained BERT (Bidirectional Encoder Representations from Transformers) language model to process the user data and course data to generate user embedding vectors and course embedding vectors, wherein the embedding vectors can represent the context semantic information of users and courses; specifically, using a pre-trained BERT language model to encode the text information of user attributes and course attributes to generate user initial embedding vectors and course initial embedding vectors that can reflect the context semantics. The BERT model has strong context and logical relationship understanding ability through its MLM and NSP pre-training tasks.
[0010] S3: forming a cold start and sparsity processing layer, applying a spherical Gaussian model to project the user embedding vectors and course embedding vectors generated in step S2 onto a unit hypersphere space, and using the spherical Gaussian model to process the embedding vectors to effectively measure the similarity between vectors through spherical distance, i.e. using spherical distance to measure similarity, so as to use spherical distance as a similarity measurement means to alleviate the data sparsity and cold start problems.
[0011] S4: Construct a user dynamic preference model that integrates a Hawkes process and a TimeXer attention mechanism, wherein the Hawkes process is used to analyze the self-excitation characteristics in the user historical interaction sequence, has a calculation of the event occurrence intensity, i.e. the conditional intensity function, to capture the self-excitation characteristics, and the TimeXer attention mechanism combines the event occurrence intensity information or derived weights calculated by the Hawkes process, and integrates the calculation process of the TimeXer attention mechanism (for example, adjusts the Query-Key dot product calculation), i.e. the event occurrence intensity information adjusts the TimeXer attention mechanism, to generate a weighted user representation vector that can dynamically reflect the current preference of the user.
[0012] According to the similarity between the weighted user representation and the projected course embedding vector, a recommendation score is calculated to generate a personalized online course recommendation result. The present application accurately captures the dynamic preference of the user and effectively handles the sparse cold start problem, thereby improving the accuracy and personalization level of online course recommendation.
[0013] S5: According to the similarity between the weighted user representation of the target user and the projected course embedding vector, a recommendation score is calculated, and a personalized online course recommendation result is generated. This step generates a recommendation list, calculates the similarity (based on spherical distance) between the weighted dynamic preference representation vector of the target user (from step S4) and the projected embedding vector of all candidate courses (from step S3). According to the similarity score, the courses are sorted, and the top several courses with the highest scores are selected to form the final personalized recommendation list. Specifically, after obtaining the latest dynamic preference representation vector of the target user (from step S4, which is located on the unit hypersphere) and the projected course vector of all candidate courses to be recommended (from step S3), this step performs final recommendation calculation. The similarity between the user dynamic preference vector and each candidate course embedding vector is calculated. Since the vectors are located on the unit hypersphere, the similarity calculation can use cosine similarity or other measurement methods based on spherical distance. According to the calculated similarity scores, all candidate courses are sorted in descending order. The top N courses with the highest scores are selected to form the final personalized online course recommendation list, which is presented to the target user.
[0014] Among the above technical solutions, a preferred technical solution may be that in step S1, the user attributes include at least the user ID and occupation category, and the course attributes include at least the course ID, course title, course description, course category, course level, and language. The specific operations of this step are as follows: Data Acquisition and Preparation: Collect and process user-related data (including attributes such as user ID and occupation category, as well as historical interactive course sequences and timestamps) and course-related data (including attributes such as course ID, title, description, category, level, and language). Perform necessary data cleaning and preprocessing.
[0015] In step S1, data acquisition and preparation: The implementation of this method begins with data acquisition and preparation. First, user-related data and course-related data of the online learning platform are collected.
[0016] User data: mainly includes the user's unique identifier (User ID), the user's static attribute information, such as the user's occupation category (Job), and the user's dynamic historical interaction sequence. This sequence records the user's past interaction behaviors with the course in detail, and at least includes the interactive course ID, the precise interaction timestamp, and the corresponding rating information. Rating information can be divided into explicit ratings (for example, based on the length of time the user watches the course online, with a rating range of 1-10 points) and implicit ratings (obtained based on behavioral conversions such as user page views). During the data preparation stage, the original rating data can be processed. For example, if both explicit and implicit ratings exist, they can be sorted based on specific weights (such as , ) to obtain a unified user rating ; If there is only one rating, it is used directly.
[0017] Course data: mainly includes the unique identifier of the course (Item ID), and static attribute information describing the course content, such as the course name (Title), detailed course content description (Description), course category (Type, such as tutorial, use case, etc.), course difficulty level (Level, such as beginner, intermediate, advanced, etc.), course language (Language), course upload time (Creation Date), etc.
[0018] After obtaining the raw data, necessary preprocessing is performed, including data cleaning (such as removing outliers and handling missing values), unifying the data format, and standardizing or normalizing the rating data (for example, mapping the implicit rating based on pageview conversion to the same 1-10 point range as the explicit rating).
[0019] In the technical solution, preferably, in step S2, the BERT model is pre-trained by using a Masked Language Model (MLM) and a Next Sentence Prediction (NSP) task to enhance its understanding of the context, dependency and logical relationship between sentences.
[0020] Semantic embedding generation: In order to capture the rich semantics contained in user and course attribute information and overcome the limitations of traditional feature representation methods, this step uses a pre-trained BERT (Bidirectional Encoder Representations from Transformers) language model for feature embedding. The BERT model is based on the Transformer architecture, and through pre-training on a large amount of corpus by using Masked Language Model (MLM) and Next Sentence Prediction (NSP) tasks, it can deeply understand the meaning of words in specific context and the logical relationship between sentences.
[0021] The user attribute text (such as job description) and course attribute text (such as the combination of course name, description, classification, etc.) prepared in step S1 are input into the pre-trained BERT model respectively. The BERT model encodes the input text and outputs a context-aware embedding vector for each input token. By performing a pooling operation (for example, selecting the output vector corresponding to the [CLS] special token, or performing average pooling on all token output vectors) on the vector sequence output by the model, an initial embedding vector (user embedding vector ) of a fixed dimension is generated for each user , and an initial embedding vector (course embedding vector ) is generated for each course. The user embedding vector and course embedding vector capture the deep semantic features of users and courses, laying a foundation for subsequent similarity calculation and preference modeling.
[0022] In the technical solution, preferably, in step S3, the spherical Gaussian model assumes that the feature vectors of users and courses follow a spherical Gaussian prior distribution model with mean 0 and variance This step combines the spherical Gaussian prior assumption (the vector follows a distribution with mean 0 and variance ), which helps to handle data sparsity and cold start scenarios.
[0023] In online recommendation systems, the cold start problem of new users and new courses and the widespread data sparsity are the main obstacles affecting the recommendation effect. In order to effectively alleviate these problems, this step introduces a spherical Gaussian model to process the embedding vector generated in step S2. and the course embedding vector Project (e.g., by L2 norm normalization) onto the unit hypersphere space to obtain the projected user vector and course vector . On the unit hypersphere, the similarity between vectors can be measured by spherical distance (such as the cosine of the angle between the vectors or the correlation function). This representation method allows vectors that are far apart in the original embedding space (possibly due to data sparsity) to have a high similarity on the hypersphere if their directions (representing semantic similarity) are close. In step S3, the formation of the cold start and sparsity processing layer includes: applying a spherical Gaussian model to embed the user embedding vector generated in step S2 and the course embedding vector Projected onto the unit hypersphere space, the projected user vector is obtained and course vector ; The spherical Gaussian model assumes that the feature vectors of users and courses After projection, the mean vector is 0 and the covariance matrix is The multivariate spherical Gaussian prior distribution of , where S is the feature vector set of users or courses, is the d-dimensional feature vector of the i-th user or course after projection, N is the total number of feature vectors, and I is the identity matrix. Furthermore, the spherical distance between the projected vectors is used to measure similarity, addressing data sparsity and cold start issues. Introducing a prior helps regularize the model, preventing overfitting. It also provides a reasonable initial probabilistic representation of users or courses with limited interaction data, based on their attributes, thereby improving cold start recommendation performance.
[0024] In the above technical solution, a preferred technical solution may also be that in step S4, the parameters of the Hawkes process include the baseline intensity , amplitude parameters and attenuation parameters , estimated by the maximum likelihood estimation method. The Hawkes procedure is used to construct the user Historical interaction sequence The self-excitation characteristics of the self-excitation characteristics are characterized by the personalized parameter set { , , } definition, where: Representative User the baseline strength of the inherent learning interest or activity level of the user; representing the user the occurrence time of the i-th interaction event with the course the amplitude parameter of the instantaneous impact of the subsequent interaction after the occurrence of the interaction; representing the decay rate of the historical interaction event impact over time; the parameter set is determined by the maximum likelihood estimation method on the observed user historical interaction sequence wherein, is the likelihood function of the Hawkes process. It represents the probability of observing the event occurrence time under the condition of the given intensity function and the observed time point , is the value of the conditional intensity function of the event at the specific time point , e represents the base of the natural logarithm, represents the total amount of observed time, is the index of the continuous multiplication time, represents the end time of the observation window.
[0025] In step S4, the calculation of the event occurrence intensity, i.e., the conditional intensity function, in the Hawkes process over time is calculated by the Hawkes process to calculate the user the conditional intensity function of the interaction at the time point , . represents the instantaneous rate of the event at the time point under the condition of the given historical information . represents the number of events occurring in the time interval (t, t+h). h defines a small time window of length h immediately after the time point , represents the conditional probability or expectation condition, and E represents the mathematical expectation factor. The conditional intensity function quantifies the possibility of interaction, and the specific mathematical form is: wherein, is the above-mentioned baseline strength defined, is the total impact of the interaction event of all event occurrence times , corresponding courses on the current time point ; the impact is determined by the above-mentioned amplitude parameter defined and a kernel function exponentially decaying over timeco-determination; the kernel function for the defined above decay rate, control the influence over time the speed of forgetting, denotes the current time point and the time difference between the historical event occurrence time .
[0026] the intensity of the Hawkes process contains a baseline intensity and a kernel function triggered by all historical interaction events at the occurrence time of the i-th interaction event decaying over time , for some point processes that consider other factors affecting the event occurrence rate, the conditional intensity function is introduced , where H represents the additional conditional information (given historical information). As a self-exciting process, a typical Hawkes process conditional intensity function defines , the kernel function contains an exponential decay parameter (i.e. decay rate ). The parameter is determined by maximum likelihood estimation to quantify the self-exciting characteristics and timing effects of interaction behavior, where the formula is . In step S4, for constructing the user dynamic preference model, the user preference is dynamically changing, affected by its learning process and external factors, this step constructs a dynamic preference model based on Hawkes process and TimeXer attention mechanism (the overall structure is referred to Figure 3 ) to accurately capture this dynamic nature.
[0027] First, the historical interaction sequence of the user is modeled using the Hawkes process. The user's interaction behavior is considered as a time point process, the counting process N(t) is given by the following formula: , denotes an indicator function or event-related counting, is the occurrence time of the i-th interaction event in the sequence. The core formula of the Hawkes process is defined as: . This function describes the user's likelihood of interacting at time point , and embodies the self-exciting characteristics of interaction behavior (i.e. past interactions will increase the probability of future interactions). The intensity function for the user is composed of two parts: one is the baseline intensity , representing the user's inherent learning interest or activity level; the other is the historical all interaction events (occurrence time , corresponding to the course ) the sum of the influences of the past time points . The influence of each historical interaction is jointly determined by an amplitude parameter (representing the instantaneous boost of learning interest to the subsequent learning interest) and a kernel function exponentially decaying over time (where is the decay parameter controlling the speed of forgetting the influence over time). The set of parameters of the Hawkes process , , reflects the personalized learning pace and interest decay pattern of the user, which can be estimated by maximizing the log-likelihood function of the observed interaction sequence based on the likelihood function defined in equation .
[0028] Secondly, the timing intensity information computed by the Hawkes process is deeply fused with the TimeXer attention mechanism (a Transformer variant adapted for time series data, whose specific structure is shown in Figure 2 ). This fusion occurs in the attention computation layer of the TimeXer model, aiming to leverage the dynamic and self-exciting characteristics of user interactions captured by the Hawkes process to enhance the model's preference perception ability. Specifically, in the self-attention or cross-attention mechanism of TimeXer, the dynamic weight derived from the real-time intensity of the Hawkes process, which can reflect the importance or timeliness of interactions , can be incorporated into the calculation of attention scores. Specifically, after calculating the dot product similarity between the Query (Q) vector and the Key (K) vector , the similarity is multiplied by the dynamic intensity weight , and then normalized by softmax, i.e. , so as to dynamically allocate weights according to the timing intensity of user interactions, so that interactions occurring during the active period of user interest (i.e. when is higher) or recently have a greater contribution to the representation of the current user preference. Finally, the model outputs a weighted user representation vector that accurately reflects the current dynamic preference of the user. Further, in the cross-attention layer of TimeXer, the mutual excitation characteristic of the Hawkes process can be used to explicitly establish the dynamic influence channel of exogenous variables (such as course features ) on endogenous variables (such as user state ). The interaction intensity Across(t) in cross-attention can be modeled as , where is the set of events. a time decay term for event influence, is a decay rate, is the occurrence time of the kth exogenous event. is the representation of the exogenous event occurred at time or its feature vector, is the representation of the endogenous variable at the current time point or its feature vector. The amplitude data (i.e., the amplitude parameter ) and the decay parameter (i.e., the decay rate ) estimated by the Hawkes process are used to adjust the strength of the influence of historical exogenous events on the current endogenous state, and this influence decays exponentially over time. In this way, the user dynamic interaction pattern captured by the Hawkes process is deeply integrated into the TimeXer attention mechanism, and the model can more accurately capture the user's interest preferences over time, and finally output a weighted user representation vector that accurately reflects the user's current dynamic preferences for subsequent course recommendations.
[0029] In the above technical solution, the preferred technical solution can also be that the dynamic preference perception online course recommendation method based on the Hawkes process and TimeXer mechanism further includes a model training step, and the adjustable parameters in the recommendation method are trained using historical user-course interaction data and rating data, and the Early Stopping and ReduceLROnPlateau strategies are used to optimize the training process.
[0030] The following is the training and optimization process of the model: the BERT_HawkesTimeXer model proposed by the present application contains a series of trainable parameters (such as part of the layer parameters of BERT, TimeXer network parameters, and Hawkes process parameters that may need to be fine-tuned, etc.). The training process of the model uses historical user-course interaction data (including interaction sequences, timestamps, ratings, etc.) as supervision information. A suitable loss function (for example, mean square error loss can be used for rating prediction tasks) and optimization algorithm (such as Adam, AdamW, etc.) are used to iteratively update the model parameters.
[0031] In order to improve the efficiency of the training process and the generalization ability of the final model, two commonly used training strategies are adopted: Early Stopping: During the training process, the performance of the model on the independent validation set (e.g., loss function value or RMSE, MAE, etc.) is continuously monitored. When the validation set performance no longer significantly improves or even starts to decline over a certain number of consecutive training epochs, the training process is terminated early to prevent the model from overfitting on the training set.
[0032] ReduceLROnPlateau: Automatically adjust the learning rate of the optimizer based on the changes in the validation set performance. For example, when the validation set performance stagnates (does not improve within a pre-set period), reduce the learning rate by a certain percentage (e.g., multiply by 0.1 or 0.5) to allow the model to search more finely near the optimal solution, which helps to converge to a better local or global optimum.
[0033] Through the above detailed implementation steps and training optimization strategies, the method of the present application can fully utilize the rich information of users and courses, accurately capture the dynamic evolution of user preferences, effectively handle the data sparsity and cold start problem, and ultimately provide high-quality personalized online course recommendations.
[0034] The beneficial effects of the present application are as follows: ① The accuracy of dynamic preference capture is high. By combining the self-excitation characteristics of Hawkes process and the time sequence weighting of TimeXer attention, the dynamic law of user interest evolution over time can be accurately captured. ② The cold start performance is improved, and the sparsity is alleviated. The introduction of the spherical Gaussian model projects the features onto a compact hypersphere manifold, so that even for users or courses with sparse interaction data, effective recommendations can be made through distance measurement, significantly improving the cold start performance. ③ Deep semantic understanding is achieved. Using BERT as an embedding layer, the text description information of users and courses can be fully utilized to capture deep semantic associations and overcome the limitations of traditional word embedding methods. ④ Performance is improved. Compared with traditional methods and deep learning models that do not integrate these mechanisms, the present application performs better in terms of recommendation accuracy (e.g., reduced RMSE, MAE) and personalization, providing a better user experience.
[0035] In summary, the present application provides a dynamic preference-aware online course recommendation method based on Hawkes process and TimeXer mechanism, which can accurately capture the dynamic evolution process of user learning preferences, effectively alleviate the data sparsity and cold start problem in online course recommendation, and improve the semantic understanding ability of user and course information using advanced language models, ultimately improving the accuracy and personalization level of the recommendation system. BRIEF DESCRIPTION OF DRAWINGS
[0036] Figure 1Reference diagram (block diagram) of the dynamic preference perception online course recommendation method based on the Hawkes process and TimeXer mechanism of the present application.
[0037] Figure 2 TimeXer neural network structure diagram.
[0038] Figure 3 Hawkes-TimeXer model structure diagram with dynamic user preference perception proposed by the present application.
[0039] Figure 4 For Figure 3 Enlarged view of A part (obtained by Figure 3 clockwise rotation of A part by 90°).
[0040] Figure 5 BERT_CNNLSTM model network structure diagram used for the comparative experiment. DETAILED DESCRIPTION
[0041] In order to make the purposes, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described clearly and completely below in combination with embodiments. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the present embodiments, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of the present application.
[0042] Embodiment 1: As Figure 1 , Figure 2 , Figure 3 , Figure 4 , Figure 5 indicated, the core model structure of the present application is shown in Figure 2 , Figure 3 , Figure 4 The present application aims to accurately capture the dynamic preference evolution in the online learning behavior of users by combining a deep learning model with a time point process theory, and effectively solve the common sparsity and cold start problems of a recommendation system. The following are the detailed implementation steps of the method of the present application: A dynamic preference perception online course recommendation method based on a Hawkes process and TimeXer mechanism, the technical solution of which is that it includes the following steps: S1: Obtain user data and course data, wherein the user data includes user attributes and user historical interaction sequences, and the course data includes course attributes.
[0043] In step S1, the user attributes at least include user ID and occupation category, and the course attributes at least include course ID, course name, course description, course classification, course level and language.
[0044] The specific operation of this step is as follows: data acquisition and preparation: collect and process user-related data (including user ID, occupation category, and other attributes, as well as historical interaction course sequence and timestamp) and course-related data (including course ID, name, description, classification, level, language, and other attributes). The data is cleaned and preprocessed as necessary.
[0045] In step S1, data acquisition and preparation: the implementation of this method begins with the acquisition and preparation of data. First, collect user-related data and course-related data of the online learning platform.
[0046] User data: mainly includes the user's unique identifier (User ID), the user's static attribute information, such as the user's occupation category (Job), and the user's dynamic historical interaction sequence. This sequence details the user's past interaction behavior with courses, including at least the course ID, the exact interaction timestamp, and the corresponding score information. The score information can be divided into explicit scores (e.g., determined according to the user's online course viewing duration, with a score range of 1-10) and implicit scores (obtained according to user page view volume and other behavior conversions). In the data preparation stage, the original score data can be processed, for example, if there are both explicit and implicit scores, they can be fused according to a certain weight (e.g. , ) to obtain a unified user score; if there is only one type of score, it is directly used.
[0047] Course data: mainly includes the course's unique identifier (Item ID), as well as static attribute information describing the course content, such as the course name (Title), detailed course content description (Description), the course's classification (Type, such as tutorial, use case, etc.), the course's difficulty level (Level, such as beginner, intermediate, advanced, etc.), the course's language (Language), the course's upload time (Creation Date), etc.
[0048] After obtaining the original data, necessary preprocessing is performed, including data cleaning (such as removing outliers, handling missing values), data format unification, and score data standardization or normalization (e.g., mapping implicit scores based on view volume to the same 1-10 score interval as explicit scores).
[0049] S2: semantic embedding generation, the pre-trained BERT (Bidirectional Encoder Representations from Transformers) language model is used to process the user data and course data to generate user embedding vectors and course embedding vectors, which can represent the context semantic information of the user and the course; specifically, the pre-trained BERT language model is used to encode the text information of the user attributes and the course attributes to generate user initial embedding vectors and course initial embedding vectors that can reflect the context semantics. The BERT model has strong context and logical relationship understanding ability through its MLM and NSP pre-training tasks.
[0050] In step S2, the BERT model is pre-trained using the Masked Language Model (MLM) and Next Sentence Prediction (NSP) tasks to enhance its understanding of sentence internal context, dependency relationships, and inter-sentence logical relationships.
[0051] Semantic embedding generation: In order to capture the rich semantics contained in user and course attribute information and overcome the limitations of traditional feature representation methods, this step uses a pre-trained BERT (Bidirectional Encoder Representations from Transformers) language model for feature embedding. The BERT model is based on the Transformer architecture and is pre-trained on a large amount of corpus through Masked Language Model (MLM) and Next Sentence Prediction (NSP) tasks, enabling it to deeply understand the meaning of words in specific context and the logical relationship between sentences.
[0052] The user attribute text (such as job description) and course attribute text (such as the combination of course name, description, classification, etc.) prepared in step S1 are input into the pre-trained BERT model. The BERT model encodes the input text and outputs a context-aware embedding vector for each input token. By performing a pooling operation (e.g., selecting the output vector corresponding to the [CLS] special token or averaging the output vectors of all tokens) on the vector sequence output by the model, a fixed-dimensional (initial) user embedding vector is generated for each user , and a (initial) course embedding vector is generated for each course , and the user embedding vector and course embedding vectors Deep semantic features of users and courses are captured, laying a foundation for subsequent similarity computation and preference modeling.
[0053] S3: Form a cold start and sparsity processing layer, apply a spherical Gaussian model, project the user embedding vectors and course embedding vectors generated in step S2 onto a unit hypersphere space, cope with sparsity and cold start, and process the embedding vectors using the spherical Gaussian model to effectively measure the similarity between vectors by spherical distance, i.e., use spherical distance to measure similarity. In this way, spherical distance is used as a similarity measurement means to alleviate the problems of data sparsity and cold start.
[0054] The spherical Gaussian model in step S3 is a spherical Gaussian prior distribution model assuming that the feature vectors of users and courses are subject to a spherical Gaussian prior distribution with a mean of 0 and a variance of This step, combined with the spherical Gaussian prior assumption (vectors are subject to a distribution with a mean of 0 and a variance of ), helps to deal with data sparsity and cold start scenarios.
[0055] In online recommendation systems, the cold start problem of new users and new courses and the ubiquitous data sparsity are major obstacles affecting recommendation effectiveness. To effectively alleviate these problems, the spherical Gaussian model is introduced in this step to process the embedding vectors generated in step S2. The user embedding vectors and course embedding vectors are projected (e.g., normalized by L2 norm) onto a unit hypersphere space to obtain projected user vectors and course vectors On the unit hypersphere, the similarity between vectors can be measured by spherical distance (such as the cosine value of the vector angle or the correlation function). This representation allows even vectors that are far apart in the original embedding space (possibly due to data sparsity) to exhibit high similarity on the hypersphere if their directions (representing semantic similarity) are close. In step S3, the cold start and sparsity processing layer includes applying a spherical Gaussian model to project the user embedding vectors and course embedding vectors generated in step S2 onto a unit hypersphere space to obtain projected user vectors and course vectors ; wherein the spherical Gaussian model assumes that the feature vectors of users and courses after projection are subject to a multivariate spherical Gaussian prior distribution with a mean of 0 vector and a covariance matrix , i.e. , where S is the set of feature vectors of users or courses, is the d-dimensional feature vector of the i-th user or course after projection, N is the total number of feature vectors, and I is the unit matrix. Moreover, the similarity between the projected vectors is measured by the spherical distance to solve the data sparsity and cold start problems. The introduction of priori helps to regularize the model and prevent overfitting, and provides a reasonable initial representation based on the attributes of the user or course in a probabilistic sense, thereby improving the cold start recommendation effect.
[0056] S4: Construct a user dynamic preference model that integrates a Hawkes process and a TimeXer attention mechanism, wherein the Hawkes process is used to analyze the self-excitation characteristics of the user historical interaction sequence, has a calculation of the event occurrence intensity, i.e. the conditional intensity function, to capture the self-excitation characteristics, and the TimeXer attention mechanism combines the event occurrence intensity information or derived weights calculated by the Hawkes process and integrates the calculation process of the TimeXer attention mechanism (for example, adjusts the Query-Key dot product calculation), i.e. the event occurrence intensity information adjusts the TimeXer attention mechanism, to generate a weighted user representation vector that can dynamically reflect the current preference of the user.
[0057] According to the similarity between the weighted user representation and the course embedding vector after projection, the recommendation score is calculated to generate personalized online course recommendation results. The present application improves the accuracy and personalization level of online course recommendation by accurately capturing the dynamic preference of the user and effectively solving the sparse cold start problem.
[0058] In step S4, the parameters of the Hawkes process include the baseline intensity , the amplitude parameter , and the decay parameter , which are estimated by the maximum likelihood estimation method. The Hawkes process is used to construct the self-excitation characteristics of the user historical interaction sequence , and the characteristics of the self-excitation characteristics are defined by a set of personalized parameters , , , wherein: represents the baseline intensity of the inherent learning interest or activity of the user ; represents the amplitude parameter of the instantaneous influence of the user on the subsequent interaction after interacting with the course at time ; represents the decay rate of the historical interaction event influence over time; and the parameter set is determined by the maximum likelihood estimation method on the observed user historical interaction sequence . is the likelihood function of the Hawkes process. It means that given the intensity function and observation time points Under the condition of The probability of For events at specific times The value of the conditional intensity function that occurs, e represents the base of the natural logarithm, represents the total amount of time observed, is the index of the multiplied time, Indicates the end time of the observation window.
[0059] In step S4, the Hawkes process calculates the event occurrence intensity that changes with time, that is, the conditional intensity function is used to calculate the user At the time point Conditional strength function for interaction , . Indicates that in the given historical information Under the condition that the event occurs at time The instantaneous rate of occurrence. Represents the number of events that occurred in the time interval (t, t+h). h defines a point in time immediately adjacent to The subsequent small time window of length h, The conditional probability or expected condition, E represents the mathematical expectation factor. Conditional intensity function Used to quantify the possibility of interaction, the specific mathematical form is: ,in, For the baseline intensity defined above, The time when all events in history occurred , corresponding courses The interaction event at the current time point The sum of the effects of and a kernel function that decays exponentially over time Jointly determine; In the kernel function, The above-defined decay rate controls the influence over time. The speed of forgetting, Indicates the current time point Time of historical events The time difference between them.
[0060] The intensity of the Hawkes process Include baseline intensity and by historical interaction events at the occurrence time of the i-th interaction event a triggered, time-decaying kernel function For some point processes that take into account other factors affecting the event rate, a conditional intensity function is introduced where H denotes the additional conditional information (given historical information). As a self-exciting process, the conditional intensity function of a typical Hawkes process defines the kernel function contains an exponential decay function (i.e., decay rate) . The parameters are determined by maximum likelihood estimation to quantify the self-exciting nature and timing influence of the interaction behavior, where the formula is In step S4, for constructing the user dynamic preference model, the user preference is dynamically changing, influenced by its learning process and external factors, this step constructs a dynamic preference model based on Hawkes process and TimeXer attention mechanism (the overall structure is referred to Figure 3 , Figure 4 ) to accurately capture this dynamic nature.
[0061] First, the historical interaction sequence of the user is modeled using the Hawkes process. The user's interaction behavior is considered as a time point process, the counting process N(t) is given by the following formula: , denotes an indicator function or event-related counting, is the occurrence time of the i-th interaction event in the sequence. The core formula of the Hawkes process is defined as . This function describes the likelihood of the user interacting at time point and embodies the self-exciting nature of the interaction behavior (i.e., past interactions increase the probability of future interactions). The intensity function for the user is composed of two parts: one is the baseline intensity , representing the user's inherent learning interest or activity level; the other is the sum of the influence of all historical interaction events (occurrence time , corresponding to course ) on subsequent time points . The influence of each historical interaction is represented by an amplitude parameter (which represents the instantaneous boost in learning interest of the subsequent learning course ) and an exponential time-decaying kernel function (where To attenuate the parameters that control the speed at which the influence of an event fades over time) jointly determine. The set of parameters of a Hawkes process { , , } reflect the personalized learning pace and interest decay pattern of a user, and these parameters can be estimated by maximizing the log-likelihood function of the observed interaction sequence, which is defined based on the formula The likelihood function is derived based on the definition.
[0062] Secondly, the timing intensity information calculated by the Hawkes process is deeply fused with the TimeXer attention mechanism (a Transformer variant suitable for time series data, whose specific structure is shown in Figure 2 ). This fusion occurs in the attention calculation layer of the TimeXer model, aiming to leverage the dynamic and self-excitation characteristics of user interactions captured by the Hawkes process to enhance the model's preference perception ability. Specifically, in the self-attention or cross-attention mechanism of TimeXer, the dynamic weight derived from the real-time intensity of the Hawkes process, which can reflect the importance or timeliness of the interaction is incorporated into the calculation of attention scores. Specifically, after calculating the dot product similarity between the Query (Query) vector Q and the Key (Key) vector K, the similarity is multiplied by the dynamic intensity weight , and then normalized by softmax, that is, , so as to dynamically allocate weights according to the timing intensity of user interactions, so that interactions occurring during the active period of user interest (i.e. when the value is higher) or recently have a greater contribution to the representation of the current user preference. Finally, the model outputs a weighted user representation vector that accurately reflects the current dynamic preference of the user. Further, in the cross-attention layer of TimeXer, the mutual excitation characteristics of the Hawkes process can be used to explicitly establish a dynamic influence channel from exogenous variables (such as course features ) to endogenous variables (such as user state ). The interaction intensity Across(t) in cross-attention can be modeled as , where, is the set of events. is the time decay term of event influence, is the decay rate, is the occurrence time of the kth exogenous event. is the representation or feature vector of the exogenous event occurring at time , at the current time point representation of endogenous variables or its eigenvectors. The amplitude data (i.e. amplitude parameters ) and decay parameters (i.e. decay rates ) estimated by Hawkes process are used to adjust the strength of the influence of historical exogenous events on the current endogenous state, and this influence decays exponentially over time. In this way, the user dynamic interaction patterns captured by Hawkes process are deeply integrated into the TimeXer attention mechanism, the model can more accurately capture the user's interest preferences over time, and finally output a weighted user representation vector that accurately reflects the user's current dynamic preferences, which is used for subsequent course recommendation.
[0063] S5: Calculate the recommendation score according to the similarity between the weighted user representation of the target user and the projected course embedding vector, and generate personalized online course recommendation results. This step generates a recommendation list, calculates the similarity (based on spherical distance) between the weighted dynamic preference representation vector of the target user (from step S4) and the projected embedding vector of all candidate courses (from step S3). According to the similarity score, the courses are sorted, and the top several courses with the highest scores are selected to form the final personalized recommendation list. Specifically, after obtaining the latest dynamic preference representation vector of the target user (from step S4, the vector is located on the unit hypersphere) and the projected course vector of all candidate courses to be recommended (from step S3), this step performs final recommendation calculation. Calculate the similarity between the user dynamic preference vector and each candidate course embedding vector. Since the vectors are located on the unit hypersphere, the similarity calculation can use cosine similarity or other measurement methods based on spherical distance. According to the similarity score calculated, all candidate courses are sorted in descending order. Select the top N courses with the highest scores to form the final personalized online course recommendation list and present it to the target user.
[0064] The dynamic preference-aware online course recommendation method based on Hawkes process and TimeXer mechanism also includes a model training step, which uses historical user-course interaction data and rating data to train the adjustable parameters in the recommendation method, and uses Early Stopping and ReduceLROnPlateau strategies to optimize the training process.
[0065] The following is the training and optimization process of the model: the BERT_HawkesTimeXer model proposed in the application contains a series of trainable parameters (such as part of the layer parameters of BERT, TimeXer network parameters, and Hawkes process parameters that may need to be fine-tuned, etc.). The training process of the model uses historical user-course interaction data (including interaction sequences, timestamps, ratings, etc.) as supervision information. A suitable loss function (for example, mean square error loss can be used for rating prediction tasks) and optimization algorithm (such as Adam, AdamW, etc.) are used to iteratively update the model parameters.
[0066] In order to improve the efficiency of the training process and the generalization ability of the final model, two commonly used training strategies are adopted: Early Stopping: During the training process, the performance of the model on the independent validation set (such as loss function value or RMSE, MAE, etc. evaluation indicators) is continuously monitored. When the performance on the validation set no longer improves significantly or even starts to decline for several consecutive training cycles (epochs), the training process is terminated in advance to prevent the model from overfitting on the training set.
[0067] ReduceLROnPlateau: Automatically adjust the learning rate of the optimizer according to the changes in the performance of the validation set. For example, when the performance of the validation set stagnates (does not improve within a predetermined period), reduce the learning rate by a certain percentage (such as multiplying by 0.1 or 0.5) to allow the model to search more finely near the optimal solution, which helps to converge to a better local optimum or global optimum.
[0068] Through the above detailed implementation steps and training optimization strategies, the method of the application can fully utilize the rich information of users and courses, accurately capture the dynamic evolution of user preferences, effectively handle the data sparsity and cold start problem, and ultimately provide high-quality personalized online course recommendations.
[0069] In summary, the application provides a dynamic preference-aware online course recommendation method based on Hawkes process and TimeXer mechanism, which can accurately capture the dynamic evolution process of user learning preferences, effectively alleviate the data sparsity and cold start problem in online course recommendation, improve the semantic understanding ability of user and course information by using advanced language models, and ultimately improve the accuracy and personalization level of the recommendation system.
Claims
1. A dynamic preference-aware online course recommendation method based on Hawkes process and TimeXer mechanism, characterized by: It includes the following steps: S1: Obtain user data and course data, wherein the user data includes user attributes and user historical interaction sequences, and the course data includes course attributes; S2: Semantic embedding generation: using a pre-trained BERT (Bidirectional Encoder Representations from Transformers) language model to process the user data and course data to generate user embedding vectors and course embedding vectors. The embedding vectors can represent the contextual semantic information of the user and the course; S3: Form a cold start and sparsity processing layer, apply the spherical Gaussian model, and project the user embedding vector and course embedding vector generated in step S2 onto the unit hypersphere space. To deal with sparsity and cold start, the spherical Gaussian model is used to process the embedding vector so that the similarity between vectors is measured by spherical distance, that is, the spherical distance is used to measure similarity; S4: Construct a user dynamic preference model that integrates the Hawkes process and the TimeXer attention mechanism. The Hawkes process calculates the event intensity that changes over time, i.e., the conditional intensity function. The TimeXer attention mechanism combines the event intensity information or derived weights calculated by the Hawkes process with the calculation process of the TimeXer attention mechanism. That is, the event intensity information adjusts the TimeXer attention mechanism to generate a weighted user representation vector that can dynamically reflect the user's current preference. S5: Based on the similarity between the weighted user representation of the target user and the projected course embedding vector, the recommendation score is calculated and personalized online course recommendation results are generated.
2. The dynamic preference-aware online course recommendation method based on Hawkes process and TimeXer mechanism according to claim 1 is characterized in that: In step S1, the user attributes include at least user ID and occupation category, and the course attributes include at least course ID, course name, course description, course classification, course level and language.
3. The dynamic preference-aware online course recommendation method based on Hawkes process and TimeXer mechanism according to claim 1 is characterized in that: In step S2, the BERT model is pre-trained using the Masked Language Model (MLM) and Next Sentence Prediction (NSP) tasks.
4. The dynamic preference-aware online course recommendation method based on Hawkes process and TimeXer mechanism according to claim 1 is characterized in that: In step S3, forming the cold start and sparsity processing layer includes: applying the spherical Gaussian model to embed the user vector generated in step S2 and the course embedding vector Projected onto the unit hypersphere space, the projected user vector is obtained and course vector ; The spherical Gaussian model assumes that the feature vectors of users and courses After projection, the mean vector is 0 and the covariance matrix is The multivariate spherical Gaussian prior distribution of , in the formula is a set of feature vectors of users or courses, is the d-dimensional feature vector of the i-th user or course after projection, is the total number of eigenvectors, I is the identity matrix, and the spherical distance between the projected vectors is used to measure the similarity to handle data sparsity and cold start problems.
5. The dynamic preference-aware online course recommendation method based on Hawkes process and TimeXer mechanism according to claim 1 is characterized in that: In step S4, the Hawkes process is used to construct the user Historical interaction sequence The self-excitation characteristics of the self-excitation characteristics are characterized by the personalized parameter set { , , } definition, where: Representative User The baseline strength of the inherent learning interest or activity; Representative User At the time of occurrence of the i-th interaction event With courses After an interaction occurs, the instantaneous impact on subsequent interactions is the amplitude parameter; Represents the decay rate of the impact of historical interaction events over time; the parameter set is obtained by analyzing the observed user historical interaction sequence The maximum likelihood estimation method is used to determine, where is the likelihood function of the Hawkes process, which represents the probability of and observation time points Under the condition of The probability of For events at specific times The value of the conditional intensity function that occurs, e represents the base of the natural logarithm, represents the total amount of time observed, is the index of the multiplied time, Indicates the end time of the observation window.
6. The dynamic preference-aware online course recommendation method based on Hawkes process and TimeXer mechanism according to claim 5 is characterized in that: In step S4, the Hawkes process calculates the event occurrence intensity that changes with time, that is, the conditional intensity function is used to calculate the user At the time point Conditional strength function for interaction , , Indicates that in the given historical information Under the condition that the event occurs at time The instantaneous rate of occurrence, Represents the number of events that occurred in the time interval (t, t+h), where h defines a point in time immediately adjacent to the time point The subsequent time window of length h, Represents the conditional probability or expected condition, E represents the mathematical expectation factor, and the conditional intensity function The mathematical form is: ,in, For the baseline intensity defined above, The time when all events in history occurred , corresponding courses The interaction event at the current time point The sum of the effects of and a kernel function that decays exponentially over time Jointly determine; In the kernel function, The above-defined decay rate controls the influence over time. The speed of forgetting, Indicates the current time point Time of historical events The time difference between them.
7. The dynamic preference-aware online course recommendation method based on Hawkes process and TimeXer mechanism according to claim 1 is characterized in that: It also includes a model training step, which uses historical user-course interaction data and rating data to train the adjustable parameters in the recommendation method, and adopts early stopping and dynamic adjustment of learning rate (ReduceLROnPlateau) strategies to optimize the training process.
Citation Information
Patent Citations
Online course recommendation method and device and computer storage medium
CN110990691A
Online course recommendation method and system based on large language model
CN118152656A
Online course recommendation method and system based on big data
CN118379117A
Cited By
AIGC generation content self-adaption method and system based on user feedback
CN122114191A
An Adaptive Method and System for AIGC-Generated Content Based on User Feedback
CN122114191B