A method and related apparatus for recommending educational course conversations
By combining wavelet transform and attention mechanism, learner interest representations are dynamically fused, which solves the shortcomings of existing educational course conversation recommendation methods in causal modeling and interpretability. It realizes multi-scale dynamic modeling and causal interpretation of learner interests, and improves the accuracy and personalization capabilities of the recommendation system.
Patent Information
- Application Number
- CN202511238688.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-01
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2045-09-01
AI Technical Summary
Existing educational course conversation recommendation methods have shortcomings in causal modeling and interpretability, making it difficult to simultaneously capture global trends and local mutations in learning interests, which affects the model's generalization ability in different educational scenarios.
Wavelet transform is used to separate the course session sequence into low-frequency and high-frequency components. An attention mechanism is used to dynamically fuse these components to generate an internal interest representation of the session. Dynamic preference embedding and counterfactual reasoning are combined to generate a candidate course probability distribution. Self-supervised loss is used to optimize the interest separation and recommendation results.
It enhances the interpretability and generalization ability of educational recommendation systems, enabling them to better capture learners' interest dynamics and provide clear recommendation explanations and personalized suggestions.
Smart Images

Figure CN120894201B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence and recommendation system technology, and in particular to a method and related apparatus for recommending educational course conversations. Background Technology
[0002] With the rapid development of the internet and intelligent education platforms, personalized recommendation systems have become a core technology for improving learning experiences and the efficiency of educational resource utilization in online education, smart campuses, and other scenarios. Educational course conversation recommendation, as an important branch of educational recommendation systems, primarily targets the learner's behavioral sequence within a learning conversation to predict the next course resource that might interest or suit them. Unlike traditional long-term learner modeling methods, course conversation recommendation focuses more on learners' changing interests and adjustments to their learning paths within a short period, making it better suited to real-world educational scenarios such as freshmen, those changing majors, and those with fluctuating interests.
[0003] Existing educational course recommendation methods primarily rely on sequence modeling techniques, such as recurrent neural networks (RNNs), long short-term memory networks (LSTMs), and gated recurrent units (GRUs). These methods can model learners' course learning behavior sequences and capture the temporal dynamics of learning interests. In recent years, attention mechanisms have been introduced into the field of educational recommendation, enhancing the model's ability to perceive key learning behaviors by dynamically assigning weights to the influence of different historical learning behaviors on the current decision. Furthermore, structures such as graph neural networks (GNNs) have been used to mine knowledge associations and prerequisite relationships between courses, further improving recommendation performance. However, these methods still have significant shortcomings in improving the interpretability and generalization ability of educational recommendation systems. On the one hand, most existing models only focus on the learning behavior sequence itself, lacking in-depth modeling of the causal relationships behind learners' behaviors, making it difficult to provide clear explanations for the recommendation results for learners and teachers. On the other hand, traditional sequence modeling and attention mechanisms have limitations in capturing multi-scale changes in learning interests, often failing to simultaneously consider global learning trends and local interest mutations, affecting the model's generalization ability in different educational scenarios.
[0004] Therefore, how to achieve multi-scale, causal modeling of learning interest dynamics and improve the interpretability and generalization ability of educational recommendation systems has become a key issue that urgently needs to be addressed in the field of educational course conversation recommendation. Summary of the Invention
[0005] To achieve multi-scale, causal modeling of learning interest dynamics and improve the interpretability and generalization ability of educational recommendation systems, this application provides an educational course conversation recommendation method and related apparatus.
[0006] Firstly, the educational course conversation recommendation method provided in this application adopts the following technical solution:
[0007] A method for recommending educational course conversations, comprising:
[0008] Obtain input information from the target learner, including the current course session sequence, historical learning behavior sequence, and candidate course set;
[0009] The current course session sequence is separated into low-frequency and high-frequency components by wavelet transform, and the two components are concatenated and dynamically fused through an attention mechanism to generate an internal interest representation of the session.
[0010] Obtain a set of recently interacted courses, extract learner static preference embeddings based on the historical learning behavior sequence, and generate dynamic preference embeddings through an attention mechanism;
[0011] Based on the in-session interest representation and the dynamic preference embedding dynamic fusion, an interest vector is generated, and the probability distribution of candidate courses corresponding to the candidate course set is output.
[0012] Pseudo-labels are generated based on historical behavior sequences and current session sequences, and interest separation is optimized by combining the dynamic fusion weights with binary cross-entropy loss.
[0013] Based on the recent interactive course set and filtering similar session sets according to Jaccard similarity to replace its ISC as the target session ISC in the session's internal interest, a counterfactual recommendation distribution is generated and fused with the recent course scores.
[0014] The model is trained by combining multi-class cross-entropy loss and self-supervised causality loss through the loss function.
[0015] Optionally, the step of performing wavelet transform on the current course session sequence to separate it into low-frequency and high-frequency components, concatenating the two components, and then dynamically fusing them through an attention mechanism to generate an internal interest representation of the session includes:
[0016] The current course session sequence is decomposed into global trend components and local mutation components using discrete wavelet transform;
[0017] An adaptive padding strategy is used to process sequences of arbitrary length.
[0018] The two types of components are dynamically weighted and fused using an attention mechanism;
[0019] Interpolation is used to restore the fused features to the original sequence length and generate an intra-session interest representation.
[0020] Optionally, the generation of the dynamic preference embedding includes:
[0021] Extract a fixed number of recent interactive lessons from historical behavior sequences;
[0022] Learner embedding vectors are used as the basis for attention queries;
[0023] Calculate the attention weights of the embedding vectors for each course and sum them using a weighted average.
[0024] The output is a dynamic preference representation that reflects recent changes in interests.
[0025] Optionally, the step of dynamically fusing the in-session interest representation and the dynamic preference embedding to generate an interest vector and outputting the candidate course probability distribution corresponding to the candidate course set includes:
[0026] The in-session interest representation, the dynamic preference embedding representation, and the features in the candidate course set are concatenated;
[0027] The fusion weights between 0 and 1 are generated using learnable parameters and activation functions;
[0028] The final feature vector is formed by linearly combining the two types of interest representations according to their weights.
[0029] The feature vector is matched with the features of all candidate courses to generate a probability distribution.
[0030] Optionally, the generation of the counterfactual recommendation distribution includes:
[0031] Calculate session similarity based on the overlap of recent interactive courses;
[0032] Select the conversations with the highest similarity as the intervention targets;
[0033] Inject short-term interest representations of the target session into similar sessions;
[0034] The recommendation results from multiple intervention sessions are aggregated to form a counterfactual distribution;
[0035] Apply a recommendation score bonus to recently accessed courses.
[0036] Optionally, the step of applying a recommended score bonus to recently accessed courses includes:
[0037] Identify courses that appear in recent interaction sequences and / or the current session as the target course set;
[0038] Increase the priority of adding a fixed value to the target course set;
[0039] The probability distribution is renormalized to keep the sum of 1.
[0040] Optionally, the step of optimizing interest separation includes:
[0041] If a course exists within a learner's historical behavioral sequence, it is marked as long-term interest-driven.
[0042] If a course exists in the current session sequence, mark it as short-term interest-driven;
[0043] The weights are matched to the label categories by constraining the fusion of binary cross-entropy loss.
[0044] The loss function optimizes both interest separation capability and recommendation accuracy.
[0045] Secondly, this application provides an educational course conversation recommendation device, comprising:
[0046] The information acquisition module is used to acquire the input information of the target learner, including the current course conversation sequence, the historical learning behavior sequence, and the candidate course set;
[0047] The internal interest representation module is used to perform wavelet transform on the current course session sequence to separate it into low-frequency components and high-frequency components, and then dynamically fuse the two components through an attention mechanism to generate the session internal interest representation.
[0048] The dynamic preference embedding module is used to obtain a set of recently interacted courses, extract learner static preference embeddings based on the historical learning behavior sequence, and generate dynamic preference embeddings through an attention mechanism.
[0049] The probability distribution module is used to generate an interest vector by dynamically fusing the in-session interest representation and the dynamic preference embedding, and output the candidate course probability distribution corresponding to the candidate course set.
[0050] The interest separation module is used to generate pseudo-labels based on historical behavior sequences and current session sequences, and optimize interest separation by combining the dynamic fusion weights with binary cross-entropy loss.
[0051] The fusion module is used to generate a counterfactual recommendation distribution based on the recent interactive course set and to filter the similar session set according to Jaccard similarity to replace its ISC as the target session ISC in the session's internal interest, and to fuse it with the recent course scores.
[0052] The training module is used to train the model by combining multi-class cross-entropy loss and self-supervised causal loss through the loss function.
[0053] Thirdly, this application provides a computer device, the device comprising: a memory and a processor, wherein the processor, when executing computer instructions stored in the memory, performs the method described above.
[0054] Fourthly, this application provides a computer-readable storage medium including instructions that, when executed on a computer, cause the computer to perform the method described above.
[0055] In summary, this application achieves the technical effect of improving the interpretability and generalization ability of the educational recommendation system by obtaining the input information of the target learner; performing wavelet transform on the current course session sequence to separate and generate session-internal interest representations; obtaining a set of recently interacted courses and generating dynamic preference embeddings based on historical learning behavior sequences; dynamically fusing the session-internal interest representations and dynamic preference embeddings to generate interest vectors and outputting candidate course probability distributions; generating pseudo-labels based on historical behavior sequences and current session sequences, and optimizing interest separation through binary cross-entropy loss combined with dynamic fusion weights; and generating a counterfactual recommendation distribution and fusing it with recent course scores. Attached Figure Description
[0056] Figure 1 This is a schematic diagram of the computer device structure of the hardware operating environment involved in the embodiments of this application;
[0057] Figure 2 This is a flowchart illustrating the first embodiment of the educational course conversation recommendation method of this application;
[0058] Figure 3 This is a structural block diagram of the first embodiment of the educational course conversation recommendation device of this application. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0060] Reference Figure 1 , Figure 1 This is a schematic diagram of the computer device structure of the hardware operating environment involved in the embodiments of this application.
[0061] like Figure 1As shown, the computer device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.
[0062] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0063] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and an educational course session recommendation program.
[0064] exist Figure 1 In the computer device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in this application can be set in the computer device, and the computer device calls the educational course session recommendation program stored in the memory 1005 through the processor 1001 and executes the educational course session recommendation method provided in the embodiment of this application.
[0065] This application provides a method for recommending educational course conversations, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the educational course conversation recommendation method of this application.
[0066] In this embodiment, the educational course session recommendation method includes the following steps:
[0067] Step S10: Obtain the input information of the target learner, including the current course session sequence, the historical learning behavior sequence, and the candidate course set.
[0068] It is understandable that step S10 is performed as follows:
[0069] The system collects the target learner, the current course session item sequence s, the learner's historical learning behavior sequence h, and the candidate course set V as multi-source input information. It performs unified encoding and index mapping on the input learner, course session sequence, historical learning behavior, and candidate courses to facilitate subsequent feature extraction and model processing. It normalizes or pads the length of the course session sequence and historical learning behavior sequence to ensure that the input data format is consistent and adapts to the batch processing requirements of the neural network model.
[0070] It should be noted that existing technologies have the following main shortcomings in the field of educational course conversation recommendation:
[0071] Insufficient causal modeling and interpretability: Most methods only focus on learning the sequence of behaviors and lack in-depth modeling of the causal relationships behind the behaviors, making the recommendation results difficult to interpret.
[0072] Multi-scale interest dynamic modeling has limitations: traditional sequence models and attention mechanisms struggle to simultaneously capture the global trends and local mutations in learning interests, resulting in limited generalization ability.
[0073] The combination of counterfactual reasoning and multi-scale modeling is insufficient: existing counterfactual recommendation methods mainly focus on causal relationships, neglecting the multi-scale changes in interest dynamics, making it difficult to balance explanatory power and generalization ability.
[0074] The integration of wavelet mechanisms with causal modeling is insufficient: Although wavelet decomposition can improve multi-scale feature modeling, it has not yet been deeply integrated with causal reasoning and other methods in the field of educational recommendation, and systematic research is insufficient.
[0075] Step S20: Perform wavelet transform on the current course session sequence to separate it into low-frequency components and high-frequency components, and then concatenate the two components and dynamically fuse them through an attention mechanism to generate an internal interest representation of the session.
[0076] It's important to note that wavelet transform is a classic signal processing method that decomposes a sequential signal into components of different frequencies (scales), capturing both global trends and local variations. In recent years, some research has attempted to combine wavelet decomposition with deep learning models for time-series data modeling. For example, in time series prediction and speech recognition, wavelet decomposition has been used to improve the model's ability to model multi-scale features. In related fields such as recommender systems, research has also explored combining wavelet decomposition with attention mechanisms to enhance the model's ability to express multi-scale features of sequential data.
[0077] In a specific implementation, step S20 further includes: representing the course session sequence embedding E(c) as a tensor X∈R.B×L×d Where B is the batch size, L is the session sequence length, and d is the embedding dimension, a one-dimensional discrete wavelet transform is performed on X to obtain the low-frequency component cA (reflecting global interest trends) and the high-frequency component cD (reflecting local interest changes):
[0078] cA,cD=DWT(X)
[0079] Here, DWT(X) represents a one-dimensional discrete wavelet transform of the tensor X.
[0080] First, the low-frequency and high-frequency features are concatenated, then input into the attention network to calculate the weights α of the multi-scale features:
[0081] α = sigmoid(W T [cA||cD]+b)
[0082] in, "||" represents the join operation, W represents the learnable weight matrix, and b represents the learnable bias term.
[0083] By fusing multi-scale features, the final session context table h is obtained. M (s):
[0084] h M (s)=α·cA+(1-α)·cD
[0085] If the length of the course session sequence is less than a power of 2, it is padded with zeros to ensure the effectiveness of wavelet decomposition.
[0086] It should be noted that the step of separating the current course session sequence into low-frequency and high-frequency components using wavelet transform, concatenating the two components, and then dynamically fusing them through an attention mechanism to generate a session internal interest representation includes: decomposing the current course session sequence into global trend components and local mutation components using discrete wavelet transform; processing sequences of arbitrary length using an adaptive padding strategy; dynamically weighting and fusing the two types of components using an attention mechanism; and restoring the fused features to the original sequence length through interpolation operations to generate a session internal interest representation.
[0087] Step S30: Obtain the set of recently interacted courses, extract the learner's static preference embedding based on the historical learning behavior sequence, and generate dynamic preference embedding through the attention mechanism.
[0088] It should be noted that the generation of the dynamic preference embedding includes: extracting a fixed number of recent interactive courses from the historical behavior sequence; using the learner embedding vector as the attention query benchmark; calculating the attention weight of each course embedding vector and summing them by weight; and outputting a dynamic preference representation that reflects recent changes in interest.
[0089] In this embodiment, let the set of all learners in the dataset be U = {u1, ... u2}. |U| Let |U| represent the total number of users, and u∈U represent any learner. Let the set of all available courses for recommendation be V={v1,...v...}. |V|}, where |V| represents the total number of courses, and v∈V represents any single course. The interaction behavior of learner u with the courses within a short period is formed into a conversation sequence, denoted as s={v 1s ,...v ts}}, where the subscript of each course v indicates its order of appearance in session s.
[0090] In practice, static preferences refer to learners' long-term unchanging interests, which are directly represented by the learner's embedding vector.
[0091]
[0092] Among them, e u For learner u, static preference embedding.
[0093] Dynamic preferences reflect recent changes in learners' interests.
[0094] Specifically, the following steps are included:
[0095] For learner u's session s, collect the set R(s) of the courses that the learner most recently interacted with before that session = {v1} R , ..., v ∣R∣ R}, where the superscript R indicates that the course belongs to the set R(s), and |R(s)| is a fixed hyperparameter representing the number of courses that learner u has most recently interacted with before this session s.
[0096] learner embedding e u As the query vector, a matrix containing the embeddings of all courses in R(s) will be used. As the key matrix and value matrix, the dynamic preference embedding h is computed through an attention mechanism. N (s):
[0097] h N (s) = attention(e) u ,E(R(s)),E(R(s)))
[0098] Here, attention(q',K',V') is an attention network, given a query vector.
[0099] A matrix of κ key vectors A matrix of κ value vectors `i` is an index variable representing the embedding of the `i`-th course in `R(s)` among the most recently interacted courses, where `i` ∈ {1, 2, ..., κ}, and `κ = |R(s)|`, representing the number of recently interacted courses. It is defined as:
[0100]
[0101] Where α(q′,K) i q' is a vector containing the attention score between each vector in K', calculated as follows:
[0102]
[0103] And q' T This represents the transpose of the query vector q';
[0104] The h obtained above N (s) is embedded as the dynamic OSC(s) of the session.
[0105] Step S40: Generate an interest vector by dynamically fusing the in-session interest representation and the dynamic preference embedding, and output the candidate course probability distribution corresponding to the candidate course set.
[0106] It should be noted that this embodiment designs a learnable, dynamically fused weight λ. In-session interests (ISC), out-of-session interests (OSC), and candidate course features are concatenated and input into a linear model. The fused weights are adaptively generated using a sigmoid activation function. This enables the model to automatically determine whether the current recommendation is more driven by long-term or short-term interests, achieving causally interpretable prediction of the next course.
[0107] In specific implementation, the step of dynamically fusing the in-session interest representation and the dynamic preference embedding to generate an interest vector and outputting the candidate course probability distribution corresponding to the candidate course set includes:
[0108] The in-session interest representation, the dynamic preference embedding representation, and the features in the candidate course set are concatenated;
[0109] The fusion weights between 0 and 1 are generated using learnable parameters and activation functions;
[0110] The final feature vector is formed by linearly combining the two types of interest representations according to their weights.
[0111] The feature vector is matched with the features of all candidate courses to generate a probability distribution.
[0112] In practical implementation, cause weighting is integrated:
[0113] The weights λ of OSCs and ISCs are calculated using the sigmoid activation function, and their impact on recommendations is dynamically adjusted.
[0114] λ = sigmoid(W T (h M (s)||h N (s)||e v )+b)
[0115] Among them, e v It is the embedding of the course v to be predicted, λ∈[0,1]. The larger the weight λ, the stronger the influence of external factors on the session.
[0116] The internal reason of the session h M (s), with external causes of the conversation h N (s) Perform dynamic fusion to obtain the final interest representation:
[0117] h(s)=λh N (s)+(1-λ)h M (s)
[0118] Fusion of interest vectors and candidate course embedding matrix Matching, Ω is the set of courses to be predicted, and the probability distribution of the recommendation of the next course for predicting s is:
[0119] p(v|M=ISC(s), N=OSC(s))=softmax(e(Ω)h(s) T )
[0120] Step S50: Generate pseudo-labels based on historical behavior sequences and current session sequences, and optimize interest separation by combining the dynamic fusion weights with binary cross-entropy loss.
[0121] In practical implementation, self-supervised pseudo-labels and loss functions are used: pseudo-labels are automatically generated based on learners' historical learning behavior and conversation context to mark whether a course belongs to OSC or ISC. A self-supervised binary cross-entropy loss is employed to guide the model in distinguishing and modeling long-term and short-term sources of interest, improving interest separation and expressive capabilities.
[0122] It should be noted that the steps for optimizing interest separation include: if a course exists in the learner's historical behavior sequence, it is marked as long-term interest-driven; if a course exists in the current session sequence, it is marked as short-term interest-driven; the weight matching and labeling categories are fused using binary cross-entropy loss constraints; the loss function simultaneously optimizes interest separation capability and recommendation accuracy.
[0123] In practice, based on the learner's historical learning behavior and the current course session context, each candidate course is traversed to determine whether it appears in the historical behavior sequence or the current session sequence, generating a 0 / 1 pseudo-label.
[0124]
[0125] Among them, V u This represents the set of historical interaction courses of learner u to which session s belongs. yN represents the pseudo-label of out-of-session interests (OSC), yM represents the pseudo-label of in-session interests (ISC), and 1[condition] is defined as:
[0126]
[0127] A self-supervised loss function is used to encourage the model to output high scores on courses dominated by long-term interests and high scores on courses dominated by short-term interests, thus achieving interest separation. The self-supervised loss is:
[0128]
[0129] Among them, v + Is this the next real course for S? b It is the set of all sessions included in the b-th training batch, |S b | represents the number of sessions in this batch. Given a predicted score x and a corresponding label y, the binary cross-entropy loss BCE(x,y) is defined as:
[0130] BCE(x,y)=y·log x+(1-y)·log(1-x)
[0131] Step S60: Based on the recently interacted course set and filtering similar session sets according to Jaccard similarity to replace its ISC as the target session ISC in the session's internal interest, generate a counterfactual recommendation distribution and merge it with the recent course scores.
[0132] In specific implementation, the generation of the counterfactual recommendation distribution includes: calculating session similarity based on the overlap of recently interacted courses; selecting several sessions with the highest similarity as intervention targets; injecting the short-term interest representation of the target session into similar sessions; aggregating the recommendation results of multiple intervention sessions to form a counterfactual distribution; and applying a recommendation score bonus to recently contacted courses.
[0133] In a specific implementation, the step of applying a recommendation score bonus to recently accessed courses includes: identifying courses that appear in recent interaction sequences and / or the current session as a target course set; increasing the priority of adding a fixed value to the target course set; and renormalizing the probability distribution to keep the sum of 1.
[0134] In practical implementation, counterfactual recommendation and enhancement work as follows: During the inference phase, a set of learner conversations with similar interests is first sampled for the target learner's conversation. The context of these similar conversations is then replaced with the context of the target conversation to construct a counterfactual scenario. These counterfactual conversations are input into the model to obtain multiple sets of counterfactual recommendation distributions. Subsequently, these distributions are fused and enhanced with the scores of recently interacted courses in the target conversation, making the influence of short-term interests on the final recommendation results more prominent, thereby improving the model's responsiveness to changes in learners' current interests and the personalization and diversity of recommendations.
[0135] It should be noted that for the target session s of the target learner u, the most similar sessions s' ≠ s are first calculated based on the recent interaction set R(s). The similarity is calculated using Jaccard similarity.
[0136]
[0137] Select the conversations with the highest similarity to form a set π(s).
[0138] For each similar session i ∈π(s), and its ISCs (i.e., ISC(s) i Replace )) with the ISCs of the target session (i.e., ISC(s)), simulate "If similar learner u' is in the context of the target session s (i.e. has the same ISCs), what will he choose as the next course?", and use the Base Recommendation Model (BRM) to calculate the counterfactual distribution of the next course:
[0139] p(v|M=ISC(s),N=OSC(s'))
[0140] Where M = ISC(s) represents the in-session interest of the current session s, and N = OSC(s') represents the out-of-session interest of a certain historical session s'.
[0141] The collaborative counterfactual recommendation distribution is obtained by summing the counterfactual distributions of all similar sessions by similarity weight:
[0142]
[0143] Where C is the normalization factor (ensuring the sum of probabilities is 1).
[0144] To amplify the impact of recently interacting lessons, a boosting factor ∈ (∈>0) is added to lessons v that appear in R(s) or the current context c. The final recommendation probability is:
[0145]
[0146] Here, 1[condition] is a vector, which is 1 if v belongs to R(s) or c, and 0 otherwise, and C′ is a normalization factor.
[0147] Step S70: Combine multi-class cross-entropy loss and self-supervised causal loss to train the model using the loss function.
[0148] In specific implementation, step S70 includes:
[0149] The prediction task for the next course is treated as a multi-class classification problem, and multi-class cross-entropy loss is used for optimization. The specific definition is as follows:
[0150]
[0151] Where p(v) is an abbreviation for p(v|M=ISC(s), N=OSC(s)), S b V represents the set of sessions in the training batch. b For a set of courses within a batch, v + For the next real course.
[0152] We jointly employ multi-class cross-entropy loss and self-supervised causality loss, balancing their weights through the hyperparameter β:
[0153]
[0154] It should be noted that the purpose of this embodiment is to propose an educational course conversation recommendation method based on counterfactual reasoning and wavelet attention mechanism. This method can distinguish and integrate the internal and external interest factors (i.e., short-term and long-term interests) of the course conversation in detail, and achieve interpretable personalized recommendations through dynamic weights and causal reasoning mechanisms. This addresses the shortcomings of existing educational course conversation recommendation systems in multi-scale interest modeling and causal interpretability, and improves the accuracy, causal interpretability, robustness and credibility of the recommendations.
[0155] The core working principle of this embodiment is:
[0156] 1. The wavelet attention mechanism decomposes learner behavior sequences into low-frequency and high-frequency features through wavelet transform, capturing global learning trends and local interest mutations, respectively. By adaptively fusing these multi-scale features through the attention mechanism, a precise characterization of learners' short-term interest dynamics can be achieved.
[0157] 2. The counterfactual reasoning framework utilizes multi-scale interest representations extracted through wavelet attention mechanisms to simulate scenarios of "how learners would make decisions if the context changed." By distinguishing and modeling long-term interests (OSC) and short-term interests (ISC), it achieves a fine-grained causal explanation of learner behavior.
[0158] 3. The dynamic fusion weight λ calculates the weights of OSC and ISC using the sigmoid function, automatically determining whether the current recommendation is more driven by long-term or short-term interests, thus achieving causally explainable prediction of the next course.
[0159] 4. Self-supervised pseudo-labels and loss functions: By automatically generating 0 / 1 pseudo-labels, the model is guided to distinguish between long-term and short-term sources of interest, thereby improving the ability to separate and express interests.
[0160] 5. Counterfactual Recommendation and Enhancement: By constructing counterfactual scenarios, integrating multiple counterfactual recommendation distributions, and reinforcing the impact of recent interactive courses, the model's responsiveness to changes in learners' current interests and the personalization and diversity of recommendations are improved.
[0161] Therefore, the core innovation lies in:
[0162] Innovative Design and Efficient Implementation of Wavelet Attention Mechanism:
[0163] This embodiment proposes an innovative Wavelet Attention Network for educational course conversation recommendation scenarios. The mechanism first utilizes wavelet transform to decompose learner behavior sequences into multi-scale features, breaking them down into low-frequency (global trends) and high-frequency (local variations) features. An adaptive padding strategy supports efficient processing of sequences of arbitrary length. Subsequently, features at different scales are concatenated along the feature dimension, and attention weights are adaptively generated through linear transformation and sigmoid activation, achieving dynamic weighted fusion of global and local interest dynamics. Finally, an interpolation module restores the fused multi-scale features to the original sequence length, ensuring seamless integration with subsequent deep network structures and achieving efficient end-to-end training and inference. This mechanism not only enhances the model's ability to characterize learner interest dynamics and its robustness to abnormal behavior but also provides richer and more detailed contextual information for subsequent causal inference.
[0164] An organic combination of counterfactual reasoning and multi-scale interest modeling:
[0165] This embodiment is the first to organically combine wavelet decomposition with an attention mechanism and introduce it into a counterfactual reasoning recommendation framework. This invention uses the aforementioned multi-scale interest representation as input for counterfactual reasoning, enabling the model to make inferences based on more comprehensive dynamic information about interests when simulating "how learners would make decisions if the situation changed." By explicitly distinguishing and modeling the internal and external interest factors (i.e., long-term interest (OSC) and short-term interest (ISC)) of the course session during the counterfactual reasoning process, the model can effectively identify the causal influence of different interest sources on the recommendation results, achieving a fine-grained causal explanation of learner behavior. By deeply integrating the wavelet attention mechanism with the counterfactual reasoning framework, the causal interpretability and generalization ability of the recommendation system are significantly improved.
[0166] In summary, the implementation method, by deeply integrating wavelet decomposition, attention mechanism and counterfactual reasoning, achieves efficient modeling and causal explanation of learner interests across multiple scales, significantly improving the accuracy, robustness and credibility of the educational course conversation recommendation system. It has important theoretical value and broad application prospects.
[0167] This embodiment acquires the input information of the target learner; performs wavelet transform on the current course session sequence to separate and generate an internal interest representation of the session; acquires a set of recently interacted courses and generates a dynamic preference embedding based on the historical learning behavior sequence; dynamically fuses the internal interest representation of the session and the dynamic preference embedding to generate an interest vector and outputs a candidate course probability distribution; generates pseudo-labels based on the historical behavior sequence and the current session sequence, and optimizes the interest separation through binary cross-entropy loss by combining dynamic fusion weights; generates a counterfactual recommendation distribution and fuses it with the recent course scores, thereby achieving the technical effect of improving the interpretability and generalization ability of the educational recommendation system.
[0168] Furthermore, embodiments of this application also propose a computer-readable storage medium storing a program for recommending educational course sessions, wherein when the program for recommending educational course sessions is executed by a processor, it implements the steps of the method for recommending educational course sessions as described above.
[0169] Reference Figure 3 , Figure 3 This is a structural block diagram of the first embodiment of the educational course conversation recommendation device of this application.
[0170] like Figure 3 As shown, the educational course conversation recommendation device proposed in this application includes:
[0171] Information acquisition module 10 is used to acquire input information of the target learner, including the current course conversation sequence, historical learning behavior sequence and candidate course set;
[0172] The internal interest representation module 20 is used to perform wavelet transform on the current course session sequence to separate it into low-frequency components and high-frequency components, and then dynamically fuse the two components through an attention mechanism to generate the session internal interest representation.
[0173] The dynamic preference embedding module 30 is used to obtain a set of recently interacted courses, extract learner static preference embeddings based on the historical learning behavior sequence, and generate dynamic preference embeddings through an attention mechanism.
[0174] The probability distribution module 40 is used to generate an interest vector based on the in-session interest representation and the dynamic preference embedding dynamic fusion, and output the candidate course probability distribution corresponding to the candidate course set;
[0175] Interest separation module 50 is used to generate pseudo-labels based on historical behavior sequences and current session sequences, and optimize interest separation by combining the dynamic fusion weights with binary cross-entropy loss.
[0176] The fusion module 60 is used to generate a counterfactual recommendation distribution and fuse it with the recent course scores, based on the recent interactive course set and filtering the similar session set according to Jaccard similarity to replace its ISC as the target session ISC in the session's internal interest.
[0177] Training module 70 is used to combine multi-class cross-entropy loss and self-supervised causal loss to train the model through the loss function.
[0178] It should be understood that the above are merely illustrative examples and do not constitute any limitation on the technical solution of this application. In specific applications, those skilled in the art can make settings as needed, and this application does not impose any restrictions on this.
[0179] This embodiment acquires the input information of the target learner; performs wavelet transform on the current course session sequence to separate and generate an internal interest representation of the session; acquires a set of recently interacted courses and generates a dynamic preference embedding based on the historical learning behavior sequence; dynamically fuses the internal interest representation of the session and the dynamic preference embedding to generate an interest vector and outputs a candidate course probability distribution; generates pseudo-labels based on the historical behavior sequence and the current session sequence, and optimizes the interest separation through binary cross-entropy loss by combining dynamic fusion weights; generates a counterfactual recommendation distribution and fuses it with the recent course scores, thereby achieving the technical effect of improving the interpretability and generalization ability of the educational recommendation system.
[0180] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this application. In practical applications, those skilled in the art can select some or all of it to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.
[0181] In addition, for technical details not described in detail in this embodiment, please refer to the method of recommending educational course sessions provided in any embodiment of this application, which will not be repeated here.
[0182] Furthermore, it should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0183] The sequence numbers of the embodiments in this application are merely for descriptive purposes and do not represent the superiority or inferiority of the embodiments. Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases, the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application. The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. An educational course session recommendation method, characterized by, The method comprises the following steps: Obtain input information of a target learner, including a current course session sequence, a historical learning behavior sequence, and a candidate course set; Perform wavelet transform on the current course session sequence to separate it into low-frequency components and high-frequency components, concatenate the two components, and then dynamically fuse them through an attention mechanism to generate an intra-session interest representation; Obtain a recent interaction course set, extract a learner static preference embedding based on the historical learning behavior sequence, and generate a dynamic preference embedding through an attention mechanism; Dynamically fuse the intra-session interest representation and the dynamic preference embedding to generate an interest vector, and output a candidate course probability distribution corresponding to the candidate course set; Generate pseudo-labels based on the historical behavior sequence and the current session sequence, and optimize the interest separation through binary cross-entropy loss combined with the dynamic fusion weight; Based on the recent interaction course set, filter similar session sets according to Jaccard similarity to replace the ISC of the similar sessions with the ISC of the target session, generate counterfactual recommendation distribution, and fuse it with the recent course score; Train the model through the loss function by combining the multi-classification cross-entropy loss and the self-supervised causal loss; The step of performing wavelet transform on the current course session sequence to separate it into low-frequency components and high-frequency components, concatenating the two components, and then dynamically fusing them through an attention mechanism to generate an intra-session interest representation comprises the following steps: Decompose the current course session sequence into a global trend component and a local mutation component through discrete wavelet transform; Use an adaptive padding strategy to process sequences of arbitrary length; Use an attention mechanism to dynamically weight and fuse the two types of components; Restore the fused features to the original sequence length through interpolation operation and generate an intra-session interest representation; The generation of the counterfactual recommendation distribution comprises the following steps: Calculate the similarity of sessions based on the overlap of recent interaction courses; Select a number of sessions with the highest similarity as intervention objects; Inject the short-term interest representation of the target session into similar sessions; Aggregate the recommendation results of multiple intervention sessions to form a counterfactual distribution; Apply a recommendation score bonus to the recent contact courses; The step of optimizing the interest separation comprises the following steps: If the course exists in the learner's historical behavior sequence, mark it as a long-term interest driver; If the course exists in the current session sequence, mark it as a short-term interest driver; Constrain the fusion weight to match the marked categories through binary cross-entropy loss; The loss function optimizes both the interest separation capability and the recommendation accuracy.
2. The method of claim 1, wherein, The generation of the dynamic preference embedding comprises the following steps: Extract a fixed number of recent interaction courses from the historical behavior sequence; Use the learner embedding vector as the attention query reference; Calculate the attention weights of each course embedding vector and perform weighted summation; Output a dynamic preference representation reflecting the changes in recent interest.
3. The method of claim 1, wherein, The step of dynamically fusing the intra-session interest representation and the dynamic preference embedding to generate an interest vector and outputting a candidate course probability distribution corresponding to the candidate course set comprises the following steps: Concatenate the intra-session interest representation, the dynamic preference embedding representation, and the features in the candidate course set; Generate a fusion weight between 0 and 1 through learnable parameters and activation functions; Linearly combine the two types of interest representations according to the weight to form a final feature vector; The feature vector is matched with all candidate course features to generate a probability distribution.
4. The method of claim 1, wherein, The step of applying a recommendation score bonus to the recently interacted course comprises: identifying courses appearing in the recent interaction sequence and / or the current session as a target course set; boosting the priority of the target course set by adding a fixed value; renormalizing the probability distribution to maintain a sum of 1.
5. An educational course session recommendation apparatus characterized by comprising: The method of claim 1, comprising: an information acquisition module for acquiring input information of a target learner, including a current course session sequence, a historical learning behavior sequence, and a candidate course set; an internal interest representation module for wavelet transform separation of the current course session sequence into low-frequency components and high-frequency components, and dynamic fusion of the two through an attention mechanism to generate an internal interest representation of the session; a dynamic preference embedding module for acquiring a recent interaction course set, extracting a static preference embedding of the learner based on the historical learning behavior sequence, and generating a dynamic preference embedding through an attention mechanism; a probability distribution module for dynamic fusion based on the internal interest representation of the session and the dynamic preference embedding to generate an interest vector, and outputting a candidate course probability distribution corresponding to the candidate course set; an interest separation module for generating pseudo-labels based on the historical behavior sequence and the current session sequence, and optimizing interest separation through binary cross-entropy loss combined with the dynamic fusion weight; a fusion module for filtering similar session sets according to Jaccard similarity based on the recent interaction course set to replace the ISC in the internal interest of the session with the ISC of the target session, generating counterfactual recommendation distribution and fusing with the recent course score; a training module for jointly training the model through a loss function based on multi-classification cross-entropy loss and self-supervised causal loss.
6. A computer device, comprising: The device comprises a memory and a processor, wherein the processor executes the computer instructions stored in the memory to perform the method of any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The instructions, when executed on a computer, cause the computer to perform the method of any one of claims 1-4.
Citation Information
Patent Citations
Course recommendation method and system fusing user interest change
CN117609615A
Multilevel session recommendation method driven by hypergraph convolution
CN119646314A